wxDockInfo wxNullDockInfo;
DEFINE_EVENT_TYPE(wxEVT_AUI_PANEBUTTON)
DEFINE_EVENT_TYPE(wxEVT_AUI_PANECLOSE)
+DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER)
#ifdef __WXMAC__
// a few defines to avoid nameclashes
#include "wx/mac/private.h"
#endif
+IMPLEMENT_DYNAMIC_CLASS(wxFrameManagerEvent, wxEvent)
+
// -- static utility functions --
BEGIN_EVENT_TABLE(wxFrameManager, wxEvtHandler)
EVT_AUI_PANEBUTTON(wxFrameManager::OnPaneButton)
+ EVT_AUI_RENDER(wxFrameManager::OnRender)
EVT_PAINT(wxFrameManager::OnPaint)
EVT_ERASE_BACKGROUND(wxFrameManager::OnEraseBackground)
EVT_SIZE(wxFrameManager::OnSize)
END_EVENT_TABLE()
-wxFrameManager::wxFrameManager(wxFrame* frame, unsigned int flags)
+wxFrameManager::wxFrameManager(wxWindow* managed_wnd, unsigned int flags)
{
m_action = actionNone;
m_last_mouse_move = wxPoint();
m_hint_wnd = NULL;
m_flags = flags;
- if (frame)
+ if (managed_wnd)
{
- SetFrame(frame);
+ SetManagedWindow(managed_wnd);
}
}
}
-// SetFrame() is usually called once when the frame
+// don't use these anymore as they are deprecated
+// use Set/GetManagedFrame() instead
+void wxFrameManager::SetFrame(wxFrame* frame)
+{
+ SetManagedWindow((wxWindow*)frame);
+}
+
+wxFrame* wxFrameManager::GetFrame() const
+{
+ return (wxFrame*)m_frame;
+}
+
+
+
+
+// SetManagedWindow() is usually called once when the frame
// manager class is being initialized. "frame" specifies
// the frame which should be managed by the frame mananger
-void wxFrameManager::SetFrame(wxFrame* frame)
+void wxFrameManager::SetManagedWindow(wxWindow* frame)
{
wxASSERT_MSG(frame, wxT("specified frame must be non-NULL"));
m_frame->RemoveEventHandler(this);
}
-// GetFrame() returns the frame pointer being managed by wxFrameManager
-wxFrame* wxFrameManager::GetFrame() const
+// GetManagedWindow() returns the window pointer being managed
+wxWindow* wxFrameManager::GetManagedWindow() const
{
return m_frame;
}
{
sizer_item = vert_pane_sizer->Add(pane.window, 1, wxEXPAND);
// Don't do this because it breaks the pane size in floating windows
- // vert_pane_sizer->SetItemMinSize(pane.window, 1, 1);
+ // BIW: Right now commenting this out is causing problems with
+ // an mdi client window as the center pane.
+ vert_pane_sizer->SetItemMinSize(pane.window, 1, 1);
}
part.type = wxDockUIPart::typePane;
if (p.frame->GetPosition() != p.floating_pos)
{
p.frame->SetSize(p.floating_pos.x, p.floating_pos.y,
- -1, -1, wxSIZE_USE_EXISTING);
+ wxDefaultCoord, wxDefaultCoord,
+ wxSIZE_USE_EXISTING);
//p.frame->Move(p.floating_pos.x, p.floating_pos.y);
}
// if a dock operation is allowed, the new dock position is copied into
// the target info. If the operation was allowed, the function returns true.
-static bool ProcessDockResult(wxPaneInfo& target,
+bool wxFrameManager::ProcessDockResult(wxPaneInfo& target,
const wxPaneInfo& new_pos)
{
bool allowed = false;
void wxFrameManager::ShowHint(const wxRect& rect)
{
+#if defined(__WXMSW__) || defined(__WXMAC__)
// First, determine if the operating system can handle transparency.
// Transparency is available on Win2000 and above
return;
}
-
+#endif
+
if (m_last_hint != rect)
{
// remove the last hint rectangle
wxDockUIPartArray uiparts;
wxPaneInfo hint = GetPane(pane_window);
hint.name = wxT("__HINT__");
+ hint.Show();
if (!hint.IsOk())
return;
e.SetPane(&pane);
e.SetCanVeto(evt.CanVeto());
ProcessMgrEvent(e);
-
+
if (e.GetVeto())
{
evt.Veto();
}
}
-// Render() draws all of the pane captions, sashes,
+// OnRender() draws all of the pane captions, sashes,
// backgrounds, captions, grippers, pane borders and buttons.
// It renders the entire user interface.
-void wxFrameManager::Render(wxDC* dc)
+void wxFrameManager::OnRender(wxFrameManagerEvent& evt)
{
+ wxDC* dc = evt.GetDC();
+
#ifdef __WXMAC__
dc->Clear() ;
#endif
}
}
+
+// Render() fire a render event, which is normally handled by
+// wxFrameManager::OnRender(). This allows the render function to
+// be overridden via the render event. This can be useful for paintin
+// custom graphics in the main window. Default behavior can be
+// invoked in the overridden function by calling OnRender()
+
+void wxFrameManager::Render(wxDC* dc)
+{
+ wxFrameManagerEvent e(wxEVT_AUI_RENDER);
+ e.SetDC(dc);
+ ProcessMgrEvent(e);
+}
+
void wxFrameManager::Repaint(wxDC* dc)
{
#ifdef __WXMAC__
void wxFrameManager::OnPaneButton(wxFrameManagerEvent& evt)
{
wxASSERT_MSG(evt.pane, wxT("Pane Info passed to wxFrameManager::OnPaneButton must be non-null"));
-
+
wxPaneInfo& pane = *(evt.pane);
if (evt.button == wxPaneInfo::buttonClose)
wxFrameManagerEvent e(wxEVT_AUI_PANECLOSE);
e.SetPane(evt.pane);
ProcessMgrEvent(e);
-
+
if (!e.GetVeto())
{
pane.Hide();