1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: toolbar.h
|
|
|
|
// Purpose: wxToolBar class
|
2003-02-28 16:54:04 -05:00
|
|
|
// Author: Stefan Csomor
|
1999-01-01 11:05:26 -05:00
|
|
|
// Modified by:
|
2003-02-28 16:54:04 -05:00
|
|
|
// Created: 1998-01-01
|
1999-01-01 11:05:26 -05:00
|
|
|
// RCS-ID: $Id$
|
2003-02-28 16:54:04 -05:00
|
|
|
// Copyright: (c) Stefan Csomor
|
2003-02-28 18:48:13 -05:00
|
|
|
// Licence: wxWindows licence
|
1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_TOOLBAR_H_
|
|
|
|
#define _WX_TOOLBAR_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1999-01-01 11:05:26 -05:00
|
|
|
#pragma interface "toolbar.h"
|
|
|
|
#endif
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
#include "wx/tbarbase.h"
|
1999-11-05 04:16:09 -05:00
|
|
|
#include "wx/dynarray.h"
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2003-03-27 15:14:39 -05:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxToolBar: public wxToolBarBase
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
|
|
|
public:
|
|
|
|
/*
|
|
|
|
* Public interface
|
|
|
|
*/
|
|
|
|
|
2003-04-13 07:57:48 -04:00
|
|
|
wxToolBar() { Init(); }
|
2000-01-13 02:57:22 -05:00
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2002-05-07 17:58:27 -04:00
|
|
|
inline wxToolBar(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr)
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
2000-01-13 02:57:22 -05:00
|
|
|
Init();
|
1999-01-01 11:05:26 -05:00
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
~wxToolBar();
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
|
2000-01-13 02:57:22 -05:00
|
|
|
// override/implement base class virtuals
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2000-01-13 02:57:22 -05:00
|
|
|
virtual bool Realize();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2000-01-13 02:57:22 -05:00
|
|
|
virtual void SetToolBitmapSize(const wxSize& size);
|
|
|
|
virtual wxSize GetToolSize() const;
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2000-01-13 02:57:22 -05:00
|
|
|
virtual void SetRows(int nRows);
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
// Add all the buttons
|
|
|
|
|
2003-06-07 16:29:57 -04:00
|
|
|
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
2003-02-28 18:48:13 -05:00
|
|
|
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
|
|
|
void OnPaint(wxPaintEvent& event) ;
|
|
|
|
void OnMouse(wxMouseEvent& event) ;
|
|
|
|
virtual void MacSuperChangedPosition() ;
|
1999-01-01 11:05:26 -05:00
|
|
|
protected:
|
2000-01-13 02:57:22 -05:00
|
|
|
// 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,
|
2002-03-26 15:52:26 -05:00
|
|
|
const wxString& label,
|
|
|
|
const wxBitmap& bmpNormal,
|
|
|
|
const wxBitmap& bmpDisabled,
|
|
|
|
wxItemKind kind,
|
2000-01-13 02:57:22 -05:00
|
|
|
wxObject *clientData,
|
2002-03-26 15:52:26 -05:00
|
|
|
const wxString& shortHelp,
|
|
|
|
const wxString& longHelp);
|
2000-01-13 02:57:22 -05:00
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
2003-02-28 18:48:13 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-01-01 11:05:26 -05:00
|
|
|
};
|
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
#endif
|
|
|
|
// _WX_TOOLBAR_H_
|