]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxAcceleratorTable, wxFrame::SetAcceleratorTable and additions to process it...
authorJulian Smart <julian@anthemion.co.uk>
Fri, 31 Jul 1998 13:01:34 +0000 (13:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 31 Jul 1998 13:01:34 +0000 (13:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

16 files changed:
include/wx/defs.h
include/wx/msw/frame.h
include/wx/msw/mdi.h
include/wx/msw/window.h
samples/mdi/mdi.cpp
samples/minimal/minimal.rc
src/msw/app.cpp
src/msw/data.cpp
src/msw/frame.cpp
src/msw/makefile.b32
src/msw/makefile.dos
src/msw/makefile.g95
src/msw/makefile.nt
src/msw/mdi.cpp
src/msw/registry.cpp
src/msw/window.cpp

index 6734839262e4e9fad185bbef1469b6ac02fb892f..099c48b6ae65cf6abe4927bbb8822159d35d28ae 100644 (file)
@@ -858,6 +858,7 @@ typedef unsigned long   WXHBRUSH;
 typedef unsigned long   WXHPALETTE;
 typedef unsigned long   WXHCURSOR;
 typedef unsigned long   WXHRGN;
 typedef unsigned long   WXHPALETTE;
 typedef unsigned long   WXHCURSOR;
 typedef unsigned long   WXHRGN;
+typedef unsigned long   WXHACCEL;
 typedef unsigned long   WXHINSTANCE;
 typedef unsigned long   WXHBITMAP;
 typedef unsigned long   WXHIMAGELIST;
 typedef unsigned long   WXHINSTANCE;
 typedef unsigned long   WXHBITMAP;
 typedef unsigned long   WXHIMAGELIST;
index 30184810c2ed390b17cfb52523ee19e71c9df89d..642962a4880e55597ef6e6763c08698f5b94db83 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "wx/window.h"
 #include "wx/toolbar.h"
 
 #include "wx/window.h"
 #include "wx/toolbar.h"
+#include "wx/msw/accel.h"
 
 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
 
 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
@@ -126,7 +127,9 @@ public:
   inline bool Iconized(void) const { return IsIconized(); }
 
   virtual void Maximize(bool maximize);
   inline bool Iconized(void) const { return IsIconized(); }
 
   virtual void Maximize(bool maximize);
-  virtual bool LoadAccelerators(const wxString& table);
+//  virtual bool LoadAccelerators(const wxString& table);
+
+  virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
 
   // Responds to colour changes
   void OnSysColourChanged(wxSysColourChangedEvent& event);
 
   // Responds to colour changes
   void OnSysColourChanged(wxSysColourChangedEvent& event);
@@ -148,6 +151,7 @@ public:
   bool MSWOnClose(void);
   void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
   bool MSWProcessMessage(WXMSG *msg);
   bool MSWOnClose(void);
   void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
   bool MSWProcessMessage(WXMSG *msg);
+  bool MSWTranslateMessage(WXMSG *msg);
   void MSWCreate(int id, wxWindow *parent, const char *WXUNUSED(wclass), wxWindow *wx_win, const char *title,
                    int x, int y, int width, int height, long style);
 
   void MSWCreate(int id, wxWindow *parent, const char *WXUNUSED(wclass), wxWindow *wx_win, const char *title,
                    int x, int y, int width, int height, long style);
 
@@ -159,6 +163,7 @@ protected:
   WXHICON               m_defaultIcon;
   static bool           m_useNativeStatusBar;
   wxToolBar *           m_frameToolBar ;
   WXHICON               m_defaultIcon;
   static bool           m_useNativeStatusBar;
   wxToolBar *           m_frameToolBar ;
+  wxAcceleratorTable    m_acceleratorTable;
 
   DECLARE_EVENT_TABLE()
 };
 
   DECLARE_EVENT_TABLE()
 };
index 0ba4f620349151be384f408ee40351d785b17157..a07466a196b8fd7a8eb92d1de2a427f2fad50fd8 100644 (file)
@@ -94,6 +94,7 @@ class WXDLLEXPORT wxMDIParentFrame: public wxFrame
   bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
   void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
   bool MSWProcessMessage(WXMSG *msg);
   bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
   void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
   bool MSWProcessMessage(WXMSG *msg);
