]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/choice.cpp
ignore clicks on a toolbar but outside any button
[wxWidgets.git] / src / os2 / choice.cpp
index 96df144bf15320426ad3227e3ff651a6b5612532..a1cdd262b1e2ed85a35cf333337d6995a404a235 100644 (file)
@@ -16,6 +16,7 @@
     #include "wx/choice.h"
     #include "wx/utils.h"
     #include "wx/log.h"
+    #include "wx/settings.h"
 #endif
 
 #include "wx/os2/private.h"
@@ -38,16 +39,16 @@ bool wxChoice::Create(
 {
     long                            lSstyle;
 
-    if (!OS2CreateControl( pParent
-                          ,vId
-                          ,rPos
-                          ,rSize
-                          ,lStyle
+    if (!CreateControl( pParent
+                       ,vId
+                       ,rPos
+                       ,rSize
+                       ,lStyle
 #if wxUSE_VALIDATORS
-                          ,rValidator
+                       ,rValidator
 #endif
-                          ,rsName
-                         ))
+                       ,rsName
+                      ))
         return FALSE;
     lSstyle = CBS_DROPDOWNLIST |
               WS_TABSTOP       |
@@ -76,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
 
@@ -181,12 +188,19 @@ void wxChoice::SetString(
 , const wxString&                   rsStr
 )
 {
-    wxFAIL_MSG(wxT("not implemented"));
+    SHORT                           nIndexType = 0;
 
-#if 0 // should do this, but no Insert() so far
-    Delete(n);
-    Insert(n + 1, s);
-#endif
+    ::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, 0);
+
+    if (m_windowStyle & wxLB_SORT)
+        nIndexType = LIT_SORTASCENDING;
+    else
+        nIndexType = LIT_END;
+    ::WinSendMsg( GetHwnd()
+                 ,LM_INSERTITEM
+                 ,(MPARAM)nIndexType
+                 ,(MPARAM)rsStr.c_str()
+                );
 } // end of wxChoice::SetString
 
 wxString wxChoice::GetString(