1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-22 21:28:01 -05:00
|
|
|
// Name: wx/gtk1/tbargtk.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
#ifndef _WX_GTK_TBARGTK_H_
|
|
|
|
#define _WX_GTK_TBARGTK_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,
|
|
|
|
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,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxToolBarNameStr );
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
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);
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
1999-10-04 05:03:48 -04:00
|
|
|
private:
|
|
|
|
DECLARE_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
|
1999-12-15 14:47:54 -05:00
|
|
|
// _WX_GTK_TBARGTK_H_
|