_T() -> wxT()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -168,7 +168,7 @@ class WXDLLEXPORT wxXmlNode
|
|||||||
class WXDLLEXPORT wxXmlDocument : public wxObject
|
class WXDLLEXPORT wxXmlDocument : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxXmlDocument() : wxObject(), m_Version(_T("1.0")), m_Root(NULL) {}
|
wxXmlDocument() : wxObject(), m_Version(wxT("1.0")), m_Root(NULL) {}
|
||||||
wxXmlDocument(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO);
|
wxXmlDocument(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||||
wxXmlDocument(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO);
|
wxXmlDocument(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||||
~wxXmlDocument() { delete m_Root; }
|
~wxXmlDocument() { delete m_Root; }
|
||||||
|
@@ -165,7 +165,7 @@ extern wxXmlResource *wxTheXmlResource;
|
|||||||
// END_EVENT_TABLE()
|
// END_EVENT_TABLE()
|
||||||
|
|
||||||
#define XMLID(str_id) \
|
#define XMLID(str_id) \
|
||||||
wxXmlResource::GetXMLID(_T(str_id))
|
wxXmlResource::GetXMLID(wxT(str_id))
|
||||||
|
|
||||||
|
|
||||||
// This macro returns pointer to particular control in dialog
|
// This macro returns pointer to particular control in dialog
|
||||||
@@ -174,7 +174,7 @@ extern wxXmlResource *wxTheXmlResource;
|
|||||||
// Example:
|
// Example:
|
||||||
// wxDialog dlg;
|
// wxDialog dlg;
|
||||||
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
|
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
|
||||||
// XMLCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(_T("default value"));
|
// XMLCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(wxT("default value"));
|
||||||
|
|
||||||
#define XMLCTRL(window, id, type) \
|
#define XMLCTRL(window, id, type) \
|
||||||
((type*)((window).FindWindow(XMLID(id))))
|
((type*)((window).FindWindow(XMLID(id))))
|
||||||
@@ -223,7 +223,7 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
|
|||||||
// Returns true if the node has property class equal to classname,
|
// Returns true if the node has property class equal to classname,
|
||||||
// e.g. <object class="wxDialog">
|
// e.g. <object class="wxDialog">
|
||||||
bool IsOfClass(wxXmlNode *node, const wxString& classname)
|
bool IsOfClass(wxXmlNode *node, const wxString& classname)
|
||||||
{ return node->GetPropVal(_T("class"), wxEmptyString) == classname; }
|
{ return node->GetPropVal(wxT("class"), wxEmptyString) == classname; }
|
||||||
|
|
||||||
// Gets node content from wxXML_ENTITY_NODE
|
// Gets node content from wxXML_ENTITY_NODE
|
||||||
// (the problem is, <tag>content<tag> is represented as
|
// (the problem is, <tag>content<tag> is represented as
|
||||||
@@ -248,7 +248,7 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
|
|||||||
|
|
||||||
// Gets style flags from text in form "flag | flag2| flag3 |..."
|
// Gets style flags from text in form "flag | flag2| flag3 |..."
|
||||||
// Only understads flags added with AddStyle
|
// Only understads flags added with AddStyle
|
||||||
int GetStyle(const wxString& param = _T("style"), int defaults = 0);
|
int GetStyle(const wxString& param = wxT("style"), int defaults = 0);
|
||||||
|
|
||||||
// Gets text from param and does some convertions:
|
// Gets text from param and does some convertions:
|
||||||
// - replaces \n, \r, \t by respective chars (according to C syntax)
|
// - replaces \n, \r, \t by respective chars (according to C syntax)
|
||||||
@@ -270,18 +270,18 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
|
|||||||
wxColour GetColour(const wxString& param);
|
wxColour GetColour(const wxString& param);
|
||||||
|
|
||||||
// Get size/position (may be in dlg units):
|
// Get size/position (may be in dlg units):
|
||||||
wxSize GetSize(const wxString& param = _T("size"));
|
wxSize GetSize(const wxString& param = wxT("size"));
|
||||||
wxPoint GetPosition(const wxString& param = _T("pos"));
|
wxPoint GetPosition(const wxString& param = wxT("pos"));
|
||||||
|
|
||||||
// Get dimension (may be in dlg units):
|
// Get dimension (may be in dlg units):
|
||||||
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0);
|
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0);
|
||||||
|
|
||||||
// Get bitmap:
|
// Get bitmap:
|
||||||
wxBitmap GetBitmap(const wxString& param = _T("bitmap"), wxSize size = wxDefaultSize);
|
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), wxSize size = wxDefaultSize);
|
||||||
wxIcon GetIcon(const wxString& param = _T("icon"), wxSize size = wxDefaultSize);
|
wxIcon GetIcon(const wxString& param = wxT("icon"), wxSize size = wxDefaultSize);
|
||||||
|
|
||||||
// Get font:
|
// Get font:
|
||||||
wxFont GetFont(const wxString& param = _T("font"));
|
wxFont GetFont(const wxString& param = wxT("font"));
|
||||||
|
|
||||||
// Sets common window options:
|
// Sets common window options:
|
||||||
void SetupWindow(wxWindow *wnd);
|
void SetupWindow(wxWindow *wnd);
|
||||||
@@ -295,7 +295,7 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
|
|||||||
wxFileSystem& GetCurFileSystem() { return m_Resource->GetCurFileSystem(); }
|
wxFileSystem& GetCurFileSystem() { return m_Resource->GetCurFileSystem(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ADD_STYLE(style) AddStyle(_T(#style), style)
|
#define ADD_STYLE(style) AddStyle(wxT(#style), style)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -30,14 +30,14 @@ wxBitmapXmlHandler::wxBitmapXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxBitmapXmlHandler::DoCreateResource()
|
wxObject *wxBitmapXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
return new wxBitmap(GetBitmap(_T("")));
|
return new wxBitmap(GetBitmap(wxT("")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxBitmapXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxBitmapXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxBitmap"));
|
return IsOfClass(node, wxT("wxBitmap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,13 +48,13 @@ wxIconXmlHandler::wxIconXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxIconXmlHandler::DoCreateResource()
|
wxObject *wxIconXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
return new wxIcon(GetIcon(_T("")));
|
return new wxIcon(GetIcon(wxT("")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxIconXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxIconXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxIcon"));
|
return IsOfClass(node, wxT("wxIcon"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,20 +38,20 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxBitmapButton *button = new wxBitmapButton(m_ParentAsWindow,
|
wxBitmapButton *button = new wxBitmapButton(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetBitmap(_T("bitmap")),
|
GetBitmap(wxT("bitmap")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(_T("style"), wxBU_AUTODRAW),
|
GetStyle(wxT("style"), wxBU_AUTODRAW),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName());
|
GetName());
|
||||||
if (GetBool(_T("default"), 0) == 1) button->SetDefault();
|
if (GetBool(wxT("default"), 0) == 1) button->SetDefault();
|
||||||
SetupWindow(button);
|
SetupWindow(button);
|
||||||
|
|
||||||
if (!GetParamValue(_T("selected")).IsEmpty())
|
if (!GetParamValue(wxT("selected")).IsEmpty())
|
||||||
button->SetBitmapSelected(GetBitmap(_T("selected")));
|
button->SetBitmapSelected(GetBitmap(wxT("selected")));
|
||||||
if (!GetParamValue(_T("focus")).IsEmpty())
|
if (!GetParamValue(wxT("focus")).IsEmpty())
|
||||||
button->SetBitmapFocus(GetBitmap(_T("focus")));
|
button->SetBitmapFocus(GetBitmap(wxT("focus")));
|
||||||
if (!GetParamValue(_T("disabled")).IsEmpty())
|
if (!GetParamValue(wxT("disabled")).IsEmpty())
|
||||||
button->SetBitmapDisabled(GetBitmap(_T("disabled")));
|
button->SetBitmapDisabled(GetBitmap(wxT("disabled")));
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxBitmapButton"));
|
return IsOfClass(node, wxT("wxBitmapButton"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,12 +34,12 @@ wxObject *wxButtonXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxButton *button = new wxButton(m_ParentAsWindow,
|
wxButton *button = new wxButton(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName());
|
GetName());
|
||||||
if (GetBool(_T("default"), 0) == 1) button->SetDefault();
|
if (GetBool(wxT("default"), 0) == 1) button->SetDefault();
|
||||||
SetupWindow(button);
|
SetupWindow(button);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
@@ -49,7 +49,7 @@ wxObject *wxButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxButtonXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxButtonXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxButton"));
|
return IsOfClass(node, wxT("wxButton"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ wxObject *wxCalendarCtrlXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxCalendarCtrl"));
|
return IsOfClass(node, wxT("wxCalendarCtrl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,14 +34,14 @@ wxObject *wxCheckBoxXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxCheckBox *control = new wxCheckBox(m_ParentAsWindow,
|
wxCheckBox *control = new wxCheckBox(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
control->SetValue( GetBool( _T("checked")));
|
control->SetValue( GetBool( wxT("checked")));
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
@@ -51,7 +51,7 @@ wxObject *wxCheckBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxCheckBox"));
|
return IsOfClass(node, wxT("wxCheckBox"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -31,11 +31,11 @@ wxCheckListXmlHandler::wxCheckListXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxCheckListXmlHandler::DoCreateResource()
|
wxObject *wxCheckListXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if (m_Class == _T("wxCheckList"))
|
if (m_Class == wxT("wxCheckList"))
|
||||||
{
|
{
|
||||||
// need to build the list of strings from children
|
// need to build the list of strings from children
|
||||||
m_InsideBox = TRUE;
|
m_InsideBox = TRUE;
|
||||||
CreateChildrenPrivately(NULL, GetParamNode(_T("content")));
|
CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));
|
||||||
wxString *strings = (wxString *) NULL;
|
wxString *strings = (wxString *) NULL;
|
||||||
if( strList.GetCount() > 0 )
|
if( strList.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
@@ -57,19 +57,19 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
|
|||||||
);
|
);
|
||||||
|
|
||||||
// step through children myself (again.)
|
// step through children myself (again.)
|
||||||
wxXmlNode *n = GetParamNode(_T("content"));
|
wxXmlNode *n = GetParamNode(wxT("content"));
|
||||||
if (n) n = n->GetChildren();
|
if (n) n = n->GetChildren();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (n)
|
while (n)
|
||||||
{
|
{
|
||||||
if (n->GetType() != wxXML_ELEMENT_NODE ||
|
if (n->GetType() != wxXML_ELEMENT_NODE ||
|
||||||
n->GetName() != _T("item"))
|
n->GetName() != wxT("item"))
|
||||||
{ n = n->GetNext(); continue; }
|
{ n = n->GetNext(); continue; }
|
||||||
|
|
||||||
// checking boolean is a bit ugly here (see GetBool() )
|
// checking boolean is a bit ugly here (see GetBool() )
|
||||||
wxString v = n->GetPropVal(_T("checked"), wxEmptyString);
|
wxString v = n->GetPropVal(wxT("checked"), wxEmptyString);
|
||||||
v.MakeLower();
|
v.MakeLower();
|
||||||
if (v && v == _T("1"))
|
if (v && v == wxT("1"))
|
||||||
control->Check( i, TRUE );
|
control->Check( i, TRUE );
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
@@ -101,8 +101,8 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxCheckList")) ||
|
return (IsOfClass(node, wxT("wxCheckList")) ||
|
||||||
(m_InsideBox && node->GetName() == _T("item"))
|
(m_InsideBox && node->GetName() == wxT("item"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,14 +31,14 @@ wxChoiceXmlHandler::wxChoiceXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxChoiceXmlHandler::DoCreateResource()
|
wxObject *wxChoiceXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if( m_Class == _T("wxChoice"))
|
if( m_Class == wxT("wxChoice"))
|
||||||
{
|
{
|
||||||
// find the selection
|
// find the selection
|
||||||
long selection = GetLong( _T("selection"), -1 );
|
long selection = GetLong( wxT("selection"), -1 );
|
||||||
|
|
||||||
// need to build the list of strings from children
|
// need to build the list of strings from children
|
||||||
m_InsideBox = TRUE;
|
m_InsideBox = TRUE;
|
||||||
CreateChildrenPrivately( NULL, GetParamNode(_T("content")));
|
CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));
|
||||||
wxString *strings = (wxString *) NULL;
|
wxString *strings = (wxString *) NULL;
|
||||||
if( strList.GetCount() > 0 )
|
if( strList.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
@@ -87,8 +87,8 @@ wxObject *wxChoiceXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxChoiceXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxChoiceXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxChoice")) ||
|
return (IsOfClass(node, wxT("wxChoice")) ||
|
||||||
(m_InsideBox && node->GetName() == _T("item"))
|
(m_InsideBox && node->GetName() == wxT("item"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,14 +36,14 @@ wxComboBoxXmlHandler::wxComboBoxXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxComboBoxXmlHandler::DoCreateResource()
|
wxObject *wxComboBoxXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if( m_Class == _T("wxComboBox"))
|
if( m_Class == wxT("wxComboBox"))
|
||||||
{
|
{
|
||||||
// find the selection
|
// find the selection
|
||||||
long selection = GetLong( _T("selection"), -1 );
|
long selection = GetLong( wxT("selection"), -1 );
|
||||||
|
|
||||||
// need to build the list of strings from children
|
// need to build the list of strings from children
|
||||||
m_InsideBox = TRUE;
|
m_InsideBox = TRUE;
|
||||||
CreateChildrenPrivately( NULL, GetParamNode(_T("content")));
|
CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));
|
||||||
wxString *strings = (wxString *) NULL;
|
wxString *strings = (wxString *) NULL;
|
||||||
if( strList.GetCount() > 0 )
|
if( strList.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
@@ -56,7 +56,7 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
wxComboBox *control = new wxComboBox(m_ParentAsWindow,
|
wxComboBox *control = new wxComboBox(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("value")),
|
GetText(wxT("value")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
strList.GetCount(),
|
strList.GetCount(),
|
||||||
strings,
|
strings,
|
||||||
@@ -93,8 +93,8 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxComboBoxXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxComboBoxXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxComboBox")) ||
|
return (IsOfClass(node, wxT("wxComboBox")) ||
|
||||||
(m_InsideBox && node->GetName() == _T("item"))
|
(m_InsideBox && node->GetName() == wxT("item"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,9 +54,9 @@ wxObject *wxDialogXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
dlg->Create(m_ParentAsWindow,
|
dlg->Create(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("title")),
|
GetText(wxT("title")),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
GetStyle(_T("style"), wxDEFAULT_DIALOG_STYLE),
|
GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE),
|
||||||
GetName());
|
GetName());
|
||||||
dlg->SetClientSize(GetSize());
|
dlg->SetClientSize(GetSize());
|
||||||
dlg->Move(GetPosition());
|
dlg->Move(GetPosition());
|
||||||
@@ -74,7 +74,7 @@ wxObject *wxDialogXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxDialogXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxDialogXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxDialog"));
|
return IsOfClass(node, wxT("wxDialog"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -38,24 +38,24 @@ wxObject *wxGaugeXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxGauge *control = new wxGauge(m_ParentAsWindow,
|
wxGauge *control = new wxGauge(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetLong( _T("range"), wxGAUGE_DEFAULT_RANGE),
|
GetLong( wxT("range"), wxGAUGE_DEFAULT_RANGE),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
if( HasParam( _T("value") ))
|
if( HasParam( wxT("value") ))
|
||||||
{
|
{
|
||||||
control->SetValue( GetLong( _T("value") ));
|
control->SetValue( GetLong( wxT("value") ));
|
||||||
}
|
}
|
||||||
if( HasParam( _T("shadow") ))
|
if( HasParam( wxT("shadow") ))
|
||||||
{
|
{
|
||||||
control->SetShadowWidth( GetDimension( _T("shadow") ));
|
control->SetShadowWidth( GetDimension( wxT("shadow") ));
|
||||||
}
|
}
|
||||||
if( HasParam( _T("bezel") ))
|
if( HasParam( wxT("bezel") ))
|
||||||
{
|
{
|
||||||
control->SetBezelFace( GetDimension( _T("bezel") ));
|
control->SetBezelFace( GetDimension( wxT("bezel") ));
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
@@ -67,7 +67,7 @@ wxObject *wxGaugeXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxGaugeXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxGaugeXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxGauge"));
|
return IsOfClass(node, wxT("wxGauge"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,22 +39,22 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource()
|
|||||||
wxHtmlWindow *control = new wxHtmlWindow(m_ParentAsWindow,
|
wxHtmlWindow *control = new wxHtmlWindow(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle( _T("style" ), wxHW_SCROLLBAR_AUTO),
|
GetStyle( wxT("style" ), wxHW_SCROLLBAR_AUTO),
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
if( HasParam( _T("borders") ))
|
if( HasParam( wxT("borders") ))
|
||||||
{
|
{
|
||||||
control->SetBorders( GetDimension( _T("borders" )));
|
control->SetBorders( GetDimension( wxT("borders" )));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( HasParam( _T("url") ))
|
if( HasParam( wxT("url") ))
|
||||||
{
|
{
|
||||||
control->LoadPage( GetParamValue( _T("url" )));
|
control->LoadPage( GetParamValue( wxT("url" )));
|
||||||
}
|
}
|
||||||
else if( HasParam( _T("htmlcode") ))
|
else if( HasParam( wxT("htmlcode") ))
|
||||||
{
|
{
|
||||||
control->SetPage( GetText(_T("htmlcode")) );
|
control->SetPage( GetText(wxT("htmlcode")) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
@@ -66,7 +66,7 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxHtmlWindow"));
|
return IsOfClass(node, wxT("wxHtmlWindow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_HTML
|
#endif // wxUSE_HTML
|
||||||
|
@@ -37,14 +37,14 @@ wxListBoxXmlHandler::wxListBoxXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxListBoxXmlHandler::DoCreateResource()
|
wxObject *wxListBoxXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if( m_Class == _T("wxListBox"))
|
if( m_Class == wxT("wxListBox"))
|
||||||
{
|
{
|
||||||
// find the selection
|
// find the selection
|
||||||
long selection = GetLong( _T("selection"), -1 );
|
long selection = GetLong( wxT("selection"), -1 );
|
||||||
|
|
||||||
// need to build the list of strings from children
|
// need to build the list of strings from children
|
||||||
m_InsideBox = TRUE;
|
m_InsideBox = TRUE;
|
||||||
CreateChildrenPrivately( NULL, GetParamNode(_T("content")));
|
CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));
|
||||||
wxString *strings = (wxString *) NULL;
|
wxString *strings = (wxString *) NULL;
|
||||||
if( strList.GetCount() > 0 )
|
if( strList.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
@@ -93,8 +93,8 @@ wxObject *wxListBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxListBoxXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxListBoxXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxListBox")) ||
|
return (IsOfClass(node, wxT("wxListBox")) ||
|
||||||
(m_InsideBox && node->GetName() == _T("item"))
|
(m_InsideBox && node->GetName() == wxT("item"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,5 +63,5 @@ wxObject *wxListCtrlXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxListCtrl"));
|
return IsOfClass(node, wxT("wxListCtrl"));
|
||||||
}
|
}
|
||||||
|
@@ -33,11 +33,11 @@ wxMenuXmlHandler::wxMenuXmlHandler() :
|
|||||||
|
|
||||||
wxObject *wxMenuXmlHandler::DoCreateResource()
|
wxObject *wxMenuXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if (m_Class == _T("wxMenu"))
|
if (m_Class == wxT("wxMenu"))
|
||||||
{
|
{
|
||||||
wxMenu *menu = new wxMenu(GetStyle());
|
wxMenu *menu = new wxMenu(GetStyle());
|
||||||
wxString title = GetText(_T("label"));
|
wxString title = GetText(wxT("label"));
|
||||||
wxString help = GetText(_T("help"));
|
wxString help = GetText(wxT("help"));
|
||||||
|
|
||||||
bool oldins = m_InsideMenu;
|
bool oldins = m_InsideMenu;
|
||||||
m_InsideMenu = TRUE;
|
m_InsideMenu = TRUE;
|
||||||
@@ -61,25 +61,25 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxMenu *p_menu = wxDynamicCast(m_Parent, wxMenu);
|
wxMenu *p_menu = wxDynamicCast(m_Parent, wxMenu);
|
||||||
|
|
||||||
if (m_Class == _T("separator"))
|
if (m_Class == wxT("separator"))
|
||||||
p_menu->AppendSeparator();
|
p_menu->AppendSeparator();
|
||||||
else if (m_Class == _T("break"))
|
else if (m_Class == wxT("break"))
|
||||||
p_menu->Break();
|
p_menu->Break();
|
||||||
else /*wxMenuItem*/
|
else /*wxMenuItem*/
|
||||||
{
|
{
|
||||||
int id = GetID();
|
int id = GetID();
|
||||||
bool checkable = GetBool(_T("checkable"));
|
bool checkable = GetBool(wxT("checkable"));
|
||||||
|
|
||||||
wxMenuItem *mitem = new wxMenuItem(p_menu, id, GetText(_T("label")),
|
wxMenuItem *mitem = new wxMenuItem(p_menu, id, GetText(wxT("label")),
|
||||||
GetText(_T("help")), checkable);
|
GetText(wxT("help")), checkable);
|
||||||
|
|
||||||
#if wxCHECK_VERSION(2,3,0) || defined(__WXMSW__)
|
#if wxCHECK_VERSION(2,3,0) || defined(__WXMSW__)
|
||||||
if (HasParam(_T("bitmap")))
|
if (HasParam(wxT("bitmap")))
|
||||||
mitem->SetBitmap(GetBitmap(_T("bitmap")));
|
mitem->SetBitmap(GetBitmap(wxT("bitmap")));
|
||||||
#endif
|
#endif
|
||||||
p_menu->Append(mitem);
|
p_menu->Append(mitem);
|
||||||
mitem->Enable(GetBool(_T("enabled"), TRUE));
|
mitem->Enable(GetBool(wxT("enabled"), TRUE));
|
||||||
if (checkable) mitem->Check(GetBool(_T("checked")));
|
if (checkable) mitem->Check(GetBool(wxT("checked")));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -89,11 +89,11 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxMenuXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxMenuXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxMenu")) ||
|
return IsOfClass(node, wxT("wxMenu")) ||
|
||||||
(m_InsideMenu &&
|
(m_InsideMenu &&
|
||||||
(IsOfClass(node, _T("wxMenuItem")) ||
|
(IsOfClass(node, wxT("wxMenuItem")) ||
|
||||||
IsOfClass(node, _T("break")) ||
|
IsOfClass(node, wxT("break")) ||
|
||||||
IsOfClass(node, _T("separator")))
|
IsOfClass(node, wxT("separator")))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +125,6 @@ wxObject *wxMenuBarXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxMenuBarXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxMenuBarXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxMenuBar"));
|
return IsOfClass(node, wxT("wxMenuBar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,9 +41,9 @@ wxNotebookXmlHandler::wxNotebookXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxNotebookXmlHandler::DoCreateResource()
|
wxObject *wxNotebookXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if (m_Class == _T("notebookpage"))
|
if (m_Class == wxT("notebookpage"))
|
||||||
{
|
{
|
||||||
wxXmlNode *n = GetParamNode(_T("object"));
|
wxXmlNode *n = GetParamNode(wxT("object"));
|
||||||
|
|
||||||
if (n)
|
if (n)
|
||||||
{
|
{
|
||||||
@@ -54,15 +54,15 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
|
|||||||
wxWindow *wnd = wxDynamicCast(item, wxWindow);
|
wxWindow *wnd = wxDynamicCast(item, wxWindow);
|
||||||
|
|
||||||
if (wnd)
|
if (wnd)
|
||||||
m_Notebook->AddPage(wnd, GetText(_T("label")),
|
m_Notebook->AddPage(wnd, GetText(wxT("label")),
|
||||||
GetBool(_T("selected"), 0));
|
GetBool(wxT("selected"), 0));
|
||||||
else
|
else
|
||||||
wxLogError(_T("Error in resource."));
|
wxLogError(wxT("Error in resource."));
|
||||||
return wnd;
|
return wnd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogError(_T("Error in resource: no control within notebook's <page> tag."));
|
wxLogError(wxT("Error in resource: no control within notebook's <page> tag."));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
|
|||||||
wxNotebook *nb = new wxNotebook(m_ParentAsWindow,
|
wxNotebook *nb = new wxNotebook(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle( _T("style" )),
|
GetStyle( wxT("style" )),
|
||||||
GetName());
|
GetName());
|
||||||
|
|
||||||
wxNotebook *old_par = m_Notebook;
|
wxNotebook *old_par = m_Notebook;
|
||||||
@@ -82,7 +82,7 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
|
|||||||
m_IsInside = old_ins;
|
m_IsInside = old_ins;
|
||||||
m_Notebook = old_par;
|
m_Notebook = old_par;
|
||||||
|
|
||||||
if (GetBool(_T("usenotebooksizer"), FALSE))
|
if (GetBool(wxT("usenotebooksizer"), FALSE))
|
||||||
return new wxNotebookSizer(nb);
|
return new wxNotebookSizer(nb);
|
||||||
else
|
else
|
||||||
return nb;
|
return nb;
|
||||||
@@ -93,8 +93,8 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxNotebookXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxNotebookXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return ((!m_IsInside && IsOfClass(node, _T("wxNotebook"))) ||
|
return ((!m_IsInside && IsOfClass(node, wxT("wxNotebook"))) ||
|
||||||
(m_IsInside && IsOfClass(node, _T("notebookpage"))));
|
(m_IsInside && IsOfClass(node, wxT("notebookpage"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -42,13 +42,13 @@ wxObject *wxPanelXmlHandler::DoCreateResource()
|
|||||||
panel = new wxPanel(m_ParentAsWindow,
|
panel = new wxPanel(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(_T("style"), 0),
|
GetStyle(wxT("style"), 0),
|
||||||
GetName());
|
GetName());
|
||||||
else
|
else
|
||||||
panel->Create(m_ParentAsWindow,
|
panel->Create(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(_T("style"), 0),
|
GetStyle(wxT("style"), 0),
|
||||||
GetName());
|
GetName());
|
||||||
SetupWindow(panel);
|
SetupWindow(panel);
|
||||||
CreateChildren(panel);
|
CreateChildren(panel);
|
||||||
@@ -59,5 +59,5 @@ wxObject *wxPanelXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxPanelXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxPanelXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxPanel"));
|
return IsOfClass(node, wxT("wxPanel"));
|
||||||
}
|
}
|
||||||
|
@@ -42,14 +42,14 @@ wxObject *wxRadioButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
wxRadioButton *control = new wxRadioButton(m_ParentAsWindow,
|
wxRadioButton *control = new wxRadioButton(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
control->SetValue( GetBool(_T("value"), 0));
|
control->SetValue( GetBool(wxT("value"), 0));
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
@@ -59,7 +59,7 @@ wxObject *wxRadioButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxRadioButtonXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxRadioButtonXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxRadioButton"));
|
return IsOfClass(node, wxT("wxRadioButton"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -36,14 +36,14 @@ wxRadioBoxXmlHandler::wxRadioBoxXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxRadioBoxXmlHandler::DoCreateResource()
|
wxObject *wxRadioBoxXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if( m_Class == _T("wxRadioBox"))
|
if( m_Class == wxT("wxRadioBox"))
|
||||||
{
|
{
|
||||||
// find the selection
|
// find the selection
|
||||||
long selection = GetLong( _T("selection"), -1 );
|
long selection = GetLong( wxT("selection"), -1 );
|
||||||
|
|
||||||
// need to build the list of strings from children
|
// need to build the list of strings from children
|
||||||
m_InsideBox = TRUE;
|
m_InsideBox = TRUE;
|
||||||
CreateChildrenPrivately( NULL, GetParamNode(_T("content")));
|
CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));
|
||||||
wxString *strings = (wxString *) NULL;
|
wxString *strings = (wxString *) NULL;
|
||||||
if( strList.GetCount() > 0 )
|
if( strList.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
@@ -56,11 +56,11 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
wxRadioBox *control = new wxRadioBox(m_ParentAsWindow,
|
wxRadioBox *control = new wxRadioBox(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
strList.GetCount(),
|
strList.GetCount(),
|
||||||
strings,
|
strings,
|
||||||
GetLong( _T("dimension"), 1 ),
|
GetLong( wxT("dimension"), 1 ),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
@@ -94,8 +94,8 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxRadioBoxXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxRadioBoxXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxRadioBox")) ||
|
return (IsOfClass(node, wxT("wxRadioBox")) ||
|
||||||
(m_InsideBox && node->GetName() == _T("item"))
|
(m_InsideBox && node->GetName() == wxT("item"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,10 +40,10 @@ wxObject *wxScrollBarXmlHandler::DoCreateResource()
|
|||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
control->SetScrollbar(GetLong( _T("value"), 0),
|
control->SetScrollbar(GetLong( wxT("value"), 0),
|
||||||
GetLong( _T("thumbsize"),1),
|
GetLong( wxT("thumbsize"),1),
|
||||||
GetLong( _T("range"), 10),
|
GetLong( wxT("range"), 10),
|
||||||
GetLong( _T("pagesize"),1)
|
GetLong( wxT("pagesize"),1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ wxObject *wxScrollBarXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxScrollBar"));
|
return IsOfClass(node, wxT("wxScrollBar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
|
bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return (IsOfClass(node, _T("wxBoxSizer"))) ||
|
return (IsOfClass(node, wxT("wxBoxSizer"))) ||
|
||||||
(IsOfClass(node, _T("wxStaticBoxSizer"))) ||
|
(IsOfClass(node, wxT("wxStaticBoxSizer"))) ||
|
||||||
(IsOfClass(node, _T("wxGridSizer"))) ||
|
(IsOfClass(node, wxT("wxGridSizer"))) ||
|
||||||
(IsOfClass(node, _T("wxFlexGridSizer")));
|
(IsOfClass(node, wxT("wxFlexGridSizer")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -74,9 +74,9 @@ wxSizerXmlHandler::wxSizerXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxSizerXmlHandler::DoCreateResource()
|
wxObject *wxSizerXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if (m_Class == _T("sizeritem"))
|
if (m_Class == wxT("sizeritem"))
|
||||||
{
|
{
|
||||||
wxXmlNode *n = GetParamNode(_T("object"));
|
wxXmlNode *n = GetParamNode(wxT("object"));
|
||||||
|
|
||||||
if (n)
|
if (n)
|
||||||
{
|
{
|
||||||
@@ -89,40 +89,40 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
|
|||||||
m_ParentSizer = old_par;
|
m_ParentSizer = old_par;
|
||||||
wxSizer *sizer = wxDynamicCast(item, wxSizer);
|
wxSizer *sizer = wxDynamicCast(item, wxSizer);
|
||||||
wxWindow *wnd = wxDynamicCast(item, wxWindow);
|
wxWindow *wnd = wxDynamicCast(item, wxWindow);
|
||||||
wxSize minsize = GetSize(_T("minsize"));
|
wxSize minsize = GetSize(wxT("minsize"));
|
||||||
|
|
||||||
if (sizer)
|
if (sizer)
|
||||||
{
|
{
|
||||||
m_ParentSizer->Add(sizer, GetLong(_T("option")),
|
m_ParentSizer->Add(sizer, GetLong(wxT("option")),
|
||||||
GetStyle(_T("flag")), GetDimension(_T("border")));
|
GetStyle(wxT("flag")), GetDimension(wxT("border")));
|
||||||
if (!(minsize == wxDefaultSize))
|
if (!(minsize == wxDefaultSize))
|
||||||
m_ParentSizer->SetItemMinSize(sizer, minsize.x, minsize.y);
|
m_ParentSizer->SetItemMinSize(sizer, minsize.x, minsize.y);
|
||||||
}
|
}
|
||||||
else if (wnd)
|
else if (wnd)
|
||||||
{
|
{
|
||||||
m_ParentSizer->Add(wnd, GetLong(_T("option")),
|
m_ParentSizer->Add(wnd, GetLong(wxT("option")),
|
||||||
GetStyle(_T("flag")), GetDimension(_T("border")));
|
GetStyle(wxT("flag")), GetDimension(wxT("border")));
|
||||||
if (!(minsize == wxDefaultSize))
|
if (!(minsize == wxDefaultSize))
|
||||||
m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y);
|
m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxLogError(_T("Error in resource."));
|
wxLogError(wxT("Error in resource."));
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
else /*n == NULL*/
|
else /*n == NULL*/
|
||||||
{
|
{
|
||||||
wxLogError(_T("Error in resource: no control/sizer within sizer's <item> tag."));
|
wxLogError(wxT("Error in resource: no control/sizer within sizer's <item> tag."));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (m_Class == _T("spacer"))
|
else if (m_Class == wxT("spacer"))
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(m_ParentSizer, NULL, _T("Incorrect syntax of XML resource: spacer not within sizer!"));
|
wxCHECK_MSG(m_ParentSizer, NULL, wxT("Incorrect syntax of XML resource: spacer not within sizer!"));
|
||||||
wxSize sz = GetSize();
|
wxSize sz = GetSize();
|
||||||
m_ParentSizer->Add(sz.x, sz.y,
|
m_ParentSizer->Add(sz.x, sz.y,
|
||||||
GetLong(_T("option")), GetStyle(_T("flag")), GetDimension(_T("border")));
|
GetLong(wxT("option")), GetStyle(wxT("flag")), GetDimension(wxT("border")));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,52 +133,52 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
|
|||||||
wxXmlNode *parentNode = m_Node->GetParent();
|
wxXmlNode *parentNode = m_Node->GetParent();
|
||||||
|
|
||||||
wxCHECK_MSG(m_ParentSizer != NULL ||
|
wxCHECK_MSG(m_ParentSizer != NULL ||
|
||||||
((IsOfClass(parentNode, _T("wxPanel")) ||
|
((IsOfClass(parentNode, wxT("wxPanel")) ||
|
||||||
IsOfClass(parentNode, _T("wxDialog"))) &&
|
IsOfClass(parentNode, wxT("wxDialog"))) &&
|
||||||
parentNode->GetType() == wxXML_ELEMENT_NODE), NULL,
|
parentNode->GetType() == wxXML_ELEMENT_NODE), NULL,
|
||||||
_T("Incorrect use of sizer: parent is not 'wxDialog' or 'wxPanel'."));
|
wxT("Incorrect use of sizer: parent is not 'wxDialog' or 'wxPanel'."));
|
||||||
|
|
||||||
if (m_Class == _T("wxBoxSizer"))
|
if (m_Class == wxT("wxBoxSizer"))
|
||||||
sizer = new wxBoxSizer(GetStyle(_T("orient"), wxHORIZONTAL));
|
sizer = new wxBoxSizer(GetStyle(wxT("orient"), wxHORIZONTAL));
|
||||||
|
|
||||||
else if (m_Class == _T("wxStaticBoxSizer"))
|
else if (m_Class == wxT("wxStaticBoxSizer"))
|
||||||
{
|
{
|
||||||
sizer = new wxStaticBoxSizer(
|
sizer = new wxStaticBoxSizer(
|
||||||
new wxStaticBox(m_ParentAsWindow, -1, GetText(_T("label"))),
|
new wxStaticBox(m_ParentAsWindow, -1, GetText(wxT("label"))),
|
||||||
GetStyle(_T("orient"), wxHORIZONTAL));
|
GetStyle(wxT("orient"), wxHORIZONTAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (m_Class == _T("wxGridSizer"))
|
else if (m_Class == wxT("wxGridSizer"))
|
||||||
sizer = new wxGridSizer(GetLong(_T("rows")), GetLong(_T("cols")),
|
sizer = new wxGridSizer(GetLong(wxT("rows")), GetLong(wxT("cols")),
|
||||||
GetDimension(_T("vgap")), GetDimension(_T("hgap")));
|
GetDimension(wxT("vgap")), GetDimension(wxT("hgap")));
|
||||||
|
|
||||||
else if (m_Class == _T("wxFlexGridSizer"))
|
else if (m_Class == wxT("wxFlexGridSizer"))
|
||||||
{
|
{
|
||||||
wxFlexGridSizer *fsizer =
|
wxFlexGridSizer *fsizer =
|
||||||
new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")),
|
new wxFlexGridSizer(GetLong(wxT("rows")), GetLong(wxT("cols")),
|
||||||
GetDimension(_T("vgap")), GetDimension(_T("hgap")));
|
GetDimension(wxT("vgap")), GetDimension(wxT("hgap")));
|
||||||
sizer = fsizer;
|
sizer = fsizer;
|
||||||
wxStringTokenizer tkn;
|
wxStringTokenizer tkn;
|
||||||
unsigned long l;
|
unsigned long l;
|
||||||
tkn.SetString(GetParamValue(_T("growablerows")), _T(","));
|
tkn.SetString(GetParamValue(wxT("growablerows")), wxT(","));
|
||||||
while (tkn.HasMoreTokens())
|
while (tkn.HasMoreTokens())
|
||||||
{
|
{
|
||||||
if (!tkn.GetNextToken().ToULong(&l))
|
if (!tkn.GetNextToken().ToULong(&l))
|
||||||
wxLogError(_T("growablerows must be comma-separated list of row numbers"));
|
wxLogError(wxT("growablerows must be comma-separated list of row numbers"));
|
||||||
else
|
else
|
||||||
fsizer->AddGrowableRow(l);
|
fsizer->AddGrowableRow(l);
|
||||||
}
|
}
|
||||||
tkn.SetString(GetParamValue(_T("growablecols")), _T(","));
|
tkn.SetString(GetParamValue(wxT("growablecols")), wxT(","));
|
||||||
while (tkn.HasMoreTokens())
|
while (tkn.HasMoreTokens())
|
||||||
{
|
{
|
||||||
if (!tkn.GetNextToken().ToULong(&l))
|
if (!tkn.GetNextToken().ToULong(&l))
|
||||||
wxLogError(_T("growablecols must be comma-separated list of column numbers"));
|
wxLogError(wxT("growablecols must be comma-separated list of column numbers"));
|
||||||
else
|
else
|
||||||
fsizer->AddGrowableCol(l);
|
fsizer->AddGrowableCol(l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize minsize = GetSize(_T("minsize"));
|
wxSize minsize = GetSize(wxT("minsize"));
|
||||||
if (!(minsize == wxDefaultSize))
|
if (!(minsize == wxDefaultSize))
|
||||||
sizer->SetMinSize(minsize);
|
sizer->SetMinSize(minsize);
|
||||||
|
|
||||||
@@ -214,6 +214,6 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
|
|||||||
bool wxSizerXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxSizerXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return ((!m_IsInside && IsSizerNode(node)) ||
|
return ((!m_IsInside && IsSizerNode(node)) ||
|
||||||
(m_IsInside && IsOfClass(node, _T("sizeritem"))) ||
|
(m_IsInside && IsOfClass(node, wxT("sizeritem"))) ||
|
||||||
(m_IsInside && IsOfClass(node, _T("spacer"))));
|
(m_IsInside && IsOfClass(node, wxT("spacer"))));
|
||||||
}
|
}
|
||||||
|
@@ -44,38 +44,38 @@ wxObject *wxSliderXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxSlider *control = new wxSlider(m_ParentAsWindow,
|
wxSlider *control = new wxSlider(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetLong( _T("value"), wxSL_DEFAULT_VALUE),
|
GetLong( wxT("value"), wxSL_DEFAULT_VALUE),
|
||||||
GetLong( _T("min"), wxSL_DEFAULT_MIN),
|
GetLong( wxT("min"), wxSL_DEFAULT_MIN),
|
||||||
GetLong( _T("max"), wxSL_DEFAULT_MAX),
|
GetLong( wxT("max"), wxSL_DEFAULT_MAX),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
if( HasParam( _T("tickfreq") ))
|
if( HasParam( wxT("tickfreq") ))
|
||||||
{
|
{
|
||||||
control->SetTickFreq( GetLong( _T("tickfreq") ), 0 );
|
control->SetTickFreq( GetLong( wxT("tickfreq") ), 0 );
|
||||||
}
|
}
|
||||||
if( HasParam( _T("pagesize") ))
|
if( HasParam( wxT("pagesize") ))
|
||||||
{
|
{
|
||||||
control->SetPageSize( GetLong( _T("pagesize") ) );
|
control->SetPageSize( GetLong( wxT("pagesize") ) );
|
||||||
}
|
}
|
||||||
if( HasParam( _T("linesize") ))
|
if( HasParam( wxT("linesize") ))
|
||||||
{
|
{
|
||||||
control->SetLineSize( GetLong( _T("linesize") ));
|
control->SetLineSize( GetLong( wxT("linesize") ));
|
||||||
}
|
}
|
||||||
if( HasParam( _T("thumb") ))
|
if( HasParam( wxT("thumb") ))
|
||||||
{
|
{
|
||||||
control->SetThumbLength( GetLong( _T("thumb") ));
|
control->SetThumbLength( GetLong( wxT("thumb") ));
|
||||||
}
|
}
|
||||||
if( HasParam( _T("tick") ))
|
if( HasParam( wxT("tick") ))
|
||||||
{
|
{
|
||||||
control->SetTick( GetLong( _T("tick") ));
|
control->SetTick( GetLong( wxT("tick") ));
|
||||||
}
|
}
|
||||||
if( HasParam( _T("selmin") ) && HasParam( _T("selmax")) )
|
if( HasParam( wxT("selmin") ) && HasParam( wxT("selmax")) )
|
||||||
{
|
{
|
||||||
control->SetSelection( GetLong( _T("selmin") ), GetLong( _T("selmax")) );
|
control->SetSelection( GetLong( wxT("selmin") ), GetLong( wxT("selmax")) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
@@ -87,7 +87,7 @@ wxObject *wxSliderXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxSliderXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxSliderXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxSlider"));
|
return IsOfClass(node, wxT("wxSlider"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,13 +39,13 @@ wxObject *wxSpinButtonXmlHandler::DoCreateResource()
|
|||||||
wxSpinButton *control = new wxSpinButton(m_ParentAsWindow,
|
wxSpinButton *control = new wxSpinButton(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle( _T("style"), wxSP_VERTICAL | wxSP_ARROW_KEYS ),
|
GetStyle( wxT("style"), wxSP_VERTICAL | wxSP_ARROW_KEYS ),
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
control->SetValue( GetLong( _T("value"), wxSP_DEFAULT_VALUE) );
|
control->SetValue( GetLong( wxT("value"), wxSP_DEFAULT_VALUE) );
|
||||||
control->SetRange( GetLong( _T("min"), wxSP_DEFAULT_MIN),
|
control->SetRange( GetLong( wxT("min"), wxSP_DEFAULT_MIN),
|
||||||
GetLong( _T("max"), wxSP_DEFAULT_MAX) );
|
GetLong( wxT("max"), wxSP_DEFAULT_MAX) );
|
||||||
SetupWindow(control);
|
SetupWindow(control);
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
@@ -55,7 +55,7 @@ wxObject *wxSpinButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return node->GetName() == _T("spinbutton");
|
return node->GetName() == wxT("spinbutton");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_SPINBTN
|
#endif // wxUSE_SPINBTN
|
||||||
@@ -75,12 +75,12 @@ wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxSpinCtrl *control = new wxSpinCtrl(m_ParentAsWindow,
|
wxSpinCtrl *control = new wxSpinCtrl(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("value")),
|
GetText(wxT("value")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle( _T("style"), wxSP_ARROW_KEYS ),
|
GetStyle( wxT("style"), wxSP_ARROW_KEYS ),
|
||||||
GetLong( _T("min"), wxSP_DEFAULT_MIN),
|
GetLong( wxT("min"), wxSP_DEFAULT_MIN),
|
||||||
GetLong( _T("max"), wxSP_DEFAULT_MAX),
|
GetLong( wxT("max"), wxSP_DEFAULT_MAX),
|
||||||
GetLong( _T("value"), wxSP_DEFAULT_VALUE),
|
GetLong( wxT("value"), wxSP_DEFAULT_VALUE),
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxSpinCtrl"));
|
return IsOfClass(node, wxT("wxSpinCtrl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_SPINCTRL
|
#endif // wxUSE_SPINCTRL
|
||||||
|
@@ -32,7 +32,7 @@ wxObject *wxStaticBitmapXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxStaticBitmap *bmp = new wxStaticBitmap(m_ParentAsWindow,
|
wxStaticBitmap *bmp = new wxStaticBitmap(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetBitmap(_T("bitmap"), GetSize()),
|
GetBitmap(wxT("bitmap"), GetSize()),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
GetName()
|
GetName()
|
||||||
@@ -46,7 +46,7 @@ wxObject *wxStaticBitmapXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxStaticBitmap"));
|
return IsOfClass(node, wxT("wxStaticBitmap"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ wxObject *wxStaticBoxXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxStaticBox *box = new wxStaticBox(m_ParentAsWindow,
|
wxStaticBox *box = new wxStaticBox(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
GetName()
|
GetName()
|
||||||
@@ -46,7 +46,7 @@ wxObject *wxStaticBoxXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxStaticBoxXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxStaticBoxXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxStaticBox"));
|
return IsOfClass(node, wxT("wxStaticBox"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ wxObject *wxStaticLineXmlHandler::DoCreateResource()
|
|||||||
wxStaticLine *line = new wxStaticLine(m_ParentAsWindow,
|
wxStaticLine *line = new wxStaticLine(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(_T("style"), wxLI_HORIZONTAL),
|
GetStyle(wxT("style"), wxLI_HORIZONTAL),
|
||||||
GetName()
|
GetName()
|
||||||
);
|
);
|
||||||
SetupWindow(line);
|
SetupWindow(line);
|
||||||
@@ -49,7 +49,7 @@ wxObject *wxStaticLineXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxStaticLineXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxStaticLineXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxStaticLine"));
|
return IsOfClass(node, wxT("wxStaticLine"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -33,7 +33,7 @@ wxObject *wxStaticTextXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxStaticText *text = new wxStaticText(m_ParentAsWindow,
|
wxStaticText *text = new wxStaticText(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("label")),
|
GetText(wxT("label")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
GetName()
|
GetName()
|
||||||
@@ -47,7 +47,7 @@ wxObject *wxStaticTextXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxStaticTextXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxStaticTextXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxStaticText"));
|
return IsOfClass(node, wxT("wxStaticText"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxTextCtrl *text = new wxTextCtrl(m_ParentAsWindow,
|
wxTextCtrl *text = new wxTextCtrl(m_ParentAsWindow,
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(_T("value")),
|
GetText(wxT("value")),
|
||||||
GetPosition(), GetSize(),
|
GetPosition(), GetSize(),
|
||||||
GetStyle(),
|
GetStyle(),
|
||||||
wxDefaultValidator,
|
wxDefaultValidator,
|
||||||
@@ -52,7 +52,7 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxTextCtrl"));
|
return IsOfClass(node, wxT("wxTextCtrl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -38,31 +38,31 @@ wxToolBarXmlHandler::wxToolBarXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxToolBarXmlHandler::DoCreateResource()
|
wxObject *wxToolBarXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
if (m_Class == _T("tool"))
|
if (m_Class == wxT("tool"))
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(m_Toolbar, NULL, _T("Incorrect syntax of XML resource: tool not within a toolbar!"));
|
wxCHECK_MSG(m_Toolbar, NULL, wxT("Incorrect syntax of XML resource: tool not within a toolbar!"));
|
||||||
m_Toolbar->AddTool(GetID(),
|
m_Toolbar->AddTool(GetID(),
|
||||||
GetBitmap(_T("bitmap")),
|
GetBitmap(wxT("bitmap")),
|
||||||
GetBitmap(_T("bitmap2")),
|
GetBitmap(wxT("bitmap2")),
|
||||||
GetBool(_T("toggle")),
|
GetBool(wxT("toggle")),
|
||||||
GetPosition().x,
|
GetPosition().x,
|
||||||
GetPosition().y,
|
GetPosition().y,
|
||||||
NULL,
|
NULL,
|
||||||
GetText(_T("tooltip")),
|
GetText(wxT("tooltip")),
|
||||||
GetText(_T("longhelp")));
|
GetText(wxT("longhelp")));
|
||||||
return m_Toolbar; // must return non-NULL
|
return m_Toolbar; // must return non-NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (m_Class == _T("separator"))
|
else if (m_Class == wxT("separator"))
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(m_Toolbar, NULL, _T("Incorrect syntax of XML resource: separator not within a toolbar!"));
|
wxCHECK_MSG(m_Toolbar, NULL, wxT("Incorrect syntax of XML resource: separator not within a toolbar!"));
|
||||||
m_Toolbar->AddSeparator();
|
m_Toolbar->AddSeparator();
|
||||||
return m_Toolbar; // must return non-NULL
|
return m_Toolbar; // must return non-NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
else /*<object class="wxToolBar">*/
|
else /*<object class="wxToolBar">*/
|
||||||
{
|
{
|
||||||
int style = GetStyle(_T("style"), wxNO_BORDER | wxTB_HORIZONTAL);
|
int style = GetStyle(wxT("style"), wxNO_BORDER | wxTB_HORIZONTAL);
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
if (!(style & wxNO_BORDER)) style |= wxNO_BORDER;
|
if (!(style & wxNO_BORDER)) style |= wxNO_BORDER;
|
||||||
#endif
|
#endif
|
||||||
@@ -73,20 +73,20 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
style,
|
style,
|
||||||
GetName());
|
GetName());
|
||||||
|
|
||||||
wxSize bmpsize = GetSize(_T("bitmapsize"));
|
wxSize bmpsize = GetSize(wxT("bitmapsize"));
|
||||||
if (!(bmpsize == wxDefaultSize))
|
if (!(bmpsize == wxDefaultSize))
|
||||||
toolbar->SetToolBitmapSize(bmpsize);
|
toolbar->SetToolBitmapSize(bmpsize);
|
||||||
wxSize margins = GetSize(_T("margins"));
|
wxSize margins = GetSize(wxT("margins"));
|
||||||
if (!(margins == wxDefaultSize))
|
if (!(margins == wxDefaultSize))
|
||||||
toolbar->SetMargins(margins.x, margins.y);
|
toolbar->SetMargins(margins.x, margins.y);
|
||||||
long packing = GetLong(_T("packing"), -1);
|
long packing = GetLong(wxT("packing"), -1);
|
||||||
if (packing != -1)
|
if (packing != -1)
|
||||||
toolbar->SetToolPacking(packing);
|
toolbar->SetToolPacking(packing);
|
||||||
long separation = GetLong(_T("separation"), -1);
|
long separation = GetLong(wxT("separation"), -1);
|
||||||
if (separation != -1)
|
if (separation != -1)
|
||||||
toolbar->SetToolSeparation(separation);
|
toolbar->SetToolSeparation(separation);
|
||||||
|
|
||||||
wxXmlNode *children_node = GetParamNode(_T("object"));
|
wxXmlNode *children_node = GetParamNode(wxT("object"));
|
||||||
if (children_node == NULL) return toolbar;
|
if (children_node == NULL) return toolbar;
|
||||||
|
|
||||||
m_IsInside = TRUE;
|
m_IsInside = TRUE;
|
||||||
@@ -97,12 +97,12 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
while (n)
|
while (n)
|
||||||
{
|
{
|
||||||
if (n->GetType() == wxXML_ELEMENT_NODE &&
|
if (n->GetType() == wxXML_ELEMENT_NODE &&
|
||||||
n->GetName() == _T("object"))
|
n->GetName() == wxT("object"))
|
||||||
{
|
{
|
||||||
wxObject *created = CreateResFromNode(n, toolbar, NULL);
|
wxObject *created = CreateResFromNode(n, toolbar, NULL);
|
||||||
wxControl *control = wxDynamicCast(created, wxControl);
|
wxControl *control = wxDynamicCast(created, wxControl);
|
||||||
if (IsOfClass(n, _T("tool")) &&
|
if (IsOfClass(n, wxT("tool")) &&
|
||||||
IsOfClass(n, _T("separator")) &&
|
IsOfClass(n, wxT("separator")) &&
|
||||||
control != NULL)
|
control != NULL)
|
||||||
toolbar->AddControl(control);
|
toolbar->AddControl(control);
|
||||||
}
|
}
|
||||||
@@ -121,9 +121,9 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxToolBarXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxToolBarXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return ((!m_IsInside && IsOfClass(node, _T("wxToolBar"))) ||
|
return ((!m_IsInside && IsOfClass(node, wxT("wxToolBar"))) ||
|
||||||
(m_IsInside && IsOfClass(node, _T("tool"))) ||
|
(m_IsInside && IsOfClass(node, wxT("tool"))) ||
|
||||||
(m_IsInside && IsOfClass(node, _T("separator"))));
|
(m_IsInside && IsOfClass(node, wxT("separator"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -51,7 +51,7 @@ wxObject *wxTreeCtrlXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxTreeCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxTreeCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("wxTreeCtrl"));
|
return IsOfClass(node, wxT("wxTreeCtrl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -32,8 +32,8 @@ wxUnknownWidgetXmlHandler::wxUnknownWidgetXmlHandler()
|
|||||||
|
|
||||||
wxObject *wxUnknownWidgetXmlHandler::DoCreateResource()
|
wxObject *wxUnknownWidgetXmlHandler::DoCreateResource()
|
||||||
{
|
{
|
||||||
long id = GetLong(_T("id"), -1);
|
long id = GetLong(wxT("id"), -1);
|
||||||
wxString name = GetParamValue(_T("name"));
|
wxString name = GetParamValue(wxT("name"));
|
||||||
|
|
||||||
wxWindow *wnd = NULL;
|
wxWindow *wnd = NULL;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ wxObject *wxUnknownWidgetXmlHandler::DoCreateResource()
|
|||||||
wnd = m_ParentAsWindow->FindWindow(name);
|
wnd = m_ParentAsWindow->FindWindow(name);
|
||||||
|
|
||||||
if (wnd == NULL)
|
if (wnd == NULL)
|
||||||
wxLogError(_T("Cannot find specified window for class 'unknown' (id=%li, name='%s')."), id, name.mb_str());
|
wxLogError(wxT("Cannot find specified window for class 'unknown' (id=%li, name='%s')."), id, name.mb_str());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (wnd->GetParent() != m_ParentAsWindow)
|
if (wnd->GetParent() != m_ParentAsWindow)
|
||||||
@@ -56,6 +56,6 @@ wxObject *wxUnknownWidgetXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
bool wxUnknownWidgetXmlHandler::CanHandle(wxXmlNode *node)
|
bool wxUnknownWidgetXmlHandler::CanHandle(wxXmlNode *node)
|
||||||
{
|
{
|
||||||
return IsOfClass(node, _T("unknown"));
|
return IsOfClass(node, wxT("unknown"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -168,7 +168,7 @@ void wxXmlNode::AddChild(wxXmlNode *child)
|
|||||||
|
|
||||||
void wxXmlNode::InsertChild(wxXmlNode *child, wxXmlNode *before_node)
|
void wxXmlNode::InsertChild(wxXmlNode *child, wxXmlNode *before_node)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG(before_node->GetParent() == this, _T("wxXmlNode::InsertChild - the node has incorrect parent"));
|
wxASSERT_MSG(before_node->GetParent() == this, wxT("wxXmlNode::InsertChild - the node has incorrect parent"));
|
||||||
|
|
||||||
if (m_Children == before_node)
|
if (m_Children == before_node)
|
||||||
m_Children = child;
|
m_Children = child;
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
bool wxXmlIOHandlerBin::CanLoad(wxInputStream& stream)
|
bool wxXmlIOHandlerBin::CanLoad(wxInputStream& stream)
|
||||||
{
|
{
|
||||||
bool canread;
|
bool canread;
|
||||||
canread = (ReadHeader(stream) == _T("XMLBIN "));
|
canread = (ReadHeader(stream) == wxT("XMLBIN "));
|
||||||
stream.SeekI(-9, wxFromCurrent);
|
stream.SeekI(-9, wxFromCurrent);
|
||||||
return canread;
|
return canread;
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
bool wxXmlIOHandlerBinZ::CanLoad(wxInputStream& stream)
|
bool wxXmlIOHandlerBinZ::CanLoad(wxInputStream& stream)
|
||||||
{
|
{
|
||||||
bool canread;
|
bool canread;
|
||||||
canread = (ReadHeader(stream) == _T("XMLBINZ"));
|
canread = (ReadHeader(stream) == wxT("XMLBINZ"));
|
||||||
stream.SeekI(-9, wxFromCurrent);
|
stream.SeekI(-9, wxFromCurrent);
|
||||||
return canread;
|
return canread;
|
||||||
}
|
}
|
||||||
|
@@ -142,15 +142,15 @@ static bool LoadLibxml()
|
|||||||
wxLogNull lg;
|
wxLogNull lg;
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
gs_libxmlDLL.Handle =
|
gs_libxmlDLL.Handle =
|
||||||
wxDllLoader::LoadLibrary(_T("wxlibxml.so.2"), &gs_libxmlLoaded);
|
wxDllLoader::LoadLibrary(wxT("wxlibxml.so.2"), &gs_libxmlLoaded);
|
||||||
if (!gs_libxmlLoaded) gs_libxmlDLL.Handle =
|
if (!gs_libxmlLoaded) gs_libxmlDLL.Handle =
|
||||||
wxDllLoader::LoadLibrary(_T("libxml.so.2"), &gs_libxmlLoaded);
|
wxDllLoader::LoadLibrary(wxT("libxml.so.2"), &gs_libxmlLoaded);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
gs_libxmlDLL.Handle =
|
gs_libxmlDLL.Handle =
|
||||||
wxDllLoader::LoadLibrary(_T("wxlibxml2.dll"), &gs_libxmlLoaded);
|
wxDllLoader::LoadLibrary(wxT("wxlibxml2.dll"), &gs_libxmlLoaded);
|
||||||
if (!gs_libxmlLoaded) gs_libxmlDLL.Handle =
|
if (!gs_libxmlLoaded) gs_libxmlDLL.Handle =
|
||||||
wxDllLoader::LoadLibrary(_T("libxml2.dll"), &gs_libxmlLoaded);
|
wxDllLoader::LoadLibrary(wxT("libxml2.dll"), &gs_libxmlLoaded);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ static bool LoadLibxml()
|
|||||||
|
|
||||||
#define LOAD_SYMBOL(sym) \
|
#define LOAD_SYMBOL(sym) \
|
||||||
gs_libxmlDLL.sym = \
|
gs_libxmlDLL.sym = \
|
||||||
(type_##sym)wxDllLoader::GetSymbol(gs_libxmlDLL.Handle, _T(#sym)); \
|
(type_##sym)wxDllLoader::GetSymbol(gs_libxmlDLL.Handle, wxT(#sym)); \
|
||||||
if (!gs_libxmlDLL.sym) \
|
if (!gs_libxmlDLL.sym) \
|
||||||
{ \
|
{ \
|
||||||
ReleaseLibxml(); \
|
ReleaseLibxml(); \
|
||||||
|
@@ -211,7 +211,7 @@ void wxXmlResource::ProcessPlatformProperty(wxXmlNode *node)
|
|||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
isok = FALSE;
|
isok = FALSE;
|
||||||
if (!c->GetPropVal(_T("platform"), &s))
|
if (!c->GetPropVal(wxT("platform"), &s))
|
||||||
isok = TRUE;
|
isok = TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -222,13 +222,13 @@ void wxXmlResource::ProcessPlatformProperty(wxXmlNode *node)
|
|||||||
s = tkn.GetNextToken();
|
s = tkn.GetNextToken();
|
||||||
if (
|
if (
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
s == wxString(_T("win"))
|
s == wxString(wxT("win"))
|
||||||
#elif defined(__UNIX__)
|
#elif defined(__UNIX__)
|
||||||
s == wxString(_T("unix"))
|
s == wxString(wxT("unix"))
|
||||||
#elif defined(__MAC__)
|
#elif defined(__MAC__)
|
||||||
s == wxString(_T("mac"))
|
s == wxString(wxT("mac"))
|
||||||
#elif defined(__OS2__)
|
#elif defined(__OS2__)
|
||||||
s == wxString(_T("os2"))
|
s == wxString(wxT("os2"))
|
||||||
#else
|
#else
|
||||||
FALSE
|
FALSE
|
||||||
#endif
|
#endif
|
||||||
@@ -297,7 +297,7 @@ void wxXmlResource::UpdateResources()
|
|||||||
delete m_Data[i].Doc;
|
delete m_Data[i].Doc;
|
||||||
m_Data[i].Doc = NULL;
|
m_Data[i].Doc = NULL;
|
||||||
}
|
}
|
||||||
else if (m_Data[i].Doc->GetRoot()->GetName() != _T("resource"))
|
else if (m_Data[i].Doc->GetRoot()->GetName() != wxT("resource"))
|
||||||
{
|
{
|
||||||
wxLogError(_("Invalid XML resource '%s': doesn't have root node 'resource'."), m_Data[i].File.c_str());
|
wxLogError(_("Invalid XML resource '%s': doesn't have root node 'resource'."), m_Data[i].File.c_str());
|
||||||
delete m_Data[i].Doc;
|
delete m_Data[i].Doc;
|
||||||
@@ -358,7 +358,7 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent, wx
|
|||||||
while (ND)
|
while (ND)
|
||||||
{
|
{
|
||||||
handler = (wxXmlResourceHandler*)ND->GetData();
|
handler = (wxXmlResourceHandler*)ND->GetData();
|
||||||
if (node->GetName() == _T("object") && handler->CanHandle(node))
|
if (node->GetName() == wxT("object") && handler->CanHandle(node))
|
||||||
{
|
{
|
||||||
ret = handler->CreateResource(node, parent, instance);
|
ret = handler->CreateResource(node, parent, instance);
|
||||||
if (ret) return ret;
|
if (ret) return ret;
|
||||||
@@ -368,7 +368,7 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent, wx
|
|||||||
|
|
||||||
wxLogError(_("No handler found for XML node '%s', class '%s'!"),
|
wxLogError(_("No handler found for XML node '%s', class '%s'!"),
|
||||||
node->GetName().c_str(),
|
node->GetName().c_str(),
|
||||||
node->GetPropVal(_T("class"), wxEmptyString).c_str());
|
node->GetPropVal(wxT("class"), wxEmptyString).c_str());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ wxObject *wxXmlResourceHandler::CreateResource(wxXmlNode *node, wxObject *parent
|
|||||||
wxWindow *myParentAW = m_ParentAsWindow, *myInstanceAW = m_InstanceAsWindow;
|
wxWindow *myParentAW = m_ParentAsWindow, *myInstanceAW = m_InstanceAsWindow;
|
||||||
|
|
||||||
m_Node = node;
|
m_Node = node;
|
||||||
m_Class = node->GetPropVal(_T("class"), wxEmptyString);
|
m_Class = node->GetPropVal(wxT("class"), wxEmptyString);
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
m_Instance = instance;
|
m_Instance = instance;
|
||||||
m_ParentAsWindow = wxDynamicCast(m_Parent, wxWindow);
|
m_ParentAsWindow = wxDynamicCast(m_Parent, wxWindow);
|
||||||
@@ -446,7 +446,7 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
|
|||||||
|
|
||||||
if (!s) return defaults;
|
if (!s) return defaults;
|
||||||
|
|
||||||
wxStringTokenizer tkn(s, _T("| "), wxTOKEN_STRTOK);
|
wxStringTokenizer tkn(s, wxT("| "), wxTOKEN_STRTOK);
|
||||||
int style = 0;
|
int style = 0;
|
||||||
int index;
|
int index;
|
||||||
wxString fl;
|
wxString fl;
|
||||||
@@ -517,9 +517,9 @@ int wxXmlResourceHandler::GetID()
|
|||||||
wxString sid = GetName();
|
wxString sid = GetName();
|
||||||
long num;
|
long num;
|
||||||
|
|
||||||
if (sid == _T("-1")) return -1;
|
if (sid == wxT("-1")) return -1;
|
||||||
else if (sid.IsNumber() && sid.ToLong(&num)) return num;
|
else if (sid.IsNumber() && sid.ToLong(&num)) return num;
|
||||||
#define stdID(id) else if (sid == _T(#id)) return id
|
#define stdID(id) else if (sid == wxT(#id)) return id
|
||||||
stdID(wxID_OPEN); stdID(wxID_CLOSE); stdID(wxID_NEW);
|
stdID(wxID_OPEN); stdID(wxID_CLOSE); stdID(wxID_NEW);
|
||||||
stdID(wxID_SAVE); stdID(wxID_SAVEAS); stdID(wxID_REVERT);
|
stdID(wxID_SAVE); stdID(wxID_SAVEAS); stdID(wxID_REVERT);
|
||||||
stdID(wxID_EXIT); stdID(wxID_UNDO); stdID(wxID_REDO);
|
stdID(wxID_EXIT); stdID(wxID_UNDO); stdID(wxID_REDO);
|
||||||
@@ -540,7 +540,7 @@ int wxXmlResourceHandler::GetID()
|
|||||||
|
|
||||||
wxString wxXmlResourceHandler::GetName()
|
wxString wxXmlResourceHandler::GetName()
|
||||||
{
|
{
|
||||||
return m_Node->GetPropVal(_T("name"), _T("-1"));
|
return m_Node->GetPropVal(wxT("name"), wxT("-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ bool wxXmlResourceHandler::GetBool(const wxString& param, bool defaultv)
|
|||||||
wxString v = GetParamValue(param);
|
wxString v = GetParamValue(param);
|
||||||
v.MakeLower();
|
v.MakeLower();
|
||||||
if (!v) return defaultv;
|
if (!v) return defaultv;
|
||||||
else return (v == _T("1"));
|
else return (v == wxT("1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -560,8 +560,8 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param)
|
|||||||
wxString v = GetParamValue(param);
|
wxString v = GetParamValue(param);
|
||||||
unsigned long tmp = 0;
|
unsigned long tmp = 0;
|
||||||
|
|
||||||
if (v.Length() != 7 || v[0] != _T('#') ||
|
if (v.Length() != 7 || v[0] != wxT('#') ||
|
||||||
wxSscanf(v.c_str(), _T("#%lX"), &tmp) != 1)
|
wxSscanf(v.c_str(), wxT("#%lX"), &tmp) != 1)
|
||||||
{
|
{
|
||||||
wxLogError(_("XML resource: Incorrect colour specification '%s' for property '%s'."),
|
wxLogError(_("XML resource: Incorrect colour specification '%s' for property '%s'."),
|
||||||
v.c_str(), param.c_str());
|
v.c_str(), param.c_str());
|
||||||
@@ -589,7 +589,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param, wxSize size)
|
|||||||
wxImage img(*(fsfile->GetStream()));
|
wxImage img(*(fsfile->GetStream()));
|
||||||
delete fsfile;
|
delete fsfile;
|
||||||
#else
|
#else
|
||||||
wxImage img(GetParamValue(_T("bitmap")));
|
wxImage img(GetParamValue(wxT("bitmap")));
|
||||||
#endif
|
#endif
|
||||||
if (!img.Ok())
|
if (!img.Ok())
|
||||||
{
|
{
|
||||||
@@ -663,15 +663,15 @@ wxString wxXmlResourceHandler::GetParamValue(const wxString& param)
|
|||||||
wxSize wxXmlResourceHandler::GetSize(const wxString& param)
|
wxSize wxXmlResourceHandler::GetSize(const wxString& param)
|
||||||
{
|
{
|
||||||
wxString s = GetParamValue(param);
|
wxString s = GetParamValue(param);
|
||||||
if (s.IsEmpty()) s = _T("-1,-1");
|
if (s.IsEmpty()) s = wxT("-1,-1");
|
||||||
bool is_dlg;
|
bool is_dlg;
|
||||||
long sx, sy;
|
long sx, sy;
|
||||||
|
|
||||||
is_dlg = s[s.Length()-1] == _T('d');
|
is_dlg = s[s.Length()-1] == wxT('d');
|
||||||
if (is_dlg) s.RemoveLast();
|
if (is_dlg) s.RemoveLast();
|
||||||
|
|
||||||
if (!s.BeforeFirst(_T(',')).ToLong(&sx) ||
|
if (!s.BeforeFirst(wxT(',')).ToLong(&sx) ||
|
||||||
!s.AfterLast(_T(',')).ToLong(&sy))
|
!s.AfterLast(wxT(',')).ToLong(&sy))
|
||||||
{
|
{
|
||||||
wxLogError(_("Cannot parse coordinates from '%s'."), s.mb_str());
|
wxLogError(_("Cannot parse coordinates from '%s'."), s.mb_str());
|
||||||
return wxDefaultSize;
|
return wxDefaultSize;
|
||||||
@@ -709,7 +709,7 @@ wxCoord wxXmlResourceHandler::GetDimension(const wxString& param, wxCoord defaul
|
|||||||
bool is_dlg;
|
bool is_dlg;
|
||||||
long sx;
|
long sx;
|
||||||
|
|
||||||
is_dlg = s[s.Length()-1] == _T('d');
|
is_dlg = s[s.Length()-1] == wxT('d');
|
||||||
if (is_dlg) s.RemoveLast();
|
if (is_dlg) s.RemoveLast();
|
||||||
|
|
||||||
if (!s.ToLong(&sx))
|
if (!s.ToLong(&sx))
|
||||||
@@ -747,37 +747,37 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param)
|
|||||||
wxXmlNode *oldnode = m_Node;
|
wxXmlNode *oldnode = m_Node;
|
||||||
m_Node = font_node;
|
m_Node = font_node;
|
||||||
|
|
||||||
long size = GetLong(_T("size"), 12);
|
long size = GetLong(wxT("size"), 12);
|
||||||
|
|
||||||
wxString style = GetParamValue(_T("style"));
|
wxString style = GetParamValue(wxT("style"));
|
||||||
wxString weight = GetParamValue(_T("weight"));
|
wxString weight = GetParamValue(wxT("weight"));
|
||||||
int istyle = wxNORMAL, iweight = wxNORMAL;
|
int istyle = wxNORMAL, iweight = wxNORMAL;
|
||||||
if (style == _T("italic")) istyle = wxITALIC;
|
if (style == wxT("italic")) istyle = wxITALIC;
|
||||||
else if (style == _T("slant")) istyle = wxSLANT;
|
else if (style == wxT("slant")) istyle = wxSLANT;
|
||||||
if (weight == _T("bold")) iweight = wxBOLD;
|
if (weight == wxT("bold")) iweight = wxBOLD;
|
||||||
else if (weight == _T("light")) iweight = wxLIGHT;
|
else if (weight == wxT("light")) iweight = wxLIGHT;
|
||||||
|
|
||||||
wxString family = GetParamValue(_T("family"));
|
wxString family = GetParamValue(wxT("family"));
|
||||||
int ifamily = wxDEFAULT;
|
int ifamily = wxDEFAULT;
|
||||||
if (family == _T("decorative")) ifamily = wxDECORATIVE;
|
if (family == wxT("decorative")) ifamily = wxDECORATIVE;
|
||||||
else if (family == _T("roman")) ifamily = wxROMAN;
|
else if (family == wxT("roman")) ifamily = wxROMAN;
|
||||||
else if (family == _T("script")) ifamily = wxSCRIPT;
|
else if (family == wxT("script")) ifamily = wxSCRIPT;
|
||||||
else if (family == _T("swiss")) ifamily = wxSWISS;
|
else if (family == wxT("swiss")) ifamily = wxSWISS;
|
||||||
else if (family == _T("modern")) ifamily = wxMODERN;
|
else if (family == wxT("modern")) ifamily = wxMODERN;
|
||||||
|
|
||||||
bool underlined = GetBool(_T("underlined"), FALSE);
|
bool underlined = GetBool(wxT("underlined"), FALSE);
|
||||||
|
|
||||||
wxString encoding = GetParamValue(_T("encoding"));
|
wxString encoding = GetParamValue(wxT("encoding"));
|
||||||
wxFontMapper mapper;
|
wxFontMapper mapper;
|
||||||
wxFontEncoding enc = wxFONTENCODING_DEFAULT;
|
wxFontEncoding enc = wxFONTENCODING_DEFAULT;
|
||||||
if (!encoding.IsEmpty()) enc = mapper.CharsetToEncoding(encoding);
|
if (!encoding.IsEmpty()) enc = mapper.CharsetToEncoding(encoding);
|
||||||
if (enc == wxFONTENCODING_SYSTEM) enc = wxFONTENCODING_SYSTEM;
|
if (enc == wxFONTENCODING_SYSTEM) enc = wxFONTENCODING_SYSTEM;
|
||||||
|
|
||||||
wxString faces = GetParamValue(_T("face"));
|
wxString faces = GetParamValue(wxT("face"));
|
||||||
wxString facename = wxEmptyString;
|
wxString facename = wxEmptyString;
|
||||||
wxFontEnumerator enu;
|
wxFontEnumerator enu;
|
||||||
enu.EnumerateFacenames();
|
enu.EnumerateFacenames();
|
||||||
wxStringTokenizer tk(faces, _T(","));
|
wxStringTokenizer tk(faces, wxT(","));
|
||||||
while (tk.HasMoreTokens())
|
while (tk.HasMoreTokens())
|
||||||
{
|
{
|
||||||
int index = enu.GetFacenames()->Index(tk.GetNextToken(), FALSE);
|
int index = enu.GetFacenames()->Index(tk.GetNextToken(), FALSE);
|
||||||
@@ -799,23 +799,23 @@ void wxXmlResourceHandler::SetupWindow(wxWindow *wnd)
|
|||||||
{
|
{
|
||||||
//FIXME : add cursor
|
//FIXME : add cursor
|
||||||
|
|
||||||
if (HasParam(_T("exstyle")))
|
if (HasParam(wxT("exstyle")))
|
||||||
wnd->SetExtraStyle(GetStyle(_T("exstyle")));
|
wnd->SetExtraStyle(GetStyle(wxT("exstyle")));
|
||||||
if (HasParam(_T("bg")))
|
if (HasParam(wxT("bg")))
|
||||||
wnd->SetBackgroundColour(GetColour(_T("bg")));
|
wnd->SetBackgroundColour(GetColour(wxT("bg")));
|
||||||
if (HasParam(_T("fg")))
|
if (HasParam(wxT("fg")))
|
||||||
wnd->SetForegroundColour(GetColour(_T("fg")));
|
wnd->SetForegroundColour(GetColour(wxT("fg")));
|
||||||
if (GetBool(_T("enabled"), 1) == 0)
|
if (GetBool(wxT("enabled"), 1) == 0)
|
||||||
wnd->Enable(FALSE);
|
wnd->Enable(FALSE);
|
||||||
if (GetBool(_T("focused"), 0) == 1)
|
if (GetBool(wxT("focused"), 0) == 1)
|
||||||
wnd->SetFocus();
|
wnd->SetFocus();
|
||||||
if (GetBool(_T("hidden"), 0) == 1)
|
if (GetBool(wxT("hidden"), 0) == 1)
|
||||||
wnd->Show(FALSE);
|
wnd->Show(FALSE);
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (HasParam(_T("tooltip")))
|
if (HasParam(wxT("tooltip")))
|
||||||
wnd->SetToolTip(GetText(_T("tooltip")));
|
wnd->SetToolTip(GetText(wxT("tooltip")));
|
||||||
#endif
|
#endif
|
||||||
if (HasParam(_T("font")))
|
if (HasParam(wxT("font")))
|
||||||
wnd->SetFont(GetFont());
|
wnd->SetFont(GetFont());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -827,7 +827,7 @@ void wxXmlResourceHandler::CreateChildren(wxObject *parent, bool this_hnd_only)
|
|||||||
while (n)
|
while (n)
|
||||||
{
|
{
|
||||||
if (n->GetType() == wxXML_ELEMENT_NODE &&
|
if (n->GetType() == wxXML_ELEMENT_NODE &&
|
||||||
n->GetName() == _T("object"))
|
n->GetName() == wxT("object"))
|
||||||
{
|
{
|
||||||
if (this_hnd_only && CanHandle(n))
|
if (this_hnd_only && CanHandle(n))
|
||||||
CreateResource(n, parent, NULL);
|
CreateResource(n, parent, NULL);
|
||||||
|
Reference in New Issue
Block a user