X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a21d4ad10620573d2089fd3120793113c0687c9d..bd84061db32633592490da273570b8d78215c6c3:/src/msw/accel.cpp diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 02bdacf289..2504eeafac 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -13,10 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "accel.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -48,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: @@ -94,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; } @@ -134,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)); } @@ -166,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); }