How to ? No tab in EditorGadget()

Just starting out? Need help? Post your questions and find answers here.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

How to ? No tab in EditorGadget()

Post 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.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post 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))
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

no, be sure i already tested this one :)
but well it doesn't work :?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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
I may look like a mule, but I'm not a complete ass.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thank the caped crusader, uhm I mean sparkie. :)

I remembered reading through the post a while ago.
I may look like a mule, but I'm not a complete ass.
Post Reply