Fix missing wxOwnerDrawn functions in WXQT wxMenuItem
This commit is contained in:
@@ -9,12 +9,20 @@
|
|||||||
#define _WX_QT_MENUITEM_H_
|
#define _WX_QT_MENUITEM_H_
|
||||||
|
|
||||||
#include "wx/menuitem.h"
|
#include "wx/menuitem.h"
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
#include "wx/ownerdrw.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
, public wxOwnerDrawnBase
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxMenuItem(wxMenu *parentMenu = NULL,
|
wxMenuItem(wxMenu *parentMenu = NULL,
|
||||||
@@ -33,15 +41,30 @@ public:
|
|||||||
virtual void Check(bool check = true);
|
virtual void Check(bool check = true);
|
||||||
virtual bool IsChecked() const;
|
virtual bool IsChecked() const;
|
||||||
|
|
||||||
|
void SetBitmaps(const wxBitmap& bmpChecked,
|
||||||
|
const wxBitmap& bmpUnchecked = wxNullBitmap);
|
||||||
void SetBitmap(const wxBitmap& bitmap);
|
void SetBitmap(const wxBitmap& bitmap);
|
||||||
const wxBitmap& GetBitmap() const;
|
const wxBitmap& GetBitmap() const;
|
||||||
|
|
||||||
virtual QAction *GetHandle() const;
|
virtual QAction *GetHandle() const;
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
void SetDisabledBitmap(const wxBitmap& bmpDisabled);
|
||||||
|
const wxBitmap& GetDisabledBitmap() const;
|
||||||
|
|
||||||
|
// override wxOwnerDrawn base class virtuals
|
||||||
|
virtual wxString GetName() const wxOVERRIDE;
|
||||||
|
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat) wxOVERRIDE;
|
||||||
|
#endif // wxUSE_OWNER_DRAWN
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Qt is using an action instead of a menu item.
|
// Qt is using an action instead of a menu item.
|
||||||
QAction *m_qtAction;
|
QAction *m_qtAction;
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
wxBitmap m_bmpDisabled;
|
||||||
|
#endif // wxUSE_OWNER_DRAWN
|
||||||
|
|
||||||
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
|
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -106,6 +106,12 @@ bool wxMenuItem::IsChecked() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxMenuItem::SetBitmaps(const wxBitmap& WXUNUSED(bmpChecked),
|
||||||
|
const wxBitmap& WXUNUSED(bmpUnchecked))
|
||||||
|
{
|
||||||
|
wxMISSING_FUNCTION();
|
||||||
|
}
|
||||||
|
|
||||||
void wxMenuItem::SetBitmap(const wxBitmap& WXUNUSED(bitmap))
|
void wxMenuItem::SetBitmap(const wxBitmap& WXUNUSED(bitmap))
|
||||||
{
|
{
|
||||||
wxMISSING_FUNCTION();
|
wxMISSING_FUNCTION();
|
||||||
@@ -125,6 +131,34 @@ QAction *wxMenuItem::GetHandle() const
|
|||||||
return m_qtAction;
|
return m_qtAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
|
||||||
|
void wxMenuItem::SetDisabledBitmap(const wxBitmap& bmpDisabled)
|
||||||
|
{
|
||||||
|
m_bmpDisabled = bmpDisabled;
|
||||||
|
wxMISSING_FUNCTION();
|
||||||
|
}
|
||||||
|
|
||||||
|
const wxBitmap& wxMenuItem::GetDisabledBitmap() const
|
||||||
|
{
|
||||||
|
wxMISSING_FUNCTION();
|
||||||
|
return m_bmpDisabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenuItem::GetName() const
|
||||||
|
{
|
||||||
|
return GetItemLabelText();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenuItem::OnDrawItem(wxDC& WXUNUSED(dc), const wxRect& WXUNUSED(rc),
|
||||||
|
wxODAction WXUNUSED(act), wxODStatus WXUNUSED(stat))
|
||||||
|
{
|
||||||
|
wxMISSING_FUNCTION();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_OWNER_DRAWN
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
wxQtAction::wxQtAction( wxMenu *parent, int id, const wxString &text, const wxString &help,
|
wxQtAction::wxQtAction( wxMenu *parent, int id, const wxString &text, const wxString &help,
|
||||||
|
Reference in New Issue
Block a user