1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2009-12-10 03:04:07 +00:00
|
|
|
// Name: wx/gtk/toolbar.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-12-10 03:04:07 +00:00
|
|
|
#ifndef _WX_GTK_TOOLBAR_H_
|
|
|
|
#define _WX_GTK_TOOLBAR_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2011-03-23 17:37:14 +00:00
|
|
|
typedef struct _GtkTooltips GtkTooltips;
|
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-07-22 22:13:31 +00:00
|
|
|
// wxToolBar
|
1999-12-15 19:47:54 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-10-04 09:03:48 +00:00
|
|
|
public:
|
1999-12-15 19:47:54 +00:00
|
|
|
// construction/destruction
|
|
|
|
wxToolBar() { Init(); }
|
|
|
|
wxToolBar( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2014-11-07 14:59:33 +00:00
|
|
|
long style = wxTB_DEFAULT_STYLE,
|
1999-12-15 19:47:54 +00:00
|
|
|
const wxString& name = wxToolBarNameStr )
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2014-11-07 14:59:33 +00:00
|
|
|
long style = wxTB_DEFAULT_STYLE,
|
1999-12-15 19:47:54 +00:00
|
|
|
const wxString& name = wxToolBarNameStr );
|
|
|
|
|
|
|
|
virtual ~wxToolBar();
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
|
1999-12-15 19:47:54 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE;
|
2000-11-24 17:07:12 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
2002-03-25 21:38:18 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
2007-03-18 23:57:20 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool Realize() wxOVERRIDE;
|
2009-12-26 16:36:39 +00:00
|
|
|
|
2004-05-06 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2007-03-18 23:57:20 +00:00
|
|
|
|
2012-03-10 00:01:09 +00:00
|
|
|
virtual wxToolBarToolBase *CreateTool(int id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxBitmap& bitmap1,
|
|
|
|
const wxBitmap& bitmap2 = wxNullBitmap,
|
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
|
|
|
wxObject *clientData = NULL,
|
|
|
|
const wxString& shortHelpString = wxEmptyString,
|
2014-03-30 00:02:23 +00:00
|
|
|
const wxString& longHelpString = wxEmptyString) wxOVERRIDE;
|
2012-03-10 00:01:09 +00:00
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
2014-03-30 00:02:23 +00:00
|
|
|
const wxString& label) wxOVERRIDE;
|
2012-03-10 00:01:09 +00:00
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
2015-02-09 00:25:51 +00:00
|
|
|
GtkToolbar* GTKGetToolbar() const { return m_toolbar; }
|
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
protected:
|
2013-03-31 01:12:27 +00:00
|
|
|
// choose the default border for this window
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_DEFAULT; }
|
2013-03-31 01:12:27 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
2007-03-18 23:57:20 +00:00
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
// implement base class pure virtuals
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
1999-12-15 19:47:54 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
|
|
|
|
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
|
|
|
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
1999-12-15 19:47:54 +00:00
|
|
|
|
1999-10-04 09:03:48 +00:00
|
|
|
private:
|
2008-08-06 16:26:16 +00:00
|
|
|
void Init();
|
|
|
|
void GtkSetStyle();
|
|
|
|
GSList* GetRadioGroup(size_t pos);
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void AddChildGTK(wxWindowGTK* child) wxOVERRIDE;
|
2008-08-06 16:26:16 +00:00
|
|
|
|
|
|
|
GtkToolbar* m_toolbar;
|
|
|
|
GtkTooltips* m_tooltips;
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2009-12-10 03:04:07 +00:00
|
|
|
// _WX_GTK_TOOLBAR_H_
|