]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/toplevel.cpp
Additional imageId values for specific drive types on OS/2.
[wxWidgets.git] / src / os2 / toplevel.cpp
index 9fbc3e6ae35311cfb4cd7c8d9f22559fe3f12049..242f6c7ab1cf73bb334d98a71641e5c9763145c6 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        msw/toplevel.cpp
-// Purpose:     implements wxTopLevelWindow for MSW
+// Name:        os2/toplevel.cpp
+// Purpose:     implements wxTopLevelWindow for OS/2
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     30.12.01
@@ -31,6 +31,7 @@
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/toplevel.h"
+    #include "wx/dialog.h"
     #include "wx/string.h"
     #include "wx/log.h"
     #include "wx/intl.h"
 // globals
 // ----------------------------------------------------------------------------
 
-// list of all frames and modeless dialogs
-wxWindowList wxModelessWindows;
-
-// the name of the default wxWindows class
+// the name of the default wxWidgets class
 extern void          wxAssociateWinWithHandle( HWND         hWnd
                                               ,wxWindowOS2* pWin
                                              );
@@ -223,48 +221,47 @@ WXDWORD wxTopLevelWindowOS2::OS2GetStyle(
                                                                      ,pdwExflags
                                                                     );
 
-    if (lStyle == wxDEFAULT_FRAME_STYLE)
+    if ((lStyle & wxDEFAULT_FRAME_STYLE) == wxDEFAULT_FRAME_STYLE)
         lMsflags |= FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU |
                     FCF_MINMAX | FCF_TASKLIST;
+
+    if ((lStyle & wxCAPTION) == wxCAPTION)
+        lMsflags |= FCF_TASKLIST;
     else
+        lMsflags |= FCF_NOMOVEWITHOWNER;
+
+    if ((lStyle & wxVSCROLL) == wxVSCROLL)
+        lMsflags |= FCF_VERTSCROLL;
+    if ((lStyle & wxHSCROLL) == wxHSCROLL)
+        lMsflags |= FCF_HORZSCROLL;
+    if (lStyle & wxMINIMIZE_BOX)
+        lMsflags |= FCF_MINBUTTON;
+    if (lStyle & wxMAXIMIZE_BOX)
+        lMsflags |= FCF_MAXBUTTON;
+    if (lStyle & wxTHICK_FRAME)
+        lMsflags |= FCF_DLGBORDER;
+    if (lStyle & wxSYSTEM_MENU)
+        lMsflags |= FCF_SYSMENU;
+    if (lStyle & wxCAPTION)
+        lMsflags |= FCF_TASKLIST;
+    if (lStyle & wxCLIP_CHILDREN)
     {
-        if ((lStyle & wxCAPTION) == wxCAPTION)
-            lMsflags |= FCF_TASKLIST;
-        else
-            lMsflags |= FCF_NOMOVEWITHOWNER;
-
-        if ((lStyle & wxVSCROLL) == wxVSCROLL)
-            lMsflags |= FCF_VERTSCROLL;
-        if ((lStyle & wxHSCROLL) == wxHSCROLL)
-            lMsflags |= FCF_HORZSCROLL;
-        if (lStyle & wxMINIMIZE_BOX)
-            lMsflags |= FCF_MINBUTTON;
-        if (lStyle & wxMAXIMIZE_BOX)
-            lMsflags |= FCF_MAXBUTTON;
-        if (lStyle & wxTHICK_FRAME)
-            lMsflags |= FCF_DLGBORDER;
-        if (lStyle & wxSYSTEM_MENU)
-            lMsflags |= FCF_SYSMENU;
-        if (lStyle & wxCAPTION)
-            lMsflags |= FCF_TASKLIST;
-        if (lStyle & wxCLIP_CHILDREN)
-        {
-            // Invalid for frame windows under PM
-        }
+        // Invalid for frame windows under PM
+    }
 
-        if (lStyle & wxTINY_CAPTION_VERT)
-            lMsflags |= FCF_TASKLIST;
-        if (lStyle & wxTINY_CAPTION_HORIZ)
-            lMsflags |= FCF_TASKLIST;
+    if (lStyle & wxTINY_CAPTION_VERT)
+        lMsflags |= FCF_TASKLIST;
+    if (lStyle & wxTINY_CAPTION_HORIZ)
+        lMsflags |= FCF_TASKLIST;
 
-        if ((lStyle & wxTHICK_FRAME) == 0)
-            lMsflags |= FCF_BORDER;
-        if (lStyle & wxFRAME_TOOL_WINDOW)
-            *pdwExflags = kFrameToolWindow;
+    if ((lStyle & wxTHICK_FRAME) == 0)
+        lMsflags |= FCF_BORDER;
+    if (lStyle & wxFRAME_TOOL_WINDOW)
+        *pdwExflags = kFrameToolWindow;
+
+    if (lStyle & wxSTAY_ON_TOP)
+        lMsflags |= FCF_SYSMODAL;
 
-        if (lStyle & wxSTAY_ON_TOP)
-            lMsflags |= FCF_SYSMODAL;
-    }
     return lMsflags;
 } // end of wxTopLevelWindowOS2::OS2GetCreateWindowFlags
 
@@ -416,7 +413,7 @@ bool wxTopLevelWindowOS2::CreateDialog(
         nX = (vSizeDpy.x - nWidth) / 2;
         nY = (vSizeDpy.y - nHeight) / 2;
     }
-    m_backgroundColour.Set(wxString("LIGHT GREY"));
+    m_backgroundColour.Set(wxString(wxT("LIGHT GREY")));
 
     LONG                            lColor = (LONG)m_backgroundColour.GetPixel();
 
@@ -501,7 +498,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
     {
         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;
     }
 
@@ -513,7 +510,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
     wxAssociateWinWithHandle(m_hWnd, this);
     wxAssociateWinWithHandle(m_hFrame, this);
 
-    m_backgroundColour.Set(wxString("MEDIUM GREY"));
+    m_backgroundColour.Set(wxString(wxT("MEDIUM GREY")));
 
     LONG                            lColor = (LONG)m_backgroundColour.GetPixel();
 
@@ -525,7 +522,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
     {
         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;
     }
 
@@ -562,7 +559,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
     {
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
-        wxLogError("Error sizing frame. Error: %s\n", sError.c_str());
+        wxLogError(_T("Error sizing frame. Error: %s\n"), sError.c_str());
         return FALSE;
     }
     lStyle =  ::WinQueryWindowULong( m_hWnd
@@ -643,9 +640,6 @@ bool wxTopLevelWindowOS2::Create(
 
 wxTopLevelWindowOS2::~wxTopLevelWindowOS2()
 {
-    if (wxModelessWindows.Find(this))
-        wxModelessWindows.DeleteObject(this);
-
     //
     // After destroying an owned window, Windows activates the next top level
     // window in Z order but it may be different from our owner (to reproduce
@@ -1093,7 +1087,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
             static const wxChar*    zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
 
             if (!::WinRegisterClass( wxGetInstance()
-                                    ,zHIDDEN_PARENT_CLASS
+                                    ,(PSZ)zHIDDEN_PARENT_CLASS
                                     ,NULL
                                     ,0
                                     ,sizeof(ULONG)
@@ -1107,7 +1101,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
             }
         }
         m_shWnd = ::WinCreateWindow( HWND_DESKTOP
-                                    ,m_szClassName
+                                    ,(PSZ)m_szClassName
                                     ,""
                                     ,0L
                                     ,(LONG)0L