function to lock a Gadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Schobaer
User
User
Posts: 16
Joined: Sat Mar 06, 2004 9:36 am
Location: Germany

function to lock a Gadget

Post by Schobaer »

A function to lock a Gadget so it doesn't response any actions with an Event so you can for example change the contents of a ComboBox and no Event release.
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

Like DisableGadget() ?
Or you want a DisableGadgetEvents() only, with a working gadget?
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
Schobaer
User
User
Posts: 16
Joined: Sat Mar 06, 2004 9:36 am
Location: Germany

Post by Schobaer »

Yes, DisableGadgetEvents() is that wat I mean. But only for a specified Gadget!
plouf
Enthusiast
Enthusiast
Posts: 281
Joined: Fri Apr 25, 2003 6:35 pm
Location: Athens,Greece

Post by plouf »

you can just o it internal put the entire event code in if

if disablevariable

blabla
endif

and you fuctions just will set ore reser the variable so you code will respond or not
Christos
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Disable Gadget (disable redraw):

Code: Select all

 SendMessage_(GadgetID(#nb),#WM_SETREDRAW,#False,0)
Enable Gadget (activate redraw and redraw gadget)

Code: Select all

SendMessage_(GadgetID(#nb),#WM_SETREDRAW,#True,0)
      RedrawWindow_(GadgetID(#nb), 0, 0,#RDW_INTERNALPAINT|#RDW_INVALIDATE)
Post Reply