]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/xmcombo/xmcombo.c
Added wxToggleBitmapButton (it compiles).
[wxWidgets.git] / src / motif / xmcombo / xmcombo.c
index b5e148b62969e0cd1ce9190ac9df40675d78683d..32f5686026cf10878650046e2b747a50dd9cc02e 100644 (file)
 #include <Xm/TextF.h>
 #include <Xm/List.h>
 #include <Xm/LabelP.h>
+
+#if (XmVersion < 2000)
+
 #include <string.h>
 #include <ctype.h> /* define toupper */
 #include "combop.h"
@@ -1268,24 +1271,32 @@ static struct { String Resource; int Flag; }
 
 static int UpdateColors(XmComboBoxWidget w, int flags)
 {
-    Pixel  Color;
+    Pixel  Color, White, Black, EditCol;
     int    i, size = XtNumber(ColorResources);
     Widget ScrolledWin, ScrollBar;
     
     ScrolledWin = XtParent(w->combobox.ListCtrl);
     XtVaGetValues(ScrolledWin, XmNverticalScrollBar, &ScrollBar, NULL);
+    White = WhitePixel(XtDisplay(w), WidgetToScreen((Widget) w));
+    Black = BlackPixel(XtDisplay(w), WidgetToScreen((Widget) w));
     for ( i=0; i<size; i++ )
        if ( flags & ColorResources[i].Flag ) {
+            if ( ColorResources[i].Flag == BACKGROUND )
+                EditCol = White;
+            else if ( ColorResources[i].Flag == FOREGROUND )
+                EditCol = Black;
+            else
+                EditCol = Color;
            XtVaGetValues((Widget) w, ColorResources[i].Resource, &Color,
                          NULL);
-           XtVaSetValues(w->combobox.ListCtrl, 
-                         ColorResources[i].Resource, Color, NULL);
-           XtVaSetValues(ScrolledWin, 
-                         ColorResources[i].Resource, Color, NULL);
            XtVaSetValues(ScrollBar, 
                          ColorResources[i].Resource, Color, NULL);
-           XtVaSetValues(w->combobox.EditCtrl, 
-                         ColorResources[i].Resource, Color, NULL);
+            XtVaSetValues(w->combobox.ListCtrl, 
+                          ColorResources[i].Resource, EditCol, NULL);
+            XtVaSetValues(w->combobox.EditCtrl, 
+                          ColorResources[i].Resource, EditCol, NULL);
+            XtVaSetValues(ScrolledWin, 
+                          ColorResources[i].Resource, Color, NULL);
            XtVaSetValues(w->combobox.LabelCtrl, 
                          ColorResources[i].Resource, Color, NULL);
            XtVaSetValues(w->combobox.ArrowCtrl, 
@@ -3548,3 +3559,5 @@ Widget XmCreateComboBox(Widget parent, String name, ArgList arglist,
 } /* XmCreateComboBox */
 
 /* Ende von ComboBox.c */
+
+#endif /* XmVersion < 2000 */