+  bool MSWTranslateMessage(WXMSG *msg);
   void MSWOnCreate(WXLPCREATESTRUCT cs);
   long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
   bool MSWOnEraseBkgnd(WXHDC pDC);
   void MSWOnCreate(WXLPCREATESTRUCT cs);
   long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
   bool MSWOnEraseBkgnd(WXHDC pDC);
@@ -161,6 +162,7 @@ class WXDLLEXPORT wxMDIChildFrame: public wxFrame
     bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
     long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
     bool MSWProcessMessage(WXMSG *msg);
     bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
     long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
     bool MSWProcessMessage(WXMSG *msg);
+    bool MSWTranslateMessage(WXMSG *msg);
     void MSWDestroyWindow(void);
 
     // Implementation
     void MSWDestroyWindow(void);
 
     // Implementation
index 82c7516980a8b4d6aa3c9d294e587f68e5be7e27..e18eec3a638b0acb392abcb3412f1841a7f7dbe0 100644 (file)
@@ -555,6 +555,7 @@ public:
   // Calls an appropriate default window procedure
   virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
   virtual bool MSWProcessMessage(WXMSG* pMsg);
   // Calls an appropriate default window procedure
   virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
   virtual bool MSWProcessMessage(WXMSG* pMsg);
+  virtual bool MSWTranslateMessage(WXMSG* pMsg);
   virtual void MSWDestroyWindow(void);
 
   // Detach "Window" menu from menu bar so it doesn't get deleted
   virtual void MSWDestroyWindow(void);
 
   // Detach "Window" menu from menu bar so it doesn't get deleted
@@ -665,7 +666,7 @@ public:
 #endif
 */
 
 #endif
 */
 
-  WXHANDLE              m_acceleratorTable;
+//  WXHANDLE              m_acceleratorTable;
   WXHMENU               m_hMenu; // Menu, if any
   wxList *              m_children;                           // Window's children
   int                   m_returnCode;
   WXHMENU               m_hMenu; // Menu, if any
   wxList *              m_children;                           // Window's children
   int                   m_returnCode;
index 5aee6a0806fc055c720fbc42139e5bab1df11831..dfcfa0bb4b5e27aade694a991547ee45350fe5ec 100644 (file)
@@ -100,6 +100,16 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c
 
     CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
     InitToolBar(GetToolBar());
 
     CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
     InitToolBar(GetToolBar());
+
+#ifdef __WXMSW__
+    // Accelerators
+    wxAcceleratorEntry entries[3];
+    entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
+    entries[1].Set(wxACCEL_CTRL, (int) 'X', MDI_QUIT);
+    entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
+    wxAcceleratorTable accel(3, entries);
+    SetAcceleratorTable(accel);
+#endif
 }
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 }
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
index 7655c62a4c3f71bc6ddb1499a59ec06d57cf29e2..3bf71d6da09b4d83a72cbcfe0af26afe57e3becc 100644 (file)
@@ -1,3 +1,6 @@
 mondrian ICON "mondrian.ico"
 #include "wx/msw/wx.rc"
 
 mondrian ICON "mondrian.ico"
 #include "wx/msw/wx.rc"
 
+#define MINIMAL_QUIT   1
+#define MINIMAL_ABOUT  102
+
index 47b65da5b4f91040d4f0f617c7603372e91da2e1..6a73f6d3222f42b32ba10ce9383beb8cfa21645f 100644 (file)
@@ -757,26 +757,29 @@ bool wxApp::ProcessMessage(WXMSG *Msg)
 
   HWND hWnd;
 
 
   HWND hWnd;
 
-  // Anyone for a message? Try youngest descendants first.
+  // Try translations first; find the youngest window with
+  // a translation table.
   for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
   {
     wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
     if (wnd)
     {
   for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
   {
     wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
     if (wnd)
     {
-       if (wnd->MSWProcessMessage(Msg))
+       if (wnd->MSWTranslateMessage(Msg))
          return TRUE;
          return TRUE;
-
-       // STOP if we've reached the top of the hierarchy!
-//       if (m_topWindow && (wnd == m_topWindow))
-//          return FALSE;
     }
   }
 
     }
   }
 
-  // TODO: Is this now obsolete, given that m_topWindow may not be defined?
-  // Does it do anything useful anyway?
-//  if (m_topWindow && m_topWindow->MSWProcessMessage(Msg))
-//     return TRUE;
-    return FALSE;
+  // Anyone for a non-translation message? Try youngest descendants first.
+  for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
+  {
+    wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
+    if (wnd)
+    {
+       if (wnd->MSWProcessMessage(Msg))
+         return TRUE;
+    }
+  }
+  return FALSE;
 }
 
 void wxApp::OnIdle(wxIdleEvent& event)
 }
 
 void wxApp::OnIdle(wxIdleEvent& event)
