Page 1 of 1
How to ? No tab in EditorGadget()
Posted: Thu Sep 07, 2006 4:45 pm
by Flype
hello, i can't remember nor find a way
to allow the 'tab' key to work just like others gadgets.
i have the code that forbid 'tab' key to work for a particular gadget :
Code: Select all
Macro NOTAB(gadget)
SetWindowLong_(GadgetID(gadget), #GWL_STYLE, (GetWindowLong_(GadgetID(gadget), #GWL_STYLE) & (~#WS_TABSTOP)))
EndMacro
but i need the - reverse - function.
Posted: Thu Sep 07, 2006 5:00 pm
by Pupil
Doesn't it work to just set the #WS_TABSTOP flag? Something like this should do that:
Code: Select all
SetWindowLong_(GadgetID(gadget), #GWL_STYLE, (GetWindowLong_(GadgetID(gadget), #GWL_STYLE)|#WS_TABSTOP))
Posted: Thu Sep 07, 2006 5:01 pm
by Flype
no, be sure i already tested this one
but well it doesn't work

Posted: Thu Sep 07, 2006 5:10 pm
by srod
#WS_TABSTOP just allows the control to receive the focus on pressing tab etc.
Sparkie has a nice example here:
http://www.purebasic.fr/english/viewtop ... =wstabstop
Posted: Thu Sep 07, 2006 6:41 pm
by Flype
thank you srod, that's exactly what i need.
in the thread you pointed, PB wrote :
> it's on my wishlist as well
In the past, a lot of people were asking for the EditorGadget to actually act
this way, instead of TAB switching to the next gadget. For example:
http://www.purebasic.fr/english/viewtop ... 9&start=15
So then Fred happily changed it in v3.93 according to all the wishes:
Fixed: TAB in an EditorGadget() doesn't give the focus to others gadgets anymore but insert a Tab
And now people want it to work the old way again? Give Fred a break.
my opinion is that normally i prefer the way it is now since 3.93
but sometimes when making GUI for my company, users needs to
work as quickly as possible.
it would be perfect if it could be an option.
something like #PB_Editor_TabKey.
thanks again for the link.
Posted: Thu Sep 07, 2006 6:44 pm
by srod
Thank the caped crusader, uhm I mean sparkie.
I remembered reading through the post a while ago.