X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd71308fc89eac2dd212b715eba68a993fa78f53..7aa88ac4af764fa92c781056bc23103cadea21a4:/src/common/resource.cpp diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 9198586a1f..49c769a130 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -20,6 +20,12 @@ #pragma hdrstop #endif +#if wxUSE_WX_RESOURCES + +#ifdef _MSC_VER + #pragma warning(disable:4706) // assignment within conditional expression +#endif // VC++ + #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/setup.h" @@ -36,6 +42,7 @@ #include "wx/listbox.h" #include "wx/choice.h" #include "wx/checkbox.h" +#include "wx/settings.h" #include "wx/slider.h" #include "wx/statbox.h" #if wxUSE_GAUGE @@ -58,8 +65,6 @@ #include "wx/log.h" -#if wxUSE_WX_RESOURCES - #include #include #include @@ -69,6 +74,8 @@ #include "wx/string.h" #include "wx/wxexpr.h" +#include "wx/settings.h" + // Forward (private) declarations bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db); wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, bool isPanel = FALSE); @@ -957,26 +964,31 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } controlItem->SetStringValues(stringList); count ++; - +// This is now obsolete: it's in the window style. // Check for wxSINGLE/wxMULTIPLE wxExpr *mult = (wxExpr *) NULL; +/* controlItem->SetValue1(wxLB_SINGLE); +*/ if ((mult = expr->Nth(count)) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord))) { +/* wxString m(mult->StringValue()); - if (m == "wxMULTIPLE") + if (m == "wxLB_MULTIPLE") controlItem->SetValue1(wxLB_MULTIPLE); - else if (m == "wxEXTENDED") + else if (m == "wxLB_EXTENDED") controlItem->SetValue1(wxLB_EXTENDED); +*/ + // Ignore the value count ++; - if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - { - // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + { + // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); count ++; - if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); - } - } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } } } else if (controlType == "wxChoice") @@ -2241,7 +2253,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) "Forgot to use wxResourceLoadIconData?"), (const char*) name); return (wxIcon *) NULL; } - return wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); + return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()); #else wxLogWarning(_("No XBM facility available!")); #endif @@ -2845,4 +2857,8 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemReso return table->CreateItem((wxWindow *)this, resource, parentResource); } +#ifdef _MSC_VER + #pragma warning(default:4706) // assignment within conditional expression +#endif // VC++ + #endif // wxUSE_WX_RESOURCES