You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This Question comes from conversation from me (paule32, and magiblot 1)
Q: paule32:
how can I get the focused control/window ?
I have a global F2-key (StatusLine), but when I try to handle the F2 in
a HandleEvent member of the class, I get only the message from global F2
instead the F2 message from the derivated class.
The derivated class is TFileEditor.
A: magiblot 1
Keyboard shortcuts in the status line have the highest precedence: they are always handled by the status line instead of the currently focused view.
In these cases, Turbo Vision expects you to use help contexts. Help contexts allow you to change the status line contents when a specific view is focused.
If I recall correctly, to use help contexts you must:
Define a help context constant in the range 1000..65280 (since 0..999 and 0xFF00..0xFFFF are reserved by Turbo Vision)
constushort hcMyEditor = 1000;
Initialize the 'helpCtx' field of your view with that value:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Note: This Question comes from conversation from me (paule32, and magiblot 1)
Q: paule32:
how can I get the focused control/window ?
I have a global F2-key (StatusLine), but when I try to handle the F2 in
a HandleEvent member of the class, I get only the message from global F2
instead the F2 message from the derivated class.
The derivated class is TFileEditor.
A: magiblot 1
Keyboard shortcuts in the status line have the highest precedence: they are always handled by the status line instead of the currently focused view.
In these cases, Turbo Vision expects you to use help contexts. Help contexts allow you to change the status line contents when a specific view is focused.
If I recall correctly, to use help contexts you must:
Define a help context constant in the range 1000..65280 (since 0..999 and 0xFF00..0xFFFF are reserved by Turbo Vision)
Initialize the 'helpCtx' field of your view with that value:
Add a status line definition for that help context, as in https://github.com/magiblot/tvterm/blob/87a46c4b637492b6e2e902c8c9b02d3402bdcf40/source/tvterm/app.cc#L83 or
tvision/examples/tvdemo/tvdemo1.cpp
Line 178 in 80bcde6
I hope this helps.
Beta Was this translation helpful? Give feedback.
All reactions