FlatGadget Lib for PB Windows

Developed or developing a new product in PureBasic? Tell the world about it.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

FlatGadget Lib for PB Windows

Post by Num3 »

I've just uploaded to http://pureproject.reelmedia.org/ a new library for Purebasic that easly let's you 'Flat' gadgets.

It will be made available soon, so keep a look for it!

Here's a direct link before it's made available there:
http://pureproject.reelmedia.org/users/ ... Gadget.zip
User avatar
J. Baker
Addict
Addict
Posts: 2184
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Nice work Num3! :D
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Here's an update using PB4 code!

Code: Select all

Procedure FlatGadget(First.l,Last.l=-1)
  
  If Last=-1
    Last=First
  EndIf
  
  For a=First To Last
    
    If IsGadget(a)
    
    type.l=GadgetType(a) 
    
    Select type
      
      ; enable and disable gadget's here ;)
      
      Case  #PB_GadgetType_String,#PB_GadgetType_ListIcon ,#PB_GadgetType_ListView, #PB_GadgetType_Editor, #PB_GadgetType_Tree
        style.l=GetWindowLong_(GadgetID(a),#GWL_STYLE)
        SetWindowLong_(GadgetID(a),#GWL_STYLE,style|#WS_GROUP|#WS_BORDER)
        
      Case  #PB_GadgetType_Panel
        SetWindowLong_(GadgetID(a),#GWL_STYLE,GetWindowLong_(GadgetID(a),#GWL_STYLE)|$148)
        SendMessage_(GadgetID(a),$1334,1,1)
        
      Case  #PB_GadgetType_Button, #PB_GadgetType_ButtonImage
        style.l=GetWindowLong_(GadgetID(a),#GWL_STYLE)
        SetWindowLong_(GadgetID(a),#GWL_STYLE,style|#BS_FLAT) 
        
    EndSelect
    
  EndIf
  Next
  
  
EndProcedure
Post Reply