KickingBear
07-01-2011 18:33:05
Hi all.
Have some problems with a lot of objects of QuickGUI::Image.
I used that class to construct my gui ("control panel", cool) and i want to store them in vector<QuickGUI::Image*> m_pGuiImages;
Ok, but each object must have few callback functions for events ( QuickGUI::Image::addWidgetEventHandler(...)) , for example there are:
QuickGUI::WIDGET_EVENT_MOUSE_ENTER
QuickGUI::WIDGET_EVENT_MOUSE_LEAVE
QuickGUI::WIDGET_EVENT_MOUSE_CLICK
and other.
So, i really don't want to create a lot of functions with names like this:
void Shortcut1_MouseEnter();
void Shortcut1_MouseLeave();
void Shortcut2_MouseEnter();
void Shortcut2_MouseLeave();
And then i try using template:
template<QuickGUI::Image*>
static void ShortcutMouseEnter();
img->addWidgetEventHandler(QuickGUI::WIDGET_EVENT_MOUSE_ENTER, &EditorMenu::ShortcutMouseEnter<img>, this);
But the are error: error C2660: 'QuickGUI::Widget::addWidgetEventHandler' : function does not take 3 arguments
So, can you tell me, how can i fix that problem? Maybe exist another way to create gui?
P.S.
sorry for my english
Dmitry
Have some problems with a lot of objects of QuickGUI::Image.
I used that class to construct my gui ("control panel", cool) and i want to store them in vector<QuickGUI::Image*> m_pGuiImages;
Ok, but each object must have few callback functions for events ( QuickGUI::Image::addWidgetEventHandler(...)) , for example there are:
QuickGUI::WIDGET_EVENT_MOUSE_ENTER
QuickGUI::WIDGET_EVENT_MOUSE_LEAVE
QuickGUI::WIDGET_EVENT_MOUSE_CLICK
and other.
So, i really don't want to create a lot of functions with names like this:
void Shortcut1_MouseEnter();
void Shortcut1_MouseLeave();
void Shortcut2_MouseEnter();
void Shortcut2_MouseLeave();
And then i try using template:
template<QuickGUI::Image*>
static void ShortcutMouseEnter();
img->addWidgetEventHandler(QuickGUI::WIDGET_EVENT_MOUSE_ENTER, &EditorMenu::ShortcutMouseEnter<img>, this);
But the are error: error C2660: 'QuickGUI::Widget::addWidgetEventHandler' : function does not take 3 arguments
So, can you tell me, how can i fix that problem? Maybe exist another way to create gui?
P.S.
sorry for my english
Dmitry