index a692201c45a2348476636ef3ef1ce9291af664d3..ea8b75ba3d933aaf8dc87658fc487fdffb6b174f 100644 (file)
@@ -99,6 +99,7 @@ wxCursor *wxHOURGLASS_CURSOR = NULL;
 wxCursor *wxCROSS_CURSOR = NULL;
 
 // 'Null' objects
 wxCursor *wxCROSS_CURSOR = NULL;
 
 // 'Null' objects
+wxAcceleratorTable wxNullAcceleratorTable;
 wxBitmap wxNullBitmap;
 wxIcon   wxNullIcon;
 wxCursor wxNullCursor;
 wxBitmap wxNullBitmap;
 wxIcon   wxNullIcon;
 wxCursor wxNullCursor;
index a616ad14a173215e37355ab8c5a0a871523b6197..4684891fc282cb643437217200d13f12425202dd 100644 (file)
@@ -348,6 +348,11 @@ void wxFrame::SetIcon(const wxIcon& icon)
 #endif
 }
 
 #endif
 }
 
+void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel)
+{
+    m_acceleratorTable = accel;
+}
+
 wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
     const wxString& name)
 {
 wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
     const wxString& name)
 {
@@ -479,6 +484,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menu_bar)
   menu_bar->m_menuBarFrame = this;
 }
 
   menu_bar->m_menuBarFrame = this;
 }
 
+#if 0
 bool wxFrame::LoadAccelerators(const wxString& table)
 {
   m_acceleratorTable = (WXHANDLE)
 bool wxFrame::LoadAccelerators(const wxString& table)
 {
   m_acceleratorTable = (WXHANDLE)
@@ -498,6 +504,7 @@ bool wxFrame::LoadAccelerators(const wxString& table)
 
   return (m_acceleratorTable != (WXHANDLE) NULL);
 }
 
   return (m_acceleratorTable != (WXHANDLE) NULL);
 }
