#if wxUSE_WX_RESOURCES
-#ifdef _MSC_VER
+#ifdef __VISUALC__
#pragma warning(disable:4706) // assignment within conditional expression
#endif // VC++
#include "wx/button.h"
#include "wx/bmpbuttn.h"
#include "wx/radiobox.h"
+#include "wx/radiobut.h"
#include "wx/listbox.h"
#include "wx/choice.h"
#include "wx/checkbox.h"
#include "wx/settings.h"
#include "wx/slider.h"
#include "wx/statbox.h"
+#include "wx/statbmp.h"
#if wxUSE_GAUGE
#include "wx/gauge.h"
#endif
#include "wx/intl.h"
#endif
+#if wxUSE_RADIOBUTTON
+#include "wx/radiobut.h"
+#endif
+
#if wxUSE_SCROLLBAR
#include "wx/scrolbar.h"
#endif
wxResourceTable *wxDefaultResourceTable = (wxResourceTable *) NULL;
-static char *wxResourceBuffer = (char *) NULL;
-static long wxResourceBufferSize = 0;
-static long wxResourceBufferCount = 0;
-static int wxResourceStringPtr = 0;
+char *wxResourceBuffer = (char *) NULL;
+long wxResourceBufferSize = 0;
+long wxResourceBufferCount = 0;
+int wxResourceStringPtr = 0;
void wxInitializeResourceSystem()
{
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;
// 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)));
wxExpr *coloursExpr = listExpr->Nth(3);
wxExpr *xresExpr = listExpr->Nth(4);
wxExpr *yresExpr = listExpr->Nth(5);
- if (nameExpr && nameExpr->StringValue())
+ if (nameExpr && nameExpr->StringValue() != "")
{
bitmapSpec->SetName(nameExpr->StringValue());
}
- if (typeExpr && typeExpr->StringValue())
+ if (typeExpr && typeExpr->StringValue() != "")
{
bitmapSpec->SetValue1(wxParseWindowStyle(typeExpr->StringValue()));
}
else
bitmapSpec->SetValue1(0);
- if (platformExpr && platformExpr->StringValue())
+ if (platformExpr && platformExpr->StringValue() != "")
{
wxString plat(platformExpr->StringValue());
if (plat == "windows" || plat == "WINDOWS")
return font;
}
+// Separate file for the remainder of this, for BC++/Win16
+
+#if !((defined(__BORLANDC__) || defined(__SC__)) && defined(__WIN16__))
/*
* (Re)allocate buffer for reading in from resource file
*/
wxItemResource *item = table->FindResource(resource);
if (item)
{
- if (!item->GetType() || strcmp(item->GetType(), "wxBitmap") != 0)
+ if ((item->GetType() == "") || (item->GetType() != "wxBitmap"))
{
wxLogWarning(_("%s not a bitmap resource specification."), (const char*) resource);
return wxNullBitmap;
"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
wxItemResource *resource = table->FindResource((const char *)resourceName);
// if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX))
- if (!resource || !resource->GetType() ||
- ! ((strcmp(resource->GetType(), "wxDialog") == 0) || (strcmp(resource->GetType(), "wxPanel") == 0)))
+ if (!resource || (resource->GetType() == "") ||
+ ! ((resource->GetType() == "wxDialog") || (resource->GetType() == "wxPanel")))
return FALSE;
wxString title(resource->GetTitle());
return table->CreateItem((wxWindow *)this, resource, parentResource);
}
-#ifdef _MSC_VER
+#ifdef __VISUALC__
#pragma warning(default:4706) // assignment within conditional expression
#endif // VC++
+#endif
+ // BC++/Win16
+
#endif // wxUSE_WX_RESOURCES