X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bbcdf8bc7ca806d8278c7cb6d09d5590378b67d8..6f34921d9369a31de14e4b07e4824e2d701710f0:/src/common/resource.cpp diff --git a/src/common/resource.cpp b/src/common/resource.cpp index e2196354b9..5cda920f99 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -31,6 +31,7 @@ #include "wx/menu.h" #include "wx/stattext.h" #include "wx/button.h" +#include "wx/bmpbuttn.h" #include "wx/radiobox.h" #include "wx/listbox.h" #include "wx/choice.h" @@ -41,7 +42,8 @@ #include "wx/gauge.h" #endif #include "wx/textctrl.h" -#include "wx/msgbxdlg.h" +#include "wx/msgdlg.h" +#include "wx/intl.h" #endif #if USE_SCROLLBAR @@ -54,6 +56,8 @@ #include "wx/validate.h" +#include "wx/log.h" + #if USE_WX_RESOURCES #include @@ -77,12 +81,12 @@ wxItemResource *wxResourceInterpretIcon(wxResourceTable& table, PrologExpr *expr // Interpret list expression wxFont *wxResourceInterpretFontSpec(PrologExpr *expr); -bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResourceTable *table = NULL); -bool wxResourceParseIncludeFile(char *f, wxResourceTable *table = NULL); +bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResourceTable *table = (wxResourceTable *) NULL); +bool wxResourceParseIncludeFile(char *f, wxResourceTable *table = (wxResourceTable *) NULL); -wxResourceTable *wxDefaultResourceTable = NULL; +wxResourceTable *wxDefaultResourceTable = (wxResourceTable *) NULL; -static char *wxResourceBuffer = NULL; +static char *wxResourceBuffer = (char *) NULL; static long wxResourceBufferSize = 0; static long wxResourceBufferCount = 0; static int wxResourceStringPtr = 0; @@ -95,11 +99,13 @@ void wxInitializeResourceSystem(void) void wxCleanUpResourceSystem(void) { delete wxDefaultResourceTable; + if (wxResourceBuffer) + delete[] wxResourceBuffer; } -void wxWarning(char *msg) +void wxLogWarning(char *msg) { - wxMessageBox(msg, "Warning", wxOK); + wxMessageBox(msg, _("Warning"), wxOK); } #if !USE_SHARED_LIBRARY @@ -109,17 +115,17 @@ IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable) wxItemResource::wxItemResource(void) { - itemType = NULL; - title = NULL; - name = NULL; + itemType = (char *) NULL; + title = (char *) NULL; + name = (char *) NULL; windowStyle = 0; x = y = width = height = 0; value1 = value2 = value3 = value5 = 0; - value4 = NULL; - stringValues = NULL; - bitmap = NULL; - backgroundColour = labelColour = buttonColour = NULL; - windowFont = NULL; + value4 = (char *) NULL; + stringValues = (wxStringList *) NULL; + bitmap = (wxBitmap *) NULL; + backgroundColour = labelColour = buttonColour = (wxColour *) NULL; + windowFont = (wxFont *) NULL; m_windowId = 0; } @@ -158,7 +164,7 @@ void wxItemResource::SetTitle(char *t) if (t) title = copystring(t); else - title = NULL; + title = (char *) NULL; } void wxItemResource::SetType(char *t) @@ -170,7 +176,7 @@ void wxItemResource::SetType(char *t) if (t) itemType = copystring(t); else - itemType = NULL; + itemType = (char *) NULL; } void wxItemResource::SetName(char *n) @@ -182,7 +188,7 @@ void wxItemResource::SetName(char *n) if (n) name = copystring(n); else - name = NULL; + name = (char *) NULL; } void wxItemResource::SetStringValues(wxStringList *svalues) @@ -192,7 +198,7 @@ void wxItemResource::SetStringValues(wxStringList *svalues) if (svalues) stringValues = svalues; else - stringValues = NULL; + stringValues = (wxStringList *) NULL; } void wxItemResource::SetValue4(char *v) @@ -204,7 +210,7 @@ void wxItemResource::SetValue4(char *v) if (v) value4 = copystring(v); else - value4 = NULL; + value4 = (char *) NULL; } /* @@ -248,7 +254,7 @@ bool wxResourceTable::DeleteResource(const wxString& name) // See if any resource has this as its child; if so, delete from // parent's child list. BeginFind(); - wxNode *node = NULL; + wxNode *node = (wxNode *) NULL; while ((node = Next())) { wxItemResource *parent = (wxItemResource *)node->Data(); @@ -287,7 +293,7 @@ bool wxResourceTable::ParseResourceData(char *data) PrologDatabase db; if (!db.ReadPrologFromString(data)) { - wxWarning("Ill-formed resource file syntax."); + wxLogWarning(_("Ill-formed resource file syntax.")); return FALSE; } @@ -343,9 +349,9 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { int id = childResource->GetId(); if ( id == 0 ) - id = -1; + id = -1; - wxControl *control = NULL; + wxControl *control = (wxControl *) NULL; wxString itemType(childResource->GetType()); if (itemType == wxString("wxButton") || itemType == wxString("wxBitmapButton")) { @@ -361,18 +367,18 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe if (bitmap) control = new wxBitmapButton(parent, id, *bitmap, wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), - childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); + wxSize(childResource->GetWidth(), childResource->GetHeight()), + childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } else // Normal, text button control = new wxButton(parent, id, childResource->GetTitle(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } else if (itemType == wxString("wxMessage") || itemType == wxString("wxStaticText") || - itemType == wxString("wxStaticBitmap")) + itemType == wxString("wxStaticBitmap")) { if (childResource->GetValue4()) { @@ -387,7 +393,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe if (bitmap) control = new wxStaticBitmap(parent, id, *bitmap, wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), childResource->GetName()); #endif } @@ -395,7 +401,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { control = new wxStaticText(parent, id, childResource->GetTitle(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), childResource->GetName()); } } @@ -403,14 +409,14 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { control = new wxTextCtrl(parent, id, childResource->GetValue4(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } else if (itemType == wxString("wxCheckBox")) { control = new wxCheckBox(parent, id, childResource->GetTitle(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); ((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0)); @@ -420,7 +426,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { control = new wxGauge(parent, id, (int)childResource->GetValue2(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); ((wxGauge *)control)->SetValue((int)childResource->GetValue1()); @@ -431,7 +437,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } #endif @@ -460,13 +466,13 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe { control = new wxStaticBox(parent, id, childResource->GetTitle(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), childResource->GetStyle(), childResource->GetName()); } else if (itemType == wxString("wxListBox")) { wxStringList *stringList = childResource->GetStringValues(); - wxString *strings = NULL; + wxString *strings = (wxString *) NULL; int noStrings = 0; if (stringList && (stringList->Number() > 0)) { @@ -483,7 +489,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe } control = new wxListBox(parent, id, wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); if (strings) @@ -492,7 +498,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe else if (itemType == wxString("wxChoice")) { wxStringList *stringList = childResource->GetStringValues(); - wxString *strings = NULL; + wxString *strings = (wxString *) NULL; int noStrings = 0; if (stringList && (stringList->Number() > 0)) { @@ -509,7 +515,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe } control = new wxChoice(parent, id, wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); if (strings) @@ -519,7 +525,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe else if (itemType == wxString("wxComboBox")) { wxStringList *stringList = childResource->GetStringValues(); - wxString *strings = NULL; + wxString *strings = (wxString *) NULL; int noStrings = 0; if (stringList && (stringList->Number() > 0)) { @@ -536,7 +542,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe } control = new wxComboBox(parent, id, childResource->GetValue4(), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); if (strings) @@ -546,7 +552,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe else if (itemType == wxString("wxRadioBox")) { wxStringList *stringList = childResource->GetStringValues(); - wxString *strings = NULL; + wxString *strings = (wxString *) NULL; int noStrings = 0; if (stringList && (stringList->Number() > 0)) { @@ -563,9 +569,9 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe } control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), wxPoint(childResource->GetX(), childResource->GetY()), - wxSize(childResource->GetWidth(), childResource->GetHeight()), + wxSize(childResource->GetWidth(), childResource->GetHeight()), noStrings, strings, (int)childResource->GetValue1(), childResource->GetStyle(), wxDefaultValidator, - childResource->GetName()); + childResource->GetName()); if (strings) delete[] strings; @@ -586,9 +592,9 @@ bool wxResourceInterpretResources(wxResourceTable& table, PrologDatabase& db) while (node) { PrologExpr *clause = (PrologExpr *)node->Data(); - wxString functor(clause->Functor()); + wxString functor(clause->Functor()); - wxItemResource *item = NULL; + wxItemResource *item = (wxItemResource *) NULL; if (functor == "dialog") item = wxResourceInterpretDialog(table, clause); else if (functor == "panel") @@ -625,13 +631,13 @@ static int g_ValidControlClassesCount = sizeof(g_ValidControlClasses) / sizeof(c static bool wxIsValidControlClass(const wxString& c) { - int i; - for ( i = 0; i < g_ValidControlClassesCount; i++) - { - if ( c == g_ValidControlClasses[i] ) - return TRUE; - } - return FALSE; + int i; + for ( i = 0; i < g_ValidControlClassesCount; i++) + { + if ( c == g_ValidControlClasses[i] ) + return TRUE; + } + return FALSE; } wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, PrologExpr *expr, bool isPanel) @@ -641,12 +647,12 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, PrologExpr *ex dialogItem->SetType("wxPanel"); else dialogItem->SetType("wxDialog"); - char *style = NULL; - char *title = NULL; - char *name = NULL; - char *backColourHex = NULL; - char *labelColourHex = NULL; - char *buttonColourHex = NULL; + char *style = (char *) NULL; + char *title = (char *) NULL; + char *name = (char *) NULL; + char *backColourHex = (char *) NULL; + char *labelColourHex = (char *) NULL; + char *buttonColourHex = (char *) NULL; long windowStyle = wxDEFAULT_DIALOG_STYLE; if (isPanel) @@ -654,9 +660,9 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, PrologExpr *ex int x = 0; int y = 0; int width = -1; int height = -1; int isModal = 0; - PrologExpr *labelFontExpr = NULL; - PrologExpr *buttonFontExpr = NULL; - PrologExpr *fontExpr = NULL; + PrologExpr *labelFontExpr = (PrologExpr *) NULL; + PrologExpr *buttonFontExpr = (PrologExpr *) NULL; + PrologExpr *fontExpr = (PrologExpr *) NULL; expr->AssignAttributeValue("style", &style); expr->AssignAttributeValue("name", &name); expr->AssignAttributeValue("title", &title); @@ -782,44 +788,44 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e if ( expr1->Type() == PrologString || expr1->Type() == PrologWord ) { - if ( wxIsValidControlClass(expr1->StringValue()) ) - { - count = 1; - controlType = expr1->StringValue(); - } - else - { + if ( wxIsValidControlClass(expr1->StringValue()) ) + { + count = 1; + controlType = expr1->StringValue(); + } + else + { wxString str(expr1->StringValue()); id = wxResourceGetIdentifier(WXSTRINGCAST str, &table); if (id == 0) { - char buf[300]; - sprintf(buf, "Could not resolve control class or id '%s'. Use (non-zero) integer instead\n or provide #define (see manual for caveats)", - (const char*) expr1->StringValue()); - wxWarning(buf); - delete controlItem; - return NULL; + wxLogWarning(_("Could not resolve control class or id '%s'. " + "Use (non-zero) integer instead\n or provide #define " + "(see manual for caveats)"), + (const char*) expr1->StringValue()); + delete controlItem; + return (wxItemResource *) NULL; } - else - { - // Success - we have an id, so the 2nd element must be the control class. - controlType = expr->Nth(1)->StringValue(); - count = 2; - } - } + else + { + // Success - we have an id, so the 2nd element must be the control class. + controlType = expr->Nth(1)->StringValue(); + count = 2; + } + } } else if (expr1->Type() == PrologInteger) { id = (int)expr1->IntegerValue(); - // Success - we have an id, so the 2nd element must be the control class. - controlType = expr->Nth(1)->StringValue(); - count = 2; + // Success - we have an id, so the 2nd element must be the control class. + controlType = expr->Nth(1)->StringValue(); + count = 2; } expr1 = expr->Nth(count); count ++; if ( expr1 ) - title = expr1->StringValue(); + title = expr1->StringValue(); expr1 = expr->Nth(count); count ++; @@ -877,9 +883,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } @@ -889,32 +895,32 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } } #endif - else if (controlType == "wxText" || controlType == "wxTextCtrl") + else if (controlType == "wxText" || controlType == "wxTextCtrl" || controlType == "wxMultiText") { // Check for default value if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) - { + { wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(WXSTRINGCAST str); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - // Do nothing - no label font any more - count ++; + // Do nothing - no label font any more + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } + } + } } else if (controlType == "wxMessage" || controlType == "wxStaticText") { @@ -937,91 +943,91 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // Check for range if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { - // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - // Do nothing - count ++; + // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); + // Do nothing + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } - } + } + } + } } else if (controlType == "wxSlider") { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // Check for min if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // Check for max if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue3(expr->Nth(count)->IntegerValue()); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - // do nothing - count ++; + // do nothing + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } - } - } + } + } + } + } } else if (controlType == "wxScrollBar") { // DEFAULT VALUE if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // PAGE LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // OBJECT LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue3(expr->Nth(count)->IntegerValue()); - count ++; + count ++; // VIEW LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) controlItem->SetValue5(expr->Nth(count)->IntegerValue()); - } - } - } + } + } + } } else if (controlType == "wxListBox") { - PrologExpr *valueList = NULL; + PrologExpr *valueList = (PrologExpr *) NULL; if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList)) { @@ -1033,10 +1039,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e stringExpr = stringExpr->GetNext(); } controlItem->SetStringValues(stringList); - count ++; + count ++; // Check for wxSINGLE/wxMULTIPLE - PrologExpr *mult = NULL; + PrologExpr *mult = (PrologExpr *) NULL; controlItem->SetValue1(wxLB_SINGLE); if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord))) { @@ -1045,20 +1051,20 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e controlItem->SetValue1(wxLB_MULTIPLE); else if (m == "wxEXTENDED") controlItem->SetValue1(wxLB_EXTENDED); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } - } + } + } + } } else if (controlType == "wxChoice") { - PrologExpr *valueList = NULL; + PrologExpr *valueList = (PrologExpr *) NULL; // Check for default value list if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList)) { @@ -1071,30 +1077,30 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e } controlItem->SetStringValues(stringList); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } + } + } } #if USE_COMBOBOX else if (controlType == "wxComboBox") { PrologExpr *textValue = expr->Nth(count); if (textValue && (textValue->Type() == PrologString || textValue->Type() == PrologWord)) - { + { wxString str(textValue->StringValue()); controlItem->SetValue4(WXSTRINGCAST str); - count ++; + count ++; - PrologExpr *valueList = NULL; + PrologExpr *valueList = (PrologExpr *) NULL; // Check for default value list if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList)) { @@ -1107,24 +1113,24 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e } controlItem->SetStringValues(stringList); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } - } + } + } + } } #endif #if 0 else if (controlType == "wxRadioBox") { - PrologExpr *valueList = NULL; + PrologExpr *valueList = (PrologExpr *) NULL; // Check for default value list if ((valueList = expr->Nth(count)) && (valueList->Type() == PrologList)) { @@ -1136,32 +1142,32 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e stringExpr = stringExpr->GetNext(); } controlItem->SetStringValues(stringList); - count ++; + count ++; // majorDim (number of rows or cols) if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) - { + { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); - count ++; - } + count ++; + } else controlItem->SetValue1(0); if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { + { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); - count ++; + count ++; if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } + } + } } #endif else { delete controlItem; - return NULL; + return (wxItemResource *) NULL; } return controlItem; } @@ -1208,10 +1214,10 @@ wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, PrologExpr * id = wxResourceGetIdentifier(WXSTRINGCAST str, &table); if (id == 0) { - char buf[300]; - sprintf(buf, "Could not resolve menu id '%s'. Use (non-zero) integer instead\n or provide #define (see manual for caveats)", - (const char*) idExpr->StringValue()); - wxWarning(buf); + wxLogWarning(_("Could not resolve menu id '%s'. " + "Use (non-zero) integer instead\n" + "or provide #define (see manual for caveats)"), + (const char*) idExpr->StringValue()); } } else if (idExpr->Type() == PrologInteger) @@ -1264,17 +1270,17 @@ wxItemResource *wxResourceInterpretMenu1(wxResourceTable& table, PrologExpr *exp wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, PrologExpr *expr) { - PrologExpr *listExpr = NULL; + PrologExpr *listExpr = (PrologExpr *) NULL; expr->AssignAttributeValue("menu", &listExpr); if (!listExpr) - return NULL; + return (wxItemResource *) NULL; wxItemResource *menuResource = wxResourceInterpretMenuItem(table, listExpr); if (!menuResource) - return NULL; + return (wxItemResource *) NULL; - char *name = NULL; + char *name = (char *) NULL; expr->AssignAttributeValue("name", &name); if (name) { @@ -1287,10 +1293,10 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, PrologExpr *expr wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, PrologExpr *expr) { - PrologExpr *listExpr = NULL; + PrologExpr *listExpr = (PrologExpr *) NULL; expr->AssignAttributeValue("menu", &listExpr); if (!listExpr) - return NULL; + return (wxItemResource *) NULL; wxItemResource *resource = new wxItemResource; resource->SetType("wxMenu"); @@ -1304,7 +1310,7 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, PrologExpr *e element = element->GetNext(); } - char *name = NULL; + char *name = (char *) NULL; expr->AssignAttributeValue("name", &name); if (name) { @@ -1317,7 +1323,7 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, PrologExpr *e wxItemResource *wxResourceInterpretString(wxResourceTable& WXUNUSED(table), PrologExpr *WXUNUSED(expr)) { - return NULL; + return (wxItemResource *) NULL; } wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), PrologExpr *expr) @@ -1325,7 +1331,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), Prol wxItemResource *bitmapItem = new wxItemResource; // bitmapItem->SetType(wxTYPE_BITMAP); bitmapItem->SetType("wxBitmap"); - char *name = NULL; + char *name = (char *) NULL; expr->AssignAttributeValue("name", &name); if (name) { @@ -1415,14 +1421,14 @@ wxItemResource *wxResourceInterpretIcon(wxResourceTable& table, PrologExpr *expr return item; } else - return NULL; + return (wxItemResource *) NULL; } // Interpret list expression as a font wxFont *wxResourceInterpretFontSpec(PrologExpr *expr) { if (expr->Type() != PrologList) - return NULL; + return (wxFont *) NULL; int point = 10; int family = wxSWISS; @@ -1461,7 +1467,7 @@ wxFont *wxResourceInterpretFontSpec(PrologExpr *expr) if (faceNameExpr) faceName = faceNameExpr->StringValue(); - char *faceName1 = NULL; + char *faceName1 = (char *) NULL; if (faceName != "") faceName1 = WXSTRINGCAST faceName; wxFont *font = wxTheFontList->FindOrCreateFont(point, family, style, weight, (underline != 0), faceName1); @@ -1630,9 +1636,7 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour } else { - char buf[300]; - sprintf(buf, "#define %s must be an integer.", name); - wxWarning(buf); + wxLogWarning(_("#define %s must be an integer."), name); delete[] name; delete[] value; return FALSE; @@ -1654,9 +1658,7 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour name[len-1] = 0; if (!wxResourceParseIncludeFile(actualName, table)) { - char buf[400]; - sprintf(buf, "Could not find resource include file %s.", actualName); - wxWarning(buf); + wxLogWarning(_("Could not find resource include file %s."), actualName); } delete[] name; return TRUE; @@ -1664,38 +1666,38 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour else if (strcmp(wxResourceBuffer, "static") != 0) { char buf[300]; - strcpy(buf, "Found "); + strcpy(buf, _("Found ")); strncat(buf, wxResourceBuffer, 30); - strcat(buf, ", expected static, #include or #define\nwhilst parsing resource."); - wxWarning(buf); + strcat(buf, _(", expected static, #include or #define\nwhilst parsing resource.")); + wxLogWarning(buf); return FALSE; } // char if (!wxGetResourceToken(fd)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (strcmp(wxResourceBuffer, "char") != 0) { - wxWarning("Expected 'char' whilst parsing resource."); + wxLogWarning(_("Expected 'char' whilst parsing resource.")); return FALSE; } // *name if (!wxGetResourceToken(fd)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (wxResourceBuffer[0] != '*') { - wxWarning("Expected '*' whilst parsing resource."); + wxLogWarning(_("Expected '*' whilst parsing resource.")); return FALSE; } char nameBuf[100]; @@ -1704,21 +1706,21 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour // = if (!wxGetResourceToken(fd)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (strcmp(wxResourceBuffer, "=") != 0) { - wxWarning("Expected '=' whilst parsing resource."); + wxLogWarning(_("Expected '=' whilst parsing resource.")); return FALSE; } // String if (!wxGetResourceToken(fd)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } @@ -1726,9 +1728,7 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour { if (!db.ReadPrologFromString(wxResourceBuffer)) { - char buf[300]; - sprintf(buf, "%s: ill-formed resource file syntax.", nameBuf); - wxWarning(buf); + wxLogWarning(_("%s: ill-formed resource file syntax."), nameBuf); return FALSE; } } @@ -1752,7 +1752,7 @@ bool wxResourceReadOneResource(FILE *fd, PrologDatabase& db, bool *eof, wxResour char *wxResourceParseWord(char *s, int *i) { if (!s) - return NULL; + return (char *) NULL; static char buf[150]; int len = strlen(s); @@ -1774,7 +1774,7 @@ char *wxResourceParseWord(char *s, int *i) } *i = ii; if (j == 0) - return NULL; + return (char *) NULL; else return buf; } @@ -1794,8 +1794,6 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxLB_SINGLE", wxLB_SINGLE }, { "wxLB_MULTIPLE", wxLB_MULTIPLE }, { "wxLB_EXTENDED", wxLB_EXTENDED }, - { "wxNEEDED_SB", wxNEEDED_SB }, - { "wxALWAYS_SB", wxALWAYS_SB }, { "wxLB_NEEDED_SB", wxLB_NEEDED_SB }, { "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB }, { "wxLB_SORT", wxLB_SORT }, @@ -1922,8 +1920,6 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxDEFAULT_DIALOG_STYLE", wxDEFAULT_DIALOG_STYLE}, { "wxBORDER", wxBORDER}, { "wxRETAINED", wxRETAINED}, - { "wxEDITABLE", wxEDITABLE}, - { "wxREADONLY", wxREADONLY}, { "wxNATIVE_IMPL", 0}, { "wxEXTENDED_IMPL", 0}, { "wxBACKINGSTORE", wxBACKINGSTORE}, @@ -2059,9 +2055,7 @@ long wxParseWindowStyle(char *bitListString) } if (!found) { - char buf[200]; - sprintf(buf, "Unrecognized style %s whilst parsing resource.", word); - wxWarning(buf); + wxLogWarning(_("Unrecognized style %s whilst parsing resource."), word); return 0; } } @@ -2083,15 +2077,13 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table) { if (!item->GetType() || strcmp(item->GetType(), "wxBitmap") != 0) { - char buf[300]; - sprintf(buf, "%s not a bitmap resource specification.", resource); - wxWarning(buf); - return NULL; + wxLogWarning(_("%s not a bitmap resource specification."), resource); + return (wxBitmap *) NULL; } int thisDepth = wxDisplayDepth(); long thisNoColours = (long)pow(2.0, (double)thisDepth); - wxItemResource *optResource = NULL; + wxItemResource *optResource = (wxItemResource *) NULL; // Try to find optimum bitmap for this platform/colour depth wxNode *node = item->GetChildren().First(); @@ -2137,7 +2129,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table) break; } #endif -#ifdef __X__ +#ifdef __WXGTK__ case RESOURCE_PLATFORM_X: { if (!optResource && ((noColours == 0) || (noColours <= thisNoColours))) @@ -2172,44 +2164,42 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table) } // If no matching resource, fail. if (!optResource) - return NULL; + return (wxBitmap *) NULL; char *name = optResource->GetName(); int bitmapType = (int)optResource->GetValue1(); - wxBitmap *bitmap = NULL; + wxBitmap *bitmap = (wxBitmap *) NULL; switch (bitmapType) { case wxBITMAP_TYPE_XBM_DATA: { -#ifdef __X__ +#ifdef __WXGTK__ wxItemResource *item = table->FindResource(name); if (!item) { - char buf[400]; - sprintf(buf, "Failed to find XBM resource %s.\nForgot to use wxResourceLoadBitmapData?", name); - wxWarning(buf); - return NULL; + wxLogWarning(_("Failed to find XBM resource %s.\n" + "Forgot to use wxResourceLoadBitmapData?"), name); + return (wxBitmap *) NULL; } bitmap = new wxBitmap((char *)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); #else - wxWarning("No XBM facility available!"); + wxLogWarning(_("No XBM facility available!")); #endif break; } case wxBITMAP_TYPE_XPM_DATA: { -#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW) +#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW) wxItemResource *item = table->FindResource(name); if (!item) { - char buf[400]; - sprintf(buf, "Failed to find XPM resource %s.\nForgot to use wxResourceLoadBitmapData?", name); - wxWarning(buf); - return NULL; + wxLogWarning(_("Failed to find XPM resource %s.\n" + "Forgot to use wxResourceLoadBitmapData?"), name); + return (wxBitmap *) NULL; } bitmap = new wxBitmap(item->GetValue1()); #else - wxWarning("No XPM facility available!"); + wxLogWarning(_("No XPM facility available!")); #endif break; } @@ -2220,7 +2210,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table) } } if (!bitmap) - return NULL; + return (wxBitmap *) NULL; if (bitmap->Ok()) { @@ -2229,15 +2219,13 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table) else { delete bitmap; - return NULL; + return (wxBitmap *) NULL; } } else { - char buf[300]; - sprintf(buf, "Bitmap resource specification %s not found.", resource); - wxWarning(buf); - return NULL; + wxLogWarning(_("Bitmap resource specification %s not found."), resource); + return (wxBitmap *) NULL; } } @@ -2256,15 +2244,13 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table) { if (!item->GetType() || strcmp(item->GetType(), "wxIcon") != 0) { - char buf[300]; - sprintf(buf, "%s not an icon resource specification.", resource); - wxWarning(buf); - return NULL; + wxLogWarning(_("%s not an icon resource specification."), resource); + return (wxIcon *) NULL; } int thisDepth = wxDisplayDepth(); long thisNoColours = (long)pow(2.0, (double)thisDepth); - wxItemResource *optResource = NULL; + wxItemResource *optResource = (wxItemResource *) NULL; // Try to find optimum icon for this platform/colour depth wxNode *node = item->GetChildren().First(); @@ -2310,7 +2296,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table) break; } #endif -#ifdef __X__ +#ifdef __WXGTK__ case RESOURCE_PLATFORM_X: { if (!optResource && ((noColours == 0) || (noColours <= thisNoColours))) @@ -2345,27 +2331,26 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table) } // If no matching resource, fail. if (!optResource) - return NULL; + return (wxIcon *) NULL; char *name = optResource->GetName(); int bitmapType = (int)optResource->GetValue1(); - wxIcon *icon = NULL; + wxIcon *icon = (wxIcon *) NULL; switch (bitmapType) { case wxBITMAP_TYPE_XBM_DATA: { -#ifdef __X__ +#ifdef __WXGTK__ wxItemResource *item = table->FindResource(name); if (!item) { - char buf[400]; - sprintf(buf, "Failed to find XBM resource %s.\nForgot to use wxResourceLoadIconData?", name); - wxWarning(buf); - return NULL; + wxLogWarning(_("Failed to find XBM resource %s.\n" + "Forgot to use wxResourceLoadIconData?"), name); + return (wxIcon *) NULL; } - icon = new wxIcon((char *)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); + icon = new wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); #else - wxWarning("No XBM facility available!"); + wxLogWarning(_("No XBM facility available!")); #endif break; } @@ -2373,31 +2358,35 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table) { // *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS *** /* -#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW) +#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW) wxItemResource *item = table->FindResource(name); if (!item) { char buf[400]; - sprintf(buf, "Failed to find XPM resource %s.\nForgot to use wxResourceLoadIconData?", name); - wxWarning(buf); + sprintf(buf, _("Failed to find XPM resource %s.\nForgot to use wxResourceLoadIconData?"), name); + wxLogWarning(buf); return NULL; } icon = new wxIcon((char **)item->GetValue1()); #else - wxWarning("No XPM facility available!"); + wxLogWarning(_("No XPM facility available!")); #endif */ - wxWarning("No XPM icon facility available!"); + wxLogWarning(_("No XPM icon facility available!")); break; } default: { +#ifdef __WXGTK__ + wxLogWarning(_("Icon resource specification %s not found."), resource); +#else icon = new wxIcon(name, bitmapType); +#endif break; } } if (!icon) - return NULL; + return (wxIcon *) NULL; if (icon->Ok()) { @@ -2406,15 +2395,13 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table) else { delete icon; - return NULL; + return (wxIcon *) NULL; } } else { - char buf[300]; - sprintf(buf, "Icon resource specification %s not found.", resource); - wxWarning(buf); - return NULL; + wxLogWarning(_("Icon resource specification %s not found."), resource); + return (wxIcon *) NULL; } } @@ -2463,7 +2450,7 @@ wxMenuBar *wxResourceCreateMenuBar(char *resource, wxResourceTable *table, wxMen } return menuBar; } - return NULL; + return (wxMenuBar *) NULL; } wxMenu *wxResourceCreateMenu(char *resource, wxResourceTable *table) @@ -2475,7 +2462,7 @@ wxMenu *wxResourceCreateMenu(char *resource, wxResourceTable *table) if (menuResource && menuResource->GetType() && strcmp(menuResource->GetType(), "wxMenu") == 0) // if (menuResource && (menuResource->GetType() == wxTYPE_MENU)) return wxResourceCreateMenu(menuResource); - return NULL; + return (wxMenu *) NULL; } // Global equivalents (so don't have to refer to default table explicitly) @@ -2739,9 +2726,7 @@ bool wxResourceReadOneResourceString(char *s, PrologDatabase& db, bool *eof, wxR } else { - char buf[300]; - sprintf(buf, "#define %s must be an integer.", name); - wxWarning(buf); + wxLogWarning(_("#define %s must be an integer."), name); delete[] name; delete[] value; return FALSE; @@ -2765,8 +2750,8 @@ bool wxResourceReadOneResourceString(char *s, PrologDatabase& db, bool *eof, wxR if (!wxResourceParseIncludeFile(actualName, table)) { char buf[400]; - sprintf(buf, "Could not find resource include file %s.", actualName); - wxWarning(buf); + sprintf(buf, _("Could not find resource include file %s."), actualName); + wxLogWarning(buf); } delete[] name; return TRUE; @@ -2775,38 +2760,38 @@ bool wxResourceReadOneResourceString(char *s, PrologDatabase& db, bool *eof, wxR else if (strcmp(wxResourceBuffer, "static") != 0) { char buf[300]; - strcpy(buf, "Found "); + strcpy(buf, _("Found ")); strncat(buf, wxResourceBuffer, 30); - strcat(buf, ", expected static, #include or #define\nwhilst parsing resource."); - wxWarning(buf); + strcat(buf, _(", expected static, #include or #define\nwhilst parsing resource.")); + wxLogWarning(buf); return FALSE; } // char if (!wxGetResourceTokenString(s)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (strcmp(wxResourceBuffer, "char") != 0) { - wxWarning("Expected 'char' whilst parsing resource."); + wxLogWarning(_("Expected 'char' whilst parsing resource.")); return FALSE; } // *name if (!wxGetResourceTokenString(s)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (wxResourceBuffer[0] != '*') { - wxWarning("Expected '*' whilst parsing resource."); + wxLogWarning(_("Expected '*' whilst parsing resource.")); return FALSE; } char nameBuf[100]; @@ -2815,21 +2800,21 @@ bool wxResourceReadOneResourceString(char *s, PrologDatabase& db, bool *eof, wxR // = if (!wxGetResourceTokenString(s)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } if (strcmp(wxResourceBuffer, "=") != 0) { - wxWarning("Expected '=' whilst parsing resource."); + wxLogWarning(_("Expected '=' whilst parsing resource.")); return FALSE; } // String if (!wxGetResourceTokenString(s)) { - wxWarning("Unexpected end of file whilst parsing resource."); + wxLogWarning(_("Unexpected end of file whilst parsing resource.")); *eof = TRUE; return FALSE; } @@ -2837,9 +2822,7 @@ bool wxResourceReadOneResourceString(char *s, PrologDatabase& db, bool *eof, wxR { if (!db.ReadPrologFromString(wxResourceBuffer)) { - char buf[300]; - sprintf(buf, "%s: ill-formed resource file syntax.", nameBuf); - wxWarning(buf); + wxLogWarning(_("%s: ill-formed resource file syntax."), nameBuf); return FALSE; } } @@ -2912,7 +2895,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, if (IsKindOf(CLASSINFO(wxDialog))) { wxDialog *dialogBox = (wxDialog *)this; - long modalStyle = isModal ? wxDIALOG_MODAL : 0; + long modalStyle = isModal ? wxDIALOG_MODAL : 0; if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name)) return FALSE; dialogBox->SetClientSize(width, height); @@ -2929,7 +2912,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, if (resource->GetBackgroundColour()) SetBackgroundColour(*resource->GetBackgroundColour()); - // TODO + // TODO if (resource->GetLabelColour()) SetForegroundColour(*resource->GetLabelColour()); else if (resource->GetButtonColour())