summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cf8ccdb)
Implement two-step creation of wxAuiToolBar to allow doing it from XRC.
See #13520.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72785
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class WXDLLIMPEXP_AUI wxAuiToolBar : public wxControl
{
public:
class WXDLLIMPEXP_AUI wxAuiToolBar : public wxControl
{
public:
+ wxAuiToolBar() { Init(); }
wxAuiToolBar(wxWindow* parent,
wxAuiToolBar(wxWindow* parent,
- wxWindowID id = -1,
- const wxPoint& position = wxDefaultPosition,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxSize& size = wxDefaultSize,
- long style = wxAUI_TB_DEFAULT_STYLE);
+ long style = wxAUI_TB_DEFAULT_STYLE)
+ {
+ Init();
+ Create(parent, id, pos, size, style);
+ }
+
+ bool Create(wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0);
+
void SetWindowStyleFlag(long style);
long GetWindowStyleFlag() const;
void SetWindowStyleFlag(long style);
long GetWindowStyleFlag() const;
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
protected:
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
protected:
virtual void OnCustomRender(wxDC& WXUNUSED(dc),
const wxAuiToolBarItem& WXUNUSED(item),
virtual void OnCustomRender(wxDC& WXUNUSED(dc),
const wxAuiToolBarItem& WXUNUSED(item),
class wxAuiToolBar : public wxControl
{
public:
class wxAuiToolBar : public wxControl
{
public:
+ /**
+ Default constructor, use Create() later.
+
+ @since 2.9.5
+ */
+ wxAuiToolBar();
+
+ /**
+ Constructor creating and initializing the object.
+ */
wxAuiToolBar(wxWindow* parent,
wxAuiToolBar(wxWindow* parent,
+ wxWindowID id = wxID_ANY,
const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_TB_DEFAULT_STYLE);
const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_TB_DEFAULT_STYLE);
+
+ /**
+ Really create wxAuiToolBar created using default constructor.
+
+ @since 2.9.5
+ */
+ bool Create(wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxAUI_TB_DEFAULT_STYLE);
virtual ~wxAuiToolBar();
void SetWindowStyleFlag(long style);
virtual ~wxAuiToolBar();
void SetWindowStyleFlag(long style);
EVT_SET_CURSOR(wxAuiToolBar::OnSetCursor)
END_EVENT_TABLE()
EVT_SET_CURSOR(wxAuiToolBar::OnSetCursor)
END_EVENT_TABLE()
-
-wxAuiToolBar::wxAuiToolBar(wxWindow* parent,
- wxWindowID id,
- const wxPoint& position,
- const wxSize& size,
- long style)
- : wxControl(parent,
- id,
- position,
- size,
- style | wxBORDER_NONE)
+void wxAuiToolBar::Init()
{
m_sizer = new wxBoxSizer(wxHORIZONTAL);
m_buttonWidth = -1;
{
m_sizer = new wxBoxSizer(wxHORIZONTAL);
m_buttonWidth = -1;
m_gripperSizerItem = NULL;
m_overflowSizerItem = NULL;
m_dragging = false;
m_gripperSizerItem = NULL;
m_overflowSizerItem = NULL;
m_dragging = false;
+ m_gripperVisible = (m_style & wxAUI_TB_GRIPPER) ? true : false;
+ m_overflowVisible = (m_style & wxAUI_TB_OVERFLOW) ? true : false;
+ m_overflowState = 0;
+}
+
+bool wxAuiToolBar::Create(wxWindow* parent,
+ wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style)
+{
+ style = style|wxBORDER_NONE;
+
+ if (!wxControl::Create(parent, id, pos, size, style))
+ return false;
+
+ m_style = style;
m_orientation = GetOrientation(style);
if (m_orientation == wxBOTH)
{
m_orientation = wxHORIZONTAL;
}
m_orientation = GetOrientation(style);
if (m_orientation == wxBOTH)
{
m_orientation = wxHORIZONTAL;
}
- m_style = style | wxBORDER_NONE;
- m_gripperVisible = (m_style & wxAUI_TB_GRIPPER) ? true : false;
- m_overflowVisible = (m_style & wxAUI_TB_OVERFLOW) ? true : false;
- m_overflowState = 0;
SetMargins(5, 5, 2, 2);
SetFont(*wxNORMAL_FONT);
SetArtFlags();
SetMargins(5, 5, 2, 2);
SetFont(*wxNORMAL_FONT);
SetArtFlags();
if (style & wxAUI_TB_HORZ_LAYOUT)
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
if (style & wxAUI_TB_HORZ_LAYOUT)
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
wxAuiToolBar::~wxAuiToolBar()
{
wxAuiToolBar::~wxAuiToolBar()
{