X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8bbe427f8e5a2078b266e282453595b5a634d35c..a4388683f1b20020b5425c59c401d6ab673860de:/src/common/resource.cpp diff --git a/src/common/resource.cpp b/src/common/resource.cpp index f31d3ae392..cbff8918cf 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -93,10 +93,10 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table = (wxR 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() { @@ -797,6 +797,19 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetId(id); if (controlType == "wxButton") + { + // 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"); + } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } + else if (controlType == "wxBitmapButton") { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -852,6 +865,19 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } else if (controlType == "wxMessage" || controlType == "wxStaticText") + { + // Check for bitmap resource name (in case it's an old-style .wxr 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("wxStaticText"); + } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } + else if (controlType == "wxStaticBitmap") { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -859,9 +885,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(str); 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 == "wxGroupBox" || controlType == "wxStaticBox") { @@ -1397,6 +1423,9 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) return font; } +// Separate file for the remainder of this, for BC++/Win16 + +#if !(defined(__BORLANDC__) && defined(__WIN16__)) /* * (Re)allocate buffer for reading in from resource file */ @@ -1744,6 +1773,8 @@ static wxResourceBitListStruct wxResourceBitListTable[] = /* wxRadioBox/wxRadioButton */ { "wxRB_GROUP", wxRB_GROUP }, + { "wxRA_SPECIFY_COLS", wxRA_SPECIFY_COLS }, + { "wxRA_SPECIFY_ROWS", wxRA_SPECIFY_ROWS }, { "wxRA_HORIZONTAL", wxRA_HORIZONTAL }, { "wxRA_VERTICAL", wxRA_VERTICAL }, @@ -2867,4 +2898,7 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemReso #pragma warning(default:4706) // assignment within conditional expression #endif // VC++ +#endif + // BC++/Win16 + #endif // wxUSE_WX_RESOURCES