1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tbargtk.h
|
|
|
|
// Purpose: GTK toolbar
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Robert Roebling
|
1999-12-15 19:47:54 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
#ifndef _WX_GTK_TBARGTK_H_
|
|
|
|
#define _WX_GTK_TBARGTK_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-12-15 19:47:54 +00:00
|
|
|
#pragma interface "tbargtk.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
|
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
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
class 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,
|
|
|
|
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 15:17:59 +00:00
|
|
|
virtual void SetMargins(int x, int y);
|
|
|
|
virtual void SetToolSeparation(int separation);
|
1999-12-15 19:47:54 +00:00
|
|
|
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
GtkToolbar *m_toolbar;
|
1999-12-15 19:47:54 +00:00
|
|
|
|
|
|
|
GdkColor *m_fg;
|
|
|
|
GdkColor *m_bg;
|
|
|
|
|
1999-10-31 16:42:46 +00:00
|
|
|
bool m_blockNextEvent;
|
1999-12-15 19:47:54 +00:00
|
|
|
|
1999-10-04 09:03:48 +00:00
|
|
|
void OnInternalIdle();
|
1999-12-15 19:47:54 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
const wxBitmap& bitmap1,
|
|
|
|
const wxBitmap& bitmap2,
|
|
|
|
bool toggle,
|
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelpString,
|
|
|
|
const wxString& longHelpString);
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
1999-10-04 09:03:48 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-12-15 19:47:54 +00:00
|
|
|
#endif // wxUSE_TOOLBAR
|
1999-06-14 23:04:05 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1999-12-15 19:47:54 +00:00
|
|
|
// _WX_GTK_TBARGTK_H_
|