]> git.saurik.com Git - wxWidgets.git/commitdiff
More OS/2 updates reflecting changes in 24 Branch
authorDavid Webster <Dave.Webster@bhmi.com>
Thu, 17 Apr 2003 15:47:35 +0000 (15:47 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Thu, 17 Apr 2003 15:47:35 +0000 (15:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/spinctrl.h
src/os2/cursor.cpp
src/os2/makefile.va
src/os2/radiobut.cpp
src/os2/scrolbar.cpp
src/os2/spinctrl.cpp
src/os2/stattext.cpp
src/os2/textctrl.cpp
src/os2/toplevel.cpp
src/os2/window.cpp
src/os2/wx25.def

index bcda821de6a46ac4ebacd2bbf66b0fefcbe064bb..5a0983870b0f0e00f5afa6ce990583fe083f1833 100644 (file)
@@ -115,6 +115,7 @@ protected:
     //
     void OnSpinChange(wxSpinEvent& rEvent);
     void OnChar(wxKeyEvent& rEvent);
+    void OnSetFocus(wxFocusEvent& rEvent);
 
     WXHWND                          m_hWndBuddy;
     static wxArraySpins             m_svAllSpins;
index be4238b9b2303f308a8df0557cbddbf096201421..a3dddf55b8618bfa72d6058e184e5343dc995d70 100644 (file)
@@ -310,6 +310,10 @@ wxCursor::wxCursor(
                                                                   );
             break;
     }
+    //
+    // No need to destroy the stock cursors
+    //
+    ((wxCursorRefData *)m_refData)->m_bDestroyCursor = FALSE;
 } // end of wxCursor::wxCursor
 
 // Global cursor setting
index f34ff5ebaa9eacdbff5050f14a881a3c99ff2460..6b662e3db8d97be548fddacfc7fa7538cedbe6f5 100644 (file)
@@ -1163,9 +1163,9 @@ clean:  $(PERIPH_CLEAN_TARGET) clean_png clean_zlib clean_jpeg clean_tiff
         rd      ..\common\$D
         rd      ..\html\$D
         rd      ..\os2\$D
-        del      $(LIBTARGET)
+        del     ..\lib\wx.lib
 !if "$(WXMAKINGDLL)" == "1"
-        erase /N ..\..\lib\wx25.lib
+        del ..\lib\wx25.lib
 !endif
 
 cleanall: clean