+#endif
 
 void wxFrame::Fit(void)
 {
 
 void wxFrame::Fit(void)
 {
@@ -758,8 +765,13 @@ void wxFrame::MSWOnMenuHighlight(WXWORD nItem, WXWORD nFlags, WXHMENU hSysMenu)
 
 bool wxFrame::MSWProcessMessage(WXMSG* pMsg)
 {
 
 bool wxFrame::MSWProcessMessage(WXMSG* pMsg)
 {
-  if (m_acceleratorTable != 0 &&
-          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, (MSG *)pMsg))
+  return FALSE;
+}
+
+bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
+{
+  if (m_acceleratorTable.Ok() &&
+          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), (MSG *)pMsg))
     return TRUE;
   
   return FALSE;
     return TRUE;
   
   return FALSE;
index 6d765757a116eb78f784499772952733e25f0db7..b44de26681a8dac9090cb7ab7973f680ca98f806 100644 (file)
@@ -118,6 +118,7 @@ COMMONOBJS = \
 #  $(MSWDIR)\matrix.obj \
 
 MSWOBJS = \
 #  $(MSWDIR)\matrix.obj \
 
 MSWOBJS = \
+  $(MSWDIR)\accel.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
@@ -234,6 +235,8 @@ $(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
 
 #$(OBJECTS):   $(WXDIR)\include\wx\setup.h
 
 
 #$(OBJECTS):   $(WXDIR)\include\wx\setup.h
 
+$(MSWDIR)\accel.obj:     $(MSWDIR)\accel.$(SRCSUFF)
+
 $(MSWDIR)\app.obj:     $(MSWDIR)\app.$(SRCSUFF)
 
 $(MSWDIR)\bitmap.obj:     $(MSWDIR)\bitmap.$(SRCSUFF)
 $(MSWDIR)\app.obj:     $(MSWDIR)\app.$(SRCSUFF)
 
 $(MSWDIR)\bitmap.obj:     $(MSWDIR)\bitmap.$(SRCSUFF)
index ee6380273194eaf318e95f6a8eb268cb0909a41f..6d28cd8edb04d9cf307efafa2cd466bfdc49ff6e 100644 (file)
@@ -119,6 +119,7 @@ COMMONOBJS = \
 #  $(COMMDIR)\fileconf.obj # Doens't compile (nested classes)
 
 MSWOBJS = \
 #  $(COMMDIR)\fileconf.obj # Doens't compile (nested classes)
 
 MSWOBJS = \
+  $(MSWDIR)\accel.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
@@ -258,6 +259,11 @@ dummydll.obj: dummydll.$(SRCSUFF) $(WXDIR)\include\wx\wx.h
 $(CPPFLAGS) /YcWX/WXPREC.H /c /Tp $*.$(SRCSUFF)
 <<
 
 $(CPPFLAGS) /YcWX/WXPREC.H /c /Tp $*.$(SRCSUFF)
 <<
 
+$(MSWDIR)/accel.obj:     $*.$(SRCSUFF)
+        cl @<<
+$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
+<<
+
 $(MSWDIR)/app.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
 $(MSWDIR)/app.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
index 8e6ac8f0243369e625640b3606952e4f8f13ad22..5db4dfeeb63b47f589d13ca060b7dc212298a1f5 100644 (file)
@@ -122,6 +122,7 @@ COMMONOBJS = \
   $(COMMDIR)/wincmn.$(OBJSUFF)
 
 MSWOBJS = \
   $(COMMDIR)/wincmn.$(OBJSUFF)
 
 MSWOBJS = \
+  accel.$(OBJSUFF) \
   app.$(OBJSUFF) \
   bitmap.$(OBJSUFF) \
   bmpbuttn.$(OBJSUFF) \
   app.$(OBJSUFF) \
   bitmap.$(OBJSUFF) \
   bmpbuttn.$(OBJSUFF) \
index 3174cef27d3b4e9dc3583e1d2557a981cb1a832e..695ae309cd6cd89e94bff33a88afc5a908a515ee 100644 (file)
@@ -122,6 +122,7 @@ COMMONOBJS = \
 
 
 MSWOBJS = \
 
 
 MSWOBJS = \
+  $(MSWDIR)\accel.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
   $(MSWDIR)\app.obj \
   $(MSWDIR)\bitmap.obj \
   $(MSWDIR)\bmpbuttn.obj \
@@ -278,6 +279,11 @@ dummydll.obj: dummydll.$(SRCSUFF) $(WXDIR)\include\wx\wx.h
 $(CPPFLAGS) $(MAKEPRECOMP) /c /Tp $*.$(SRCSUFF)
 <<
 
 $(CPPFLAGS) $(MAKEPRECOMP) /c /Tp $*.$(SRCSUFF)
 <<
 
+$(MSWDIR)/accel.obj:     $*.$(SRCSUFF)
+        cl @<<
+$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
+<<
+
 $(MSWDIR)/app.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
 $(MSWDIR)/app.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
index 55998c12407ae11af4cd3ffba45b6cdc4fee3704..774b215ca1810175fa455384ad2d284cf85d674b 100644 (file)
@@ -479,7 +479,7 @@ bool wxMDIParentFrame::MSWOnActivate(int state, bool minimized, WXHWND activate)
 
 bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
 {
 
 bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
 {
-  if (cmd == 0)
+//  if (cmd == 0) // Why did I do this test?
   {
     // In case it's e.g. a toolbar.
     wxWindow *win = wxFindWinFromHandle(control);
   {
     // In case it's e.g. a toolbar.
     wxWindow *win = wxFindWinFromHandle(control);
@@ -599,8 +599,18 @@ bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg)
   if ((m_currentChild != (wxWindow *)NULL) && (m_currentChild->GetHWND() != (WXHWND) NULL) && m_currentChild->MSWProcessMessage(msg))
      return TRUE;
        
   if ((m_currentChild != (wxWindow *)NULL) && (m_currentChild->GetHWND() != (WXHWND) NULL) && m_currentChild->MSWProcessMessage(msg))
      return TRUE;
        
-  if (m_acceleratorTable != (WXHANDLE) NULL &&
-          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, pMsg))
+  return FALSE;
+}
+
+bool wxMDIParentFrame::MSWTranslateMessage(WXMSG* msg)
+{
+  MSG *pMsg = (MSG *)msg;
+
+  if ((m_currentChild != (wxWindow *)NULL) && (m_currentChild->GetHWND() != (WXHWND) NULL) && m_currentChild->MSWTranslateMessage(msg))
+     return TRUE;
+       
+  if (m_acceleratorTable.Ok() &&
+          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), pMsg))
     return TRUE;
 
   if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
     return TRUE;
 
   if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
@@ -612,6 +622,7 @@ bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg)
   return FALSE;
 }
 
   return FALSE;
 }
 
