]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/utilsgui.cpp
1. derive wxGTK wxRadioBox from wxRadioBoxBase now, as in all other ports
[wxWidgets.git] / src / os2 / utilsgui.cpp
index 52701bb3c6d2d0a237d387cb4ddc5cd95eba3f11..46712f85f1bb88c5005c04ddb28066a7953a4bec 100644 (file)
@@ -57,8 +57,6 @@ public:
     }
 };
 
     }
 };
 
-static wxTimer*                     wxTheSleepTimer = NULL;
-
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
 #if wxUSE_RESOURCES
 bool wxWriteResource(
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
 #if wxUSE_RESOURCES
 bool wxWriteResource(
@@ -335,7 +333,6 @@ bool wxCheckForInterrupt(
         QMSG                        vMsg;
         HAB                         hab = 0;
         HWND                        hwndFilter = NULLHANDLE;
         QMSG                        vMsg;
         HAB                         hab = 0;
         HWND                        hwndFilter = NULLHANDLE;
-        HWND                        hwndWin= (HWND) pWnd->GetHWND();
 
         while(::WinPeekMsg(hab, &vMsg, hwndFilter, 0, 0, PM_REMOVE))
         {
 
         while(::WinPeekMsg(hab, &vMsg, hwndFilter, 0, 0, PM_REMOVE))
         {
@@ -473,6 +470,16 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     wxDisplaySize(width, height);
 }
 
     wxDisplaySize(width, height);
 }
 
+void wxGUIAppTraits::InitializeGui(unsigned long &ulHab)
+{
+    ulHab = ::WinInitialize(0);
+}
+
+void wxGUIAppTraits::TerminateGui(unsigned long ulHab)
+{
+    ::WinTerminate(ulHab);
+}
+
 wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo()
 {
     static wxToolkitInfo           vInfo;
 wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo()
 {
     static wxToolkitInfo           vInfo;
@@ -508,10 +515,12 @@ wxString WXDLLEXPORT wxGetWindowText(
 )
 {
     wxString                        vStr;
 )
 {
     wxString                        vStr;
-    long                            lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
 
 
-    ::WinQueryWindowText((HWND)hWnd, lLen, vStr.GetWriteBuf((int)lLen));
-    vStr.UngetWriteBuf();
+    if ( hWnd )
+    {
+       long                lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
+       ::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen));
+    }
 
     return vStr;
 }
 
     return vStr;
 }
@@ -521,22 +530,24 @@ wxString WXDLLEXPORT wxGetWindowClass(
 )
 {
     wxString                        vStr;
 )
 {
     wxString                        vStr;
-    int                             nLen = 256; // some starting value
-
-    for ( ;; )
+    if ( hWnd )
     {
     {
-        int                         nCount = ::WinQueryClassName((HWND)hWnd, nLen, vStr.GetWriteBuf(nLen));
-
-        vStr.UngetWriteBuf();
-        if (nCount == nLen )
-        {
-            // the class name might have been truncated, retry with larger
-            // buffer
-            nLen *= 2;
-        }
-        else
-        {
-            break;
+        int                         nLen = 256; // some starting value
+
+       for ( ;; )
+       {
+           int                     nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen));
+
+           if (nCount == nLen )
+           {
+               // the class name might have been truncated, retry with larger
+               // buffer
+               nLen *= 2;
+           }
+           else
+           {
+               break;
+           }
         }
     }
     return vStr;
         }
     }
     return vStr;
@@ -928,7 +939,7 @@ wxBitmap wxDisableBitmap(
     int                             j;
 
     //
     int                             j;
 
     //
-    // Bitmap must be ina double-word alligned address so we may
+    // Bitmap must be in a double-word aligned address so we may
     // have some padding to worry about
     //
     if (nLineBoundary > 0)
     // have some padding to worry about
     //
     if (nLineBoundary > 0)