source.window = window;
source.frame = frame;
source.buttons = buttons;
+ wxCHECK_RET(source.IsValid(),
+ "window settings and pane settings are incompatible");
// now assign
*this = source;
}
#ifdef SWIG
%typemap(out) wxAuiPaneInfo& { $result = $self; Py_INCREF($result); }
#endif
- wxAuiPaneInfo& Window(wxWindow* w) { window = w; return *this; }
+ wxAuiPaneInfo& Window(wxWindow* w)
+ {
+ wxAuiPaneInfo test(*this);
+ test.window = w;
+ wxCHECK_MSG(test.IsValid(), *this,
+ "window settings and pane settings are incompatible");
+ *this = test;
+ return *this;
+ }
wxAuiPaneInfo& Name(const wxString& n) { name = n; return *this; }
wxAuiPaneInfo& Caption(const wxString& c) { caption = c; return *this; }
wxAuiPaneInfo& Left() { dock_direction = wxAUI_DOCK_LEFT; return *this; }
wxAuiPaneInfo& DefaultPane()
{
- state |= optionTopDockable | optionBottomDockable |
+ wxAuiPaneInfo test(*this);
+ test.state |= optionTopDockable | optionBottomDockable |
optionLeftDockable | optionRightDockable |
optionFloatable | optionMovable | optionResizable |
optionCaption | optionPaneBorder | buttonClose;
+ wxCHECK_MSG(test.IsValid(), *this,
+ "window settings and pane settings are incompatible");
+ *this = test;
return *this;
}
wxAuiPaneInfo& SetFlag(int flag, bool option_state)
{
+ wxAuiPaneInfo test(*this);
if (option_state)
- state |= flag;
+ test.state |= flag;
else
- state &= ~flag;
+ test.state &= ~flag;
+ wxCHECK_MSG(test.IsValid(), *this,
+ "window settings and pane settings are incompatible");
+ *this = test;
return *this;
}
wxAuiPaneButtonArray buttons; // buttons on the pane
wxRect rect; // current rectangle (populated by wxAUI)
+
+ bool IsValid() const;
};