X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/631cefffd44d49cff6ee96a7c45fa90d32721890..c54f5226220ea48997f161e53728d7071245a59d:/src/common/resource.cpp?ds=sidebyside diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 5fd8860ea3..b3391f9ac7 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -39,23 +39,21 @@ #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/icon.h" #include "wx/statbox.h" #include "wx/statbmp.h" -#if wxUSE_GAUGE #include "wx/gauge.h" -#endif #include "wx/textctrl.h" #include "wx/msgdlg.h" #include "wx/intl.h" #endif -#if wxUSE_RADIOBUTTON +#if wxUSE_RADIOBTN #include "wx/radiobut.h" #endif @@ -173,10 +171,10 @@ wxItemResource *wxResourceTable::FindResource(const wxString& name) const void wxResourceTable::AddResource(wxItemResource *item) { wxString name = item->GetName(); - if (name == _T("")) + if (name == wxT("")) name = item->GetTitle(); - if (name == _T("")) - name = _T("no name"); + if (name == wxT("")) + name = wxT("no name"); // Delete existing resource, if any. Delete(name); @@ -193,7 +191,8 @@ bool wxResourceTable::DeleteResource(const wxString& name) // parent's child list. BeginFind(); wxNode *node = (wxNode *) NULL; - while ((node = Next())) + node = Next(); + while (node != NULL) { wxItemResource *parent = (wxItemResource *)node->Data(); if (parent->GetChildren().Member(item)) @@ -201,6 +200,7 @@ bool wxResourceTable::DeleteResource(const wxString& name) parent->GetChildren().DeleteObject(item); break; } + node = Next(); } delete item; @@ -243,7 +243,7 @@ bool wxResourceTable::RegisterResourceBitmapData(const wxString& name, char bits // Register pre-loaded bitmap data wxItemResource *item = new wxItemResource; // item->SetType(wxRESOURCE_TYPE_XBM_DATA); - item->SetType(_T("wxXBMData")); + item->SetType(wxT("wxXBMData")); item->SetName(name); item->SetValue1((long)bits); item->SetValue2((long)width); @@ -257,7 +257,7 @@ bool wxResourceTable::RegisterResourceBitmapData(const wxString& name, char **da // Register pre-loaded bitmap data wxItemResource *item = new wxItemResource; // item->SetType(wxRESOURCE_TYPE_XPM_DATA); - item->SetType(_T("wxXPMData")); + item->SetType(wxT("wxXPMData")); item->SetName(name); item->SetValue1((long)data); AddResource(item); @@ -307,9 +307,9 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c size = wxSize(childResource->GetWidth(), childResource->GetHeight()); } - if (itemType == wxString(_T("wxButton")) || itemType == wxString(_T("wxBitmapButton"))) + if (itemType == wxString(wxT("wxButton")) || itemType == wxString(wxT("wxBitmapButton"))) { - if (childResource->GetValue4() != _T("")) + if (childResource->GetValue4() != wxT("")) { // Bitmap button wxBitmap bitmap = childResource->GetBitmap(); @@ -327,10 +327,10 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c control = new wxButton(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxMessage")) || itemType == wxString(_T("wxStaticText")) || - itemType == wxString(_T("wxStaticBitmap"))) + else if (itemType == wxString(wxT("wxMessage")) || itemType == wxString(wxT("wxStaticText")) || + itemType == wxString(wxT("wxStaticBitmap"))) { - if (childResource->GetValue4() != _T("")) + if (childResource->GetValue4() != wxT("")) { // Bitmap message wxBitmap bitmap = childResource->GetBitmap(); @@ -351,12 +351,12 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c childResource->GetStyle(), childResource->GetName()); } } - else if (itemType == wxString(_T("wxText")) || itemType == wxString(_T("wxTextCtrl")) || itemType == wxString(_T("wxMultiText"))) + else if (itemType == wxString(wxT("wxText")) || itemType == wxString(wxT("wxTextCtrl")) || itemType == wxString(wxT("wxMultiText"))) { control = new wxTextCtrl(parent, id, childResource->GetValue4(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxCheckBox"))) + else if (itemType == wxString(wxT("wxCheckBox"))) { control = new wxCheckBox(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -364,7 +364,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c ((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0)); } #if wxUSE_GAUGE - else if (itemType == wxString(_T("wxGauge"))) + else if (itemType == wxString(wxT("wxGauge"))) { control = new wxGauge(parent, id, (int)childResource->GetValue2(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -372,8 +372,8 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c ((wxGauge *)control)->SetValue((int)childResource->GetValue1()); } #endif -#if wxUSE_RADIOBUTTON - else if (itemType == wxString(_T("wxRadioButton"))) +#if wxUSE_RADIOBTN + else if (itemType == wxString(wxT("wxRadioButton"))) { control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(), pos, size, @@ -381,7 +381,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } #endif #if wxUSE_SCROLLBAR - else if (itemType == wxString(_T("wxScrollBar"))) + else if (itemType == wxString(wxT("wxScrollBar"))) { control = new wxScrollBar(parent, id, pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -396,18 +396,18 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } #endif - else if (itemType == wxString(_T("wxSlider"))) + else if (itemType == wxString(wxT("wxSlider"))) { control = new wxSlider(parent, id, (int)childResource->GetValue1(), (int)childResource->GetValue2(), (int)childResource->GetValue3(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxGroupBox")) || itemType == wxString(_T("wxStaticBox"))) + else if (itemType == wxString(wxT("wxGroupBox")) || itemType == wxString(wxT("wxStaticBox"))) { control = new wxStaticBox(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), childResource->GetName()); } - else if (itemType == wxString(_T("wxListBox"))) + else if (itemType == wxString(wxT("wxListBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -431,7 +431,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c if (strings) delete[] strings; } - else if (itemType == wxString(_T("wxChoice"))) + else if (itemType == wxString(wxT("wxChoice"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -456,7 +456,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c delete[] strings; } #if wxUSE_COMBOBOX - else if (itemType == wxString(_T("wxComboBox"))) + else if (itemType == wxString(wxT("wxComboBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -481,7 +481,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c delete[] strings; } #endif - else if (itemType == wxString(_T("wxRadioBox"))) + else if (itemType == wxString(wxT("wxRadioBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -532,25 +532,25 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) wxString functor(clause->Functor()); wxItemResource *item = (wxItemResource *) NULL; - if (functor == _T("dialog")) + if (functor == wxT("dialog")) item = wxResourceInterpretDialog(table, clause); - else if (functor == _T("panel")) + else if (functor == wxT("panel")) item = wxResourceInterpretDialog(table, clause, TRUE); - else if (functor == _T("menubar")) + else if (functor == wxT("menubar")) item = wxResourceInterpretMenuBar(table, clause); - else if (functor == _T("menu")) + else if (functor == wxT("menu")) item = wxResourceInterpretMenu(table, clause); - else if (functor == _T("string")) + else if (functor == wxT("string")) item = wxResourceInterpretString(table, clause); - else if (functor == _T("bitmap")) + else if (functor == wxT("bitmap")) item = wxResourceInterpretBitmap(table, clause); - else if (functor == _T("icon")) + else if (functor == wxT("icon")) item = wxResourceInterpretIcon(table, clause); if (item) { // Remove any existing resource of same name - if (item->GetName() != _T("")) + if (item->GetName() != wxT("")) table.DeleteResource(item->GetName()); table.AddResource(item); } @@ -561,26 +561,26 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) static const wxChar *g_ValidControlClasses[] = { - _T("wxButton"), - _T("wxBitmapButton"), - _T("wxMessage"), - _T("wxStaticText"), - _T("wxStaticBitmap"), - _T("wxText"), - _T("wxTextCtrl"), - _T("wxMultiText"), - _T("wxListBox"), - _T("wxRadioBox"), - _T("wxRadioButton"), - _T("wxCheckBox"), - _T("wxBitmapCheckBox"), - _T("wxGroupBox"), - _T("wxStaticBox"), - _T("wxSlider"), - _T("wxGauge"), - _T("wxScrollBar"), - _T("wxChoice"), - _T("wxComboBox") + wxT("wxButton"), + wxT("wxBitmapButton"), + wxT("wxMessage"), + wxT("wxStaticText"), + wxT("wxStaticBitmap"), + wxT("wxText"), + wxT("wxTextCtrl"), + wxT("wxMultiText"), + wxT("wxListBox"), + wxT("wxRadioBox"), + wxT("wxRadioButton"), + wxT("wxCheckBox"), + wxT("wxBitmapCheckBox"), + wxT("wxGroupBox"), + wxT("wxStaticBox"), + wxT("wxSlider"), + wxT("wxGauge"), + wxT("wxScrollBar"), + wxT("wxChoice"), + wxT("wxComboBox") }; static bool wxIsValidControlClass(const wxString& c) @@ -597,15 +597,15 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, { wxItemResource *dialogItem = new wxItemResource; if (isPanel) - dialogItem->SetType(_T("wxPanel")); + dialogItem->SetType(wxT("wxPanel")); else - dialogItem->SetType(_T("wxDialog")); - wxString style = _T(""); - wxString title = _T(""); - wxString name = _T(""); - wxString backColourHex = _T(""); - wxString labelColourHex = _T(""); - wxString buttonColourHex = _T(""); + dialogItem->SetType(wxT("wxDialog")); + wxString style = wxT(""); + wxString title = wxT(""); + wxString name = wxT(""); + wxString backColourHex = wxT(""); + wxString labelColourHex = wxT(""); + wxString buttonColourHex = wxT(""); long windowStyle = wxDEFAULT_DIALOG_STYLE; if (isPanel) @@ -616,46 +616,49 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, wxExpr *labelFontExpr = (wxExpr *) NULL; wxExpr *buttonFontExpr = (wxExpr *) NULL; wxExpr *fontExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("style"), style); - expr->GetAttributeValue(_T("name"), name); - expr->GetAttributeValue(_T("title"), title); - expr->GetAttributeValue(_T("x"), x); - expr->GetAttributeValue(_T("y"), y); - expr->GetAttributeValue(_T("width"), width); - expr->GetAttributeValue(_T("height"), height); - expr->GetAttributeValue(_T("modal"), isModal); - expr->GetAttributeValue(_T("label_font"), &labelFontExpr); - expr->GetAttributeValue(_T("button_font"), &buttonFontExpr); - expr->GetAttributeValue(_T("font"), &fontExpr); - expr->GetAttributeValue(_T("background_colour"), backColourHex); - expr->GetAttributeValue(_T("label_colour"), labelColourHex); - expr->GetAttributeValue(_T("button_colour"), buttonColourHex); + expr->GetAttributeValue(wxT("style"), style); + expr->GetAttributeValue(wxT("name"), name); + expr->GetAttributeValue(wxT("title"), title); + expr->GetAttributeValue(wxT("x"), x); + expr->GetAttributeValue(wxT("y"), y); + expr->GetAttributeValue(wxT("width"), width); + expr->GetAttributeValue(wxT("height"), height); + expr->GetAttributeValue(wxT("modal"), isModal); + expr->GetAttributeValue(wxT("label_font"), &labelFontExpr); + expr->GetAttributeValue(wxT("button_font"), &buttonFontExpr); + expr->GetAttributeValue(wxT("font"), &fontExpr); + expr->GetAttributeValue(wxT("background_colour"), backColourHex); + expr->GetAttributeValue(wxT("label_colour"), labelColourHex); + expr->GetAttributeValue(wxT("button_colour"), buttonColourHex); int useDialogUnits = 0; - expr->GetAttributeValue(_T("use_dialog_units"), useDialogUnits); + expr->GetAttributeValue(wxT("use_dialog_units"), useDialogUnits); if (useDialogUnits != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_DIALOG_UNITS); int useDefaults = 0; - expr->GetAttributeValue(_T("use_system_defaults"), useDefaults); + expr->GetAttributeValue(wxT("use_system_defaults"), useDefaults); if (useDefaults != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS); long id = 0; - expr->GetAttributeValue(_T("id"), id); + expr->GetAttributeValue(wxT("id"), id); dialogItem->SetId(id); - if (style != _T("")) + if (style != wxT("")) { windowStyle = wxParseWindowStyle(style); } dialogItem->SetStyle(windowStyle); dialogItem->SetValue1(isModal); + if (windowStyle & wxDIALOG_MODAL) // Uses style in wxWin 2 + dialogItem->SetValue1(TRUE); + dialogItem->SetName(name); dialogItem->SetTitle(title); dialogItem->SetSize(x, y, width, height); - if (backColourHex != _T("")) + if (backColourHex != wxT("")) { int r = 0; int g = 0; @@ -665,7 +668,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, b = wxHexToDec(backColourHex.Mid(4, 2)); dialogItem->SetBackgroundColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b)); } - if (labelColourHex != _T("")) + if (labelColourHex != wxT("")) { int r = 0; int g = 0; @@ -675,7 +678,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, b = wxHexToDec(labelColourHex.Mid(4, 2)); dialogItem->SetLabelColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b)); } - if (buttonColourHex != _T("")) + if (buttonColourHex != wxT("")) { int r = 0; int g = 0; @@ -700,7 +703,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, if (controlExpr->Number() == 3) { wxString controlKeyword(controlExpr->Nth(1)->StringValue()); - if (controlKeyword != _T("") && controlKeyword == _T("control")) + if (controlKeyword != wxT("") && controlKeyword == wxT("control")) { // The value part: always a list. wxExpr *listExpr = controlExpr->Nth(2); @@ -818,7 +821,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetType(controlType); controlItem->SetId(id); - if (controlType == _T("wxButton")) + if (controlType == wxT("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))) @@ -826,16 +829,16 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); count ++; - if (str != _T("")) + if (str != wxT("")) { controlItem->SetValue4(str); - controlItem->SetType(_T("wxBitmapButton")); + controlItem->SetType(wxT("wxBitmapButton")); } } if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxBitmapButton")) + else if (controlType == wxT("wxBitmapButton")) { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -847,7 +850,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } } - else if (controlType == _T("wxCheckBox")) + else if (controlType == wxT("wxCheckBox")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -858,8 +861,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } } -#if wxUSE_RADIOBUTTON - else if (controlType == _T("wxRadioButton")) +#if wxUSE_RADIOBTN + else if (controlType == wxT("wxRadioButton")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -871,7 +874,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } #endif - else if (controlType == _T("wxText") || controlType == _T("wxTextCtrl") || controlType == _T("wxMultiText")) + else if (controlType == wxT("wxText") || controlType == wxT("wxTextCtrl") || controlType == wxT("wxMultiText")) { // Check for default value if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -890,7 +893,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxMessage") || controlType == _T("wxStaticText")) + else if (controlType == wxT("wxMessage") || controlType == wxT("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))) @@ -898,12 +901,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(str); count ++; - controlItem->SetType(_T("wxStaticText")); + controlItem->SetType(wxT("wxStaticText")); } if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxStaticBitmap")) + else if (controlType == wxT("wxStaticBitmap")) { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -915,12 +918,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxGroupBox") || controlType == _T("wxStaticBox")) + else if (controlType == wxT("wxGroupBox") || controlType == wxT("wxStaticBox")) { if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxGauge")) + else if (controlType == wxT("wxGauge")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -946,7 +949,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxSlider")) + else if (controlType == wxT("wxSlider")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -979,7 +982,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxScrollBar")) + else if (controlType == wxT("wxScrollBar")) { // DEFAULT VALUE if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -1006,7 +1009,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxListBox")) + else if (controlType == wxT("wxListBox")) { wxExpr *valueList = (wxExpr *) NULL; @@ -1048,7 +1051,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxChoice")) + else if (controlType == wxT("wxChoice")) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list @@ -1076,7 +1079,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } #if wxUSE_COMBOBOX - else if (controlType == _T("wxComboBox")) + else if (controlType == wxT("wxComboBox")) { wxExpr *textValue = expr->Nth(count); if (textValue && (textValue->Type() == PrologString || textValue->Type() == PrologWord)) @@ -1114,7 +1117,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } #endif #if 1 - else if (controlType == _T("wxRadioBox")) + else if (controlType == wxT("wxRadioBox")) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list @@ -1178,13 +1181,13 @@ wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, wxExpr *expr if (expr->Number() == 0) { // item->SetType(wxRESOURCE_TYPE_SEPARATOR); - item->SetType(_T("wxMenuSeparator")); + item->SetType(wxT("wxMenuSeparator")); return item; } else { // item->SetType(wxTYPE_MENU); // Well, menu item, but doesn't matter. - item->SetType(_T("wxMenu")); // Well, menu item, but doesn't matter. + item->SetType(wxT("wxMenu")); // Well, menu item, but doesn't matter. if (labelExpr) { wxString str(labelExpr->StringValue()); @@ -1257,7 +1260,7 @@ wxItemResource *wxResourceInterpretMenu1(wxResourceTable& table, wxExpr *expr) wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) { wxExpr *listExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("menu"), &listExpr); + expr->GetAttributeValue(wxT("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; @@ -1267,7 +1270,7 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) return (wxItemResource *) NULL; wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(wxT("name"), name)) { menuResource->SetName(name); } @@ -1278,12 +1281,12 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) { wxExpr *listExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("menu"), &listExpr); + expr->GetAttributeValue(wxT("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; wxItemResource *resource = new wxItemResource; - resource->SetType(_T("wxMenu")); + resource->SetType(wxT("wxMenu")); // resource->SetType(wxTYPE_MENU); wxExpr *element = listExpr->GetFirst(); @@ -1295,7 +1298,7 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) } wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(wxT("name"), name)) { resource->SetName(name); } @@ -1312,9 +1315,9 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx { wxItemResource *bitmapItem = new wxItemResource; // bitmapItem->SetType(wxTYPE_BITMAP); - bitmapItem->SetType(_T("wxBitmap")); + bitmapItem->SetType(wxT("wxBitmap")); wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(wxT("name"), name)) { bitmapItem->SetName(name); } @@ -1325,7 +1328,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx if (bitmapExpr->Number() == 3) { wxString bitmapKeyword(bitmapExpr->Nth(1)->StringValue()); - if (bitmapKeyword == _T("bitmap") || bitmapKeyword == _T("icon")) + if (bitmapKeyword == wxT("bitmap") || bitmapKeyword == wxT("icon")) { // The value part: always a list. wxExpr *listExpr = bitmapExpr->Nth(2); @@ -1333,7 +1336,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx { wxItemResource *bitmapSpec = new wxItemResource; // bitmapSpec->SetType(wxTYPE_BITMAP); - bitmapSpec->SetType(_T("wxBitmap")); + bitmapSpec->SetType(wxT("wxBitmap")); // List is of form: [filename, bitmaptype, platform, colours, xresolution, yresolution] // where everything after 'filename' is optional. @@ -1343,25 +1346,25 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx wxExpr *coloursExpr = listExpr->Nth(3); wxExpr *xresExpr = listExpr->Nth(4); wxExpr *yresExpr = listExpr->Nth(5); - if (nameExpr && nameExpr->StringValue() != _T("")) + if (nameExpr && nameExpr->StringValue() != wxT("")) { bitmapSpec->SetName(nameExpr->StringValue()); } - if (typeExpr && typeExpr->StringValue() != _T("")) + if (typeExpr && typeExpr->StringValue() != wxT("")) { bitmapSpec->SetValue1(wxParseWindowStyle(typeExpr->StringValue())); } else bitmapSpec->SetValue1(0); - if (platformExpr && platformExpr->StringValue() != _T("")) + if (platformExpr && platformExpr->StringValue() != wxT("")) { wxString plat(platformExpr->StringValue()); - if (plat == _T("windows") || plat == _T("WINDOWS")) + if (plat == wxT("windows") || plat == wxT("WINDOWS")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_WINDOWS); - else if (plat == _T("x") || plat == _T("X")) + else if (plat == wxT("x") || plat == wxT("X")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_X); - else if (plat == _T("mac") || plat == _T("MAC")) + else if (plat == wxT("mac") || plat == wxT("MAC")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_MAC); else bitmapSpec->SetValue2(RESOURCE_PLATFORM_ANY); @@ -1395,7 +1398,7 @@ wxItemResource *wxResourceInterpretIcon(wxResourceTable& table, wxExpr *expr) if (item) { // item->SetType(wxTYPE_ICON); - item->SetType(_T("wxIcon")); + item->SetType(wxT("wxIcon")); return item; } else @@ -1413,7 +1416,7 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) int style = wxNORMAL; int weight = wxNORMAL; int underline = 0; - wxString faceName(_T("")); + wxString faceName(wxT("")); wxExpr *pointExpr = expr->Nth(0); wxExpr *familyExpr = expr->Nth(1); @@ -1527,7 +1530,7 @@ static bool wxEatWhiteSpace(FILE *fd) default: ungetc(ch, fd); return TRUE; - + } } return FALSE; @@ -1617,10 +1620,10 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceToken(fd); - wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); + wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); wxGetResourceToken(fd); - wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); - if (wxIsalpha(value[0])) + wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); + if (wxIsdigit(value[0])) { int val = (int)wxAtol(value); wxResourceAddIdentifier(name, val, table); @@ -1640,12 +1643,12 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour else if (strcmp(wxResourceBuffer, "#include") == 0) { wxGetResourceToken(fd); - wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); + wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); wxChar *actualName = name; - if (name[0] == _T('"')) + if (name[0] == wxT('"')) actualName = name + 1; int len = wxStrlen(name); - if ((len > 0) && (name[len-1] == _T('"'))) + if ((len > 0) && (name[len-1] == wxT('"'))) name[len-1] = 0; if (!wxResourceParseIncludeFile(actualName, table)) { @@ -1658,7 +1661,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour { wxChar buf[300]; wxStrcpy(buf, _("Found ")); - wxStrncat(buf, wxConv_libc.cMB2WX(wxResourceBuffer), 30); + wxStrncat(buf, wxConvCurrent->cMB2WX(wxResourceBuffer), 30); wxStrcat(buf, _(", expected static, #include or #define\nwhilst parsing resource.")); wxLogWarning(buf); return FALSE; @@ -1750,7 +1753,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) int len = wxStrlen(s); int j = 0; int ii = *i; - while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == _T('_')))) + while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == wxT('_')))) { buf[j] = s[ii]; j ++; @@ -1760,7 +1763,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) // Eat whitespace and conjunction characters while ((ii < len) && - ((s[ii] == _T(' ')) || (s[ii] == _T('|')) || (s[ii] == _T(',')))) + ((s[ii] == wxT(' ')) || (s[ii] == wxT('|')) || (s[ii] == wxT(',')))) { ii ++; } @@ -1780,254 +1783,259 @@ struct wxResourceBitListStruct static wxResourceBitListStruct wxResourceBitListTable[] = { /* wxListBox */ - { _T("wxSINGLE"), wxLB_SINGLE }, - { _T("wxMULTIPLE"), wxLB_MULTIPLE }, - { _T("wxEXTENDED"), wxLB_EXTENDED }, - { _T("wxLB_SINGLE"), wxLB_SINGLE }, - { _T("wxLB_MULTIPLE"), wxLB_MULTIPLE }, - { _T("wxLB_EXTENDED"), wxLB_EXTENDED }, - { _T("wxLB_NEEDED_SB"), wxLB_NEEDED_SB }, - { _T("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB }, - { _T("wxLB_SORT"), wxLB_SORT }, - { _T("wxLB_OWNERDRAW"), wxLB_OWNERDRAW }, - { _T("wxLB_HSCROLL"), wxLB_HSCROLL }, + { wxT("wxSINGLE"), wxLB_SINGLE }, + { wxT("wxMULTIPLE"), wxLB_MULTIPLE }, + { wxT("wxEXTENDED"), wxLB_EXTENDED }, + { wxT("wxLB_SINGLE"), wxLB_SINGLE }, + { wxT("wxLB_MULTIPLE"), wxLB_MULTIPLE }, + { wxT("wxLB_EXTENDED"), wxLB_EXTENDED }, + { wxT("wxLB_NEEDED_SB"), wxLB_NEEDED_SB }, + { wxT("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB }, + { wxT("wxLB_SORT"), wxLB_SORT }, + { wxT("wxLB_OWNERDRAW"), wxLB_OWNERDRAW }, + { wxT("wxLB_HSCROLL"), wxLB_HSCROLL }, /* wxComboxBox */ - { _T("wxCB_SIMPLE"), wxCB_SIMPLE }, - { _T("wxCB_DROPDOWN"), wxCB_DROPDOWN }, - { _T("wxCB_READONLY"), wxCB_READONLY }, - { _T("wxCB_SORT"), wxCB_SORT }, + { wxT("wxCB_SIMPLE"), wxCB_SIMPLE }, + { wxT("wxCB_DROPDOWN"), wxCB_DROPDOWN }, + { wxT("wxCB_READONLY"), wxCB_READONLY }, + { wxT("wxCB_SORT"), wxCB_SORT }, /* wxGauge */ - { _T("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR }, - { _T("wxGA_HORIZONTAL"), wxGA_HORIZONTAL }, - { _T("wxGA_VERTICAL"), wxGA_VERTICAL }, + { wxT("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR }, + { wxT("wxGA_HORIZONTAL"), wxGA_HORIZONTAL }, + { wxT("wxGA_VERTICAL"), wxGA_VERTICAL }, /* wxTextCtrl */ - { _T("wxPASSWORD"), wxPASSWORD}, - { _T("wxPROCESS_ENTER"), wxPROCESS_ENTER}, - { _T("wxTE_PASSWORD"), wxTE_PASSWORD}, - { _T("wxTE_READONLY"), wxTE_READONLY}, - { _T("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, - { _T("wxTE_MULTILINE"), wxTE_MULTILINE}, + { wxT("wxPASSWORD"), wxPASSWORD}, + { wxT("wxPROCESS_ENTER"), wxPROCESS_ENTER}, + { wxT("wxTE_PASSWORD"), wxTE_PASSWORD}, + { wxT("wxTE_READONLY"), wxTE_READONLY}, + { wxT("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, + { wxT("wxTE_MULTILINE"), wxTE_MULTILINE}, + { wxT("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL}, /* wxRadioBox/wxRadioButton */ - { _T("wxRB_GROUP"), wxRB_GROUP }, - { _T("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS }, - { _T("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS }, - { _T("wxRA_HORIZONTAL"), wxRA_HORIZONTAL }, - { _T("wxRA_VERTICAL"), wxRA_VERTICAL }, + { wxT("wxRB_GROUP"), wxRB_GROUP }, + { wxT("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS }, + { wxT("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS }, + { wxT("wxRA_HORIZONTAL"), wxRA_HORIZONTAL }, + { wxT("wxRA_VERTICAL"), wxRA_VERTICAL }, /* wxSlider */ - { _T("wxSL_HORIZONTAL"), wxSL_HORIZONTAL }, - { _T("wxSL_VERTICAL"), wxSL_VERTICAL }, - { _T("wxSL_AUTOTICKS"), wxSL_AUTOTICKS }, - { _T("wxSL_LABELS"), wxSL_LABELS }, - { _T("wxSL_LEFT"), wxSL_LEFT }, - { _T("wxSL_TOP"), wxSL_TOP }, - { _T("wxSL_RIGHT"), wxSL_RIGHT }, - { _T("wxSL_BOTTOM"), wxSL_BOTTOM }, - { _T("wxSL_BOTH"), wxSL_BOTH }, - { _T("wxSL_SELRANGE"), wxSL_SELRANGE }, + { wxT("wxSL_HORIZONTAL"), wxSL_HORIZONTAL }, + { wxT("wxSL_VERTICAL"), wxSL_VERTICAL }, + { wxT("wxSL_AUTOTICKS"), wxSL_AUTOTICKS }, + { wxT("wxSL_LABELS"), wxSL_LABELS }, + { wxT("wxSL_LEFT"), wxSL_LEFT }, + { wxT("wxSL_TOP"), wxSL_TOP }, + { wxT("wxSL_RIGHT"), wxSL_RIGHT }, + { wxT("wxSL_BOTTOM"), wxSL_BOTTOM }, + { wxT("wxSL_BOTH"), wxSL_BOTH }, + { wxT("wxSL_SELRANGE"), wxSL_SELRANGE }, /* wxScrollBar */ - { _T("wxSB_HORIZONTAL"), wxSB_HORIZONTAL }, - { _T("wxSB_VERTICAL"), wxSB_VERTICAL }, + { wxT("wxSB_HORIZONTAL"), wxSB_HORIZONTAL }, + { wxT("wxSB_VERTICAL"), wxSB_VERTICAL }, /* wxButton */ - { _T("wxBU_AUTODRAW"), wxBU_AUTODRAW }, - { _T("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW }, + { wxT("wxBU_AUTODRAW"), wxBU_AUTODRAW }, + { wxT("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW }, /* wxTreeCtrl */ - { _T("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS }, - { _T("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS }, - { _T("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT }, + { wxT("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS }, + { wxT("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS }, + { wxT("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT }, /* wxListCtrl */ - { _T("wxLC_ICON"), wxLC_ICON }, - { _T("wxLC_SMALL_ICON"), wxLC_SMALL_ICON }, - { _T("wxLC_LIST"), wxLC_LIST }, - { _T("wxLC_REPORT"), wxLC_REPORT }, - { _T("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP }, - { _T("wxLC_ALIGN_LEFT"), wxLC_ALIGN_LEFT }, - { _T("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE }, - { _T("wxLC_USER_TEXT"), wxLC_USER_TEXT }, - { _T("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS }, - { _T("wxLC_NO_HEADER"), wxLC_NO_HEADER }, - { _T("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER }, - { _T("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL }, - { _T("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING }, - { _T("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING }, + { wxT("wxLC_ICON"), wxLC_ICON }, + { wxT("wxLC_SMALL_ICON"), wxLC_SMALL_ICON }, + { wxT("wxLC_LIST"), wxLC_LIST }, + { wxT("wxLC_REPORT"), wxLC_REPORT }, + { wxT("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP }, + { wxT("wxLC_ALIGN_LEFT"), wxLC_ALIGN_LEFT }, + { wxT("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE }, + { wxT("wxLC_USER_TEXT"), wxLC_USER_TEXT }, + { wxT("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS }, + { wxT("wxLC_NO_HEADER"), wxLC_NO_HEADER }, + { wxT("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER }, + { wxT("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL }, + { wxT("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING }, + { wxT("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING }, /* wxSpinButton */ - { _T("wxSP_VERTICAL"), wxSP_VERTICAL}, - { _T("wxSP_HORIZONTAL"), wxSP_HORIZONTAL}, - { _T("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS}, - { _T("wxSP_WRAP"), wxSP_WRAP}, + { wxT("wxSP_VERTICAL"), wxSP_VERTICAL}, + { wxT("wxSP_HORIZONTAL"), wxSP_HORIZONTAL}, + { wxT("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS}, + { wxT("wxSP_WRAP"), wxSP_WRAP}, /* wxSplitterWnd */ - { _T("wxSP_NOBORDER"), wxSP_NOBORDER}, - { _T("wxSP_3D"), wxSP_3D}, - { _T("wxSP_BORDER"), wxSP_BORDER}, + { wxT("wxSP_NOBORDER"), wxSP_NOBORDER}, + { wxT("wxSP_3D"), wxSP_3D}, + { wxT("wxSP_BORDER"), wxSP_BORDER}, /* wxTabCtrl */ - { _T("wxTC_MULTILINE"), wxTC_MULTILINE}, - { _T("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY}, - { _T("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH}, - { _T("wxTC_OWNERDRAW"), wxTC_OWNERDRAW}, + { wxT("wxTC_MULTILINE"), wxTC_MULTILINE}, + { wxT("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY}, + { wxT("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH}, + { wxT("wxTC_OWNERDRAW"), wxTC_OWNERDRAW}, /* wxStatusBar95 */ - { _T("wxST_SIZEGRIP"), wxST_SIZEGRIP}, + { wxT("wxST_SIZEGRIP"), wxST_SIZEGRIP}, /* wxControl */ - { _T("wxFIXED_LENGTH"), wxFIXED_LENGTH}, - { _T("wxALIGN_LEFT"), wxALIGN_LEFT}, - { _T("wxALIGN_CENTER"), wxALIGN_CENTER}, - { _T("wxALIGN_CENTRE"), wxALIGN_CENTRE}, - { _T("wxALIGN_RIGHT"), wxALIGN_RIGHT}, - { _T("wxCOLOURED"), wxCOLOURED}, + { wxT("wxFIXED_LENGTH"), wxFIXED_LENGTH}, + { wxT("wxALIGN_LEFT"), wxALIGN_LEFT}, + { wxT("wxALIGN_CENTER"), wxALIGN_CENTER}, + { wxT("wxALIGN_CENTRE"), wxALIGN_CENTRE}, + { wxT("wxALIGN_RIGHT"), wxALIGN_RIGHT}, + { wxT("wxCOLOURED"), wxCOLOURED}, /* wxToolBar */ - { _T("wxTB_3DBUTTONS"), wxTB_3DBUTTONS}, - { _T("wxTB_HORIZONTAL"), wxTB_HORIZONTAL}, - { _T("wxTB_VERTICAL"), wxTB_VERTICAL}, - { _T("wxTB_FLAT"), wxTB_FLAT}, + { wxT("wxTB_3DBUTTONS"), wxTB_3DBUTTONS}, + { wxT("wxTB_HORIZONTAL"), wxTB_HORIZONTAL}, + { wxT("wxTB_VERTICAL"), wxTB_VERTICAL}, + { wxT("wxTB_FLAT"), wxTB_FLAT}, + + /* wxDialog */ + { wxT("wxDIALOG_MODAL"), wxDIALOG_MODAL }, /* Generic */ - { _T("wxVSCROLL"), wxVSCROLL }, - { _T("wxHSCROLL"), wxHSCROLL }, - { _T("wxCAPTION"), wxCAPTION }, - { _T("wxSTAY_ON_TOP"), wxSTAY_ON_TOP}, - { _T("wxICONIZE"), wxICONIZE}, - { _T("wxMINIMIZE"), wxICONIZE}, - { _T("wxMAXIMIZE"), wxMAXIMIZE}, - { _T("wxSDI"), 0}, - { _T("wxMDI_PARENT"), 0}, - { _T("wxMDI_CHILD"), 0}, - { _T("wxTHICK_FRAME"), wxTHICK_FRAME}, - { _T("wxRESIZE_BORDER"), wxRESIZE_BORDER}, - { _T("wxSYSTEM_MENU"), wxSYSTEM_MENU}, - { _T("wxMINIMIZE_BOX"), wxMINIMIZE_BOX}, - { _T("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX}, - { _T("wxRESIZE_BOX"), wxRESIZE_BOX}, - { _T("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE}, - { _T("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE}, - { _T("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE}, - { _T("wxBORDER"), wxBORDER}, - { _T("wxRETAINED"), wxRETAINED}, - { _T("wxNATIVE_IMPL"), 0}, - { _T("wxEXTENDED_IMPL"), 0}, - { _T("wxBACKINGSTORE"), wxBACKINGSTORE}, -// { _T("wxFLAT"), wxFLAT}, -// { _T("wxMOTIF_RESIZE"), wxMOTIF_RESIZE}, - { _T("wxFIXED_LENGTH"), 0}, - { _T("wxDOUBLE_BORDER"), wxDOUBLE_BORDER}, - { _T("wxSUNKEN_BORDER"), wxSUNKEN_BORDER}, - { _T("wxRAISED_BORDER"), wxRAISED_BORDER}, - { _T("wxSIMPLE_BORDER"), wxSIMPLE_BORDER}, - { _T("wxSTATIC_BORDER"), wxSTATIC_BORDER}, - { _T("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW}, - { _T("wxNO_BORDER"), wxNO_BORDER}, - { _T("wxCLIP_CHILDREN"), wxCLIP_CHILDREN}, - - { _T("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ}, - { _T("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT}, + { wxT("wxVSCROLL"), wxVSCROLL }, + { wxT("wxHSCROLL"), wxHSCROLL }, + { wxT("wxCAPTION"), wxCAPTION }, + { wxT("wxSTAY_ON_TOP"), wxSTAY_ON_TOP}, + { wxT("wxICONIZE"), wxICONIZE}, + { wxT("wxMINIMIZE"), wxICONIZE}, + { wxT("wxMAXIMIZE"), wxMAXIMIZE}, + { wxT("wxSDI"), 0}, + { wxT("wxMDI_PARENT"), 0}, + { wxT("wxMDI_CHILD"), 0}, + { wxT("wxTHICK_FRAME"), wxTHICK_FRAME}, + { wxT("wxRESIZE_BORDER"), wxRESIZE_BORDER}, + { wxT("wxSYSTEM_MENU"), wxSYSTEM_MENU}, + { wxT("wxMINIMIZE_BOX"), wxMINIMIZE_BOX}, + { wxT("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX}, + { wxT("wxRESIZE_BOX"), wxRESIZE_BOX}, + { wxT("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE}, + { wxT("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE}, + { wxT("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE}, + { wxT("wxBORDER"), wxBORDER}, + { wxT("wxRETAINED"), wxRETAINED}, + { wxT("wxNATIVE_IMPL"), 0}, + { wxT("wxEXTENDED_IMPL"), 0}, + { wxT("wxBACKINGSTORE"), wxBACKINGSTORE}, +// { wxT("wxFLAT"), wxFLAT}, +// { wxT("wxMOTIF_RESIZE"), wxMOTIF_RESIZE}, + { wxT("wxFIXED_LENGTH"), 0}, + { wxT("wxDOUBLE_BORDER"), wxDOUBLE_BORDER}, + { wxT("wxSUNKEN_BORDER"), wxSUNKEN_BORDER}, + { wxT("wxRAISED_BORDER"), wxRAISED_BORDER}, + { wxT("wxSIMPLE_BORDER"), wxSIMPLE_BORDER}, + { wxT("wxSTATIC_BORDER"), wxSTATIC_BORDER}, + { wxT("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW}, + { wxT("wxNO_BORDER"), wxNO_BORDER}, + { wxT("wxCLIP_CHILDREN"), wxCLIP_CHILDREN}, + { wxT("wxTAB_TRAVERSAL"), 0}, // Compatibility only + + { wxT("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ}, + { wxT("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT}, // Text font families - { _T("wxDEFAULT"), wxDEFAULT}, - { _T("wxDECORATIVE"), wxDECORATIVE}, - { _T("wxROMAN"), wxROMAN}, - { _T("wxSCRIPT"), wxSCRIPT}, - { _T("wxSWISS"), wxSWISS}, - { _T("wxMODERN"), wxMODERN}, - { _T("wxTELETYPE"), wxTELETYPE}, - { _T("wxVARIABLE"), wxVARIABLE}, - { _T("wxFIXED"), wxFIXED}, - { _T("wxNORMAL"), wxNORMAL}, - { _T("wxLIGHT"), wxLIGHT}, - { _T("wxBOLD"), wxBOLD}, - { _T("wxITALIC"), wxITALIC}, - { _T("wxSLANT"), wxSLANT}, - { _T("wxSOLID"), wxSOLID}, - { _T("wxDOT"), wxDOT}, - { _T("wxLONG_DASH"), wxLONG_DASH}, - { _T("wxSHORT_DASH"), wxSHORT_DASH}, - { _T("wxDOT_DASH"), wxDOT_DASH}, - { _T("wxUSER_DASH"), wxUSER_DASH}, - { _T("wxTRANSPARENT"), wxTRANSPARENT}, - { _T("wxSTIPPLE"), wxSTIPPLE}, - { _T("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH}, - { _T("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH}, - { _T("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH}, - { _T("wxCROSS_HATCH"), wxCROSS_HATCH}, - { _T("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH}, - { _T("wxVERTICAL_HATCH"), wxVERTICAL_HATCH}, - { _T("wxJOIN_BEVEL"), wxJOIN_BEVEL}, - { _T("wxJOIN_MITER"), wxJOIN_MITER}, - { _T("wxJOIN_ROUND"), wxJOIN_ROUND}, - { _T("wxCAP_ROUND"), wxCAP_ROUND}, - { _T("wxCAP_PROJECTING"), wxCAP_PROJECTING}, - { _T("wxCAP_BUTT"), wxCAP_BUTT}, + { wxT("wxDEFAULT"), wxDEFAULT}, + { wxT("wxDECORATIVE"), wxDECORATIVE}, + { wxT("wxROMAN"), wxROMAN}, + { wxT("wxSCRIPT"), wxSCRIPT}, + { wxT("wxSWISS"), wxSWISS}, + { wxT("wxMODERN"), wxMODERN}, + { wxT("wxTELETYPE"), wxTELETYPE}, + { wxT("wxVARIABLE"), wxVARIABLE}, + { wxT("wxFIXED"), wxFIXED}, + { wxT("wxNORMAL"), wxNORMAL}, + { wxT("wxLIGHT"), wxLIGHT}, + { wxT("wxBOLD"), wxBOLD}, + { wxT("wxITALIC"), wxITALIC}, + { wxT("wxSLANT"), wxSLANT}, + { wxT("wxSOLID"), wxSOLID}, + { wxT("wxDOT"), wxDOT}, + { wxT("wxLONG_DASH"), wxLONG_DASH}, + { wxT("wxSHORT_DASH"), wxSHORT_DASH}, + { wxT("wxDOT_DASH"), wxDOT_DASH}, + { wxT("wxUSER_DASH"), wxUSER_DASH}, + { wxT("wxTRANSPARENT"), wxTRANSPARENT}, + { wxT("wxSTIPPLE"), wxSTIPPLE}, + { wxT("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH}, + { wxT("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH}, + { wxT("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH}, + { wxT("wxCROSS_HATCH"), wxCROSS_HATCH}, + { wxT("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH}, + { wxT("wxVERTICAL_HATCH"), wxVERTICAL_HATCH}, + { wxT("wxJOIN_BEVEL"), wxJOIN_BEVEL}, + { wxT("wxJOIN_MITER"), wxJOIN_MITER}, + { wxT("wxJOIN_ROUND"), wxJOIN_ROUND}, + { wxT("wxCAP_ROUND"), wxCAP_ROUND}, + { wxT("wxCAP_PROJECTING"), wxCAP_PROJECTING}, + { wxT("wxCAP_BUTT"), wxCAP_BUTT}, // Logical ops - { _T("wxCLEAR"), wxCLEAR}, - { _T("wxXOR"), wxXOR}, - { _T("wxINVERT"), wxINVERT}, - { _T("wxOR_REVERSE"), wxOR_REVERSE}, - { _T("wxAND_REVERSE"), wxAND_REVERSE}, - { _T("wxCOPY"), wxCOPY}, - { _T("wxAND"), wxAND}, - { _T("wxAND_INVERT"), wxAND_INVERT}, - { _T("wxNO_OP"), wxNO_OP}, - { _T("wxNOR"), wxNOR}, - { _T("wxEQUIV"), wxEQUIV}, - { _T("wxSRC_INVERT"), wxSRC_INVERT}, - { _T("wxOR_INVERT"), wxOR_INVERT}, - { _T("wxNAND"), wxNAND}, - { _T("wxOR"), wxOR}, - { _T("wxSET"), wxSET}, - - { _T("wxFLOOD_SURFACE"), wxFLOOD_SURFACE}, - { _T("wxFLOOD_BORDER"), wxFLOOD_BORDER}, - { _T("wxODDEVEN_RULE"), wxODDEVEN_RULE}, - { _T("wxWINDING_RULE"), wxWINDING_RULE}, - { _T("wxHORIZONTAL"), wxHORIZONTAL}, - { _T("wxVERTICAL"), wxVERTICAL}, - { _T("wxBOTH"), wxBOTH}, - { _T("wxCENTER_FRAME"), wxCENTER_FRAME}, - { _T("wxOK"), wxOK}, - { _T("wxYES_NO"), wxYES_NO}, - { _T("wxCANCEL"), wxCANCEL}, - { _T("wxYES"), wxYES}, - { _T("wxNO"), wxNO}, - { _T("wxICON_EXCLAMATION"), wxICON_EXCLAMATION}, - { _T("wxICON_HAND"), wxICON_HAND}, - { _T("wxICON_QUESTION"), wxICON_QUESTION}, - { _T("wxICON_INFORMATION"), wxICON_INFORMATION}, - { _T("wxICON_STOP"), wxICON_STOP}, - { _T("wxICON_ASTERISK"), wxICON_ASTERISK}, - { _T("wxICON_MASK"), wxICON_MASK}, - { _T("wxCENTRE"), wxCENTRE}, - { _T("wxCENTER"), wxCENTRE}, - { _T("wxUSER_COLOURS"), wxUSER_COLOURS}, - { _T("wxVERTICAL_LABEL"), 0}, - { _T("wxHORIZONTAL_LABEL"), 0}, + { wxT("wxCLEAR"), wxCLEAR}, + { wxT("wxXOR"), wxXOR}, + { wxT("wxINVERT"), wxINVERT}, + { wxT("wxOR_REVERSE"), wxOR_REVERSE}, + { wxT("wxAND_REVERSE"), wxAND_REVERSE}, + { wxT("wxCOPY"), wxCOPY}, + { wxT("wxAND"), wxAND}, + { wxT("wxAND_INVERT"), wxAND_INVERT}, + { wxT("wxNO_OP"), wxNO_OP}, + { wxT("wxNOR"), wxNOR}, + { wxT("wxEQUIV"), wxEQUIV}, + { wxT("wxSRC_INVERT"), wxSRC_INVERT}, + { wxT("wxOR_INVERT"), wxOR_INVERT}, + { wxT("wxNAND"), wxNAND}, + { wxT("wxOR"), wxOR}, + { wxT("wxSET"), wxSET}, + + { wxT("wxFLOOD_SURFACE"), wxFLOOD_SURFACE}, + { wxT("wxFLOOD_BORDER"), wxFLOOD_BORDER}, + { wxT("wxODDEVEN_RULE"), wxODDEVEN_RULE}, + { wxT("wxWINDING_RULE"), wxWINDING_RULE}, + { wxT("wxHORIZONTAL"), wxHORIZONTAL}, + { wxT("wxVERTICAL"), wxVERTICAL}, + { wxT("wxBOTH"), wxBOTH}, + { wxT("wxCENTER_FRAME"), wxCENTER_FRAME}, + { wxT("wxOK"), wxOK}, + { wxT("wxYES_NO"), wxYES_NO}, + { wxT("wxCANCEL"), wxCANCEL}, + { wxT("wxYES"), wxYES}, + { wxT("wxNO"), wxNO}, + { wxT("wxICON_EXCLAMATION"), wxICON_EXCLAMATION}, + { wxT("wxICON_HAND"), wxICON_HAND}, + { wxT("wxICON_QUESTION"), wxICON_QUESTION}, + { wxT("wxICON_INFORMATION"), wxICON_INFORMATION}, + { wxT("wxICON_STOP"), wxICON_STOP}, + { wxT("wxICON_ASTERISK"), wxICON_ASTERISK}, + { wxT("wxICON_MASK"), wxICON_MASK}, + { wxT("wxCENTRE"), wxCENTRE}, + { wxT("wxCENTER"), wxCENTRE}, + { wxT("wxUSER_COLOURS"), wxUSER_COLOURS}, + { wxT("wxVERTICAL_LABEL"), 0}, + { wxT("wxHORIZONTAL_LABEL"), 0}, // Bitmap types (not strictly styles) - { _T("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM}, - { _T("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM}, - { _T("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP}, - { _T("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, - { _T("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, - { _T("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF}, - { _T("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF}, - { _T("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO}, - { _T("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE}, - { _T("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR}, - { _T("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE}, - { _T("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA}, - { _T("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA}, - { _T("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY} + { wxT("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM}, + { wxT("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM}, + { wxT("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP}, + { wxT("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, + { wxT("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, + { wxT("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF}, + { wxT("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF}, + { wxT("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO}, + { wxT("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE}, + { wxT("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR}, + { wxT("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE}, + { wxT("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA}, + { wxT("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA}, + { wxT("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY} }; static int wxResourceBitListCount = (sizeof(wxResourceBitListTable)/sizeof(wxResourceBitListStruct)); @@ -2037,7 +2045,8 @@ long wxParseWindowStyle(const wxString& bitListString) int i = 0; wxChar *word; long bitList = 0; - while ((word = wxResourceParseWord(WXSTRINGCAST bitListString, &i))) + word = wxResourceParseWord(WXSTRINGCAST bitListString, &i); + while (word != NULL) { bool found = FALSE; int j; @@ -2053,6 +2062,7 @@ long wxParseWindowStyle(const wxString& bitListString) wxLogWarning(_("Unrecognized style %s whilst parsing resource."), word); return 0; } + word = wxResourceParseWord(WXSTRINGCAST bitListString, &i); } return bitList; } @@ -2070,7 +2080,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table wxItemResource *item = table->FindResource(resource); if (item) { - if ((item->GetType() == _T("")) || (item->GetType() != _T("wxBitmap"))) + if ((item->GetType() == wxT("")) || (item->GetType() != wxT("wxBitmap"))) { wxLogWarning(_("%s not a bitmap resource specification."), (const wxChar*) resource); return wxNullBitmap; @@ -2225,7 +2235,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) wxItemResource *item = table->FindResource(resource); if (item) { - if ((item->GetType() == _T("")) || wxStrcmp(item->GetType(), _T("wxIcon")) != 0) + if ((item->GetType() == wxT("")) || wxStrcmp(item->GetType(), wxT("wxIcon")) != 0) { wxLogWarning(_("%s not an icon resource specification."), (const wxChar*) resource); return wxNullIcon; @@ -2383,7 +2393,7 @@ wxMenu *wxResourceCreateMenu(wxItemResource *item) while (node) { wxItemResource *child = (wxItemResource *)node->Data(); - if ((child->GetType() != _T("")) && (child->GetType() == _T("wxMenuSeparator"))) + if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator"))) menu->AppendSeparator(); else if (child->GetChildren().Number() > 0) { @@ -2406,7 +2416,7 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta table = wxDefaultResourceTable; wxItemResource *menuResource = table->FindResource(resource); - if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu"))) + if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu"))) { if (!menuBar) menuBar = new wxMenuBar; @@ -2430,7 +2440,7 @@ wxMenu *wxResourceCreateMenu(const wxString& resource, wxResourceTable *table) table = wxDefaultResourceTable; wxItemResource *menuResource = table->FindResource(resource); - if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu"))) + if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu"))) // if (menuResource && (menuResource->GetType() == wxTYPE_MENU)) return wxResourceCreateMenu(menuResource); return (wxMenu *) NULL; @@ -2487,7 +2497,7 @@ bool wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *t if (!table) table = wxDefaultResourceTable; - table->identifiers.Put(name, (wxObject *)value); + table->identifiers.Put(name, (wxObject *)(long)value); return TRUE; } @@ -2496,7 +2506,7 @@ int wxResourceGetIdentifier(const wxString& name, wxResourceTable *table) if (!table) table = wxDefaultResourceTable; - return (int)table->identifiers.Get(name); + return (int)(long)table->identifiers.Get(name); } /* @@ -2518,9 +2528,9 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table) if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceToken(fd); - wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); + wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); wxGetResourceToken(fd); - wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); + wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); if (wxIsdigit(value[0])) { int val = (int)wxAtol(value); @@ -2601,7 +2611,7 @@ bool wxEatWhiteSpaceString(char *s) default: ungetc_string(); return TRUE; - + } } return FALSE; @@ -2691,10 +2701,10 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceTokenString(s); - wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); + wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); wxGetResourceTokenString(s); - wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer)); - if (wxIsalpha(value[0])) + wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); + if (wxIsdigit(value[0])) { int val = (int)wxAtol(value); wxResourceAddIdentifier(name, val, table); @@ -2736,7 +2746,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR { wxChar buf[300]; wxStrcpy(buf, _("Found ")); - wxStrncat(buf, wxConv_libc.cMB2WX(wxResourceBuffer), 30); + wxStrncat(buf, wxConvCurrent->cMB2WX(wxResourceBuffer), 30); wxStrcat(buf, _(", expected static, #include or #define\nwhilst parsing resource.")); wxLogWarning(buf); return FALSE; @@ -2846,15 +2856,15 @@ bool wxResourceParseString(char *s, wxResourceTable *table) * resource loading facility */ -bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table) +bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; wxItemResource *resource = table->FindResource((const wxChar *)resourceName); // if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX)) - if (!resource || (resource->GetType() == _T("")) || - ! ((resource->GetType() == _T("wxDialog")) || (resource->GetType() == _T("wxPanel")))) + if (!resource || (resource->GetType() == wxT("")) || + ! ((resource->GetType() == wxT("wxDialog")) || (resource->GetType() == wxT("wxPanel")))) return FALSE; wxString title(resource->GetTitle()); @@ -2885,7 +2895,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, } else { - if (!this->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name)) + if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name)) return FALSE; } @@ -2932,7 +2942,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, return TRUE; } -wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table) +wxControl *wxWindowBase::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table) { if (!table) table = wxDefaultResourceTable;