Update Gadget flags during runtime

Just starting out? Need help? Post your questions and find answers here.
RJP Computing
Enthusiast
Enthusiast
Posts: 202
Joined: Sun Apr 27, 2003 4:44 am
Location: Michigan, USA
Contact:

Update Gadget flags during runtime

Post by RJP Computing »

How do you update gadget flags after creating them? During runtime. Any examples would be helpful.

Thanks
-Ryan
RJP Computing

Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Which flags do you mean? Some Flags/ States can be set by PureBasic, others must be set by Windows API (eg SendMessage_())

Mike
Tranquil
RJP Computing
Enthusiast
Enthusiast
Posts: 202
Joined: Sun Apr 27, 2003 4:44 am
Location: Michigan, USA
Contact:

Post by RJP Computing »

Something to this effect, If I want to change if the explorerlistgadget has the grid lines showing or not. Things you would find in options for a program that control the look and feel of the gadgets.

Thanks
-Ryan
RJP Computing

Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Most Flags, that affect the visual style of the Gadget can be changed using
the Windows API. You need to know the WindowsAPI Constant for that
style, and if it is a n extended style or not.

Here is an example for Gridlines:

Code: Select all

ExStyle.l = GetWindowLong_(GadgetID(#Gadget), #GWL_EXSTYLE)

; To enable Gridlines
ExStyle = ExStyle | #LVS_EX_GRIDLINES 

; To disable Gridlines
;ExStyle = ExStyle & (~#LVS_EX_GRIDLINES)

SetWindowLong_(GadgetID(#Gadget), #GWL_EXSTYLE, Ex_Style)
(This works for ListIconGadget and ExplorerListGadget.)

More ExStyles for these Gadgets:
#LVS_EX_FULLROWSELECT
#LVS_EX_HEADERDRAGDROP

#LVS_SHOWSELALWAYS (this is a normal window style, use #GWL_STYLE
at GEtWindowLong/SetWindowLong to change that.

The Flags, that affect the stuff the Gadget does (like #PB_Explorer_NoFiles)
can't be changed on runtime for now. Maybe thewe will come a command
for that in future versions.

Timo
quidquid Latine dictum sit altum videtur
Post Reply