// --------------------------
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
+
virtual wxSize DoGetBestSize() const;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
// common part of all ctors
void Init();
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
+
// set the GTK toolbar style and orientation
void GtkSetStyle();
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
Init();
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
virtual ~wxToolBar();
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
Init();
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
virtual ~wxToolBar();
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
Create(parent, id, pos, size, style, name);
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
// override/implement base class virtuals
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr,
wxMenuBar* menuBar = NULL)
{
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER | wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr,
wxMenuBar* menuBar = NULL);
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
- ,long lStyle = wxNO_BORDER | wxTB_HORIZONTAL
+ ,long lStyle = wxTB_HORIZONTAL
,const wxString& rName = wxToolBarNameStr
) : m_vToolTimer(this, ID_TOOLTIMER)
, m_vToolExpTimer(this, ID_TOOLEXPTIMER)
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
- ,long lStyle = wxNO_BORDER | wxTB_HORIZONTAL
+ ,long lStyle = wxTB_HORIZONTAL
,const wxString& rName = wxToolBarNameStr
);
inline wxToolBar(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER|wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
Init();
virtual ~wxToolBar();
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER|wxTB_HORIZONTAL,
+ long style = wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
virtual void SetWindowStyleFlag(long style);
#endif
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// to implement in derived classes
// -------------------------------
wxTB_BOTTOM = 0x2000,
// lay out toolbar at the right edge of the window
- wxTB_RIGHT = 0x4000
+ wxTB_RIGHT = 0x4000,
+
+ wxTB_DEFAULT_STYLE = wxTB_HORIZONTAL | wxTB_FLAT
};
#if wxUSE_TOOLBAR
@see CreateStatusBar(), OnCreateToolBar(), SetToolBar(), GetToolBar()
*/
- virtual wxToolBar* CreateToolBar(long style = wxBORDER_NONE | wxTB_HORIZONTAL,
+ virtual wxToolBar* CreateToolBar(long style = wxTB_DEFAULT_STYLE,
wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr);
enum
{
/** lay out the toolbar horizontally */
- wxTB_HORIZONTAL,
- wxTB_TOP,
+ wxTB_HORIZONTAL = wxHORIZONTAL,
+ wxTB_TOP = wxTB_HORIZONTAL,
/** lay out the toolbar vertically */
- wxTB_VERTICAL,
- wxTB_LEFT,
+ wxTB_VERTICAL = wxVERTICAL,
+ wxTB_LEFT = wxTB_VERTICAL,
/** show 3D buttons (wxToolBarSimple only) */
wxTB_3DBUTTONS,
/** show the text and the icons alongside, not vertically stacked (Win32/GTK) */
wxTB_HORZ_LAYOUT,
- wxTB_HORZ_TEXT,
+ wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT,
/** don't show the toolbar short help tooltips */
wxTB_NO_TOOLTIPS,
wxTB_BOTTOM,
/** lay out toolbar at the right edge of the window */
- wxTB_RIGHT
+ wxTB_RIGHT,
+
+ /** flags that are closest to the native look*/
+ wxTB_DEFAULT_STYLE = wxTB_HORIZONTAL | wxTB_FLAT
};
Align the toolbar at the bottom of parent window.
@style{wxTB_RIGHT}
Align the toolbar at the right side of parent window.
+ @style{wxTB_DEFAULT_STYLE}
+ Combination of @c wxTB_HORIZONTAL and @c wxTB_FLAT. This style is new
+ since wxWidgets 2.9.5.
@endStyleTable
See also @ref overview_windowstyles. Note that the wxMSW native toolbar
// a) this allows us to have different defaults for different
// platforms (even if we don't have them right now)
// b) we don't need to include wx/toolbar.h in the header then
- style = wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT;
+ style = wxTB_DEFAULT_STYLE;
}
SetToolBar(OnCreateToolBar(style, id, name));