Kirix Support Forums

Closing Panes

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

Closing Panes

Postby tncalucard on Mon Oct 22, 2007 9:39 am

I would like to know if there is a way to close Pane.
I want to use hide with some panes, but if a use the same name it gives an erro, that I knew it would happen. So I wanted to destroy then in a function so every time that I need to create another pane with the same name a call this function to close it frist.
Is it possible?
tncalucard
Registered User
 
Posts: 14
Joined: Mon Oct 08, 2007 9:30 am

Re: Closing Panes

Postby tncalucard on Mon Oct 22, 2007 12:17 pm

Should I use DetachPane?
tncalucard
Registered User
 
Posts: 14
Joined: Mon Oct 08, 2007 9:30 am

Re: Closing Panes

Postby Ben on Wed Oct 24, 2007 5:18 am

tncalucard wrote:Should I use DetachPane?


Yes. If you want to destroy your window, you should detach it from the manager by calling DetachPane first.

Best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

[SOLVED]Closing Panes

Postby tncalucard on Mon Oct 29, 2007 10:42 am

It's working, but I have to hide it before or I get an erro in the pane that will that it's place.
Wouldn't be faster if there was a close command like the close button, that hides it and destroy?
Is there something like it?

P.S: Sorry that it took time to reply I was out.
tncalucard
Registered User
 
Posts: 14
Joined: Mon Oct 08, 2007 9:30 am

Re: Closing Panes

Postby MrNiceGuy on Mon Nov 05, 2007 5:33 am

Hello,
so what would be the best way to implement a quit button on a frame, which can be floating?
Detaching and destroying the pane works but is imo a bit complicated.
GetParent()->Close() would work right only when the frame is floating, but since the aui manager does not catch the event the parent window gets closed when the pane in docked.
So wouldn't it be possible for the manager to catch the close event and hide or destroy the frame? Or would this break something else?
MrNiceGuy
Registered User
 
Posts: 2
Joined: Sun Nov 04, 2007 7:03 am

Re: Closing Panes

Postby Jes on Mon Nov 05, 2007 10:25 am

that's Way to destroy pane from event invoked from it (as another button or etc)
Code: Select all
void MyFrame3::r333( wxCommandEvent& event ){
   wxAuiPaneInfo &pane(m_mgr.GetPane(wxT("EPane1")));
   if(pane.IsDestroyOnClose()){
      wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON);
      e.SetButton(wxAUI_BUTTON_CLOSE);
      e.SetManager(&m_mgr);
      e.SetPane(&pane);
      wxPostEvent(&m_mgr,e);
   }else{
      m_mgr.ClosePane(pane);
      m_mgr.Update();
   }

}
Let improove it together
Jes
Registered User
 
Posts: 15
Joined: Mon Oct 15, 2007 10:27 am

Return to wxAUI Questions, Thoughts & Feedback