Unicode fixes (patch 754930)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-07-10 11:44:49 +00:00
parent 71414756b2
commit 019abbf209
5 changed files with 50 additions and 48 deletions

View File

@ -39,7 +39,7 @@ class SashHtmlWindow : public wxHtmlWindow {
public:
SashHtmlWindow(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxHW_SCROLLBAR_NEVER, const wxString& name = "sashHtmlWindow");
long style = wxHW_SCROLLBAR_NEVER, const wxString& name = wxT("sashHtmlWindow"));
wxSize DoGetBestSize() const;
@ -51,19 +51,18 @@ private:
IMPLEMENT_APP(Demo)
char *HTML_content =
"<P><H1>wxDynamicSashWindow demo</H1>"
wxChar *HTML_content =
wxT("<P><H1>wxDynamicSashWindow demo</H1>"
"<P>Here is an example of how you can use <TT>wxDynamicSashWindow</TT> to allow your users to "
"dynamically split and unify the views of your windows. Try dragging out a few splits "
"and then reunifying the window."
"<P>Also, see the <TT>dynsash_switch</TT> sample for an example of an application which "
"manages the scrollbars provided by <TT>wxDynamicSashWindow</TT> itself."
;
"manages the scrollbars provided by <TT>wxDynamicSashWindow</TT> itself.");
bool Demo::OnInit() {
wxInitAllImageHandlers();
wxFrame *frame = new wxFrame(NULL, -1, "Dynamic Sash Demo");
wxFrame *frame = new wxFrame(NULL, -1, wxT("Dynamic Sash Demo"));
frame->SetSize(480, 480);
wxDynamicSashWindow *sash = new wxDynamicSashWindow(frame, -1);

View File

@ -69,15 +69,15 @@ SwitchView::SwitchView(wxDynamicSashWindow *win) {
m_dyn_sash = win;
m_bar = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER, "bar");
m_bar = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER, wxT("bar"));
m_choice = new wxChoice(m_bar, -1);
m_choice->SetEventHandler(this);
m_view = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, 0, "view");
m_view = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("view"));
m_view->SetBackgroundColour(*wxWHITE);
m_view->SetEventHandler(this);
m_choice->Append("Triangle");
m_choice->Append("Square");
m_choice->Append(wxT("Triangle"));
m_choice->Append(wxT("Square"));
m_choice->SetSelection(0);
wxLayoutConstraints *layout;
@ -222,7 +222,7 @@ bool SwitchDemo::OnInit() {
wxFrame *frame;
wxDynamicSashWindow *dyn;
frame = new wxFrame(NULL, -1, "Dynamic Sash Window Switch Demo");
frame = new wxFrame(NULL, -1, wxT("Dynamic Sash Window Switch Demo"));
dyn = new wxDynamicSashWindow(frame, -1, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN);
new SwitchView(dyn);

View File

@ -48,12 +48,12 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, (char *) "wxMultiCellSizer Sample", wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500));
MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, wxT("wxMultiCellSizer Sample"), wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500));
frame->Show(TRUE);
SetTopWindow(frame);
frame = new MyFrame(2, (wxFrame *) NULL, (char *) "wxMultiCellCanvas Sample", wxPoint(100, 100), wxSize(600, 500));
frame = new MyFrame(2, (wxFrame *) NULL, wxT("wxMultiCellCanvas Sample"), wxPoint(100, 100), wxSize(600, 500));
frame->Show(TRUE);
@ -78,56 +78,56 @@ wxFrame(frame, -1, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCRO
sizer->SetRowHeight(8,5,FALSE);
// add first row
sizer->Add(
new wxButton( this, -1, "B1 - 0,0, horizontal resizable" ),
new wxButton( this, -1,wxT( "B1 - 0,0, horizontal resizable")),
0, 0, 0, new wxMultiCellItemHandle(0,0,1,1, wxDefaultSize, wxHORIZONTAL_RESIZABLE, wxSize(2,2)));
sizer->Add(
new wxButton( this, -1, "B2 - 0,1, vertical resizable" ),
new wxButton( this, -1, wxT("B2 - 0,1, vertical resizable")),
0, 0, 0, new wxMultiCellItemHandle(0,1,1,1, wxDefaultSize, wxVERTICAL_RESIZABLE, wxSize(2, 2)));
sizer->Add(
new wxButton( this, -1, "B3 - 0,2" ),
new wxButton( this, -1, wxT("B3 - 0,2")),
0, 0, 0, new wxMultiCellItemHandle(0,2,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_CENTER_HORIZONTAL)); //, wxALIGN_CENTER));
sizer->Add(
new wxStaticText(this, -1, "jbb 0,3, lower-right"),
new wxStaticText(this, -1, wxT("jbb 0,3, lower-right")),
0, 0, 0, new wxMultiCellItemHandle(0,3,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_BOTTOM | wxALIGN_RIGHT));
// add button for secord row
sizer->Add(
new wxTextCtrl(this, -1, "Text control - 1,0, 4 cols wide"),
new wxTextCtrl(this, -1, wxT("Text control - 1,0, 4 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(1,0,1,4));
// add buttons for next row
sizer->Add(
new wxButton( this, -1, "B6 - 2,0, 2 cols wide" ),
new wxButton( this, -1, wxT("B6 - 2,0, 2 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(2,0,1,2));
sizer->Add(
new wxButton( this, -1, "B7 - 2,3" ),
new wxButton( this, -1, wxT("B7 - 2,3")),
0, 0, 0, new wxMultiCellItemHandle(2,3,1,1));
// and last additions
sizer->Add(
new wxButton( this, -1, "B8 - 3,0, 4 rows high, vert resizable" ),
new wxButton( this, -1, wxT("B8 - 3,0, 4 rows high, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(3,0,4,1,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B9 - 3,2, 2 cols wide, vert resizable" ),
new wxButton( this, -1, wxT("B9 - 3,2, 2 cols wide, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(3,2,1,2,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B10 - 4,1, 3 cols wide, vert resizable" ),
new wxButton( this, -1, wxT("B10 - 4,1, 3 cols wide, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(4,1,1,3,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B11 - 5,1, 3 cols wide" ),
new wxButton( this, -1, wxT("B11 - 5,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(5,1,1,3));
sizer->Add(
new wxButton( this, -1, "B12 - 6,1, 3 cols wide" ),
new wxButton( this, -1, wxT("B12 - 6,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(6,1,1,3));
sizer->Add(
new wxButton( this, -1, "B13 - 7,1, 2 cols wide" ),
new wxButton( this, -1, wxT("B13 - 7,1, 2 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(7,1,1,2));
sizer->Add(
new wxButton( this, -1, "B14 - 8,1, 3 cols wide" ),
new wxButton( this, -1, wxT("B14 - 8,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(8,1,1,3));
SetAutoLayout( TRUE );
@ -145,44 +145,44 @@ wxFrame(frame, -1, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCRO
// add first row
sizer->Add(
new wxButton( this, -1, "Button 1" ),
new wxButton( this, -1, wxT("Button 1")),
0, 0);
sizer->Add(
new wxButton( this, -1, "Button 2" ),
new wxButton( this, -1, wxT("Button 2")),
0, 1);
sizer->Add(
new wxButton( this, -1, "Button 3" ),
new wxButton( this, -1, wxT("Button 3")),
0, 2);
sizer->Add(
new wxStaticText(this, -1, "jbb test"),
new wxStaticText(this, -1, wxT("jbb test")),
0, 3);
sizer->Add(
new wxStaticText(this, -1, "jbb test 2"),
new wxStaticText(this, -1, wxT("jbb test 2")),
0, 4);
// add button for secord row
sizer->Add(
new wxTextCtrl(this, -1, "Text control"),
new wxTextCtrl(this, -1, wxT("Text control")),
1, 0);
// add buttons for next row
sizer->Add(
new wxButton( this, -1, "Button 6" ),
new wxButton( this, -1, wxT("Button 6")),
2, 0);
sizer->Add(
new wxButton( this, -1, "Button 7" ),
new wxButton( this, -1, wxT("Button 7")),
2, 3);
// and last additions
sizer->Add(
new wxButton( this, -1, "Button 8" ),
new wxButton( this, -1, wxT("Button 8")),
3, 0);
sizer->Add(
new wxButton( this, -1, "Button 9" ),
new wxButton( this, -1, wxT("Button 9")),
3, 1);
sizer->Add(
new wxButton( this, -1, "Button 10" ),
new wxButton( this, -1, wxT("Button 10")),
4, 1);
sizer->CalculateConstraints();

View File

@ -133,7 +133,7 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
// create the main application window
MyFrame *frame = new MyFrame("Tree Testing",
MyFrame *frame = new MyFrame(wxT("Tree Testing"),
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
@ -190,18 +190,18 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
SetIcon(wxICON(mondrian));
// create a menu bar
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF);
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(Minimal_About, "&About...\tCtrl-A", "Show about dialog");
helpMenu->Append(Minimal_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program");
menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, "&File");
menuBar->Append(helpMenu, "&Help");
menuBar->Append(menuFile, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
@ -219,10 +219,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
msg.Printf( _T("This is the about dialog of splittree sample.\n")
_T("Welcome to %s"), wxVERSION_STRING);
msg.Printf( wxT("This is the about dialog of splittree sample.\n")
wxT("Welcome to %s"), wxVERSION_STRING);
wxMessageBox(msg, "About Tree Test", wxOK | wxICON_INFORMATION, this);
wxMessageBox(msg, wxT("About Tree Test"), wxOK | wxICON_INFORMATION, this);
}
/*

View File

@ -634,9 +634,12 @@ wxMultiCellCanvas :: wxMultiCellCanvas(wxWindow *par, int numRows, int numCols)
//---------------------------------------------------------------------------
wxString itoa(int x)
{
/*
char bfr[255];
sprintf(bfr, "%d", x);
return bfr;
*/
return wxString::Format(wxT("%d"), x);
}
//---------------------------------------------------------------------------
void wxMultiCellCanvas :: Add(wxWindow *win, unsigned int row, unsigned int col)
@ -659,7 +662,7 @@ void wxMultiCellCanvas :: CalculateConstraints()
if (!m_cells[CELL_LOC(row, col)])
{
// Create an empty static text field as a placeholder
m_cells[CELL_LOC(row, col)] = new wxCell(new wxStaticText(m_parent, -1, ""));
m_cells[CELL_LOC(row, col)] = new wxCell(new wxStaticText(m_parent, -1, wxT("")));
}
wxFlexGridSizer::Add(m_cells[CELL_LOC(row, col)]->m_window);
}