Merge branch 'qt-ownerdrawn-fix' of https://github.com/MaartenBent/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/957
This commit is contained in:
commit
f4c7a31414
3 changed files with 1 additions and 57 deletions
|
|
@ -162,6 +162,7 @@ if(wxUSE_GUI)
|
|||
wx_option_force_value(wxUSE_METAFILE OFF)
|
||||
if(WIN32)
|
||||
wx_option_force_value(wxUSE_ACCESSIBILITY OFF)
|
||||
wx_option_force_value(wxUSE_OWNER_DRAWN OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,20 +9,12 @@
|
|||
#define _WX_QT_MENUITEM_H_
|
||||
|
||||
#include "wx/menuitem.h"
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#include "wx/ownerdrw.h"
|
||||
#endif
|
||||
|
||||
class QAction;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
, public wxOwnerDrawnBase
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
wxMenuItem(wxMenu *parentMenu = NULL,
|
||||
|
|
@ -41,30 +33,15 @@ public:
|
|||
virtual void Check(bool check = true);
|
||||
virtual bool IsChecked() const;
|
||||
|
||||
void SetBitmaps(const wxBitmap& bmpChecked,
|
||||
const wxBitmap& bmpUnchecked = wxNullBitmap);
|
||||
void SetBitmap(const wxBitmap& bitmap);
|
||||
const wxBitmap& GetBitmap() 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:
|
||||
// Qt is using an action instead of a menu item.
|
||||
QAction *m_qtAction;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
wxBitmap m_bmpDisabled;
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -106,12 +106,6 @@ bool wxMenuItem::IsChecked() const
|
|||
}
|
||||
|
||||
|
||||
void wxMenuItem::SetBitmaps(const wxBitmap& WXUNUSED(bmpChecked),
|
||||
const wxBitmap& WXUNUSED(bmpUnchecked))
|
||||
{
|
||||
wxMISSING_FUNCTION();
|
||||
}
|
||||
|
||||
void wxMenuItem::SetBitmap(const wxBitmap& WXUNUSED(bitmap))
|
||||
{
|
||||
wxMISSING_FUNCTION();
|
||||
|
|
@ -131,34 +125,6 @@ QAction *wxMenuItem::GetHandle() const
|
|||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue