1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tbargtk.h
|
|
|
|
// 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,
|
2006-05-28 13:17:02 -04:00
|
|
|
long style = wxTB_HORIZONTAL,
|
1999-12-15 14:47:54 -05: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,
|
2008-08-06 12:26:16 -04:00
|
|
|
long style = wxTB_HORIZONTAL,
|
1999-12-15 14:47:54 -05:00
|
|
|
const wxString& name = wxToolBarNameStr );
|
|
|
|
|
|
|
|
virtual ~wxToolBar();
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
2007-02-06 16:13:03 -05:00
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
|
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
|
2007-03-18 19:57:20 -04:00
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2007-03-18 19:57:20 -04:00
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
1999-10-04 05:03:48 -04:00
|
|
|
void OnInternalIdle();
|
1999-12-15 14:47:54 -05:00
|
|
|
|
|
|
|
protected:
|
2008-08-06 12:26:16 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-10-06 17:49:10 -04:00
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
2007-03-18 19:57:20 -04:00
|
|
|
|
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:
|
2008-08-06 12:26:16 -04:00
|
|
|
void Init();
|
|
|
|
void GtkSetStyle();
|
|
|
|
GSList* GetRadioGroup(size_t pos);
|
2008-08-29 11:46:48 -04:00
|
|
|
virtual void AddChildGTK(wxWindowGTK* child);
|
2008-08-06 12:26:16 -04:00
|
|
|
|
|
|
|
GtkToolbar* m_toolbar;
|
|
|
|
GtkTooltips* m_tooltips;
|
|
|
|
|
1999-10-04 05:03:48 -04:00
|
|
|
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_
|