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