Page 1 of 1
Change WindowEvent() and WaitWindowEvent() functionality
Posted: Sun Sep 26, 2004 9:46 pm
by fsw
The commands WindowEvent() and WaitWindowEvent() seem to intervene the TAB keyboard key.
I work with a edit custom control and all seems to work fine except that the TAB key doesn't work (doesn't pass through the custom control).
If I use Windows API like:
(example)
Code: Select all
While GetMessage_(msg.MSG, #NULL, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
instead of WindowEvent() or WaitWindowEvent() all works fine.
Posted: Sun Sep 26, 2004 11:24 pm
by Kale
A possible answer from the PB manual:
Add or replace a keyboard shortcut to the specified #Window. A shortcut generates a menu event (like a menu item) as most of them are used in conjonction with menus. The EventID is the number which will be returned by the EventMenuID() command. By default, a window already has the #PB_Shorcut_Tab and #PB_Shortcut_Tab|#PB_Shortcut_Shift shortcuts to handle tab and shift-tab correctly trough the gadgets. A shortcut can be removed with RemoveKeyboardShortcut().

Re: WindowEvent() and WaitWindowEvent() BUG
Posted: Mon Sep 27, 2004 12:49 am
by PB
> I work with a edit custom control and all seems to work fine except that the
> TAB key doesn't work (doesn't pass through the custom control).
Try PolyVector's TabStop tip, and apply it to the custom control:
viewtopic.php?t=12388
Should fix the problem. (BTW, this isn't a bug, since you're using a custom
control that PureBasic doesn't natively support).

Posted: Mon Sep 27, 2004 11:19 am
by freak
The tab key is automatically added to each window as a shortcut to jump
between the gadgets. Shortcuts are processed before passing on the
Message to the WindorProc it belongs to, that's why you get nothing.
With RemoveKeyboardShortcut() you can remove this easily.
The reason why your api code works is that it doesn't call TranslateAccelerator_(), which handles the shortcuts.
Timo
Posted: Mon Sep 27, 2004 5:25 pm
by fsw
Kale wrote:A possible answer from the PB manual:
Add or replace a keyboard shortcut to the specified #Window. A shortcut generates a menu event (like a menu item) as most of them are used in conjonction with menus. The EventID is the number which will be returned by the EventMenuID() command. By default, a window already has the #PB_Shorcut_Tab and #PB_Shortcut_Tab|#PB_Shortcut_Shift shortcuts to handle tab and shift-tab correctly trough the gadgets. A shortcut can be removed with RemoveKeyboardShortcut().

Kale,
I don't won't to ADD the TAB key.
It's already there.... but not working because of PB.
EDIT: you are right, there it says:
- By default, a window already has the #PB_Shorcut_Tab and #PB_Shortcut_Tab|#PB_Shortcut_Shift shortcuts to handle tab and shift-tab correctly trough the gadgets.
I missed that.
Now I stand corrected too...
Thanks
Re: WindowEvent() and WaitWindowEvent() BUG
Posted: Mon Sep 27, 2004 5:29 pm
by fsw
PB wrote:> I work with a edit custom control and all seems to work fine except that the
> TAB key doesn't work (doesn't pass through the custom control).
Try PolyVector's TabStop tip, and apply it to the custom control:
viewtopic.php?t=12388
Should fix the problem. (BTW, this isn't a bug, since you're using a custom
control that PureBasic doesn't natively support).

PB,
no offence, but you are wrong.
This has nothing to do with a specific custom control, it's just an example.
It's PB that is cutting off the messages from the os...
Thanks
Posted: Mon Sep 27, 2004 5:46 pm
by fsw
freak wrote:The tab key is automatically added to each window as a shortcut to jump
between the gadgets. Shortcuts are processed before passing on the
Message to the WindorProc it belongs to, that's why you get nothing.
With RemoveKeyboardShortcut() you can remove this easily.
The reason why your api code works is that it doesn't call TranslateAccelerator_(), which handles the shortcuts.
Timo
Timo,
just looked at the manual and you are right:
- By default, a window already has the #PB_Shorcut_Tab and #PB_Shortcut_Tab|#PB_Shortcut_Shift shortcuts to handle tab and shift-tab correctly trough the gadgets. A shortcut can be removed with RemoveKeyboardShortcut().
But nevertheless, IMO the way it is now, is not OK.
Normally if the user wants special functionality like: shortcuts to handle tab and shift-tab correctly trough the gadgets, this should be added through a command or through a parameter for WaitWindowEvent() and WindowEvent(), and not automatically added.
Like: WaitWindowEvent(#PB_ADD_GADGETS_TAB)
Maybe I should add this to the PB_Wishlist.
Thanks
EDIT: maybe WaitWindowEvent(#PB_USE_DIALOGSTYLE_TABS) is better, but it's up to the PureBasic Coding Team
Posted: Mon Sep 27, 2004 5:49 pm
by fsw
BTW:
@FREAK,
If you are a admin you could move this topic to the WISHLIST section.
Thanks
Posted: Mon Sep 27, 2004 5:54 pm
by freak
Jumping between Gadgets with the Tab key is basic functionality, why should
everybody be required to add that on his own?
Posted: Mon Sep 27, 2004 5:57 pm
by fsw
freak wrote:Jumping between Gadgets with the Tab key is basic functionality, why should
everybody be required to add that on his own?
No it's not.
At least not for normal Windows.
It's a special functionality from a Dialog Window.
PureBasic doesn't have DialogWindow(...)
But that is another story...
EDIT: @Freak: Thanks for moving...
Re: WindowEvent() and WaitWindowEvent() BUG
Posted: Mon Sep 27, 2004 9:51 pm
by PB
> PB, no offence, but you are wrong.
No offence taken at all.
> This has nothing to do with a specific custom control, it's just an example.
Well you did say that Tab didn't pass through a custom control, so that's why
I thought it wasn't working, because PureBasic didn't recognize the control.
> It's PB that is cutting off the messages from the os...
Yep, I've read Freak's explanation, and I stand corrected.
Re: WindowEvent() and WaitWindowEvent() BUG
Posted: Mon Sep 27, 2004 10:11 pm
by fsw
PB wrote:... and I stand corrected.
me too... every morning when I look in the mirror 8O
Posted: Sun Oct 03, 2004 8:56 pm
by fsw
Hope this wish makes it in v4...