// Author: Benjamin I. Williams
// Modified by:
// Created: 2005-05-17
-// RCS-ID: $Id: dockart.cpp 48848 2007-09-21 10:19:53Z SC $
+// RCS-ID: $Id$
// Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifdef __WXMAC__
#include "wx/osx/private.h"
+// for themeing support
+#include <Carbon/Carbon.h>
#endif
#include "wx/arrimpl.cpp"
WX_DEFINE_OBJARRAY(wxAuiToolBarItemArray)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG)
+wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEvent )
+wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, wxAuiToolBarEvent )
+wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, wxAuiToolBarEvent )
+wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, wxAuiToolBarEvent )
+wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEvent )
IMPLEMENT_CLASS(wxAuiToolBar, wxControl)
SetFont(*wxNORMAL_FONT);
m_art->SetFlags((unsigned int)m_style);
SetExtraStyle(wxWS_EX_PROCESS_IDLE);
- if (style & wxAUI_TB_HORZ_TEXT)
+ if (style & wxAUI_TB_HORZ_LAYOUT)
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
}
else
m_overflow_visible = false;
- if (style & wxAUI_TB_HORZ_TEXT)
+ if (style & wxAUI_TB_HORZ_LAYOUT)
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
else
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_BOTTOM);
-void wxAuiToolBar::AddTool(int tool_id,
+wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
const wxString& short_help_string,
wxItemKind kind)
{
- AddTool(tool_id,
+ return AddTool(tool_id,
label,
bitmap,
wxNullBitmap,
}
-void wxAuiToolBar::AddTool(int tool_id,
+wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
const wxBitmap& disabled_bitmap,
item.disabled_bitmap = MakeDisabledBitmap(item.bitmap);
}
}
-
m_items.Add(item);
+ return &m_items.Last();
}
-void wxAuiToolBar::AddControl(wxControl* control,
+wxAuiToolBarItem* wxAuiToolBar::AddControl(wxControl* control,
const wxString& label)
{
wxAuiToolBarItem item;
item.sticky = false;
m_items.Add(item);
+ return &m_items.Last();
}
-void wxAuiToolBar::AddLabel(int tool_id,
+wxAuiToolBarItem* wxAuiToolBar::AddLabel(int tool_id,
const wxString& label,
const int width)
{
item.sticky = false;
m_items.Add(item);
+ return &m_items.Last();
}
-void wxAuiToolBar::AddSeparator()
+wxAuiToolBarItem* wxAuiToolBar::AddSeparator()
{
wxAuiToolBarItem item;
item.window = NULL;
item.sticky = false;
m_items.Add(item);
+ return &m_items.Last();
}
-void wxAuiToolBar::AddSpacer(int pixels)
+wxAuiToolBarItem* wxAuiToolBar::AddSpacer(int pixels)
{
wxAuiToolBarItem item;
item.window = NULL;
item.sticky = false;
m_items.Add(item);
+ return &m_items.Last();
}
-void wxAuiToolBar::AddStretchSpacer(int proportion)
+wxAuiToolBarItem* wxAuiToolBar::AddStretchSpacer(int proportion)
{
wxAuiToolBarItem item;
item.window = NULL;
item.sticky = false;
m_items.Add(item);
+ return &m_items.Last();
}
void wxAuiToolBar::Clear()
vert_sizer->AddStretchSpacer(1);
ctrl_sizer_item = vert_sizer->Add(item.window, 0, wxEXPAND);
vert_sizer->AddStretchSpacer(1);
- if ( (m_style & wxAUI_TB_TEXT) && !item.GetLabel().empty() )
+ if ( (m_style & wxAUI_TB_TEXT) &&
+ m_tool_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM &&
+ !item.GetLabel().empty() )
{
wxSize s = GetLabelSize(item.GetLabel());
vert_sizer->Add(1, s.y);