window Titlebar's event

huaner

18-07-2007 02:49:04

hi,
if we don't hide window's Titlebar, there is a close button on the right top. when we knob down this button, the window will be hide. so, where is event? in source? i can't track it.
thanks.

kungfoomasta

18-07-2007 03:21:50

If you want to add an event when button down:

QuickGUI::Button* closeButton = myWindow->getTitleBar()->getCloseButton();

closeButton->addEvent(QuickGUI::QGUI_EVENT_MOUSE_BUTTON_DOWN,...);

Code is in QuickGUITitleBar.cpp constructor:


mCloseButton = new Button(mInstanceName+".CloseButton",cbDimensions,QGUI_GMM_RELATIVE,QGUI_GMM_RELATIVE,mWidgetMaterial+".button",mChildrenContainer,this);
mCloseButton->addEventHandler(Widget::QGUI_EVENT_MOUSE_CLICK,&Window::hide,dynamic_cast<Window*>(mParentWidget));
mCloseButton->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP,&Window::hide,dynamic_cast<Window*>(mParentWidget));


I don't really need the CLICK event.. I should get rid of it. :wink:

huaner

18-07-2007 07:29:38

thanks for your help. i think sometiome adding TitleBar's event is usrful. it depent on edtior.