#ifndef WX_PRECOMP
#endif
+IMPLEMENT_CLASS( wxFloatingPane, wxFloatingPaneBaseClass )
+
wxFloatingPane::wxFloatingPane(wxWindow* parent,
wxFrameManager* owner_mgr,
- wxWindowID id /*= wxID_ANY*/,
- const wxPoint& pos /*= wxDefaultPosition*/,
- const wxSize& size /*= wxDefaultSize*/)
- : wxFloatingPaneBaseClass(parent, id, wxEmptyString, pos, size,
+ const wxPaneInfo& pane,
+ wxWindowID id /*= wxID_ANY*/)
+ : wxFloatingPaneBaseClass(parent, id, wxEmptyString,
+ pane.floating_pos, pane.floating_size,
wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
- wxCLOSE_BOX | wxFRAME_NO_TASKBAR |
- wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN)
+ (pane.HasCloseButton()?wxCLOSE_BOX:0) |
+ wxFRAME_NO_TASKBAR |
+ wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN |
+ (pane.IsFixed()?0:wxRESIZE_BORDER)
+ )
{
m_owner_mgr = owner_mgr;
m_moving = false;
m_last_rect = wxRect();
- m_mgr.SetFrame(this);
+ m_mgr.SetManagedWindow(this);
SetExtraStyle(wxWS_EX_PROCESS_IDLE);
}
PaneBorder(false).
Layer(0).Row(0).Position(0);
+ // Carry over the minimum size
+ SetMinSize(pane.window->GetMinSize());
+
m_mgr.AddPane(m_pane_window, contained_pane);
m_mgr.Update();
SetTitle(pane.caption);
- if (contained_pane.IsFixed())
- SetWindowStyle(GetWindowStyle() & ~wxRESIZE_BORDER);
-
if (pane.floating_size != wxDefaultSize)
{
SetSize(pane.floating_size);
m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize());
}
-void wxFloatingPane::OnClose(wxCloseEvent& WXUNUSED(event))
+void wxFloatingPane::OnClose(wxCloseEvent& evt)
{
- m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
- Destroy();
+ m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt);
+ if (!evt.GetVeto())
+ Destroy();
}
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)