index 540bb7deffc33561595ace19b5c6edc863e34880..8d1b543ad8f108ad4aec8d4cc4cedc22cfc55434 100644 (file)
@@ -227,36 +227,42 @@ void wxRadioButton::SetValue(
 
         wxCHECK_RET(pNodeThis, _T("radio button not a child of its parent?"));
 
-        // 
-        // Turn off all radio buttons before this one
         //
-        for ( wxWindowList::Node* pNodeBefore = pNodeThis->GetPrevious();
-              pNodeBefore;
-              pNodeBefore = pNodeBefore->GetPrevious() )
+        // If it's not the first item of the group ...
+        //
+        if ( !HasFlag(wxRB_GROUP) )
         {
-            wxRadioButton*          pBtn = wxDynamicCast( pNodeBefore->GetData()
+            //
+            // ...turn off all radio buttons before this one
+            //
+            for ( wxWindowList::Node* pNodeBefore = pNodeThis->GetPrevious();
+                  pNodeBefore;
+                  pNodeBefore = pNodeBefore->GetPrevious() )
+            {
+                wxRadioButton*      pBtn = wxDynamicCast( pNodeBefore->GetData()
                                                          ,wxRadioButton
                                                         );
-            if (!pBtn)
-            {
-                // 
-                // The radio buttons in a group must be consecutive, so there
-                // are no more of them
-                //
-                break;
-            }
-            pBtn->SetValue(FALSE);
-            if (pBtn->HasFlag(wxRB_GROUP))
-            {
-                // 
-                // Even if there are other radio buttons before this one,
-                // they're not in the same group with us
-                //
-                break;
+                if (!pBtn)
+                {
+                    //
+                    // The radio buttons in a group must be consecutive, so there
+                    // are no more of them
+                    //
+                    break;
+                }
+                pBtn->SetValue(FALSE);
+                if (pBtn->HasFlag(wxRB_GROUP))
+                {
+                    //
+                    // Even if there are other radio buttons before this one,
+                    // they're not in the same group with us
+                    //
+                    break;
+                }
             }
         }
 
-        // 
+        //
         // ... and all after this one
         //
         for (wxWindowList::Node* pNodeAfter = pNodeThis->GetNext();
@@ -269,7 +275,7 @@ void wxRadioButton::SetValue(
 
             if (!pBtn || pBtn->HasFlag(wxRB_GROUP) )
             {
-                // 
+                //
                 // No more buttons or the first button of the next group
                 //
                 break;
index a27773d3080f62eee90b6c05c1110151a9d9c3d6..8b88e4078cf083b77ba6ffda69cbcced2096f962 100644 (file)
@@ -226,6 +226,7 @@ bool wxScrollBar::OS2OnScroll (
                                            ,m_windowId
                                           );
 
+    vEvent.SetOrientation(IsVertical() ? wxVERTICAL : wxHORIZONTAL);
     vEvent.SetPosition(nPosition);
     vEvent.SetEventObject(this);
     return GetEventHandler()->ProcessEvent(vEvent);
index d526cfa43f47d5f62ef667e6eb06866319cc15c6..d5fb52d270ef35df9f2320d0bd52c86ce99031de 100644 (file)
@@ -49,7 +49,9 @@ wxArraySpins                        wxSpinCtrl::m_svAllSpins;
 IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
 
 BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
+    EVT_CHAR(wxSpinCtrl::OnChar)
     EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
+    EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
 END_EVENT_TABLE()
 // ----------------------------------------------------------------------------
 // constants
@@ -404,6 +406,18 @@ void wxSpinCtrl::OnSpinChange(
     }
 } // end of wxSpinCtrl::OnSpinChange
 
+void wxSpinCtrl::OnSetFocus (
+  wxFocusEvent&                     rEvent
+)
+{
+    //
+    // When we get focus, give it to our buddy window as it needs it more than
+    // we do
+    //
+    ::WinSetFocus(HWND_DESKTOP, (HWND)m_hWndBuddy);
+    rEvent.Skip();
+} // end of wxSpinCtrl::OnSetFocus
+
 bool wxSpinCtrl::ProcessTextCommand(
   WXWORD                            wCmd
 , WXWORD                            wId
index 167caa3e8623e411468b098594410adbffcba4ea..d5cfd5c9e4a629b482f66992ac71adbdc0e0e10a 100644 (file)
@@ -121,6 +121,7 @@ wxSize wxStaticText::DoGetBestSize() const
     int                             nHeightLineDefault = 0;
     int                             nHeightLine = 0;
     wxString                        sCurLine;
+    bool                            bLastWasAmpersand = FALSE;
 
     for (const wxChar *pc = sText; ; pc++)
     {
@@ -161,6 +162,29 @@ wxSize wxStaticText::DoGetBestSize() const
         }
         else
         {
+            //
+            // We shouldn't take into account the '&' which just introduces the
+            // mnemonic characters and so are not shown on the screen -- except
+            // when it is preceded by another '&' in which case it stands for a
+            // literal ampersand
+            //
+            if (*pc == _T('&'))
+            {
+                if (!bLastWasAmpersand)
+                {
+                    bLastWasAmpersand = TRUE;
+
+                    //
+                    // Skip the statement adding pc to curLine below
+                    //
+                    continue;
+                }
+
+                //
+                // It is a literal ampersand
+                //
+                bLastWasAmpersand = FALSE;
+            }
             sCurLine += *pc;
         }
     }
index 3b2b97719ae88dcd3cc30684b3c86ecc72de1200..679d0fa248cd56ac7bb8bb1da1306173bd09a3ea 100644 (file)
@@ -507,6 +507,15 @@ void wxTextCtrl::SetInsertionPointEnd()
 {
     long                            lPos = GetLastPosition();
 
+    //
+    // We must not do anything if the caret is already there because calling
+    // SetInsertionPoint() thaws the controls if Freeze() had been called even
+    // if it doesn't actually move the caret anywhere and so the simple fact of
+    // doing it results in horrible flicker when appending big amounts of text
+    // to the control in a few chunks (see DoAddText() test in the text sample)
+    //
+    if (GetInsertionPoint() == GetLastPosition())
+        return;
     SetInsertionPoint(lPos);
 } // end of wxTextCtrl::SetInsertionPointEnd
 
index 4b3857b38655450f02f5b31e55e5252780a4c6f5..3fbed4f75574c1ce423e0228d4d63101fe214749 100644 (file)
@@ -801,7 +801,7 @@ void wxTopLevelWindowOS2::Maximize(
         // We can't maximize the hidden frame because it shows it as well, so
         // just remember that we should do it later in this case
         //
-        m_bMaximizeOnShow = TRUE;
+        m_bMaximizeOnShow = bMaximize;
     }
 } // end of wxTopLevelWindowOS2::Maximize
 
index 25610ad24863b1e170559b5cd6c8c934dab7461f..e99ecaa4d2c9d00d4dd4b81f7db6e1b4840c58db 100644 (file)
@@ -3513,7 +3513,9 @@ bool wxWindowOS2::HandleCreate(
 
 bool wxWindowOS2::HandleDestroy()
 {
-    SendDestroyEvent();
+    wxWindowDestroyEvent            vEvent((wxWindow*)this);
+    vEvent.SetId(GetId());
+    (void)GetEventHandler()->ProcessEvent(vEvent);
 
     //
     // Delete our drop target if we've got one
index 70a327186f40407157c3eaacd0f57660722ff822..e8199fef0c827fc9e75b6726b82471b15e0335b6 100644 (file)
@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
 CODE LOADONCALL
 
 EXPORTS
-;From library:  H:\DEV\WX2\WXWINDOWS\lib\wx.lib
+;From library:  H:\DEV\WX2\WXWINDOWS\LIB\wx.lib
   ;From object file:  dummy.cpp
     ;PUBDEFs (Symbols available from object file):
       wxDummyChar
@@ -13090,6 +13090,8 @@ EXPORTS
       SetFocus__10wxSpinCtrlFv
       ;wxSpinCtrl::SetValue(const wxString&)
       SetValue__10wxSpinCtrlFRC8wxString
+      ;wxSpinCtrl::OnSetFocus(wxFocusEvent&)
+      OnSetFocus__10wxSpinCtrlFR12wxFocusEvent
       ;wxSpinCtrl::sm_classwxSpinCtrl
       sm_classwxSpinCtrl__10wxSpinCtrl
       ;wxSpinCtrl::m_svAllSpins