]> git.saurik.com Git - wxWidgets.git/commitdiff
Lots of fixes for scrolling
authorDavid Webster <Dave.Webster@bhmi.com>
Thu, 31 Jan 2002 22:48:09 +0000 (22:48 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Thu, 31 Jan 2002 22:48:09 +0000 (22:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

19 files changed:
src/os2/app.cpp
src/os2/button.cpp
src/os2/checkbox.cpp
src/os2/choice.cpp
src/os2/combobox.cpp
src/os2/control.cpp
src/os2/gauge.cpp
src/os2/listbox.cpp
src/os2/ownerdrw.cpp
src/os2/radiobox.cpp
src/os2/radiobut.cpp
src/os2/slider.cpp
src/os2/spinbutt.cpp
src/os2/spinctrl.cpp
src/os2/statbox.cpp
src/os2/stattext.cpp
src/os2/textctrl.cpp
src/os2/toplevel.cpp
src/os2/window.cpp

index 7bcf7d2b7d251c9e2c198cfae71c77812ca16dbb..8062159328e7df5487c74134212a5e45281e3974 100644 (file)
@@ -901,7 +901,8 @@ bool wxApp::ProcessMessage(
     if (pMsg->msg == WM_TIMER &&
         (SHORT1FROMMP(pMsg->mp1) != TID_CURSOR &&
          SHORT1FROMMP(pMsg->mp1) != TID_FLASHWINDOW &&
-         SHORT1FROMMP(pMsg->mp1) != TID_SCROLL
+         SHORT1FROMMP(pMsg->mp1) != TID_SCROLL &&
+         SHORT1FROMMP(pMsg->mp1) != 0x0000
         ))
         wxTimerProc(NULL, 0, (int)pMsg->mp1, 0);
 
index 33634d0a7a4a5792c626710399c34146a1aa0b78..19977b783a7fce23c0ccf89078632c2e9800d450 100644 (file)
@@ -71,14 +71,6 @@ bool wxButton::Create(
     //
     if (m_windowStyle & wxCLIP_SIBLINGS )
         lStyle |= WS_CLIPSIBLINGS;
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lStyle |= WS_CLIPSIBLINGS;
 
     m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent)   // Parent handle
                                        ,WC_BUTTON            // A Button class window
@@ -113,6 +105,7 @@ bool wxButton::Create(
             ,rSize.x
             ,rSize.y
            );
+    delete pButtonFont;
     return TRUE;
 } // end of wxButton::Create
 
index 2c18c0eb223499f82a543d4594467799a29972a2..e2b20ca4d74bbafe047d7b525e1a7a179f252555 100644 (file)
@@ -97,15 +97,6 @@ bool wxCheckBox::Create(
     if (lStyle & wxCLIP_SIBLINGS )
         lSstyle |= WS_CLIPSIBLINGS;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lSstyle |= WS_CLIPSIBLINGS;
-
     m_hWnd = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
                                         ,WC_BUTTON
                                         ,rsLabel.c_str()
@@ -131,13 +122,18 @@ bool wxCheckBox::Create(
                       ,(PVOID)&lColor
                      );
 
-    SetFont(*wxSMALL_FONT);
-
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     SetSize( nX
             ,nY
             ,nWidth
             ,nHeight
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxCheckBox::Create
 
index 00d0d583e48576a7a8af7c620227992607354fac..21bdbb4151732dc8e3b4d7eb3d4fb843e7b8c6cd 100644 (file)
@@ -77,12 +77,18 @@ bool wxChoice::Create(
     {
         Append(asChoices[i]);
     }
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
             ,rSize.y
            );
-
+    delete pTextFont;
     return TRUE;
 } // end of wxChoice::Create
 
index fc4697b255af247b86d2a9fe607e18ade0997afd..8b0980688b1473f9a109cc2070b86cb452273175 100644 (file)
@@ -143,10 +143,14 @@ bool wxComboBox::Create(
     //
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
 
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
 
     int                             i;
-
     for (i = 0; i < n; i++)
     {
         Append(asChoices[i]);
@@ -165,6 +169,7 @@ bool wxComboBox::Create(
                                                     ,(PFNWP)wxComboEditWndProc
                                                    );
     ::WinSetWindowULong(GetHwnd(), QWL_USER, (ULONG)this);
+    delete pTextFont;
     return TRUE;
 } // end of wxComboBox::Create
 
index f9f19112b98d86ee2606f852da5d69af6dbab63a..3ed6d787a06b4a06557ccda762420ac9f962899b 100644 (file)
@@ -140,15 +140,6 @@ bool wxControl::OS2CreateControl(
         zClass = WC_BUTTON;
     dwStyle |= WS_VISIBLE;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            dwStyle |= WS_CLIPSIBLINGS;
-
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                        ,(PSZ)zClass              // Window class
                                        ,(PSZ)rsLabel.c_str()     // Initial Text
index b7700f4147cbf29e2a47ea18f36c0bc5305aaf63..e12f17230431c2e0fef5361da4b9629e50470f4c 100644 (file)
@@ -156,15 +156,6 @@ bool wxGauge::Create(
     if (m_windowStyle & wxCLIP_SIBLINGS)
         lMsStyle |= WS_CLIPSIBLINGS;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lMsStyle |= WS_CLIPSIBLINGS;
-
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                        ,WC_ENTRYFIELD            // Window class
                                        ,(PSZ)NULL                // Initial Text
@@ -185,7 +176,12 @@ bool wxGauge::Create(
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
-    SetFont(pParent->GetFont());
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     if (nWidth == -1L)
         nWidth = 50L;
     if (nHeight == -1L)
@@ -196,6 +192,7 @@ bool wxGauge::Create(
             ,nHeight
            );
     ::WinShowWindow((HWND)GetHWND(), TRUE);
+    delete pTextFont;
     return TRUE;
 } // end of wxGauge::Create
 
index f99ec829ec8f1908f5d3fc98a43a3b01fc258694..2e7ffc1757d4d611f6a27a41b4f722325716216c 100644 (file)
@@ -143,15 +143,6 @@ bool wxListBox::Create(
     //
     lStyle |= LS_NOADJUSTPOS;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lStyle |= WS_CLIPSIBLINGS;
-
     m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) // Parent
                                        ,WC_LISTBOX          // Default Listbox class
                                        ,"LISTBOX"           // Control's name
@@ -179,7 +170,12 @@ bool wxListBox::Create(
     {
         Append(asChoices[lUi]);
     }
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
 
     //
     // Set standard wxWindows colors for Listbox items and highlighting
@@ -208,6 +204,7 @@ bool wxListBox::Create(
             ,nWidth
             ,nHeight
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxListBox::Create
 
index 75c8906036d2a42525d99b9aacd081ffc5533bb8..5e156318e31661d7b84a74f729b0425ff590424f 100644 (file)
@@ -399,7 +399,6 @@ bool wxOwnerDrawn::OnDrawItem(
                               ,&vLine
                              );
                 ::GpiMove(hPS, &vPnt1);
-                char   zMsg[128];
                 ::GpiBox( hPS
                          ,DRO_OUTLINE
                          ,&vPnt2
index 70a9a050e400b5b13c485d3009e0a67d6c1542c9..8fa3845bae85490bc2861789ed23fde1ed5f4a71 100644 (file)
@@ -264,7 +264,11 @@ bool wxRadioBox::Create(
     // System fonts are too big in OS/2 and they are blue
     // We want smaller fonts and black by default.
     //
-    wxFont&                         rFont = *wxSMALL_FONT;
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
     wxColour                        vColour;
     LONG                            lColor;
 
@@ -319,9 +323,9 @@ bool wxRadioBox::Create(
     m_pnRadioWidth   = new int[nNum];
     m_pnRadioHeight  = new int[nNum];
 
-    if (rFont.Ok())
+    if (pTextFont->Ok())
     {
-        hFont = rFont.GetResourceHandle();
+        hFont = pTextFont->GetResourceHandle();
     }
 
     for (int i = 0; i < nNum; i++)
@@ -365,7 +369,7 @@ bool wxRadioBox::Create(
         m_ahRadioButtons[i] = (WXHWND)hWndBtn;
         SubclassRadioButton((WXHWND)hWndBtn);
         wxOS2SetFont( hWndBtn
-                     ,rFont
+                     ,*pTextFont
                     );
         ::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
         m_aSubControls.Add(nNewId);
@@ -385,7 +389,7 @@ bool wxRadioBox::Create(
                              ,NULL
                              ,NULL
                             );
-     SetFont(*wxSMALL_FONT);
+    SetFont(*pTextFont);
     lColor = (LONG)vColour.GetPixel();
     ::WinSetPresParam( m_hWnd
                       ,PP_FOREGROUNDCOLOR
@@ -405,6 +409,7 @@ bool wxRadioBox::Create(
             ,rSize.x
             ,rSize.y
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxRadioBox::Create
 
index 1f48c70a66e373496d707daccde91b9ea0108750..f30fb7e20170ffa518d36f692a10f878b8eadd7e 100644 (file)
@@ -85,12 +85,18 @@ bool wxRadioButton::Create(
     if (HasFlag(wxRB_GROUP))
         SetValue(TRUE);
 
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
             ,rSize.y
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxRadioButton::Create
 
index 7819dca287ef0ef6af1bea376e76fcede34513ab..b190205052f71eb75cd10b046b46a066513d52c8 100644 (file)
@@ -96,7 +96,7 @@ void wxSlider::AdjustSubControls(
                                   ,(LONG)nYOffset
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
-                                  ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+                                  ,SWP_SIZE | SWP_MOVE
                                  );
             }
             ::WinSetWindowPos( (HWND)m_hStaticMin
@@ -105,7 +105,7 @@ void wxSlider::AdjustSubControls(
                               ,(LONG)nYOffset
                               ,(LONG)nMinLen
                               ,(LONG)nCy
-                              ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+                              ,SWP_SIZE | SWP_MOVE
                              );
             nXOffset += nWidth + nCx;
 
@@ -201,15 +201,6 @@ bool wxSlider::Create(
     {
         lMsStyle |= WS_VISIBLE | SS_TEXT | DT_VCENTER;
 
-        //
-        // If the parent is a scrolled window the controls must
-        // have this style or they will overlap the scrollbars
-        //
-        if (pParent)
-            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-                lMsStyle |= WS_CLIPSIBLINGS;
-
         m_hStaticValue = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                    ,WC_STATIC                // Window class
                                                    ,(PSZ)NULL                // Initial Text
@@ -229,14 +220,6 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lWstyle |= WS_CLIPSIBLINGS;
-        //
-        // If the parent is a scrolled window the controls must
-        // have this style or they will overlap the scrollbars
-        //
-        if (pParent)
-            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-                lWstyle |= WS_CLIPSIBLINGS;
 
         m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
@@ -282,15 +265,6 @@ bool wxSlider::Create(
     else
         lMsStyle |= SLS_PRIMARYSCALE2;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lMsStyle |= WS_CLIPSIBLINGS;
-
     m_nPageSize = ((nMaxValue - nMinValue)/10);
     vSlData.usScale1Increments = m_nPageSize;
     vSlData.usScale2Increments = m_nPageSize;
@@ -329,7 +303,13 @@ bool wxSlider::Create(
     m_hWnd = (WXHWND)hScrollBar;
     SubclassWin(GetHWND());
     ::WinSetWindowText((HWND)m_hWnd, "");
-    SetFont(*wxSMALL_FONT);
+
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     if (m_windowStyle & wxSL_LABELS)
     {
         //
@@ -339,14 +319,6 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lMsStyle |= WS_CLIPSIBLINGS;
-        //
-        // If the parent is a scrolled window the controls must
-        // have this style or they will overlap the scrollbars
-        //
-        if (pParent)
-            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-                lWstyle |= WS_CLIPSIBLINGS;
 
         m_hStaticMax = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
@@ -441,6 +413,7 @@ bool wxSlider::Create(
                       ,(PVOID)&lColor
                      );
     SetValue(nValue);
+    delete pTextFont;
     return TRUE;
 } // end of wxSlider::Create
 
index 720b9d0f1eb64e136d1150bf922b1d80bd97782a..2103d2c98b9ae1008919245bde557f72dc64613f 100644 (file)
@@ -102,15 +102,6 @@ bool wxSpinButton::Create(
     if (m_windowStyle & wxCLIP_SIBLINGS )
         lSstyle |= WS_CLIPSIBLINGS;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lSstyle |= WS_CLIPSIBLINGS;
-
     SPBCDATA                        vCtrlData;
 
     vCtrlData.cbSize = sizeof(SPBCDATA);
@@ -141,7 +132,12 @@ bool wxSpinButton::Create(
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     //
     // 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
@@ -156,6 +152,7 @@ bool wxSpinButton::Create(
                             );
     ::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
     fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
+    delete pTextFont;
     return TRUE;
 } // end of wxSpinButton::Create
 
index bfda23f725af4c6396662ab81fc0fb4fd1069702..8c2735901ef9b6ba91f8dceeea7e244240134bb4 100644 (file)
@@ -151,15 +151,6 @@ bool wxSpinCtrl::Create(
     if (m_windowStyle & wxCLIP_SIBLINGS )
         lSstyle |= WS_CLIPSIBLINGS;
 
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lSstyle |= WS_CLIPSIBLINGS;
-
     SPBCDATA                        vCtrlData;
 
     vCtrlData.cbSize = sizeof(SPBCDATA);
@@ -187,7 +178,12 @@ bool wxSpinCtrl::Create(
     m_hWndBuddy = m_hWnd; // One in the same for OS/2
     if(pParent)
         pParent->AddChild((wxSpinButton *)this);
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
@@ -209,6 +205,7 @@ bool wxSpinCtrl::Create(
     ::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
     fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
     m_svAllSpins.Add(this);
+    delete pTextFont;
     return TRUE;
 } // end of wxSpinCtrl::Create
 
index 7ca2b7fa23208f60f6f7fcf7f5485e30c2537b71..61f5db74d6cf964bb3d8488d21d466b94a39f386 100644 (file)
@@ -79,12 +79,18 @@ bool wxStaticBox::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
             ,rSize.y
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxStaticBox::Create
 
index 871921424161b0a23dd6521ec26fbc713e0c8e41..56e44dca0e4fe5039ab1dcb331cfe12a8586a940 100644 (file)
@@ -67,15 +67,6 @@ bool wxStaticText::Create(
         lSstyle |= DT_RIGHT;
     else
         lSstyle |= DT_LEFT;
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lSstyle |= WS_CLIPSIBLINGS;
-
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                        ,WC_STATIC                // Window class
                                        ,(PSZ)rsLabel.c_str()     // Initial Text
@@ -110,12 +101,18 @@ bool wxStaticText::Create(
                      );
 
     SubclassWin(m_hWnd);
-    wxControl::SetFont(*wxSMALL_FONT);
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    wxControl::SetFont(*pTextFont);
     SetSize( nX
             ,nY
             ,nWidth
             ,nHeight
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxStaticText::Create
 
index 0c762e5d8e4e1d055e1c525338eb7b4456293157..87c8150bace89f7e35d3afedc41677c892bbfbc0 100644 (file)
@@ -154,14 +154,6 @@ bool wxTextCtrl::Create(
         if (m_windowStyle & wxTE_PASSWORD) // hidden input
             lSstyle |= ES_UNREADABLE;
     }
-    //
-    // If the parent is a scrolled window the controls must
-    // have this style or they will overlap the scrollbars
-    //
-    if (pParent)
-        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
-            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
-            lSstyle |= WS_CLIPSIBLINGS;
 
     if (m_bIsMLE)
     {
@@ -231,6 +223,7 @@ bool wxTextCtrl::Create(
             ,rSize.x
             ,rSize.y
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxTextCtrl::Create
 
@@ -320,7 +313,10 @@ void wxTextCtrl::WriteText(
   const wxString&                   rsValue
 )
 {
-    ::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
+    if (m_bIsMLE)
+        ::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
+    else
+        ::WinSetWindowText(GetHwnd(), rsValue.c_str());
     AdjustSpaceLimit();
 } // end of wxTextCtrl::WriteText
 
index 888f0ccf68dd7e396f3986cf6059b7685a65fcf9..c0187c6f007da904d9f354ba6e1645cf92e36c80 100644 (file)
@@ -281,6 +281,7 @@ bool wxTopLevelWindowOS2::CreateDialog(
     {
         return FALSE;
     }
+
     ::WinSetWindowPos( GetHwnd()
                       ,HWND_TOP
                       ,nX
@@ -289,9 +290,6 @@ bool wxTopLevelWindowOS2::CreateDialog(
                       ,nHeight
                       ,SWP_MOVE | SWP_SIZE | SWP_ZORDER | SWP_SHOW
                      );
-    //
-    // Set the m_hFrame to m_hWnd for Dialogs
-    //
     m_hFrame = m_hWnd;
     SubclassWin(m_hWnd);
     return TRUE;
index 681b0b3451b22c8b8ddbb138054f4205c1a45e70..3d0ae02f03bb5c5044478b87e7000cd2294a5cb4 100644 (file)
@@ -766,6 +766,7 @@ void wxWindowOS2::SetScrollbar(
     HWND                            hWnd = GetHwnd();
     ULONG                           ulStyle = WS_VISIBLE;
     RECTL                           vRect;
+    SWP                             vSwp;
 
     ::WinQueryWindowRect(hWnd, &vRect);
     if (nPageSize > 1 && nRange > 0)
@@ -783,18 +784,13 @@ void wxWindowOS2::SetScrollbar(
         ulStyle |= SBS_HORZ;
         if (m_hWndScrollBarHorz == 0L)
         {
-            //
-            // We create the scrollbars with the desktop so that they are not
-            // registered as child windows of the window in order that child
-            // windows may be scrolled without scrolling the scrollbars themselves!
-            //
             m_hWndScrollBarHorz = ::WinCreateWindow( hWnd
                                                     ,WC_SCROLLBAR
                                                     ,(PSZ)NULL
                                                     ,ulStyle
                                                     ,vRect.xLeft
                                                     ,vRect.yBottom
-                                                    ,vRect.xRight - vRect.xLeft
+                                                    ,vRect.xRight - vRect.xLeft - 20
                                                     ,20
                                                     ,hWnd
                                                     ,HWND_TOP
@@ -824,7 +820,7 @@ void wxWindowOS2::SetScrollbar(
                                   ,HWND_TOP
                                   ,vRect.xLeft
                                   ,vRect.yBottom
-                                  ,vRect.xRight - vRect.xLeft
+                                  ,vRect.xRight - vRect.xLeft - 20
                                   ,20
                                   ,SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW
                                  );
@@ -894,25 +890,24 @@ void wxWindowOS2::ScrollWindow(
 {
     nDy *= -1; // flip the sign of Dy as OS/2 is opposite Windows.
     RECTL                           vRect;
-    RECTL                           vRect2;
     RECTL                           vRectHorz;
     RECTL                           vRectVert;
     RECTL                           vRectChild;
 
     if (pRect)
     {
-        vRect2.xLeft   = pRect->x;
-        vRect2.yTop    = pRect->y + pRect->height;
-        vRect2.xRight  = pRect->x + pRect->width;
-        vRect2.yBottom = pRect->y;
+        vRect.xLeft   = pRect->x;
+        vRect.yTop    = pRect->y + pRect->height;
+        vRect.xRight  = pRect->x + pRect->width;
+        vRect.yBottom = pRect->y;
     }
     else
     {
         ::WinQueryWindowRect(GetHwnd(), &vRect);
         ::WinQueryWindowRect(m_hWndScrollBarHorz, &vRectHorz);
-        vRect2.yBottom += vRect.yTop - vRect.yBottom;
+        vRect.yBottom += vRectHorz.yTop - vRectHorz.yBottom;
         ::WinQueryWindowRect(m_hWndScrollBarVert, &vRectVert);
-        vRect2.xRight -= vRect.xRight - vRect.xLeft;
+        vRect.xRight -= vRectVert.xRight - vRectVert.xLeft;
 
     }
     ::WinScrollWindow( GetHwnd()
@@ -924,9 +919,6 @@ void wxWindowOS2::ScrollWindow(
                       ,NULL
                       ,SW_INVALIDATERGN
                      );
-    ::WinInvalidateRect(m_hWndScrollBarHorz, &vRectHorz, FALSE);
-    ::WinInvalidateRect(m_hWndScrollBarVert, &vRectVert, FALSE);
-
     //
     // Move the children
     //
@@ -940,7 +932,7 @@ void wxWindowOS2::ScrollWindow(
         if (pChildWin->GetHWND() != NULLHANDLE)
         {
             ::WinQueryWindowPos(pChildWin->GetHWND(), &vSwp);
-            ::WinQueryWindowRect(pChildWin->GetHWND(), &vRectChild);
+            ::WinQueryWindowRect(pChildWin->GetHWND(), &vRect);
             if (pChildWin->IsKindOf(CLASSINFO(wxControl)))
             {
                 wxControl*          pCtrl;
@@ -960,7 +952,7 @@ void wxWindowOS2::ScrollWindow(
                               ,vSwp.y + nDy
                               ,0
                               ,0
-                              ,SWP_MOVE | SWP_ZORDER
+                              ,SWP_MOVE
                              );
             if (pChildWin->IsKindOf(CLASSINFO(wxRadioBox)))
             {
@@ -990,6 +982,38 @@ void wxWindowOS2::ScrollWindow(
         }
         pCurrent = pCurrent->GetNext();
     }
+    if (GetChildren().GetCount() > 0)
+    {
+        //
+        // Clean up child window slop
+        //
+        ::WinQueryWindowRect(GetHwnd(), &vRect);
+        vRect.xRight -= 20;
+        vRect.yBottom += 20;
+        ::WinInvalidateRect(GetHwnd(), &vRect, TRUE);
+    }
+
+    //
+    // Takes a lot to keep the scrollbars on top of everything
+    //
+    ::WinSetWindowPos( m_hWndScrollBarHorz
+                      ,HWND_TOP
+                      ,0
+                      ,0
+                      ,0
+                      ,0
+                      ,SWP_ZORDER
+                     );
+    ::WinSetWindowPos( m_hWndScrollBarVert
+                      ,HWND_TOP
+                      ,0
+                      ,0
+                      ,0
+                      ,0
+                      ,SWP_ZORDER
+                     );
+    ::WinInvalidateRect(m_hWndScrollBarHorz, &vRectHorz, FALSE);
+    ::WinInvalidateRect(m_hWndScrollBarVert, &vRectVert, FALSE);
 } // end of wxWindowOS2::ScrollWindow
 
 // ---------------------------------------------------------------------------
@@ -4063,12 +4087,12 @@ void wxWindowOS2::MoveChildren(
             vSwp.x -= pCtrl->GetXComp();
         }
         ::WinSetWindowPos( GetHwndOf(pWin)
-                          ,HWND_TOP
+                          ,HWND_BOTTOM
                           ,vSwp.x
                           ,vSwp.y - nDiff
                           ,vSwp.cx
                           ,vSwp.cy
-                          ,SWP_MOVE
+                          ,SWP_MOVE | SWP_ZORDER
                          );
         if (pWin->IsKindOf(CLASSINFO(wxRadioBox)))
         {
@@ -4094,6 +4118,68 @@ void wxWindowOS2::MoveChildren(
                                        ,(int)pSlider->GetSizeFlags()
                                       );
         }
+        //
+        // Originally created before Panel was properly sized, most likely.
+        // So now the the panel is sized correctly, resize the scrollbars
+        // and bring them to the top of all the other panel children
+        //
+        if (m_hWndScrollBarVert != NULLHANDLE ||
+            m_hWndScrollBarHorz != NULLHANDLE)
+        {
+            RECTL                   vRect;
+
+            ::WinQueryWindowRect(GetHwnd(), &vRect);
+            ::WinQueryWindowPos(m_hWndScrollBarHorz, &vSwp);
+            if ( (vRect.xRight - vRect.xLeft) - vSwp.cx != 20)
+            {
+                ::WinSetWindowPos( m_hWndScrollBarHorz
+                                  ,HWND_TOP
+                                  ,0
+                                  ,0
+                                  ,(vRect.xRight - vRect.xLeft) - 20
+                                  ,vSwp.cy
+                                  ,SWP_ZORDER | SWP_SIZE
+                                 );
+            }
+            else
+            {
+                ::WinSetWindowPos( m_hWndScrollBarHorz
+                                  ,HWND_TOP
+                                  ,0
+                                  ,0
+                                  ,0
+                                  ,0
+                                  ,SWP_ZORDER
+                                 );
+            }
+            ::WinQueryWindowPos(m_hWndScrollBarVert, &vSwp);
+            if ( (vRect.yTop - vRect.yBottom) - vSwp.cy != 20)
+            {
+                ::WinSetWindowPos( m_hWndScrollBarVert
+                                  ,HWND_TOP
+                                  ,vSwp.x
+                                  ,vSwp.y + 20
+                                  ,vSwp.cx
+                                  ,(vRect.yTop - vRect.yBottom) - 20
+                                  ,SWP_ZORDER | SWP_SIZE | SWP_MOVE
+                                 );
+            }
+            else
+            {
+                ::WinSetWindowPos( m_hWndScrollBarVert
+                                  ,HWND_TOP
+                                  ,0
+                                  ,0
+                                  ,0
+                                  ,0
+                                  ,SWP_ZORDER
+                                 );
+            }
+            ::WinQueryWindowRect(m_hWndScrollBarHorz, &vRect);
+            ::WinInvalidateRect(m_hWndScrollBarHorz, &vRect, FALSE);
+            ::WinQueryWindowRect(m_hWndScrollBarVert, &vRect);
+            ::WinInvalidateRect(m_hWndScrollBarVert, &vRect, FALSE);
+        }
     }
 } // end of wxWindowOS2::MoveChildren