Page 1 of 1

function to lock a Gadget

Posted: Mon Mar 22, 2004 9:20 pm
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.

Posted: Mon Mar 22, 2004 9:40 pm
by Saboteur
Like DisableGadget() ?
Or you want a DisableGadgetEvents() only, with a working gadget?

Posted: Tue Mar 23, 2004 3:57 pm
by Schobaer
Yes, DisableGadgetEvents() is that wat I mean. But only for a specified Gadget!

Posted: Tue Mar 23, 2004 5:39 pm
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

Posted: Tue Mar 23, 2004 5:42 pm
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)