// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include "wx/validate.h"
+#include "wx/log.h"
+
#if USE_WX_RESOURCES
#include <ctype.h>
delete wxDefaultResourceTable;
}
-void wxWarning(char *msg)
+void wxLogWarning(char *msg)
{
- wxMessageBox(msg, "Warning", wxOK);
+ wxMessageBox(msg, _("Warning"), wxOK);
}
#if !USE_SHARED_LIBRARY
PrologDatabase db;
if (!db.ReadPrologFromString(data))
{
- wxWarning("Ill-formed resource file syntax.");
+ wxLogWarning(_("Ill-formed resource file syntax."));
return FALSE;
}
{
int id = childResource->GetId();
if ( id == 0 )
- id = -1;
+ id = -1;
wxControl *control = NULL;
wxString itemType(childResource->GetType());
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())
{
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
}
{
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());
}
}
{
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));
{
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());
{
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
{
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"))
}
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)
}
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)
}
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)
node = node->Next();
}
}
- control = new wxRadioBox(parent, (const wxWindowID) id, wxString(childResource->GetTitle()),
+ 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;
while (node)
{
PrologExpr *clause = (PrologExpr *)node->Data();
- wxString functor(clause->Functor());
+ wxString functor(clause->Functor());
wxItemResource *item = NULL;
if (functor == "dialog")
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)
expr->AssignAttributeValue("label_colour", &labelColourHex);
expr->AssignAttributeValue("button_colour", &buttonColourHex);
+ long id = 0;
+ expr->GetAttributeValue("id", id);
+ dialogItem->SetId(id);
+
if (style)
{
windowStyle = wxParseWindowStyle(style);
if ( expr1->Type() == PrologString || expr1->Type() == PrologWord )
{
- if ( wxIsValidControlClass(expr1->StringValue()) )
- {
- count = 1;
- controlType = expr1->StringValue();
- }
- else
- {
- id = wxResourceGetIdentifier(WXSTRINGCAST expr1->StringValue(), &table);
+ 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 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 ++;
// Check for bitmap resource name
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
{
- controlItem->SetValue4(WXSTRINGCAST expr->Nth(count)->StringValue());
- count ++;
- if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
- controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+ wxString str(expr->Nth(count)->StringValue());
+ controlItem->SetValue4(WXSTRINGCAST str);
+ count ++;
+ if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
+ controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
}
else if (controlType == "wxCheckBox")
{
// 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)));
}
{
// 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)));
}
{
// Check for default value
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
- {
- controlItem->SetValue4(WXSTRINGCAST expr->Nth(count)->StringValue());
- count ++;
+ {
+ wxString str(expr->Nth(count)->StringValue());
+ controlItem->SetValue4(WXSTRINGCAST str);
+ 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")
{
// Check for bitmap resource name
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
{
- controlItem->SetValue4(WXSTRINGCAST expr->Nth(count)->StringValue());
+ wxString str(expr->Nth(count)->StringValue());
+ controlItem->SetValue4(WXSTRINGCAST str);
count ++;
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
{
// 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")
{
stringExpr = stringExpr->GetNext();
}
controlItem->SetStringValues(stringList);
- count ++;
+ count ++;
// Check for wxSINGLE/wxMULTIPLE
PrologExpr *mult = NULL;
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")
{
}
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))
- {
- controlItem->SetValue4(WXSTRINGCAST textValue->StringValue());
+ {
+ wxString str(textValue->StringValue());
+ controlItem->SetValue4(WXSTRINGCAST str);
- count ++;
+ count ++;
PrologExpr *valueList = NULL;
// Check for default value list
}
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
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
item->SetType("wxMenu"); // Well, menu item, but doesn't matter.
if (labelExpr)
{
- item->SetTitle(WXSTRINGCAST labelExpr->StringValue());
+ wxString str(labelExpr->StringValue());
+ item->SetTitle(WXSTRINGCAST str);
}
if (idExpr)
{
// If a string or word, must look up in identifier table.
if ((idExpr->Type() == PrologString) || (idExpr->Type() == PrologWord))
{
- id = wxResourceGetIdentifier(WXSTRINGCAST idExpr->StringValue(), &table);
+ wxString str(idExpr->StringValue());
+ 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)
}
if (helpExpr)
{
- item->SetValue4(WXSTRINGCAST helpExpr->StringValue());
+ wxString str(helpExpr->StringValue());
+ item->SetValue4(WXSTRINGCAST str);
}
if (checkableExpr)
item->SetValue2(checkableExpr->IntegerValue());
PrologExpr *xresExpr = listExpr->Nth(4);
PrologExpr *yresExpr = listExpr->Nth(5);
if (nameExpr && nameExpr->StringValue())
- bitmapSpec->SetName(WXSTRINGCAST nameExpr->StringValue());
+ {
+ wxString str(nameExpr->StringValue());
+ bitmapSpec->SetName(WXSTRINGCAST str);
+ }
if (typeExpr && typeExpr->StringValue())
- bitmapSpec->SetValue1(wxParseWindowStyle(WXSTRINGCAST typeExpr->StringValue()));
+ {
+ wxString str(typeExpr->StringValue());
+ bitmapSpec->SetValue1(wxParseWindowStyle(WXSTRINGCAST str));
+ }
else
bitmapSpec->SetValue1(0);
PrologExpr *faceNameExpr = expr->Nth(5);
if (pointExpr)
point = (int)pointExpr->IntegerValue();
+
+ wxString str;
if (familyExpr)
- family = (int)wxParseWindowStyle(WXSTRINGCAST familyExpr->StringValue());
+ {
+ str = familyExpr->StringValue();
+ family = (int)wxParseWindowStyle(WXSTRINGCAST str);
+ }
if (styleExpr)
- style = (int)wxParseWindowStyle(WXSTRINGCAST styleExpr->StringValue());
+ {
+ str = styleExpr->StringValue();
+ style = (int)wxParseWindowStyle(WXSTRINGCAST str);
+ }
if (weightExpr)
- weight = (int)wxParseWindowStyle(WXSTRINGCAST weightExpr->StringValue());
+ {
+ str = weightExpr->StringValue();
+ weight = (int)wxParseWindowStyle(WXSTRINGCAST str);
+ }
if (underlineExpr)
underline = (int)underlineExpr->IntegerValue();
if (faceNameExpr)
}
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;
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;
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];
// =
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;
}
{
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;
}
}
{ "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 },
+ { "wxLB_OWNERDRAW", wxLB_OWNERDRAW },
+ { "wxLB_HSCROLL", wxLB_HSCROLL },
/* wxComboxBox */
{ "wxCB_SIMPLE", wxCB_SIMPLE },
{ "wxCB_DROPDOWN", wxCB_DROPDOWN },
+ { "wxCB_READONLY", wxCB_READONLY },
{ "wxCB_SORT", wxCB_SORT },
/* wxGauge */
{ "wxGA_PROGRESSBAR", wxGA_PROGRESSBAR },
+ { "wxGA_HORIZONTAL", wxGA_HORIZONTAL },
+ { "wxGA_VERTICAL", wxGA_VERTICAL },
/* wxTextCtrl */
{ "wxPASSWORD", wxPASSWORD},
{ "wxTE_PASSWORD", wxTE_PASSWORD},
{ "wxTE_READONLY", wxTE_READONLY},
{ "wxTE_PROCESS_ENTER", wxTE_PROCESS_ENTER},
+ { "wxTE_MULTILINE", wxTE_MULTILINE},
- /* wxRadioButton */
+ /* wxRadioBox/wxRadioButton */
{ "wxRB_GROUP", wxRB_GROUP },
-
- /* wxItem */
+ { "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
+ { "wxRA_VERTICAL", wxRA_VERTICAL },
+
+ /* wxSlider */
+ { "wxSL_HORIZONTAL", wxSL_HORIZONTAL },
+ { "wxSL_VERTICAL", wxSL_VERTICAL },
+ { "wxSL_AUTOTICKS", wxSL_AUTOTICKS },
+ { "wxSL_LABELS", wxSL_LABELS },
+ { "wxSL_LEFT", wxSL_LEFT },
+ { "wxSL_TOP", wxSL_TOP },
+ { "wxSL_RIGHT", wxSL_RIGHT },
+ { "wxSL_BOTTOM", wxSL_BOTTOM },
+ { "wxSL_BOTH", wxSL_BOTH },
+ { "wxSL_SELRANGE", wxSL_SELRANGE },
+
+ /* wxScrollBar */
+ { "wxSB_HORIZONTAL", wxSB_HORIZONTAL },
+ { "wxSB_VERTICAL", wxSB_VERTICAL },
+
+ /* wxButton */
+ { "wxBU_AUTODRAW", wxBU_AUTODRAW },
+ { "wxBU_NOAUTODRAW", wxBU_NOAUTODRAW },
+
+ /* wxTreeCtrl */
+ { "wxTR_HAS_BUTTONS", wxTR_HAS_BUTTONS },
+ { "wxTR_EDIT_LABELS", wxTR_EDIT_LABELS },
+ { "wxTR_LINES_AT_ROOT", wxTR_LINES_AT_ROOT },
+
+ /* wxListCtrl */
+ { "wxLC_ICON", wxLC_ICON },
+ { "wxLC_SMALL_ICON", wxLC_SMALL_ICON },
+ { "wxLC_LIST", wxLC_LIST },
+ { "wxLC_REPORT", wxLC_REPORT },
+ { "wxLC_ALIGN_TOP", wxLC_ALIGN_TOP },
+ { "wxLC_ALIGN_LEFT", wxLC_ALIGN_LEFT },
+ { "wxLC_AUTOARRANGE", wxLC_AUTOARRANGE },
+ { "wxLC_USER_TEXT", wxLC_USER_TEXT },
+ { "wxLC_EDIT_LABELS", wxLC_EDIT_LABELS },
+ { "wxLC_NO_HEADER", wxLC_NO_HEADER },
+ { "wxLC_NO_SORT_HEADER", wxLC_NO_SORT_HEADER },
+ { "wxLC_SINGLE_SEL", wxLC_SINGLE_SEL },
+ { "wxLC_SORT_ASCENDING", wxLC_SORT_ASCENDING },
+ { "wxLC_SORT_DESCENDING", wxLC_SORT_DESCENDING },
+
+ /* wxSpinButton */
+ { "wxSP_VERTICAL", wxSP_VERTICAL},
+ { "wxSP_HORIZONTAL", wxSP_HORIZONTAL},
+ { "wxSP_ARROW_KEYS", wxSP_ARROW_KEYS},
+ { "wxSP_WRAP", wxSP_WRAP},
+
+ /* wxSplitterWnd */
+ { "wxSP_NOBORDER", wxSP_NOBORDER},
+ { "wxSP_3D", wxSP_3D},
+ { "wxSP_BORDER", wxSP_BORDER},
+
+ /* wxTabCtrl */
+ { "wxTC_MULTILINE", wxTC_MULTILINE},
+ { "wxTC_RIGHTJUSTIFY", wxTC_RIGHTJUSTIFY},
+ { "wxTC_FIXEDWIDTH", wxTC_FIXEDWIDTH},
+ { "wxTC_OWNERDRAW", wxTC_OWNERDRAW},
+
+ /* wxStatusBar95 */
+ { "wxST_SIZEGRIP", wxST_SIZEGRIP},
+
+ /* wxControl */
{ "wxFIXED_LENGTH", wxFIXED_LENGTH},
{ "wxALIGN_LEFT", wxALIGN_LEFT},
{ "wxALIGN_CENTER", wxALIGN_CENTER},
{ "wxALIGN_CENTRE", wxALIGN_CENTRE},
{ "wxALIGN_RIGHT", wxALIGN_RIGHT},
+ { "wxCOLOURED", wxCOLOURED},
/* wxToolBar */
{ "wxTB_3DBUTTONS", wxTB_3DBUTTONS},
+ { "wxTB_HORIZONTAL", wxTB_HORIZONTAL},
+ { "wxTB_VERTICAL", wxTB_VERTICAL},
+ { "wxTB_FLAT", wxTB_FLAT},
/* Generic */
{ "wxVSCROLL", wxVSCROLL },
{ "wxDEFAULT_DIALOG_STYLE", wxDEFAULT_DIALOG_STYLE},
{ "wxBORDER", wxBORDER},
{ "wxRETAINED", wxRETAINED},
- { "wxEDITABLE", wxEDITABLE},
- { "wxREADONLY", wxREADONLY},
{ "wxNATIVE_IMPL", 0},
{ "wxEXTENDED_IMPL", 0},
{ "wxBACKINGSTORE", wxBACKINGSTORE},
// { "wxFLAT", wxFLAT},
// { "wxMOTIF_RESIZE", wxMOTIF_RESIZE},
- { "wxFIXED_LENGTH", wxFIXED_LENGTH},
+ { "wxFIXED_LENGTH", 0},
+ { "wxDOUBLE_BORDER", wxDOUBLE_BORDER},
+ { "wxSUNKEN_BORDER", wxSUNKEN_BORDER},
+ { "wxRAISED_BORDER", wxRAISED_BORDER},
+ { "wxSIMPLE_BORDER", wxSIMPLE_BORDER},
+ { "wxSTATIC_BORDER", wxSTATIC_BORDER},
+ { "wxTRANSPARENT_WINDOW", wxTRANSPARENT_WINDOW},
+ { "wxNO_BORDER", wxNO_BORDER},
+ { "wxCLIP_CHILDREN", wxCLIP_CHILDREN},
-#if USE_ENHANCED_DIALOG
- // Enhanced dialog
- { "wxBOTTOM_COMMANDS", wxBOTTOM_COMMANDS},
- { "wxRIGHT_COMMANDS", wxRIGHT_COMMANDS},
- { "wxSTATUS_FOOTER", wxSTATUS_FOOTER},
- { "wxNO_STATUS_FOOTER", wxNO_STATUS_FOOTER},
- { "wxNO_CANCEL_BUTTON", wxNO_CANCEL_BUTTON},
- { "wxCANCEL_BUTTON_FIRST", wxCANCEL_BUTTON_FIRST},
- { "wxCANCEL_BUTTON_SECOND", wxCANCEL_BUTTON_SECOND},
- { "wxCANCEL_BUTTON_LAST", wxCANCEL_BUTTON_LAST},
- { "wxENH_DEFAULT", wxENH_DEFAULT},
-#endif
-
- { "wxCOLOURED", wxCOLOURED},
{ "wxTINY_CAPTION_HORIZ", wxTINY_CAPTION_HORIZ},
{ "wxTINY_CAPTION_VERT", wxTINY_CAPTION_VERT},
}
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;
}
}
{
if (!item->GetType() || strcmp(item->GetType(), "wxBitmap") != 0)
{
- char buf[300];
- sprintf(buf, "%s not a bitmap resource specification.", resource);
- wxWarning(buf);
+ wxLogWarning(_("%s not a bitmap resource specification."), resource);
return NULL;
}
int thisDepth = wxDisplayDepth();
}
break;
}
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
case RESOURCE_PLATFORM_WINDOWS:
{
if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
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);
+ wxLogWarning(_("Failed to find XBM resource %s.\n"
+ "Forgot to use wxResourceLoadBitmapData?"), name);
return 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(__WINDOWS__) && USE_XPM_IN_MSW)
+#if (defined(__X__) && USE_XPM_IN_X) || (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);
+ wxLogWarning(_("Failed to find XPM resource %s.\n"
+ "Forgot to use wxResourceLoadBitmapData?"), name);
return NULL;
}
bitmap = new wxBitmap(item->GetValue1());
#else
- wxWarning("No XPM facility available!");
+ wxLogWarning(_("No XPM facility available!"));
#endif
break;
}
}
else
{
- char buf[300];
- sprintf(buf, "Bitmap resource specification %s not found.", resource);
- wxWarning(buf);
+ wxLogWarning(_("Bitmap resource specification %s not found."), resource);
return NULL;
}
}
{
if (!item->GetType() || strcmp(item->GetType(), "wxIcon") != 0)
{
- char buf[300];
- sprintf(buf, "%s not an icon resource specification.", resource);
- wxWarning(buf);
+ wxLogWarning(_("%s not an icon resource specification."), resource);
return NULL;
}
int thisDepth = wxDisplayDepth();
}
break;
}
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
case RESOURCE_PLATFORM_WINDOWS:
{
if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
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);
+ wxLogWarning(_("Failed to find XBM resource %s.\n"
+ "Forgot to use wxResourceLoadIconData?"), name);
return NULL;
}
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;
}
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
-#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WINDOWS__) && USE_XPM_IN_MSW)
+#if (defined(__X__) && USE_XPM_IN_X) || (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:
}
else
{
- char buf[300];
- sprintf(buf, "Icon resource specification %s not found.", resource);
- wxWarning(buf);
+ wxLogWarning(_("Icon resource specification %s not found."), resource);
return NULL;
}
}
}
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;
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;
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];
// =
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;
}
{
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;
}
}
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);
}
else
{
if (resource->GetBackgroundColour())
SetBackgroundColour(*resource->GetBackgroundColour());
- // TODO
+ // TODO
if (resource->GetLabelColour())
SetForegroundColour(*resource->GetLabelColour());
else if (resource->GetButtonColour())