]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/accel.cpp
added wxAuiNotebook::Split(); hooked up wxAuiMDIParentFrame::Tile() to it
[wxWidgets.git] / src / os2 / accel.cpp
index f87668f0626c057a6ac65085443c4044dd299100..3dc254182f641b23d25ac4815d8ef3dae2c23b91 100644 (file)
@@ -1,27 +1,26 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        accel.cpp
+// Name:        src/os2/accel.cpp
 // Purpose:     wxAcceleratorTable
 // Author:      David Webster
 // Modified by:
 // Created:     10/13/99
 // RCS-ID:      $Id$
 // Copyright:   (c) David Webster
 // Purpose:     wxAcceleratorTable
 // Author:      David Webster
 // Modified by:
 // Created:     10/13/99
 // RCS-ID:      $Id$
 // Copyright:   (c) David Webster
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#include "wx/accel.h"
+
 #ifndef WX_PRECOMP
 #ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/setup.h"
-#include "wx/window.h"
-#include "wx/app.h"
-#include "wx/frame.h"
+    #include <stdio.h>
+    #include "wx/window.h"
+    #include "wx/app.h"
+    #include "wx/frame.h"
 #endif
 
 #endif
 
-#include "wx/os2/accel.h"
-
 #include "wx/os2/private.h"
 
 
 #include "wx/os2/private.h"
 
 
@@ -32,7 +31,7 @@ class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
     friend class WXDLLEXPORT wxAcceleratorTable;
 public:
     wxAcceleratorRefData();
     friend class WXDLLEXPORT wxAcceleratorTable;
 public:
     wxAcceleratorRefData();
-    ~wxAcceleratorRefData();
+    virtual ~wxAcceleratorRefData();
 
     inline HACCEL GetHACCEL() const { return m_hAccel; }
 protected:
 
     inline HACCEL GetHACCEL() const { return m_hAccel; }
 protected:
@@ -44,7 +43,7 @@ protected:
 
 wxAcceleratorRefData::wxAcceleratorRefData()
 {
 
 wxAcceleratorRefData::wxAcceleratorRefData()
 {
-    m_ok = FALSE;
+    m_ok = false;
     m_hAccel = 0;
 } // end of wxAcceleratorRefData::wxAcceleratorRefData
 
     m_hAccel = 0;
 } // end of wxAcceleratorRefData::wxAcceleratorRefData
 
@@ -135,20 +134,19 @@ wxAcceleratorTable::wxAcceleratorTable(
             uVirt |= AF_VIRTUALKEY;
         }
 
             uVirt |= AF_VIRTUALKEY;
         }
 
-        bool                        bIsVirtual;
-        USHORT                      uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
-                                                             ,&bIsVirtual
-                                                            );
+        bool bIsVirtual;
+        USHORT uKey = (USHORT)wxCharCodeWXToOS2( vaEntries[i].GetKeyCode(),
+                                                 &bIsVirtual);
         if (bIsVirtual)
             uVirt = AF_CHAR | AF_VIRTUALKEY;
 
         if (bIsVirtual)
             uVirt = AF_CHAR | AF_VIRTUALKEY;
 
-        USHORT                      uCmd = vaEntries[i].GetCommand();
+        USHORT uCmd = (USHORT)vaEntries[i].GetCommand();
 
         pArr->aaccel[i].fs  = uVirt;
         pArr->aaccel[i].key = uKey;
         pArr->aaccel[i].cmd = uCmd;
     }
 
         pArr->aaccel[i].fs  = uVirt;
         pArr->aaccel[i].key = uKey;
         pArr->aaccel[i].cmd = uCmd;
     }
-    pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq);
+    pArr->codepage = (USHORT)::WinQueryCp(wxTheApp->m_hMq);
     pArr->cAccel = (USHORT)n;
     M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
                                                   ,pArr
     pArr->cAccel = (USHORT)n;
     M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
                                                   ,pArr
@@ -158,7 +156,7 @@ wxAcceleratorTable::wxAcceleratorTable(
         //
         // If we have accelerators the top window is the frame
         //
         //
         // If we have accelerators the top window is the frame
         //
-        wxFrame*                    pFrame = (wxFrame*)wxTheApp->GetTopWindow();
+        wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
 
         ::WinSetAccelTable( vHabmain
                            ,M_ACCELDATA->m_hAccel
 
         ::WinSetAccelTable( vHabmain
                            ,M_ACCELDATA->m_hAccel
@@ -170,10 +168,10 @@ wxAcceleratorTable::wxAcceleratorTable(
     M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0);
 } // end of wxAcceleratorTable::wxAcceleratorTable
 
     M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0);
 } // end of wxAcceleratorTable::wxAcceleratorTable
 
-bool wxAcceleratorTable::Ok() const
+bool wxAcceleratorTable::IsOk() const
 {
     return(M_ACCELDATA && (M_ACCELDATA->m_ok));
 {
     return(M_ACCELDATA && (M_ACCELDATA->m_ok));
-} // end of wxAcceleratorTable::Ok
+} // end of wxAcceleratorTable::IsOk
 
 void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel)
 {
 
 void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel)
 {
@@ -190,23 +188,17 @@ WXHACCEL wxAcceleratorTable::GetHACCEL() const
     return (WXHACCEL) M_ACCELDATA->m_hAccel;
 }
 
     return (WXHACCEL) M_ACCELDATA->m_hAccel;
 }
 
-bool wxAcceleratorTable::Translate(
-  WXHWND                            hWnd
-, WXMSG*                            pWxmsg
-) const
+bool wxAcceleratorTable::Translate( WXHWND  hWnd,
+                                    WXMSG*  pWxmsg ) const
 {
 {
-    PQMSG                           pMsg = (PQMSG)pWxmsg;
-    BOOL                            rc = FALSE;
+    PQMSG pMsg = (PQMSG)pWxmsg;
+    BOOL  rc = FALSE;
 
     rc = ::WinTranslateAccel( vHabmain
                              ,(HWND)hWnd
                              ,GetHaccel()
                              ,pMsg
                             );
 
     rc = ::WinTranslateAccel( vHabmain
                              ,(HWND)hWnd
                              ,GetHaccel()
                              ,pMsg
                             );
-    if (rc)
-    {
-        int x = 1;
-    }
     return (Ok() && rc);
 } // end of wxAcceleratorTable::Translate
 
     return (Ok() && rc);
 } // end of wxAcceleratorTable::Translate
 
@@ -214,14 +206,12 @@ bool wxAcceleratorTable::Translate(
 // function for translating labels
 // ---------------------------------------------------------------------------
 
 // function for translating labels
 // ---------------------------------------------------------------------------
 
-wxString wxPMTextToLabel(
-  const wxString&                   rsTitle
-)
+wxString wxPMTextToLabel( const wxString& rsTitle )
 {
 {
-    wxString                        sTitle;
-    const wxChar*                   zPc;
+    wxString      sTitle;
+    const wxChar* zPc;
 
 
-    if (rsTitle.IsEmpty())
+    if (rsTitle.empty())
         return(sTitle);
 
     for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++)
         return(sTitle);
 
     for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++)
@@ -251,4 +241,3 @@ wxString wxPMTextToLabel(
     }
     return(sTitle);
 } // end of wxPMTextToLabel
     }
     return(sTitle);
 } // end of wxPMTextToLabel
-