2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-10-17 10:44:52 -04:00
|
|
|
// Name: wx/mac/carbon/toolbar.h
|
2004-03-23 12:35:05 -05:00
|
|
|
// Purpose: wxToolBar class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_TOOLBAR_H_
|
|
|
|
#define _WX_TOOLBAR_H_
|
|
|
|
|
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
#include "wx/tbarbase.h"
|
|
|
|
#include "wx/dynarray.h"
|
|
|
|
|
2006-01-16 09:59:55 -05:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar) wxToolBarNameStr[];
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxToolBar: public wxToolBarBase
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
|
|
|
public:
|
|
|
|
/*
|
|
|
|
* Public interface
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxToolBar() { Init(); }
|
|
|
|
|
|
|
|
inline wxToolBar(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxToolBar();
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
|
2005-07-27 10:53:12 -04:00
|
|
|
virtual void SetWindowStyleFlag(long style);
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// override/implement base class virtuals
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
|
|
|
|
2005-07-27 10:53:12 -04:00
|
|
|
virtual bool Show(bool show = true);
|
|
|
|
virtual bool IsShown() const;
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual bool Realize();
|
|
|
|
|
|
|
|
virtual void SetToolBitmapSize(const wxSize& size);
|
|
|
|
virtual wxSize GetToolSize() const;
|
|
|
|
|
|
|
|
virtual void SetRows(int nRows);
|
|
|
|
|
2007-02-06 16:13:03 -05:00
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
|
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
|
|
|
|
|
|
|
|
// Add all the buttons
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
|
|
|
void OnPaint(wxPaintEvent& event) ;
|
|
|
|
void OnMouse(wxMouseEvent& event) ;
|
|
|
|
virtual void MacSuperChangedPosition() ;
|
2005-07-27 10:53:12 -04:00
|
|
|
|
|
|
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
|
|
|
bool MacInstallNativeToolbar(bool usesNative);
|
|
|
|
bool MacWantsNativeToolbar();
|
|
|
|
bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const;
|
|
|
|
#endif
|
2004-03-23 12:35:05 -05:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2006-02-08 16:47:09 -05:00
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
2004-03-23 12:35:05 -05:00
|
|
|
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 wxString& label,
|
|
|
|
const wxBitmap& bmpNormal,
|
|
|
|
const wxBitmap& bmpDisabled,
|
|
|
|
wxItemKind kind,
|
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelp,
|
|
|
|
const wxString& longHelp);
|
2007-03-18 19:13:18 -04:00
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
|
|
|
const wxString& label);
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2006-10-17 10:44:52 -04:00
|
|
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
|
|
|
bool m_macUsesNativeToolbar ;
|
|
|
|
void* m_macHIToolbarRef ;
|
2005-07-27 10:53:12 -04:00
|
|
|
#endif
|
2004-03-23 12:35:05 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_TOOLBAR_H_
|