+
 bool wxMDIParentFrame::MSWOnEraseBkgnd(WXHDC WXUNUSED(pDC))
 {
   return TRUE;
 bool wxMDIParentFrame::MSWOnEraseBkgnd(WXHDC WXUNUSED(pDC))
 {
   return TRUE;
@@ -918,7 +929,8 @@ bool wxMDIChildFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
 #if WXDEBUG > 1
   wxDebugMsg("wxMDIChildFrame::MSWOnCommand %d\n", GetHWND());
 #endif
 #if WXDEBUG > 1
   wxDebugMsg("wxMDIChildFrame::MSWOnCommand %d\n", GetHWND());
 #endif
-  if ((cmd == 0) && GetHWND())
+//  if ((cmd == 0) && GetHWND())
+  if (GetHWND())
   {
     // In case it's e.g. a toolbar.
     wxWindow *win = wxFindWinFromHandle(control);
   {
     // In case it's e.g. a toolbar.
     wxWindow *win = wxFindWinFromHandle(control);
@@ -946,14 +958,20 @@ long wxMDIChildFrame::MSWDefWindowProc(WXUINT message, WXUINT wParam, WXLPARAM l
 }
 
 bool wxMDIChildFrame::MSWProcessMessage(WXMSG *msg)
 }
 
 bool wxMDIChildFrame::MSWProcessMessage(WXMSG *msg)
+{
+  return FALSE;
+}
+
+bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
 {
   MSG *pMsg = (MSG *)msg;
 {
   MSG *pMsg = (MSG *)msg;
-  if (m_acceleratorTable && GetHWND())
+  if (m_acceleratorTable.Ok())
   {
     wxFrame *parent = (wxFrame *)GetParent();
     HWND parent_hwnd = (HWND) parent->GetHWND();
   {
     wxFrame *parent = (wxFrame *)GetParent();
     HWND parent_hwnd = (HWND) parent->GetHWND();
-    return (::TranslateAccelerator(parent_hwnd, (HACCEL) m_acceleratorTable, pMsg) != 0);
+    return (::TranslateAccelerator(parent_hwnd, (HACCEL) m_acceleratorTable.GetHACCEL(), pMsg) != 0);
   }
   }
+
   return FALSE;
 }
 
   return FALSE;
 }
 
index e7d698cbbdbe81d49fead19962045b0e32a50a86..c6d0142dc1fb940c9637b4a19935fcc8a4e3c3ad 100644 (file)
 #include  "wx/log.h"
 
 // Windows headers
 #include  "wx/log.h"
 
 // Windows headers
+/*
 #define   STRICT
 #define   WIN32_LEAN_AND_MEAN
 #define   STRICT
 #define   WIN32_LEAN_AND_MEAN
+*/
+
 #include  <windows.h>
 
 // other std headers
 #include  <windows.h>
 
 // other std headers
index d5e8050619b48cf3235f970c84eaffae7722c68d..e594c9b07b20f728d08ae78ce81a0680db38cb29 100644 (file)
@@ -252,7 +252,7 @@ wxWindow::wxWindow(void)
   m_lastMsg = 0;
   m_lastWParam = 0;
   m_lastLParam = 0;
   m_lastMsg = 0;
   m_lastWParam = 0;
   m_lastLParam = 0;
-  m_acceleratorTable = 0;
+//  m_acceleratorTable = 0;
   m_hMenu = 0;
 
   m_xThumbSize = 0;
   m_hMenu = 0;
 
   m_xThumbSize = 0;
@@ -434,7 +434,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
   m_lastMsg = 0;
   m_lastWParam = 0;
   m_lastLParam = 0;
   m_lastMsg = 0;
   m_lastWParam = 0;
   m_lastLParam = 0;
-  m_acceleratorTable = 0;
+//  m_acceleratorTable = 0;
   m_hMenu = 0;
 
   m_xThumbSize = 0;
   m_hMenu = 0;
 
   m_xThumbSize = 0;
@@ -2012,6 +2012,11 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
   return FALSE;
 }
 
   return FALSE;
 }
 
+bool wxWindow::MSWTranslateMessage(WXMSG* WXUNUSED(pMsg))
+{
+    return FALSE;
+}
+
 long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate))
 {
 #if WXDEBUG > 1
 long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate))
 {
 #if WXDEBUG > 1