]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/xmcombo/xmcombo.c
define WM_CONTEXTMENU if the standard headers don't
[wxWidgets.git] / src / motif / xmcombo / xmcombo.c
index dd806ccae9ec14413094053752236fbf9cb3e1ba..601fe89c43e35b67e2255f9f9418db8b5c816aa3 100644 (file)
  */
 #ifdef __VMS
 #include <wx/vms_x_fix.h>
  */
 #ifdef __VMS
 #include <wx/vms_x_fix.h>
+#undef XtDisplay
+#undef XtScreen
+#undef XtWindow
+#undef XtIsRealized
+#undef XtParent
 #endif
 
 #include <X11/IntrinsicP.h>
 #endif
 
 #include <X11/IntrinsicP.h>
 #include <Xm/TextF.h>
 #include <Xm/List.h>
 #include <Xm/LabelP.h>
 #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"
 #include <string.h>
 #include <ctype.h> /* define toupper */
 #include "combop.h"
@@ -557,7 +565,10 @@ static XtActionsRec actions[] = {
  * durchgefuehrt werden.
  */
 static XtTranslations NewEditTranslations, NewEditTranslationsNE, 
  * durchgefuehrt werden.
  */
 static XtTranslations NewEditTranslations, NewEditTranslationsNE, 
-                      NewListTranslations, NewListTranslationsE;
+#ifdef NODRAGNDROP
+                      NewListTranslations,
+#endif
+                      NewListTranslationsE;
 
 static XtConvertArgRec ConverterScreenConvertArg[] = {
     { XtBaseOffset, (XtPointer) XtOffset(Widget, core.screen), 
 
 static XtConvertArgRec ConverterScreenConvertArg[] = {
     { XtBaseOffset, (XtPointer) XtOffset(Widget, core.screen), 
@@ -1265,24 +1276,32 @@ static struct { String Resource; int Flag; }
 
 static int UpdateColors(XmComboBoxWidget w, int flags)
 {
 
 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);
     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 ) {
     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);
            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(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, 
            XtVaSetValues(w->combobox.LabelCtrl, 
                          ColorResources[i].Resource, Color, NULL);
            XtVaSetValues(w->combobox.ArrowCtrl, 
@@ -1597,6 +1616,8 @@ static void GetValuesAlmost(XmComboBoxWidget w, ArgList args,
                            break;
                        }
                    break;
                            break;
                        }
                    break;
+        case RWIGNORE:
+            ;
                } /* case read mode */
            } /* if entry found */
        } /* for every mirrored entry */
                } /* case read mode */
            } /* if entry found */
        } /* for every mirrored entry */
@@ -3543,3 +3564,5 @@ Widget XmCreateComboBox(Widget parent, String name, ArgList arglist,
 } /* XmCreateComboBox */
 
 /* Ende von ComboBox.c */
 } /* XmCreateComboBox */
 
 /* Ende von ComboBox.c */
+
+#endif /* XmVersion < 2000 */