1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tbargtk.h
|
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Robert Roebling
|
1999-12-15 14:47:54 -05: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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-12-15 14:47:54 -05:00
|
|
|
#pragma interface "tbargtk.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
class 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 );
|
|
|
|
|
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
|
|
|
|
|
|
|
GdkColor *m_fg;
|
|
|
|
GdkColor *m_bg;
|
|
|
|
|
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_
|