X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a69b365fbbd7fe05b78187f4d8336dcaaf4c7485..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/aui/auibar.cpp diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 613cfe0d6d..d00706115b 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -804,7 +804,7 @@ void wxAuiToolBar::Init() m_buttonWidth = -1; m_buttonHeight = -1; m_sizerElementCount = 0; - m_actionPos = wxPoint(-1,-1); + m_actionPos = wxDefaultPosition; m_actionItem = NULL; m_tipItem = NULL; m_art = new wxAuiDefaultToolBarArt; @@ -814,9 +814,10 @@ void wxAuiToolBar::Init() m_gripperSizerItem = NULL; m_overflowSizerItem = NULL; m_dragging = false; - m_gripperVisible = (m_windowStyle & wxAUI_TB_GRIPPER) ? true : false; - m_overflowVisible = (m_windowStyle & wxAUI_TB_OVERFLOW) ? true : false; + m_gripperVisible = false; + m_overflowVisible = false; m_overflowState = 0; + m_orientation = wxHORIZONTAL; } bool wxAuiToolBar::Create(wxWindow* parent, @@ -831,6 +832,10 @@ bool wxAuiToolBar::Create(wxWindow* parent, return false; m_windowStyle = style; + + m_gripperVisible = (style & wxAUI_TB_GRIPPER) ? true : false; + m_overflowVisible = (style & wxAUI_TB_OVERFLOW) ? true : false; + m_orientation = GetOrientation(style); if (m_orientation == wxBOTH) { @@ -1256,16 +1261,16 @@ void wxAuiToolBar::SetToolDropDown(int tool_id, bool dropdown) if (!item) return; - item->m_dropDown = dropdown; + item->SetHasDropDown(dropdown); } bool wxAuiToolBar::GetToolDropDown(int tool_id) const { wxAuiToolBarItem* item = FindTool(tool_id); if (!item) - return 0; + return false; - return item->m_dropDown; + return item->HasDropDown(); } void wxAuiToolBar::SetToolSticky(int tool_id, bool sticky) @@ -2406,41 +2411,36 @@ void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt)) break; } - if (item.m_kind == wxITEM_SEPARATOR) - { - // draw a separator - m_art->DrawSeparator(dc, this, item_rect); - } - else if (item.m_kind == wxITEM_LABEL) - { - // draw a text label only - m_art->DrawLabel(dc, this, item, item_rect); - } - else if (item.m_kind == wxITEM_NORMAL) + switch ( item.m_kind ) { - // draw a regular button or dropdown button - if (!item.m_dropDown) - m_art->DrawButton(dc, this, item, item_rect); - else - m_art->DrawDropDownButton(dc, this, item, item_rect); - } - else if (item.m_kind == wxITEM_CHECK) - { - // draw either a regular or dropdown toggle button - if (!item.m_dropDown) + case wxITEM_NORMAL: + // draw a regular or dropdown button + if (!item.m_dropDown) + m_art->DrawButton(dc, this, item, item_rect); + else + m_art->DrawDropDownButton(dc, this, item, item_rect); + break; + + case wxITEM_CHECK: + case wxITEM_RADIO: + // draw a toggle button m_art->DrawButton(dc, this, item, item_rect); - else - m_art->DrawDropDownButton(dc, this, item, item_rect); - } - else if (item.m_kind == wxITEM_RADIO) - { - // draw a toggle button - m_art->DrawButton(dc, this, item, item_rect); - } - else if (item.m_kind == wxITEM_CONTROL) - { - // draw the control's label - m_art->DrawControlLabel(dc, this, item, item_rect); + break; + + case wxITEM_SEPARATOR: + // draw a separator + m_art->DrawSeparator(dc, this, item_rect); + break; + + case wxITEM_LABEL: + // draw a text label only + m_art->DrawLabel(dc, this, item, item_rect); + break; + + case wxITEM_CONTROL: + // draw the control's label + m_art->DrawControlLabel(dc, this, item, item_rect); + break; } // fire a signal to see if the item wants to be custom-rendered