Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
White_Owl is currently offline  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?
 
Read Message
Read Message
Previous Topic: show tooltip as QTF
Next Topic: What is ParentCtrl?
Goto Forum:
  


Current Time: Sun May 05 02:17:50 CEST 2024

Total time taken to generate the page: 0.03822 seconds