// a few defines to avoid nameclashes
#define __MAC_OS_X_MEMORY_MANAGER_CLEAN__ 1
#define __AIFF__
- #include "wx/mac/private.h"
+ #include "wx/osx/private.h"
#endif
#ifdef __WXMSW__
bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
{
+ wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
+
// check if the pane has a valid window
if (!window)
return false;
if (pinfo.name.empty() || already_exists)
{
pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
- ((unsigned long)pinfo.window) & 0xffffffff,
+ wxPtrToUInt(pinfo.window) & 0xffffffff,
(unsigned int)time(NULL),
#ifdef __WXWINCE__
(unsigned int)GetTickCount(),
bool wxAuiManager::InsertPane(wxWindow* window, const wxAuiPaneInfo& pane_info,
int insert_level)
{
+ wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
+
// shift the panes around, depending on the insert level
switch (insert_level)
{
// method will not destroy the window that is removed.
bool wxAuiManager::DetachPane(wxWindow* window)
{
+ wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
+
int i, count;
for (i = 0, count = m_panes.GetCount(); i < count; ++i)
{
if (middle->GetChildren().GetCount() > 0)
cont->Add(middle, 1, wxEXPAND);
-
+ else
+ delete middle;
+
// find any bottom docks in this layer
void wxAuiManager::Update()
{
m_hover_button = NULL;
+ m_action_part = NULL;
wxSizer* sizer;
int i, pane_count = m_panes.GetCount();
(part->dock->dock_direction != wxAUI_DOCK_CENTER &&
part->dock->dock_direction != wxAUI_DOCK_NONE)))
{
- drop.Float();
+ if (drop.IsFloatable())
+ drop.Float();
}
m_skipping = false;
// nasty redrawn problems.
clip.Intersect(m_frame->GetRect());
- screendc.SetClippingRegion(clip);
+ screendc.SetDeviceClippingRegion(clip);
wxBitmap stipple = wxPaneCreateStippleBitmap();
wxBrush brush(stipple);
{
m_hover_button = NULL;
m_frame->ReleaseMouse();
- UpdateButtonOnScreen(m_action_part, event);
-
- // make sure we're still over the item that was originally clicked
- if (m_action_part == HitTest(event.GetX(), event.GetY()))
+
+ if (m_action_part)
{
- // fire button-click event
- wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON);
- e.SetManager(this);
- e.SetPane(m_action_part->pane);
- e.SetButton(m_action_part->button->button_id);
- ProcessMgrEvent(e);
+ UpdateButtonOnScreen(m_action_part, event);
+
+ // make sure we're still over the item that was originally clicked
+ if (m_action_part == HitTest(event.GetX(), event.GetY()))
+ {
+ // fire button-click event
+ wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON);
+ e.SetManager(this);
+ e.SetPane(m_action_part->pane);
+ e.SetButton(m_action_part->button->button_id);
+ ProcessMgrEvent(e);
+ }
}
}
else if (m_action == actionClickCaption)
if (m_action == actionResize)
{
- wxPoint pos = m_action_part->rect.GetPosition();
- if (m_action_part->orientation == wxHORIZONTAL)
- pos.y = wxMax(0, event.m_y - m_action_offset.y);
- else
- pos.x = wxMax(0, event.m_x - m_action_offset.x);
+ if (m_action_part)
+ {
+ wxPoint pos = m_action_part->rect.GetPosition();
+ if (m_action_part->orientation == wxHORIZONTAL)
+ pos.y = wxMax(0, event.m_y - m_action_offset.y);
+ else
+ pos.x = wxMax(0, event.m_x - m_action_offset.x);
- wxRect rect(m_frame->ClientToScreen(pos),
- m_action_part->rect.GetSize());
+ wxRect rect(m_frame->ClientToScreen(pos),
+ m_action_part->rect.GetSize());
- wxScreenDC dc;
- if (!m_action_hintrect.IsEmpty())
- DrawResizeHint(dc, m_action_hintrect);
- DrawResizeHint(dc, rect);
- m_action_hintrect = rect;
+ wxScreenDC dc;
+ if (!m_action_hintrect.IsEmpty())
+ DrawResizeHint(dc, m_action_hintrect);
+ DrawResizeHint(dc, rect);
+ m_action_hintrect = rect;
+ }
}
else if (m_action == actionClickCaption)
{
// caption has been clicked. we need to check if the mouse
// is now being dragged. if it is, we need to change the
// mouse action to 'drag'
- if (abs(event.m_x - m_action_start.x) > drag_x_threshold ||
- abs(event.m_y - m_action_start.y) > drag_y_threshold)
+ if (m_action_part &&
+ (abs(event.m_x - m_action_start.x) > drag_x_threshold ||
+ abs(event.m_y - m_action_start.y) > drag_y_threshold))
{
wxAuiPaneInfo* pane_info = m_action_part->pane;