2014-08-23 21:50:11 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/qt/toolbar.h
|
2014-08-28 23:37:46 -04:00
|
|
|
// Author: Sean D'Epagnier, Mariano Reingart
|
|
|
|
// Copyright: (c) 2010 wxWidgets dev team
|
2014-08-23 21:50:11 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _WX_QT_TOOLBAR_H_
|
|
|
|
#define _WX_QT_TOOLBAR_H_
|
|
|
|
|
2015-10-25 13:00:05 -04:00
|
|
|
class QActionGroup;
|
2019-01-18 06:09:18 -05:00
|
|
|
class QToolBar;
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxToolBar() { Init(); }
|
|
|
|
wxToolBar(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2014-11-07 09:59:33 -05:00
|
|
|
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxToolBarNameStr))
|
2014-08-23 21:50:11 -04:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxToolBar();
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2014-11-07 09:59:33 -05:00
|
|
|
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxToolBarNameStr));
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2017-11-05 16:56:57 -05:00
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2017-11-05 16:56:57 -05:00
|
|
|
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
2017-07-14 10:53:11 -04:00
|
|
|
|
|
|
|
virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE;
|
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
|
|
|
|
|
2014-08-23 21:50:11 -04:00
|
|
|
virtual bool Realize() wxOVERRIDE;
|
|
|
|
|
|
|
|
virtual wxToolBarToolBase *CreateTool(int toolid,
|
|
|
|
const wxString& label,
|
|
|
|
const wxBitmap& bmpNormal,
|
2017-07-14 10:51:18 -04:00
|
|
|
const wxBitmap& bmpDisabled = wxNullBitmap,
|
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
|
|
|
wxObject *clientData = NULL,
|
|
|
|
const wxString& shortHelp = wxEmptyString,
|
|
|
|
const wxString& longHelp = wxEmptyString) wxOVERRIDE;
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
2017-11-05 16:56:57 -05:00
|
|
|
const wxString& label) wxOVERRIDE;
|
|
|
|
QWidget *GetHandle() const wxOVERRIDE;
|
|
|
|
|
2019-01-19 21:19:32 -05:00
|
|
|
// Private, only used by wxFrame.
|
|
|
|
QToolBar *GetQToolBar() const { return m_qtToolBar; }
|
|
|
|
|
2014-08-23 21:50:11 -04:00
|
|
|
protected:
|
|
|
|
QActionGroup* GetActionGroup(size_t pos);
|
2017-11-05 16:56:57 -05:00
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
|
|
|
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
|
|
|
|
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
|
|
|
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
private:
|
2017-07-14 10:40:09 -04:00
|
|
|
void Init();
|
|
|
|
|
2016-08-25 11:56:00 -04:00
|
|
|
long GetButtonStyle();
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
QToolBar *m_qtToolBar;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
|
2014-08-23 21:50:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_QT_TOOLBAR_H_
|