]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/resource.cpp
1. ReadMailcap/MimeTypes returna bool error code
[wxWidgets.git] / src / common / resource.cpp
index 436565d0ed2c7220c76ebf0fa6a5036fa4396980..a3c99026f98bdb641574d018b8d4b6ee101b35a8 100644 (file)
@@ -22,7 +22,7 @@
 
 #if wxUSE_WX_RESOURCES
 
-#ifdef _MSC_VER
+#ifdef __VISUALC__
     #pragma warning(disable:4706)   // assignment within conditional expression
 #endif // VC++
 
@@ -559,17 +559,33 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
   return TRUE;
 }
 
-static char *g_ValidControlClasses[] = { "wxButton", "wxBitmapButton", "wxMessage",
- "wxStaticText", "wxStaticBitmap", "wxText", "wxTextCtrl", "wxMultiText",
- "wxListBox", "wxRadioBox", "wxRadioButton", "wxCheckBox", "wxBitmapCheckBox",
- "wxGroupBox", "wxStaticBox", "wxSlider", "wxGauge", "wxScrollBar",
- "wxChoice", "wxComboBox" } ;
-static int g_ValidControlClassesCount = sizeof(g_ValidControlClasses) / sizeof(char *) ;
+static const char *g_ValidControlClasses[] =
+{
+    "wxButton",
+    "wxBitmapButton",
+    "wxMessage",
+    "wxStaticText",
+    "wxStaticBitmap",
+    "wxText",
+    "wxTextCtrl",
+    "wxMultiText",
+    "wxListBox",
+    "wxRadioBox",
+    "wxRadioButton",
+    "wxCheckBox",
+    "wxBitmapCheckBox",
+    "wxGroupBox",
+    "wxStaticBox",
+    "wxSlider",
+    "wxGauge",
+    "wxScrollBar",
+    "wxChoice",
+    "wxComboBox"
+};
 
 static bool wxIsValidControlClass(const wxString& c)
 {
-   int i;
-   for ( i = 0; i < g_ValidControlClassesCount; i++)
+   for ( size_t i = 0; i < WXSIZEOF(g_ValidControlClasses); i++ )
    {
       if ( c == g_ValidControlClasses[i] )
          return TRUE;
@@ -807,10 +823,14 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
     // Check for bitmap resource name (in case loading old-style resource file)
     if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
     {
-        wxString str(expr->Nth(count)->StringValue());
-        controlItem->SetValue4(str);
         count ++;
-        controlItem->SetType("wxBitmapButton");
+        wxString str(expr->Nth(count)->StringValue());
+
+        if (str != "")
+        {
+            controlItem->SetValue4(str);
+            controlItem->SetType("wxBitmapButton");
+        }
     }
     if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
       controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
@@ -2157,7 +2177,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
                          "Forgot to use wxResourceLoadBitmapData?"), (const char*) name);
           return wxNullBitmap;
         }
-        return wxBitmap(item->GetValue1());
+        return wxBitmap((char **)item->GetValue1());
 #else
         wxLogWarning(_("No XPM facility available!"));
 #endif
@@ -2900,7 +2920,7 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemReso
   return table->CreateItem((wxWindow *)this, resource, parentResource);
 }
 
-#ifdef _MSC_VER
+#ifdef __VISUALC__
     #pragma warning(default:4706)   // assignment within conditional expression
 #endif // VC++