Home » U++ Library support » U++ Widgets - General questions or Mixed problems » how to define hot-keys not associated with any menu?
how to define hot-keys not associated with any menu? [message #19875] |
Wed, 28 January 2009 22:53 |
White_Owl
Messages: 27 Registered: January 2009 Location: New York
|
Promising Member |
|
|
I have my own widget(s) inside TopWindow, this widget should react to hot-keys. Only widget itself knows what these keys are.
So I am trying to do:
class MainWindow: public TopWindow {
BaseWidget widget*;
};
void MainWindow::ChooseWidget() {
widget = WidgetFactory(widget_id);
this.Add(&*widget);
widget->SetupHotKeys(this);
} Widgets are defined like this:class BaseWidget: public Ctrl {
public:
virtual void SetupHotKeys(TopWindow &tw) = 0;
};
class RealWidget: public BaseWidget {
void foo1();
void foo2();
void SetupHotKeys(TopWindow &tw) {
tw.SomeKindOfAssignKey(K_A, THISBACK(foo1));
tw.SomeKindOfAssignKey(K_SHIFT_A, THISBACK(foo2));
}
};
So the question is what is the name of the function which does actual key assignments? Am I going in the right direction? Any tutorial or examples with similar functionality?
|
|
|
Goto Forum:
Current Time: Tue May 21 17:04:34 CEST 2024
Total time taken to generate the page: 0.01878 seconds
|