]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/resource.cpp
vsprintf() is ANSI so there is normally no need to test for it
[wxWidgets.git] / src / common / resource.cpp
index 9198586a1f5a01fcdc7cd612f51889de8d67c138..49c769a1308e237003564b7d4745cb669f0251c6 100644 (file)
 #pragma hdrstop
 #endif
 
+#if wxUSE_WX_RESOURCES
+
+#ifdef _MSC_VER
+    #pragma warning(disable:4706)   // assignment within conditional expression
+#endif // VC++
+
 #ifndef WX_PRECOMP
 #include "wx/defs.h"
 #include "wx/setup.h"
@@ -36,6 +42,7 @@
 #include "wx/listbox.h"
 #include "wx/choice.h"
 #include "wx/checkbox.h"
+#include "wx/settings.h"
 #include "wx/slider.h"
 #include "wx/statbox.h"
 #if wxUSE_GAUGE
@@ -58,8 +65,6 @@
 
 #include "wx/log.h"
 
-#if wxUSE_WX_RESOURCES
-
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
@@ -69,6 +74,8 @@
 #include "wx/string.h"
 #include "wx/wxexpr.h"
 
+#include "wx/settings.h"
+
 // Forward (private) declarations
 bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db);
 wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, bool isPanel = FALSE);
@@ -957,26 +964,31 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
       }
       controlItem->SetStringValues(stringList);
      count ++;
-
+// This is now obsolete: it's in the window style.
       // Check for wxSINGLE/wxMULTIPLE
       wxExpr *mult = (wxExpr *) NULL;
+/*
       controlItem->SetValue1(wxLB_SINGLE);
+*/
       if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
       {
+/*
         wxString m(mult->StringValue());
-        if (m == "wxMULTIPLE")
+        if (m == "wxLB_MULTIPLE")
           controlItem->SetValue1(wxLB_MULTIPLE);
-        else if (m == "wxEXTENDED")
+        else if (m == "wxLB_EXTENDED")
           controlItem->SetValue1(wxLB_EXTENDED);
+*/
+       // Ignore the value
        count ++;
-        if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-       {
-          // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+      }
+      if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
+      {
+         // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
          count ++;
-          if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-            controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-       }
-     }
+         if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
+           controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+      }
    }
   }
   else if (controlType == "wxChoice")
@@ -2241,7 +2253,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
                          "Forgot to use wxResourceLoadIconData?"), (const char*) name);
           return (wxIcon *) NULL;
         }
-        return wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
+        return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
 #else
         wxLogWarning(_("No XBM facility available!"));
 #endif
@@ -2845,4 +2857,8 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemReso
   return table->CreateItem((wxWindow *)this, resource, parentResource);
 }
 
+#ifdef _MSC_VER
+    #pragma warning(default:4706)   // assignment within conditional expression
+#endif // VC++
+
 #endif // wxUSE_WX_RESOURCES