]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
Additional imageId values for specific drive types on OS/2.
[wxWidgets.git] / src / os2 / window.cpp
index 977e27bc94ac7f9f0542c2bad5c095f97c28d213..bac428084893af6ecdcde8ba139bc0fadc340e04 100644 (file)
@@ -394,6 +394,10 @@ bool wxWindowOS2::Create(
                   _T("wxStaticBox can't be used as a window parent!") );
 #endif // wxUSE_STATBOX
 
+     // Ensure groupbox backgrounds are painted
+     if (IsKindOf(CLASSINFO(wxPanel)))
+         lStyle &= ~wxCLIP_CHILDREN;
+
     if ( !CreateBase( pParent
                      ,vId
                      ,rPos
@@ -583,7 +587,7 @@ void wxWindowOS2::SetTitle(
   const wxString&                   rTitle
 )
 {
-    ::WinSetWindowText(GetHwnd(), rTitle.c_str());
+    ::WinSetWindowText(GetHwnd(), (PSZ)rTitle.c_str());
 } // end of wxWindowOS2::SetTitle
 
 wxString wxWindowOS2::GetTitle() const
@@ -1623,12 +1627,19 @@ void wxWindowOS2::DoMoveWindow(
                               ,vSwpScroll.cy - nAdjustHeight
                               ,SWP_MOVE | SWP_SIZE
                              );
-            nYDiff += nAdjustHeight;
+            nYDiff -= nAdjustHeight;
         }
         MoveChildren(nYDiff);
         ::WinQueryWindowPos(GetHwnd(), &m_vWinSwp);
     }
+#if 0
+    // FIXME: By my logic, the next line should be needed as it moves child
+    //        windows when resizing the parent (see comment at beginning of
+    //       function). However, this seems to cause lots of problems. At
+    //        least, e.g. the grid sample almost works with this line
+    //        commented out but crashes badly with it. 
     MoveChildren(nHeightDelta);
+#endif
 } // end of wxWindowOS2::DoMoveWindow
 
 //
@@ -3030,9 +3041,10 @@ void wxAssociateWinWithHandle(
     if (pOldWin && (pOldWin != pWin))
     {
         wxString                    str(pWin->GetClassInfo()->GetClassName());
-        wxLogError( "Bug! Found existing HWND %X for new window of class %s"
+
+        wxLogError( _T("Bug! Found existing HWND %X for new window of class %s")
                    ,(int)hWnd
-                   ,(const char*)str
+                   ,str.c_str()
                   );
     }
     else if (!pOldWin)
@@ -3101,7 +3113,7 @@ WXHWND wxWindowOS2::OS2GetParent() const
 
 bool wxWindowOS2::OS2Create(
   PSZ                               zClass
-, const char*                       zTitle
+, const wxChar*                     zTitle
 , WXDWORD                           dwStyle
 , const wxPoint&                    rPos
 , const wxSize&                     rSize
@@ -3147,7 +3159,7 @@ bool wxWindowOS2::OS2Create(
     }
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
                                        ,(PSZ)sClassName.c_str()
-                                       ,(PSZ)zTitle ? zTitle : ""
+                                       ,(PSZ)(zTitle ? zTitle : wxEmptyString)
                                        ,(ULONG)dwStyle
                                        ,(LONG)0L
                                        ,(LONG)0L
@@ -3168,7 +3180,7 @@ bool wxWindowOS2::OS2Create(
     SubclassWin(m_hWnd);
     SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
 
-    m_backgroundColour.Set(wxString("GREY"));
+    m_backgroundColour.Set(wxString(wxT("GREY")));
 
     LONG                            lColor = (LONG)m_backgroundColour.GetPixel();
 
@@ -3180,7 +3192,7 @@ bool wxWindowOS2::OS2Create(
     {
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
-        wxLogError("Error creating frame. Error: %s\n", sError.c_str());
+        wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
         return FALSE;
     }
     SetSize( nX
@@ -3431,7 +3443,7 @@ bool wxWindowOS2::OS2OnDrawItem(
         {
             vError = ::WinGetLastError(vHabmain);
             sError = wxPMErrorToStr(vError);
-            wxLogError("Unable to set current color table. Error: %s\n", sError.c_str());
+            wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
         }
         //
         // Set the color table to RGB mode
@@ -3446,7 +3458,7 @@ bool wxWindowOS2::OS2OnDrawItem(
         {
             vError = ::WinGetLastError(vHabmain);
             sError = wxPMErrorToStr(vError);
-            wxLogError("Unable to set current color table. Error: %s\n", sError.c_str());
+            wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
         }
 
         wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
@@ -4310,15 +4322,15 @@ bool wxWindowOS2::HandleKeyUp(
         //
         // Normal ASCII char
         //
-        nId = (int)wParam;
+        nId = CHAR1FROMMP(lParam);
     }
 
     if (nId != -1)
     {
         wxKeyEvent                  vEvent(CreateKeyEvent( wxEVT_KEY_UP
                                                           ,nId
-                                                          ,lParam
-                                                          ,wParam
+                                                          ,(MPARAM)lParam
+                                                          ,(MPARAM)wParam
                                                          ));
 
         if (GetEventHandler()->ProcessEvent(vEvent))
@@ -4416,6 +4428,10 @@ void wxWindowOS2::MoveChildren(
             ::WinQueryWindowPos( GetHwndOf(pWin)
                                 ,&vSwp
                                );
+            // Actually, only move children that already are placed on the
+            // frame, not ones which are still at wxDefaultCoord.
+            if (vSwp.y == wxDefaultCoord)
+                continue;
             if (pWin->IsKindOf(CLASSINFO(wxControl)))
             {
                 wxControl*          pCtrl;
@@ -4620,6 +4636,8 @@ int wxCharCodeOS2ToWX(
         case VK_CTRL:       nId = WXK_CONTROL; break;
         case VK_PAUSE:      nId = WXK_PAUSE; break;
         case VK_SPACE:      nId = WXK_SPACE; break;
+        case VK_PAGEUP:     nId = WXK_PRIOR; break;
+        case VK_PAGEDOWN:   nId = WXK_NEXT; break;
         case VK_ESC:        nId = WXK_ESCAPE; break;
         case VK_END:        nId = WXK_END; break;
         case VK_HOME :      nId = WXK_HOME; break;
@@ -4690,6 +4708,8 @@ int wxCharCodeWXToOS2(
         case WXK_SHIFT:     nKeySym = VK_SHIFT; break;
         case WXK_CONTROL:   nKeySym = VK_CTRL; break;
         case WXK_PAUSE:     nKeySym = VK_PAUSE; break;
+        case WXK_PRIOR:     nKeySym = VK_PAGEUP; break;
+        case WXK_NEXT :     nKeySym = VK_PAGEDOWN; break;
         case WXK_END:       nKeySym = VK_END; break;
         case WXK_HOME :     nKeySym = VK_HOME; break;
         case WXK_LEFT :     nKeySym = VK_LEFT; break;