X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..069b2e594107028ef3ee0a03b8b9fd13b0fa4f32:/src/msw/accel.cpp?ds=sidebyside diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 40924c0528..2504eeafac 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -44,10 +44,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData { - friend class WXDLLEXPORT wxAcceleratorTable; + friend class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable; public: wxAcceleratorRefData(); - ~wxAcceleratorRefData(); + virtual ~wxAcceleratorRefData(); inline HACCEL GetHACCEL() const { return m_hAccel; } protected: @@ -90,7 +90,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) { m_refData = new wxAcceleratorRefData; - HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource); + HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource.wx_str()); M_ACCELDATA->m_hAccel = hAccel; M_ACCELDATA->m_ok = hAccel != 0; } @@ -130,17 +130,7 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[] M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0); } -bool wxAcceleratorTable::operator==(const wxAcceleratorTable& accel) const -{ - const wxAcceleratorRefData * - accelData = (wxAcceleratorRefData *)accel.m_refData; - - return m_refData ? (accelData && - M_ACCELDATA->m_hAccel == accelData->m_hAccel) - : !accelData; -} - -bool wxAcceleratorTable::Ok() const +bool wxAcceleratorTable::IsOk() const { return (M_ACCELDATA && (M_ACCELDATA->m_ok)); } @@ -162,6 +152,13 @@ WXHACCEL wxAcceleratorTable::GetHACCEL() const bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const { +#if 0 + // calling TranslateAccelerator() with child window doesn't do anything so + // it's probably a bug + wxASSERT_MSG( window->IsTopLevel(), + _T("TranslateAccelerator() needs a top level window") ); +#endif + MSG *msg = (MSG *)wxmsg; return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); }