From f8ebb70d6c40f5ba8db6c24a6537cc65ac48ccd6 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 18 Jan 2009 21:46:46 +0000 Subject: [PATCH] remove usage of wxT() macro; it makes example code a bit harder to read git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/access.h | 4 ++-- interface/wx/aui/framemanager.h | 4 ++-- interface/wx/collpane.h | 4 ++-- interface/wx/html/helpctrl.h | 2 +- interface/wx/mdi.h | 2 +- interface/wx/menuitem.h | 2 +- interface/wx/msw/ole/activex.h | 22 +++++++++++----------- interface/wx/notebook.h | 2 +- interface/wx/propdlg.h | 2 +- interface/wx/propgrid/manager.h | 14 +++++++------- interface/wx/regex.h | 6 +++--- interface/wx/richtext/richtextformatdlg.h | 4 +++- interface/wx/richtext/richtexthtml.h | 4 ++-- interface/wx/richtext/richtextprint.h | 4 ++-- interface/wx/richtext/richtextsymboldlg.h | 2 +- interface/wx/richtext/richtextxml.h | 4 ++-- interface/wx/strconv.h | 2 +- interface/wx/toolbar.h | 4 ++-- interface/wx/xml/xml.h | 6 +++--- interface/wx/xrc/xmlres.h | 6 +++--- 20 files changed, 51 insertions(+), 49 deletions(-) diff --git a/interface/wx/access.h b/interface/wx/access.h index 5a540f5964..10cb58bcfe 100644 --- a/interface/wx/access.h +++ b/interface/wx/access.h @@ -357,9 +357,9 @@ public: Acceptable values are: @li a null variant (IsNull() returns @true) - @li a list variant (GetType() == wxT("list")) + @li a list variant (GetType() == "list") @li an integer representing the selected child element, - or 0 if this object is selected (GetType() == wxT("long")) + or 0 if this object is selected (GetType() == "long") @li a "void*" pointer to a wxAccessible child object */ virtual wxAccStatus GetSelections(wxVariant* selections); diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 8b0dba7b15..bdca83fbfd 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -70,8 +70,8 @@ enum wxAuiManagerOption @code wxTextCtrl* text1 = new wxTextCtrl(this, -1); wxTextCtrl* text2 = new wxTextCtrl(this, -1); - m_mgr.AddPane(text1, wxLEFT, wxT("Pane Caption")); - m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Caption")); + m_mgr.AddPane(text1, wxLEFT, "Pane Caption"); + m_mgr.AddPane(text2, wxBOTTOM, "Pane Caption"); m_mgr.Update(); @endcode diff --git a/interface/wx/collpane.h b/interface/wx/collpane.h index f7205fe55e..5718757d1f 100644 --- a/interface/wx/collpane.h +++ b/interface/wx/collpane.h @@ -65,7 +65,7 @@ public: Usage sample: @code - wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, wxT("Details:")); + wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, "Details:"); // add the pane with a zero proportion value to the 'sz' sizer which contains it sz->Add(collpane, 0, wxGROW|wxALL, 5); @@ -73,7 +73,7 @@ public: // now add a test label in the collapsible pane using a sizer to layout it: wxWindow *win = collpane->GetPane(); wxSizer *paneSz = new wxBoxSizer(wxVERTICAL); - paneSz->Add(new wxStaticText(win, wxID_ANY, wxT("test!")), 1, wxGROW|wxALL, 2); + paneSz->Add(new wxStaticText(win, wxID_ANY, "test!"), 1, wxGROW|wxALL, 2); win->SetSizer(paneSz); paneSz->SetSizeHints(win); @endcode diff --git a/interface/wx/html/helpctrl.h b/interface/wx/html/helpctrl.h index 3b0803bf0d..50e51989a0 100644 --- a/interface/wx/html/helpctrl.h +++ b/interface/wx/html/helpctrl.h @@ -240,7 +240,7 @@ protected: @code // The help can be browsed during the lifetime of this object; when the // user quits the help, program execution will continue. - wxHtmlModalHelp help(parent, wxT("help"), wxT("My topic")); + wxHtmlModalHelp help(parent, "help", "My topic"); @endcode @library{wxhtml} diff --git a/interface/wx/mdi.h b/interface/wx/mdi.h index 63119a1368..83627cd2c3 100644 --- a/interface/wx/mdi.h +++ b/interface/wx/mdi.h @@ -281,7 +281,7 @@ public: @code frame = new MyParentFrame; - frame->Create(parent, myParentFrameId, wxT("My Parent Frame")); + frame->Create(parent, myParentFrameId, "My Parent Frame"); @endcode @remarks diff --git a/interface/wx/menuitem.h b/interface/wx/menuitem.h index 532bfdb565..8b3c3fb26b 100644 --- a/interface/wx/menuitem.h +++ b/interface/wx/menuitem.h @@ -73,7 +73,7 @@ public: helpMenu->Append(wxID_ABOUT); // use the stock label and the stock accelerator but not the stock help string: - helpMenu->Append(wxID_ABOUT, wxEmptyString, wxT("My custom help string")); + helpMenu->Append(wxID_ABOUT, wxEmptyString, "My custom help string"); // use all stock properties except for the bitmap: wxMenuItem *mymenu = new wxMenuItem(helpMenu, wxID_ABOUT); diff --git a/interface/wx/msw/ole/activex.h b/interface/wx/msw/ole/activex.h index 74b7d22a1b..5bfeab0d71 100644 --- a/interface/wx/msw/ole/activex.h +++ b/interface/wx/msw/ole/activex.h @@ -158,9 +158,9 @@ public: virtual bool Load(const wxString& fileName) { - if(m_PDF.CallMethod(wxT("LoadFile"), fileName).GetBool()) + if(m_PDF.CallMethod("LoadFile", fileName).GetBool()) { - m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)0)); + m_PDF.CallMethod("setCurrentPage", wxVariant((long)0)); NotifyMovieLoaded(); // initial refresh wxSizeEvent event; m_pAX->OnSize(event); @@ -171,7 +171,7 @@ public: } virtual bool Load(const wxURI& location) { - return m_PDF.CallMethod(wxT("LoadFile"), location.BuildUnescapedURI()).GetBool(); + return m_PDF.CallMethod("LoadFile", location.BuildUnescapedURI()).GetBool(); } virtual bool Load(const wxURI& WXUNUSED(location), const wxURI& WXUNUSED(proxy)) @@ -186,7 +186,7 @@ public: virtual bool SetPosition(wxLongLong where) { - m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)where.GetValue())); + m_PDF.CallMethod("setCurrentPage", wxVariant((long)where.GetValue())); return true; } virtual wxLongLong GetPosition() @@ -229,13 +229,13 @@ public: { if(flags) { - m_PDF.CallMethod(wxT("setShowToolbar"), true); - m_PDF.CallMethod(wxT("setShowScrollbars"), true); + m_PDF.CallMethod("setShowToolbar", true); + m_PDF.CallMethod("setShowScrollbars", true); } else { - m_PDF.CallMethod(wxT("setShowToolbar"), false); - m_PDF.CallMethod(wxT("setShowScrollbars"), false); + m_PDF.CallMethod("setShowToolbar", false); + m_PDF.CallMethod("setShowScrollbars", false); } return true; @@ -251,9 +251,9 @@ public: Put this in one of your existant source files and then create a wxMediaCtrl with //[this] is the parent window, "myfile.pdf" is the PDF file to open - wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, wxT("myfile.pdf"), wxID_ANY, + wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, "myfile.pdf", wxID_ANY, wxDefaultPosition, wxSize(300,300), - 0, wxT("wxPDFMediaBackend")); + 0, "wxPDFMediaBackend"); @endcode @@ -262,7 +262,7 @@ public: @library{wxbase} @category{misc,ipc} - @see wxActiveXEvent, @ref page_samples_flash Flash sample + @see wxActiveXEvent, @ref page_samples_flash */ class wxActiveXContainer : public wxControl { diff --git a/interface/wx/notebook.h b/interface/wx/notebook.h index d323d92e13..a04135c4ac 100644 --- a/interface/wx/notebook.h +++ b/interface/wx/notebook.h @@ -65,7 +65,7 @@ To disable themed pages globally: @code - wxSystemOptions::SetOption(wxT("msw.notebook.themed-background"), 0); + wxSystemOptions::SetOption("msw.notebook.themed-background", 0); @endcode Set the value to 1 to enable it again. diff --git a/interface/wx/propdlg.h b/interface/wx/propdlg.h index 07af2d11ea..9b7c9bbe05 100644 --- a/interface/wx/propdlg.h +++ b/interface/wx/propdlg.h @@ -80,7 +80,7 @@ enum wxPropertySheetDialogFlags // Add page wxPanel* panel = new wxPanel(GetBookCtrl(), ...); - GetBookCtrl()->AddPage(panel, wxT("General")); + GetBookCtrl()->AddPage(panel, "General"); LayoutDialog(); return true; diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 473dd12b54..1b2e3a14cd 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -170,19 +170,19 @@ public: wxPropertyGridPage* page; - page = pgMan->AddPage(wxT("First Page")); + page = pgMan->AddPage("First Page"); - page->Append( new wxPropertyCategory(wxT("Category A1")) ); + page->Append( new wxPropertyCategory("Category A1") ); - page->Append( new wxIntProperty(wxT("Number"),wxPG_LABEL,1) ); + page->Append( new wxIntProperty("Number",wxPG_LABEL,1) ); - page->Append( new wxColourProperty(wxT("Colour"),wxPG_LABEL,*wxWHITE) ); + page->Append( new wxColourProperty("Colour",wxPG_LABEL,*wxWHITE) ); - page = pgMan->AddPage(wxT("Second Page")); + page = pgMan->AddPage("Second Page"); - page->Append( wxT("Text"),wxPG_LABEL,wxT("(no text)") ); + page->Append( "Text",wxPG_LABEL,"(no text)" ); - page->Append( new wxFontProperty(wxT("Font"),wxPG_LABEL) ); + page->Append( new wxFontProperty("Font",wxPG_LABEL) ); @endcode @section propgridmanager_window_styles_ Window Styles diff --git a/interface/wx/regex.h b/interface/wx/regex.h index 147ea7622e..c414b9f47f 100644 --- a/interface/wx/regex.h +++ b/interface/wx/regex.h @@ -94,19 +94,19 @@ enum @code wxString text; ... - wxRegEx reEmail = wxT("([^@]+)@([[:alnum:].-_].)+([[:alnum:]]+)"); + wxRegEx reEmail = "([^@]+)@([[:alnum:].-_].)+([[:alnum:]]+)"; if ( reEmail.Matches(text) ) { wxString text = reEmail.GetMatch(email); wxString username = reEmail.GetMatch(email, 1); - if ( reEmail.GetMatch(email, 3) == wxT("com") ) // .com TLD? + if ( reEmail.GetMatch(email, 3) == "com" ) // .com TLD? { ... } } // or we could do this to hide the email address - size_t count = reEmail.ReplaceAll(text, wxT("HIDDEN@\\2\\3")); + size_t count = reEmail.ReplaceAll(text, "HIDDEN@\\2\\3"); printf("text now contains %u hidden addresses", count); @endcode */ diff --git a/interface/wx/richtext/richtextformatdlg.h b/interface/wx/richtext/richtextformatdlg.h index 5ef56d5c6a..21d215d1cc 100644 --- a/interface/wx/richtext/richtextformatdlg.h +++ b/interface/wx/richtext/richtextformatdlg.h @@ -167,7 +167,9 @@ public: details about the parameters. */ bool Create(long flags, wxWindow* parent, - const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); + const wxString& title = wxGetTranslation("Formatting"), wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); //@{ /** diff --git a/interface/wx/richtext/richtexthtml.h b/interface/wx/richtext/richtexthtml.h index e697d851db..fba16366be 100644 --- a/interface/wx/richtext/richtexthtml.h +++ b/interface/wx/richtext/richtexthtml.h @@ -60,8 +60,8 @@ public: /** Constructor. */ - wxRichTextHTMLHandler(const wxString& name = wxT("HTML"), - const wxString& ext = wxT("html"), + wxRichTextHTMLHandler(const wxString& name = "HTML", + const wxString& ext = "html", int type = wxRICHTEXT_TYPE_HTML); /** diff --git a/interface/wx/richtext/richtextprint.h b/interface/wx/richtext/richtextprint.h index ae7417c121..6344debdd4 100644 --- a/interface/wx/richtext/richtextprint.h +++ b/interface/wx/richtext/richtextprint.h @@ -194,7 +194,7 @@ public: /** Constructor. */ - wxRichTextPrintout(const wxString& title = wxT("Printout")); + wxRichTextPrintout(const wxString& title = "Printout"); /** Calculates scaling and text, header and footer rectangles. @@ -272,7 +272,7 @@ public: Optionally pass a title to be used in the preview frame and printing wait dialog, and also a parent window for these windows. */ - wxRichTextPrinting(const wxString& name = wxT("Printing"), + wxRichTextPrinting(const wxString& name = "Printing", wxWindow* parentWindow = NULL); /** diff --git a/interface/wx/richtext/richtextsymboldlg.h b/interface/wx/richtext/richtextsymboldlg.h index 5391f5a810..3e1778910c 100644 --- a/interface/wx/richtext/richtextsymboldlg.h +++ b/interface/wx/richtext/richtextsymboldlg.h @@ -49,7 +49,7 @@ // 'normal text', i.e. the current font) but do tell the dialog // what 'normal text' is. - wxSymbolPickerDialog dlg(wxT("*"), wxEmptyString, currentFontName, this); + wxSymbolPickerDialog dlg("*", wxEmptyString, currentFontName, this); if (dlg.ShowModal() == wxID_OK) { diff --git a/interface/wx/richtext/richtextxml.h b/interface/wx/richtext/richtextxml.h index 74fc2a2bc4..aaa42f746d 100644 --- a/interface/wx/richtext/richtextxml.h +++ b/interface/wx/richtext/richtextxml.h @@ -35,8 +35,8 @@ public: /** Constructor. */ - wxRichTextXMLHandler(const wxString& name = wxT("XML"), - const wxString& ext = wxT("xml"), + wxRichTextXMLHandler(const wxString& name = "XML", + const wxString& ext = "xml", int type = wxRICHTEXT_TYPE_XML); /** diff --git a/interface/wx/strconv.h b/interface/wx/strconv.h index 22e9de2850..174133388e 100644 --- a/interface/wx/strconv.h +++ b/interface/wx/strconv.h @@ -469,7 +469,7 @@ public: could use it like this: @code - wxChar *name = wxT("rawfile.doc"); + wxChar *name = "rawfile.doc"; FILE *fil = fopen(wxFNCONV(name), "r"); @endcode diff --git a/interface/wx/toolbar.h b/interface/wx/toolbar.h index cef105a0dc..a7ccb783a7 100644 --- a/interface/wx/toolbar.h +++ b/interface/wx/toolbar.h @@ -36,12 +36,12 @@ bitmaps will inadvertently be mapped to system colours. To do this, set the msw.remap system option before creating the toolbar: @code - wxSystemOptions::SetOption(wxT("msw.remap"), 0); + wxSystemOptions::SetOption("msw.remap", 0); @endcode If you wish to use 32-bit images (which include an alpha channel for transparency) use: @code - wxSystemOptions::SetOption(wxT("msw.remap"), 2); + wxSystemOptions::SetOption("msw.remap", 2); @endcode Then colour remapping is switched off, and a transparent background used. But only use this option under Windows XP with true colour: diff --git a/interface/wx/xml/xml.h b/interface/wx/xml/xml.h index cabd080e2f..c3491b4f92 100644 --- a/interface/wx/xml/xml.h +++ b/interface/wx/xml/xml.h @@ -511,7 +511,7 @@ public: Loads the XML document from given stream using the given encoding. See Load(). */ wxXmlDocument(wxInputStream& stream, - const wxString& encoding = wxT("UTF-8")); + const wxString& encoding = "UTF-8"); /** Virtual destructor. Frees the document root node. @@ -579,14 +579,14 @@ public: Returns true on success, false otherwise. */ virtual bool Load(const wxString& filename, - const wxString& encoding = wxT("UTF-8"), int flags = wxXMLDOC_NONE); + const wxString& encoding = "UTF-8", int flags = wxXMLDOC_NONE); /** Like Load(const wxString&, const wxString&, int) but takes the data from given input stream. */ virtual bool Load(wxInputStream& stream, - const wxString& encoding = wxT("UTF-8"), int flags = wxXMLDOC_NONE); + const wxString& encoding = "UTF-8", int flags = wxXMLDOC_NONE); /** Saves XML tree creating a file named with given string. diff --git a/interface/wx/xrc/xmlres.h b/interface/wx/xrc/xmlres.h index 75b8820a00..849b932ea6 100644 --- a/interface/wx/xrc/xmlres.h +++ b/interface/wx/xrc/xmlres.h @@ -381,7 +381,7 @@ protected: /** Creates an animation (see wxAnimation) from the filename specified in @a param. */ - wxAnimation GetAnimation(const wxString& param = wxT("animation")); + wxAnimation GetAnimation(const wxString& param = "animation"); /** Gets a bitmap. @@ -457,7 +457,7 @@ protected: /** Gets the position (may be in dialog units). */ - wxPoint GetPosition(const wxString& param = wxT("pos")); + wxPoint GetPosition(const wxString& param = "pos"); /** Gets the size (may be in dialog units). @@ -468,7 +468,7 @@ protected: Gets style flags from text in form "flag | flag2| flag3 |..." Only understands flags added with AddStyle(). */ - int GetStyle(const wxString& param = wxT("style"), int defaults = 0); + int GetStyle(const wxString& param = "style", int defaults = 0); /** Gets text from param and does some conversions: -- 2.47.2