2011-03-20 18:05:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/toolbar.h
|
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Copyright: (c) Robert Roebling
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GTK_TOOLBAR_H_
|
|
|
|
#define _WX_GTK_TOOLBAR_H_
|
|
|
|
|
2012-03-18 01:12:27 +00:00
|
|
|
typedef struct _GtkTooltips GtkTooltips;
|
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxToolBar
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// construction/destruction
|
|
|
|
wxToolBar() { Init(); }
|
|
|
|
wxToolBar( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2016-06-26 05:25:29 +00:00
|
|
|
long style = wxTB_DEFAULT_STYLE,
|
2011-03-20 18:05:19 +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,
|
2016-06-26 05:25:29 +00:00
|
|
|
long style = wxTB_DEFAULT_STYLE,
|
2011-03-20 18:05:19 +00:00
|
|
|
const wxString& name = wxToolBarNameStr );
|
|
|
|
|
|
|
|
virtual ~wxToolBar();
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool Realize() wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
2012-03-18 01:12:27 +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,
|
2016-06-26 05:25:29 +00:00
|
|
|
const wxString& longHelpString = wxEmptyString) wxOVERRIDE;
|
2012-03-18 01:12:27 +00:00
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
2016-06-26 05:25:29 +00:00
|
|
|
const wxString& label) wxOVERRIDE;
|
2012-03-18 01:12:27 +00:00
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
GtkToolbar* GTKGetToolbar() const { return m_toolbar; }
|
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
protected:
|
2013-09-22 22:44:55 +00:00
|
|
|
// choose the default border for this window
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_DEFAULT; }
|
2013-09-22 22:44:55 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// implement base class pure virtuals
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +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;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
void GtkSetStyle();
|
|
|
|
GSList* GetRadioGroup(size_t pos);
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual void AddChildGTK(wxWindowGTK* child) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
GtkToolbar* m_toolbar;
|
|
|
|
GtkTooltips* m_tooltips;
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
|
2011-03-20 18:05:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_GTK_TOOLBAR_H_
|