]> git.saurik.com Git - wxWidgets.git/commitdiff
Lots of fixes for OS/2
authorDavid Webster <Dave.Webster@bhmi.com>
Wed, 23 Jan 2002 23:12:33 +0000 (23:12 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Wed, 23 Jan 2002 23:12:33 +0000 (23:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

17 files changed:
include/wx/os2/menu.h
src/os2/app.cpp
src/os2/button.cpp
src/os2/checkbox.cpp
src/os2/combobox.cpp
src/os2/frame.cpp
src/os2/listbox.cpp
src/os2/menu.cpp
src/os2/slider.cpp
src/os2/spinbutt.cpp
src/os2/spinctrl.cpp
src/os2/statbmp.cpp
src/os2/statbox.cpp
src/os2/stattext.cpp
src/os2/textctrl.cpp
src/os2/toplevel.cpp
src/os2/window.cpp

index e75b73d6f05f4cc8a177ba082a1d5f0e2fa1a914..4a0baba04b8e709104f3fcee5271114a9fd1013c 100644 (file)
@@ -288,8 +288,6 @@ protected:
     wxAcceleratorTable              m_vAccelTable;
 #endif // wxUSE_ACCEL
 
-    wxFrame*                        m_pMenuBarFrame;
-
 private:
     //
     // Virtual function hiding suppression
index a2608efbf2306965f1e9b0883b2186d648239f6e..7bcf7d2b7d251c9e2c198cfae71c77812ca16dbb 100644 (file)
@@ -896,9 +896,13 @@ bool wxApp::ProcessMessage(
 #endif // wxUSE_TOOLTIPS
 
     //
-    // We must relay Timer events to wxTimer's processing function
+    // Pass non-system timer messages to the wxTimerProc
     //
-    if (pMsg->msg == WM_TIMER)
+    if (pMsg->msg == WM_TIMER &&
+        (SHORT1FROMMP(pMsg->mp1) != TID_CURSOR &&
+         SHORT1FROMMP(pMsg->mp1) != TID_FLASHWINDOW &&
+         SHORT1FROMMP(pMsg->mp1) != TID_SCROLL
+        ))
         wxTimerProc(NULL, 0, (int)pMsg->mp1, 0);
 
     //
index 83301398f7ffbed054116a2f22aa8c8130004fe8..ab27b61602e7abeac4957c4d9c5a100cbf6fdae5 100644 (file)
@@ -100,7 +100,7 @@ bool wxButton::Create(
     // Subclass again for purposes of dialog editing mode
     //
     SubclassWin(m_hWnd);
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
index eaa7389885d9f23c3537e46114e276114ec6f9b6..2c18c0eb223499f82a543d4594467799a29972a2 100644 (file)
@@ -131,7 +131,7 @@ bool wxCheckBox::Create(
                       ,(PVOID)&lColor
                      );
 
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
 
     SetSize( nX
             ,nY
index 1fd96160e517223c94162a30b2b9389e51e06bf2..fc4697b255af247b86d2a9fe607e18ade0997afd 100644 (file)
@@ -143,7 +143,7 @@ bool wxComboBox::Create(
     //
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
 
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
 
     int                             i;
 
index 0f687f7f86c709c23c25c02b1175a69726edddd8..4b5e439c6a2d6a8617082b7aa7ca4d063d07e254 100644 (file)
@@ -144,7 +144,6 @@ bool wxFrame::Create(
                                   ,rsName
                                  ))
         return FALSE;
-    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
     wxModelessWindows.Append(this);
     return TRUE;
 } // end of wxFrame::Create
index 290b46be3016a6304a8bf6bdb08f91a9e176420f..f99ec829ec8f1908f5d3fc98a43a3b01fc258694 100644 (file)
@@ -179,8 +179,8 @@ bool wxListBox::Create(
     {
         Append(asChoices[lUi]);
     }
-    SetFont(pParent->GetFont());
-    
+    SetFont(*wxSMALL_FONT);
+
     //
     // Set standard wxWindows colors for Listbox items and highlighting
     //
index a964e5497a3c6019183b0505ebca7ab8db28bd66..6b82bb84fd8771119b8fa828592246fabb2a88bc 100644 (file)
@@ -628,7 +628,7 @@ wxMenuItem* wxMenu::FindItem(
 void wxMenuBar::Init()
 {
     m_eventHandler = this;
-    m_pMenuBarFrame = NULL;
+    m_menuBarFrame = NULL;
     m_hMenu = 0;
 } // end of wxMenuBar::Init
 
@@ -673,7 +673,7 @@ void wxMenuBar::Refresh()
 {
     wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") );
 
-    WinSendMsg(GetWinHwnd(m_pMenuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+    WinSendMsg(GetWinHwnd(m_menuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
 } // end of wxMenuBar::Refresh
 
 WXHMENU wxMenuBar::Create()
@@ -689,8 +689,8 @@ WXHMENU wxMenuBar::Create()
     //
     // Menubars should be associated with a frame otherwise they are popups
     //
-    if (m_pMenuBarFrame != NULL)
-        hFrame = GetWinHwnd(m_pMenuBarFrame);
+    if (m_menuBarFrame != NULL)
+        hFrame = GetWinHwnd(m_menuBarFrame);
     else
         hFrame = HWND_DESKTOP;
     //
@@ -900,8 +900,6 @@ bool wxMenuBar::Insert(
                     ,nPos
                    );
 
-    pMenu->Attach(this);
-
     if (IsAttached())
     {
         ::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)Title.c_str());
@@ -1024,7 +1022,7 @@ void wxMenuBar::Attach(
 )
 {
     wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
-    m_pMenuBarFrame = pFrame;
+    m_menuBarFrame = pFrame;
 
 #if wxUSE_ACCEL
     RebuildAccelTable();
@@ -1043,7 +1041,7 @@ void wxMenuBar::Detach()
 {
     ::WinDestroyWindow((HWND)m_hMenu);
     m_hMenu = (WXHMENU)NULL;
-    m_pMenuBarFrame = NULL;
+    m_menuBarFrame = NULL;
 } // end of wxMenuBar::Detach
 
 // ---------------------------------------------------------------------------
index 931d848e9d6f4b5ba55a88658bfadfee10a0c2a3..7819dca287ef0ef6af1bea376e76fcede34513ab 100644 (file)
@@ -329,7 +329,7 @@ bool wxSlider::Create(
     m_hWnd = (WXHWND)hScrollBar;
     SubclassWin(GetHWND());
     ::WinSetWindowText((HWND)m_hWnd, "");
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     if (m_windowStyle & wxSL_LABELS)
     {
         //
index 55e9b2c6a350d1c8b4dcd1464b15b35ae6479f53..720b9d0f1eb64e136d1150bf922b1d80bd97782a 100644 (file)
@@ -141,7 +141,7 @@ bool wxSpinButton::Create(
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     //
     // For OS/2 we want to hide the text portion so we can substitute an
     // independent text ctrl in its place.  10 device units does this
index 6804a3ab94f9b78e987d1a799eb601c3d5f7a0e1..bfda23f725af4c6396662ab81fc0fb4fd1069702 100644 (file)
@@ -187,7 +187,7 @@ bool wxSpinCtrl::Create(
     m_hWndBuddy = m_hWnd; // One in the same for OS/2
     if(pParent)
         pParent->AddChild((wxSpinButton *)this);
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
index f162d5c4728d73a10930cb873f380ee717d7e07b..d06a109a0eadb887d5426915554fd09121007999 100644 (file)
@@ -93,7 +93,7 @@ bool wxStaticBitmap::Create(
 
     // Subclass again for purposes of dialog editing mode
     SubclassWin(m_hWnd);
-    SetFont(GetParent()->GetFont());
+    SetFont(*wxSMALL_FONT);
     SetSize(nX, nY, nWidth, nHeight);
     return(FALSE);
 }
index 792a6fd3042297cc472d9e3dc57816703eaebaaa..7ca2b7fa23208f60f6f7fcf7f5485e30c2537b71 100644 (file)
@@ -79,7 +79,7 @@ bool wxStaticBox::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
index 7f033e228cde316ff9f501902babf63c177e0d08..871921424161b0a23dd6521ec26fbc713e0c8e41 100644 (file)
@@ -110,7 +110,7 @@ bool wxStaticText::Create(
                      );
 
     SubclassWin(m_hWnd);
-    wxControl::SetFont(pParent->GetFont());
+    wxControl::SetFont(*wxSMALL_FONT);
     SetSize( nX
             ,nY
             ,nWidth
index 4070a296890d54c460df26f2433ff1d3257623aa..66b4819ebb0846a41fe7b46b54c7907f6063e657 100644 (file)
@@ -208,16 +208,7 @@ bool wxTextCtrl::Create(
     //
     // Set font, position, size and initial value
     //
-    wxFont&                         vFontParent = pParent->GetFont();
-
-    if (vFontParent.Ok())
-    {
-        SetFont(vFontParent);
-    }
-    else
-    {
-        SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
-    }
+    SetFont(*wxSMALL_FONT);
     if (!rsValue.IsEmpty())
     {
         SetValue(rsValue);
index abbd5c5c21ea2d034b6abd6db3e2d84daeca9ab9..238342a0521f12633a7887c15cfaed72fb729194 100644 (file)
@@ -351,7 +351,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
     wxAssociateWinWithHandle(m_hWnd, this);
     wxAssociateWinWithHandle(m_hFrame, this);
 
-    m_backgroundColour.Set(wxString("DARK GREY"));
+    m_backgroundColour.Set(wxString("MEDIUM GREY"));
 
     LONG                            lColor = (LONG)m_backgroundColour.GetPixel();
 
index 30ac8d5c44d2c53d01cb50af67730f0eb454386d..8dbadd4520475de01897f1658418dfa7ff2396e3 100644 (file)
@@ -1051,9 +1051,20 @@ void wxWindowOS2::SubclassWin(
 {
     HWND                            hwnd = (HWND)hWnd;
 
-    wxASSERT_MSG( !m_fnOldWndProc, wxT("subclassing window twice?") );
     wxCHECK_RET(::WinIsWindow(vHabmain, hwnd), wxT("invalid HWND in SubclassWin") );
-    m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc);
+    wxAssociateWinWithHandle( hWnd
+                             ,(wxWindow*)this
+                            );
+    if (!wxCheckWindowWndProc( hWnd
+                              ,(WXFARPROC)wxWndProc
+                             ))
+    {
+        m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc);
+    }
+    else
+    {
+        m_fnOldWndProc = (WXFARPROC)NULL;
+    }
 } // end of wxWindowOS2::SubclassWin
 
 void wxWindowOS2::UnsubclassWin()
@@ -3026,17 +3037,22 @@ bool wxWindowOS2::OS2Create(
     //
     if (pParent)
     {
-        if (IsKindOf(CLASSINFO(wxStatusBar)) &&
-            pParent->IsKindOf(CLASSINFO(wxFrame)))
+        if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) ||
+             pParent->IsKindOf(CLASSINFO(wxScrolledWindow))
+           )
         {
-            RECTL                   vRect;
-            wxFrame*                pFrame = wxDynamicCast(pParent, wxFrame);
+            if (IsKindOf(CLASSINFO(wxStatusBar)) &&
+                pParent->IsKindOf(CLASSINFO(wxFrame)))
+            {
+                RECTL               vRect;
+                wxFrame*            pFrame = wxDynamicCast(pParent, wxFrame);
 
-            ::WinQueryWindowRect((HWND)pFrame->GetFrame(), &vRect);
-            nY = vRect.yTop - (nY + nHeight);
+                ::WinQueryWindowRect((HWND)pFrame->GetFrame(), &vRect);
+                nY = vRect.yTop - (nY + nHeight);
+            }
+            else
+                nY = pParent->GetSize().y - (nY + nHeight);
         }
-        else
-            nY = pParent->GetSize().y - (nY + nHeight);
     }
     else
     {