]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/choice.cpp
use unsgined int instead of int for 1 bit bitfields (SGI CC warning fix)
[wxWidgets.git] / src / motif / choice.cpp
index 87e7eb7880e926bf2a2f7430e8416644d0ed8b40..7b88db0e3e28fd413286802f3a1782e3b162c284 100644 (file)
@@ -93,7 +93,8 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
     * Create the popup menu
     */
     m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget,
     * Create the popup menu
     */
     m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget,
-                                                    "choiceMenu", NULL, 0);
+                                                    wxMOTIF_STR("choiceMenu"),
+                                                    NULL, 0);
 
     if (n > 0)
     {
 
     if (n > 0)
     {
@@ -113,7 +114,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
     XtSetArg (args[argcnt], XmNmarginHeight, 0); ++argcnt;
     XtSetArg (args[argcnt], XmNpacking, XmPACK_TIGHT); ++argcnt;
     m_buttonWidget = (WXWidget) XmCreateOptionMenu ((Widget) m_formWidget,
     XtSetArg (args[argcnt], XmNmarginHeight, 0); ++argcnt;
     XtSetArg (args[argcnt], XmNpacking, XmPACK_TIGHT); ++argcnt;
     m_buttonWidget = (WXWidget) XmCreateOptionMenu ((Widget) m_formWidget,
-                                                    "choiceButton",
+                                                    wxMOTIF_STR("choiceButton"),
                                                     args, argcnt);
 
     m_mainWidget = m_buttonWidget;
                                                     args, argcnt);
 
     m_mainWidget = m_buttonWidget;
@@ -189,7 +190,7 @@ wxChoice::~wxChoice()
 int wxChoice::DoAppend(const wxString& item)
 {
     Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item),
 int wxChoice::DoAppend(const wxString& item)
 {
     Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item),
-#if USE_GADGETS
+#if wxUSE_GADGETS
         xmPushButtonGadgetClass, (Widget) m_menuWidget,
 #else
         xmPushButtonWidgetClass, (Widget) m_menuWidget,
         xmPushButtonGadgetClass, (Widget) m_menuWidget,
 #else
         xmPushButtonWidgetClass, (Widget) m_menuWidget,
@@ -441,8 +442,8 @@ void wxChoiceCallback (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr))
         {
             wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, item->GetId());
             event.SetEventObject(item);
         {
             wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, item->GetId());
             event.SetEventObject(item);
-            event.m_commandInt = n;
-            event.m_commandString = item->GetStrings().Item(n)->GetData();
+            event.SetInt(n);
+            event.SetString( item->GetStrings().Item(n)->GetData() );
             if ( item->HasClientObjectData() )
                 event.SetClientObject( item->GetClientObject(n) );
             else if ( item->HasClientUntypedData() )
             if ( item->HasClientObjectData() )
                 event.SetClientObject( item->GetClientObject(n) );
             else if ( item->HasClientUntypedData() )
@@ -459,19 +460,22 @@ void wxChoice::ChangeFont(bool keepOriginalSize)
     // back again. TODO: a better way in Motif?
     if (m_font.Ok())
     {
     // back again. TODO: a better way in Motif?
     if (m_font.Ok())
     {
+        Display* dpy = XtDisplay((Widget) m_mainWidget);
         int width, height, width1, height1;
         GetSize(& width, & height);
 
         int width, height, width1, height1;
         GetSize(& width, & height);
 
-        WXFontType fontType =
-            m_font.GetFontType(XtDisplay((Widget) m_mainWidget));
         WXString fontTag = wxFont::GetFontTag();
 
         WXString fontTag = wxFont::GetFontTag();
 
-        XtVaSetValues ((Widget) m_formWidget, fontTag, fontType, NULL);
-        XtVaSetValues ((Widget) m_buttonWidget, fontTag, fontType, NULL);
+        XtVaSetValues ((Widget) m_formWidget,
+                       fontTag, m_font.GetFontTypeC(dpy),
+                       NULL);
+        XtVaSetValues ((Widget) m_buttonWidget,
+                       fontTag, m_font.GetFontTypeC(dpy),
+                       NULL);
 
         for( size_t i = 0; i < m_noStrings; ++i )
             XtVaSetValues( (Widget)m_widgetArray[i],
 
         for( size_t i = 0; i < m_noStrings; ++i )
             XtVaSetValues( (Widget)m_widgetArray[i],
-                           fontTag, fontType,
+                           fontTag, m_font.GetFontTypeC(dpy),
                            NULL );
 
         GetSize(& width1, & height1);
                            NULL );
 
         GetSize(& width1, & height1);