]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/accel.cpp
Simplest fix received from OW community (Peter C. Chapin).
[wxWidgets.git] / src / msw / accel.cpp
index 02bdacf2891099ba2b633cc81d8ec84c4cfa1d43..b1451eedfe71bd53247412bc7890e63a5a0fb555 100644 (file)
 // declarations
 // ============================================================================
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "accel.h"
-#endif
-
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
@@ -51,7 +47,7 @@ class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
     friend class WXDLLEXPORT wxAcceleratorTable;
 public:
     wxAcceleratorRefData();
-    ~wxAcceleratorRefData();
+    virtual ~wxAcceleratorRefData();
 
     inline HACCEL GetHACCEL() const { return m_hAccel; }
 protected:
@@ -144,7 +140,7 @@ bool wxAcceleratorTable::operator==(const wxAcceleratorTable& accel) const
                      : !accelData;
 }
 
-bool wxAcceleratorTable::Ok() const
+bool wxAcceleratorTable::IsOk() const
 {
     return (M_ACCELDATA && (M_ACCELDATA->m_ok));
 }
@@ -166,6 +162,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);
 }