I would appreciate it much, if someone could help me with this X-looking button on the framewindow called Close Button.
Excuse my ignorance here, but the close button seems not to close anything. I found out that the CloseButtonEnabled property is only to hide or show the button. How do i get the button to actually close the window. I can't really call an event to handle it, since it doesn't have a name.
I'm hoping there's something really easy that i just dont know about . I figure it should be a common feature to deal with, but i failed to find the solution in the forum. It might just have been my ignorance's fault again.
thanks
Close button on a framewindow
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Close button on a framewindow
Subscribe to the "CloseClicked" event of the FrameWindow and do what you feel the button should do in that handler
HTH
HTH
Re: Close button on a framewindow
Greetings.
This is really easy stuff.
To handle close window button (as any other button) you need to subscribe window event.
Like this example:
[size=x-small][color=0000CC][font=Arial]
using namespace CEGUI;
Window* someWindow = WindowManager::getSingleton().getWindow("SomeWindow");
someWindow->
subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&AuroraGUI::handleCloseButton, this));
[/font][/color][/size]
This "handleCloseButton" function will do everything you need on pressing close window button.
I'm using following code to handle all windows close buttons:
[size=x-small][color=0000CC][font=Arial]
bool AuroraGUI::handleCloseButton(const CEGUI::EventArgs& e)
{
static_cast<const CEGUI::WindowEventArgs&>(e).window->hide();
return true;
}
[/font][/color][/size]
This is really easy stuff.
To handle close window button (as any other button) you need to subscribe window event.
Like this example:
[size=x-small][color=0000CC][font=Arial]
using namespace CEGUI;
Window* someWindow = WindowManager::getSingleton().getWindow("SomeWindow");
someWindow->
subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&AuroraGUI::handleCloseButton, this));
[/font][/color][/size]
This "handleCloseButton" function will do everything you need on pressing close window button.
I'm using following code to handle all windows close buttons:
[size=x-small][color=0000CC][font=Arial]
bool AuroraGUI::handleCloseButton(const CEGUI::EventArgs& e)
{
static_cast<const CEGUI::WindowEventArgs&>(e).window->hide();
return true;
}
[/font][/color][/size]
Re: Close button on a framewindow
Thanks a lot,
love love love the replies .
love love love the replies .
Re: Close button on a framewindow
:( when i t coded as suggested and got compilation error. here's that code segment:
wmgr.getWindow((CEGUI::utf8*)"Demo8/CodeWindow") ->subscribeEvent( CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber(&GuiApplication::handleCloseButton, this));
and here's the error,
error C2027: use of undefined type 'FrameWindow'
i can't make any sense of why FrameWindow is undefined Type. :(.
Thanks for the help.
wmgr.getWindow((CEGUI::utf8*)"Demo8/CodeWindow") ->subscribeEvent( CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber(&GuiApplication::handleCloseButton, this));
and here's the error,
error C2027: use of undefined type 'FrameWindow'
i can't make any sense of why FrameWindow is undefined Type. :(.
Thanks for the help.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Bing [Bot] and 9 guests