1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2009-12-09 22:04:07 -05:00
|
|
|
// Name: wx/gtk1/toolbar.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-12-09 22:04:07 -05:00
|
|
|
#ifndef _WX_GTK_TOOLBAR_H_
|
|
|
|
#define _WX_GTK_TOOLBAR_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-07-22 18:13:31 -04:00
|
|
|
// wxToolBar
|
1999-12-15 14:47:54 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-10-04 05:03:48 -04:00
|
|
|
public:
|
1999-12-15 14:47:54 -05:00
|
|
|
// construction/destruction
|
|
|
|
wxToolBar() { Init(); }
|
|
|
|
wxToolBar( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxToolBarNameStr) )
|
1999-12-15 14:47:54 -05:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxToolBarNameStr) );
|
1999-12-15 14:47:54 -05:00
|
|
|
|
|
|
|
virtual ~wxToolBar();
|
|
|
|
|
|
|
|
// override base class virtuals
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual void SetMargins(int x, int y);
|
|
|
|
virtual void SetToolSeparation(int separation);
|
1999-12-15 14:47:54 -05:00
|
|
|
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
|
|
|
|
2000-11-24 12:07:12 -05:00
|
|
|
virtual void SetToolShortHelp(int id, const wxString& helpString);
|
|
|
|
|
2002-03-25 16:38:18 -05:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2006-01-22 21:28:01 -05:00
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
GtkToolbar *m_toolbar;
|
1999-12-15 14:47:54 -05:00
|
|
|
|
2001-11-17 18:50:58 -05:00
|
|
|
bool m_blockEvent;
|
1999-12-15 14:47:54 -05:00
|
|
|
|
1999-10-04 05:03:48 -04:00
|
|
|
void OnInternalIdle();
|
1999-12-15 14:47:54 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2013-03-30 21:12:27 -04:00
|
|
|
// choose the default border for this window
|
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
|
|
|
|
|
2002-03-25 16:38:18 -05:00
|
|
|
// set the GTK toolbar style and orientation
|
|
|
|
void GtkSetStyle();
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
|
|
|
|
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
|
|
|
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
|
|
|
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
|
|
|
|
|
|
|
virtual wxToolBarToolBase *CreateTool(int id,
|
2002-03-25 16:38:18 -05:00
|
|
|
const wxString& label,
|
1999-12-15 14:47:54 -05:00
|
|
|
const wxBitmap& bitmap1,
|
|
|
|
const wxBitmap& bitmap2,
|
2002-03-25 16:38:18 -05:00
|
|
|
wxItemKind kind,
|
1999-12-15 14:47:54 -05:00
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelpString,
|
|
|
|
const wxString& longHelpString);
|
2007-03-18 19:57:20 -04:00
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
|
|
|
const wxString& label);
|
1999-12-15 14:47:54 -05:00
|
|
|
|
1999-10-04 05:03:48 -04:00
|
|
|
private:
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
#endif // wxUSE_TOOLBAR
|
1999-06-14 19:04:05 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
2009-12-09 22:04:07 -05:00
|
|
|
// _WX_GTK_TOOLBAR_H_
|