added ability to set tool alignment (#10174)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams 2009-03-25 15:56:23 +00:00
parent 8bc10f3280
commit 0eefa65979
2 changed files with 8 additions and 2 deletions

View File

@ -119,6 +119,7 @@ public:
dropdown = true;
sticky = true;
user_data = 0;
alignment = wxALIGN_CENTER;
}
wxAuiToolBarItem(const wxAuiToolBarItem& c)
@ -152,6 +153,7 @@ public:
dropdown = c.dropdown;
sticky = c.sticky;
user_data = c.user_data;
alignment = c.alignment;
}
@ -209,6 +211,9 @@ public:
void SetUserData(long l) { user_data = l; }
long GetUserData() const { return user_data; }
void SetAlignment(int l) { alignment = l; }
int GetAlignment() const { return alignment; }
private:
wxWindow* window; // item's associated window
@ -229,6 +234,7 @@ private:
bool dropdown; // true if the item has a dropdown button
bool sticky; // overrides button states if true (always active)
long user_data; // user-specified data
int alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other
};
#ifndef SWIG

View File

@ -1786,7 +1786,7 @@ bool wxAuiToolBar::Realize()
sizer_item = sizer->Add(size.x + (m_tool_border_padding*2),
size.y + (m_tool_border_padding*2),
item.proportion,
wxALIGN_CENTER);
item.alignment);
if (i+1 < count)
{
sizer->AddSpacer(m_tool_packing);
@ -1803,7 +1803,7 @@ bool wxAuiToolBar::Realize()
sizer_item = sizer->Add(size.x + (m_tool_border_padding*2),
size.y + (m_tool_border_padding*2),
0,
wxALIGN_CENTER);
item.alignment);
// add tool packing
if (i+1 < count)
{