diff --git a/include/wx/cmdproc.h b/include/wx/cmdproc.h index 91ed5ee234..b5b8b88b10 100644 --- a/include/wx/cmdproc.h +++ b/include/wx/cmdproc.h @@ -26,7 +26,7 @@ class WXDLLEXPORT wxCommand : public wxObject { public: - wxCommand(bool canUndoIt = FALSE, const wxString& name = ""); + wxCommand(bool canUndoIt = FALSE, const wxString& name = wxT("")); ~wxCommand(); // Override this to perform a command diff --git a/include/wx/defs.h b/include/wx/defs.h index ae0aff0c45..a468967973 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1795,11 +1795,11 @@ enum wxPrintMode // macro to specify "All Files" on different platforms #if defined(__WXMSW__) || defined(__WXPM__) -# define wxALL_FILES_PATTERN "*.*" -# define wxALL_FILES gettext_noop("All files (*.*)|*.*") +# define wxALL_FILES_PATTERN wxT("*.*") +# define wxALL_FILES gettext_noop(wxT("All files (*.*)|*.*")) #else -# define wxALL_FILES_PATTERN "*" -# define wxALL_FILES gettext_noop("All files (*)|*") +# define wxALL_FILES_PATTERN wxT("*") +# define wxALL_FILES gettext_noop(wxT("All files (*)|*")) #endif // --------------------------------------------------------------------------- diff --git a/include/wx/docmdi.h b/include/wx/docmdi.h index 37b2109475..089a328ce4 100644 --- a/include/wx/docmdi.h +++ b/include/wx/docmdi.h @@ -29,26 +29,26 @@ class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame { - DECLARE_CLASS(wxDocMDIParentFrame) - public: - wxDocMDIParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, - const wxString& title, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"); +public: + wxDocMDIParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, + const wxString& title, const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); - // Extend event processing to search the document manager's event table - virtual bool ProcessEvent(wxEvent& event); + // Extend event processing to search the document manager's event table + virtual bool ProcessEvent(wxEvent& event); - wxDocManager *GetDocumentManager(void) const { return m_docManager; } + wxDocManager *GetDocumentManager(void) const { return m_docManager; } - void OnExit(wxCommandEvent& event); - void OnMRUFile(wxCommandEvent& event); - void OnCloseWindow(wxCloseEvent& event); + void OnExit(wxCommandEvent& event); + void OnMRUFile(wxCommandEvent& event); + void OnCloseWindow(wxCloseEvent& event); - protected: - wxDocManager *m_docManager; +protected: + wxDocManager *m_docManager; - -DECLARE_EVENT_TABLE() +private: + DECLARE_CLASS(wxDocMDIParentFrame) + DECLARE_EVENT_TABLE() }; /* @@ -57,31 +57,31 @@ DECLARE_EVENT_TABLE() class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame { - DECLARE_CLASS(wxDocMDIChildFrame) +public: + wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, + const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); + ~wxDocMDIChildFrame(); - public: - wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, - const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"); - ~wxDocMDIChildFrame(void); + // Extend event processing to search the view's event table + virtual bool ProcessEvent(wxEvent& event); - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); + void OnActivate(wxActivateEvent& event); + void OnCloseWindow(wxCloseEvent& event); - void OnActivate(wxActivateEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - inline wxDocument *GetDocument(void) const { return m_childDocument; } - inline wxView *GetView(void) const { return m_childView; } - inline void SetDocument(wxDocument *doc) { m_childDocument = doc; } - inline void SetView(wxView *view) { m_childView = view; } - bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } - protected: - wxDocument* m_childDocument; - wxView* m_childView; - -DECLARE_EVENT_TABLE() + inline wxDocument *GetDocument() const { return m_childDocument; } + inline wxView *GetView(void) const { return m_childView; } + inline void SetDocument(wxDocument *doc) { m_childDocument = doc; } + inline void SetView(wxView *view) { m_childView = view; } + bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } + +protected: + wxDocument* m_childDocument; + wxView* m_childView; +private: + DECLARE_EVENT_TABLE() + DECLARE_CLASS(wxDocMDIChildFrame) }; #endif diff --git a/include/wx/docview.h b/include/wx/docview.h index 93e968d334..251be3a4a6 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -64,8 +64,6 @@ enum class WXDLLEXPORT wxDocument : public wxEvtHandler { - DECLARE_ABSTRACT_CLASS(wxDocument) - public: wxDocument(wxDocument *parent = (wxDocument *) NULL); ~wxDocument(); @@ -160,12 +158,13 @@ protected: wxDocument* m_documentParent; wxCommandProcessor* m_commandProcessor; bool m_savedYet; + +private: + DECLARE_ABSTRACT_CLASS(wxDocument) }; class WXDLLEXPORT wxView: public wxEvtHandler { - DECLARE_ABSTRACT_CLASS(wxView) - public: // wxView(wxDocument *doc = (wxDocument *) NULL); wxView(); @@ -222,12 +221,14 @@ protected: wxDocument* m_viewDocument; wxString m_viewTypeName; wxWindow* m_viewFrame; + +private: + DECLARE_ABSTRACT_CLASS(wxView) }; // Represents user interface (and other) properties of documents and views class WXDLLEXPORT wxDocTemplate: public wxObject { -DECLARE_CLASS(wxDocTemplate) friend class WXDLLEXPORT wxDocManager; @@ -286,6 +287,9 @@ protected: // For dynamic creation of appropriate instances. wxClassInfo* m_docClassInfo; wxClassInfo* m_viewClassInfo; + +private: + DECLARE_CLASS(wxDocTemplate) }; // One object of this class may be created in an application, to manage all @@ -427,8 +431,6 @@ protected: class WXDLLEXPORT wxDocChildFrame : public wxFrame { - DECLARE_CLASS(wxDocChildFrame) - public: wxDocChildFrame(wxDocument *doc, wxView *view, @@ -438,7 +440,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long type = wxDEFAULT_FRAME_STYLE, - const wxString& name = "frame"); + const wxString& name = wxT("frame")); ~wxDocChildFrame(); // Extend event processing to search the view's event table @@ -457,6 +459,8 @@ protected: wxDocument* m_childDocument; wxView* m_childView; +private: + DECLARE_CLASS(wxDocChildFrame) DECLARE_EVENT_TABLE() }; @@ -466,8 +470,6 @@ protected: class WXDLLEXPORT wxDocParentFrame : public wxFrame { - DECLARE_CLASS(wxDocParentFrame) - public: wxDocParentFrame(wxDocManager *manager, wxFrame *frame, @@ -476,7 +478,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long type = wxDEFAULT_FRAME_STYLE, - const wxString& name = "frame"); + const wxString& name = wxT("frame")); // Extend event processing to search the document manager's event table virtual bool ProcessEvent(wxEvent& event); @@ -490,6 +492,8 @@ public: protected: wxDocManager *m_docManager; +private: + DECLARE_CLASS(wxDocParentFrame) DECLARE_EVENT_TABLE() }; @@ -500,10 +504,8 @@ protected: #if wxUSE_PRINTING_ARCHITECTURE class WXDLLEXPORT wxDocPrintout : public wxPrintout { - DECLARE_DYNAMIC_CLASS(wxDocPrintout) - public: - wxDocPrintout(wxView *view = (wxView *) NULL, const wxString& title = "Printout"); + wxDocPrintout(wxView *view = (wxView *) NULL, const wxString& title = wxT("Printout")); bool OnPrintPage(int page); bool HasPage(int page); bool OnBeginDocument(int startPage, int endPage); @@ -513,6 +515,9 @@ public: protected: wxView* m_printoutView; + +private: + DECLARE_DYNAMIC_CLASS(wxDocPrintout) }; #endif // wxUSE_PRINTING_ARCHITECTURE @@ -522,8 +527,6 @@ protected: class WXDLLEXPORT wxFileHistory : public wxObject { - DECLARE_DYNAMIC_CLASS(wxFileHistory) - public: wxFileHistory(int maxFiles = 9); ~wxFileHistory(); @@ -563,6 +566,9 @@ protected: wxList m_fileMenus; // Max files to maintain int m_fileMaxFiles; + +private: + DECLARE_DYNAMIC_CLASS(wxFileHistory) }; #if wxUSE_STD_IOSTREAM diff --git a/include/wx/generic/helphtml.h b/include/wx/generic/helphtml.h index ca99146693..8e81689988 100644 --- a/include/wx/generic/helphtml.h +++ b/include/wx/generic/helphtml.h @@ -86,7 +86,7 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase) @file Name of help directory. @return true on success */ - virtual bool LoadFile(const wxString& file = ""); + virtual bool LoadFile(const wxString& file = wxT("")); /** Display list of all help entries. @return true on success diff --git a/include/wx/generic/laywin.h b/include/wx/generic/laywin.h index 7a4908efdc..992e1b0d34 100644 --- a/include/wx/generic/laywin.h +++ b/include/wx/generic/laywin.h @@ -61,9 +61,7 @@ enum wxLayoutAlignment class WXDLLEXPORT wxQueryLayoutInfoEvent: public wxEvent { -DECLARE_DYNAMIC_CLASS(wxQueryLayoutInfoEvent) public: - wxQueryLayoutInfoEvent(wxWindowID id = 0) { SetEventType(wxEVT_QUERY_LAYOUT_INFO); @@ -99,7 +97,9 @@ protected: wxSize m_size; wxLayoutOrientation m_orientation; wxLayoutAlignment m_alignment; - + +private: + DECLARE_DYNAMIC_CLASS(wxQueryLayoutInfoEvent) }; typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&); @@ -113,7 +113,6 @@ typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEv class WXDLLEXPORT wxCalculateLayoutEvent: public wxEvent { -DECLARE_DYNAMIC_CLASS(wxCalculateLayoutEvent) public: wxCalculateLayoutEvent(wxWindowID id = 0) { @@ -135,6 +134,9 @@ public: protected: int m_flags; wxRect m_rect; + +private: + DECLARE_DYNAMIC_CLASS(wxCalculateLayoutEvent) }; typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&); @@ -149,7 +151,6 @@ typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEv // an IDE-style interface. class WXDLLEXPORT wxSashLayoutWindow: public wxSashWindow { - DECLARE_CLASS(wxSashLayoutWindow) public: wxSashLayoutWindow() { @@ -157,13 +158,13 @@ public: } wxSashLayoutWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "layoutWindow") + const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")) { Create(parent, id, pos, size, style, name); } bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "layoutWindow"); + const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")); // Accessors inline wxLayoutAlignment GetAlignment() const { return m_alignment; }; @@ -190,7 +191,9 @@ private: wxLayoutOrientation m_orientation; wxSize m_defaultSize; -DECLARE_EVENT_TABLE() +private: + DECLARE_CLASS(wxSashLayoutWindow) + DECLARE_EVENT_TABLE() }; #endif // wxUSE_SASH diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index b29dd9b516..b84337ef21 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -72,7 +72,7 @@ public: const wxSize &size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "listctrl" ) + const wxString &name = wxT("listctrl") ) { Create(parent, id, pos, size, style, validator, name); } @@ -84,7 +84,7 @@ public: const wxSize &size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "listctrl" ); + const wxString &name = wxT("listctrl") ); bool GetColumn( int col, wxListItem& item ) const; bool SetColumn( int col, wxListItem& item ); @@ -246,7 +246,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator &validator = wxDefaultValidator, - const wxString &name = "listctrl" ) + const wxString &name = wxT("listctrl") ) : wxGenericListCtrl(parent, id, pos, size, style, validator, name) { } diff --git a/include/wx/generic/sashwin.h b/include/wx/generic/sashwin.h index 73648209eb..dcd39f47f5 100644 --- a/include/wx/generic/sashwin.h +++ b/include/wx/generic/sashwin.h @@ -69,13 +69,7 @@ public: class WXDLLEXPORT wxSashWindow: public wxWindow { - DECLARE_DYNAMIC_CLASS(wxSashWindow) - public: - -//////////////////////////////////////////////////////////////////////////// -// Public API - // Default constructor wxSashWindow() { @@ -84,7 +78,7 @@ public: // Normal constructor wxSashWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "sashWindow") + const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")) { Init(); Create(parent, id, pos, size, style, name); @@ -93,7 +87,7 @@ public: ~wxSashWindow(); bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "sashWindow"); + const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")); // Set whether there's a sash in this position void SetSashVisible(wxSashEdgePosition edge, bool sash); @@ -196,7 +190,9 @@ private: bool m_mouseCaptured; wxCursor* m_currentCursor; -DECLARE_EVENT_TABLE() +private: + DECLARE_DYNAMIC_CLASS(wxSashWindow) + DECLARE_EVENT_TABLE() }; BEGIN_DECLARE_EVENT_TYPES() @@ -213,9 +209,7 @@ enum wxSashDragStatus class WXDLLEXPORT wxSashEvent: public wxCommandEvent { - DECLARE_DYNAMIC_CLASS(wxSashEvent) - - public: +public: inline wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE) { m_eventType = (wxEventType) wxEVT_SASH_DRAGGED; m_id = id; m_edge = edge; } @@ -230,10 +224,14 @@ class WXDLLEXPORT wxSashEvent: public wxCommandEvent //// dragging the top below the bottom) inline void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; } inline wxSashDragStatus GetDragStatus() const { return m_dragStatus; } - private: + +private: wxSashEdgePosition m_edge; wxRect m_dragRect; wxSashDragStatus m_dragStatus; + +private: + DECLARE_DYNAMIC_CLASS(wxSashEvent) }; typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&); diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 2ea74a49d0..26480fe129 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -71,7 +71,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_3D, - const wxString& name = "splitter") + const wxString& name = wxT("splitter")) { Init(); Create(parent, id, pos, size, style, name); @@ -83,7 +83,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_3D, - const wxString& name = "splitter"); + const wxString& name = wxT("splitter")); // Gets the only or left/top pane wxWindow *GetWindow1() const { return m_windowOne; } diff --git a/include/wx/generic/treelay.h b/include/wx/generic/treelay.h index 4bcc4baf0f..b202da646e 100644 --- a/include/wx/generic/treelay.h +++ b/include/wx/generic/treelay.h @@ -29,8 +29,6 @@ class wxMouseEvent; class WXDLLEXPORT wxTreeLayout: public wxObject { - DECLARE_ABSTRACT_CLASS(wxTreeLayout) - public: wxTreeLayout(); virtual ~wxTreeLayout() { } @@ -49,7 +47,7 @@ public: // Optional redefinition void Initialize(void); inline virtual void SetNodeName(long WXUNUSED(id), const wxString& WXUNUSED(name)) {} - inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(""); } + inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(wxT("")); } virtual void GetNodeSize(long id, long *x, long *y, wxDC& dc); virtual void Draw(wxDC& dc); virtual void DrawNodes(wxDC& dc); @@ -76,8 +74,6 @@ public: private: void CalcLayout(long node_id, int level, wxDC& dc); - // Members - protected: long m_parentNode; long m_lastY; @@ -87,6 +83,9 @@ protected: long m_topMargin; long m_leftMargin; bool m_orientation; // TRUE for top-to-bottom, FALSE for left-to-right + +private: + DECLARE_ABSTRACT_CLASS(wxTreeLayout) }; class WXDLLEXPORT wxStoredNode @@ -105,7 +104,6 @@ public: class WXDLLEXPORT wxTreeLayoutStored: public wxTreeLayout { - DECLARE_DYNAMIC_CLASS(wxTreeLayoutStored) public: wxTreeLayoutStored(int noNodes = 200); virtual ~wxTreeLayoutStored(void); @@ -130,7 +128,7 @@ public: virtual void SetClientData(long id, long clientData); virtual long GetClientData(long id) const; - virtual long AddChild(const wxString& name, const wxString& parent = ""); + virtual long AddChild(const wxString& name, const wxString& parent = wxT("")); virtual long AddChild(const wxString& name, long parent); virtual long NameToId(const wxString& name); @@ -139,6 +137,9 @@ private: wxStoredNode* m_nodes; int m_num; int m_maxNodes; + +private: + DECLARE_DYNAMIC_CLASS(wxTreeLayoutStored) }; // For backward compatibility diff --git a/include/wx/gtk/colour.h b/include/wx/gtk/colour.h index f299ca5949..de243d30a7 100644 --- a/include/wx/gtk/colour.h +++ b/include/wx/gtk/colour.h @@ -47,7 +47,7 @@ public: // Implicit conversion from the colour name wxColour( const wxString &colourName ) { InitFromName(colourName); } - wxColour( const char *colourName ) { InitFromName(colourName); } + wxColour( const char *colourName ) { InitFromName( wxString::FromAscii(colourName) ); } #if wxUSE_UNICODE wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } #endif diff --git a/include/wx/gtk1/colour.h b/include/wx/gtk1/colour.h index f299ca5949..de243d30a7 100644 --- a/include/wx/gtk1/colour.h +++ b/include/wx/gtk1/colour.h @@ -47,7 +47,7 @@ public: // Implicit conversion from the colour name wxColour( const wxString &colourName ) { InitFromName(colourName); } - wxColour( const char *colourName ) { InitFromName(colourName); } + wxColour( const char *colourName ) { InitFromName( wxString::FromAscii(colourName) ); } #if wxUSE_UNICODE wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } #endif diff --git a/include/wx/helpbase.h b/include/wx/helpbase.h index 9ac23f2e9f..95a1562e7a 100644 --- a/include/wx/helpbase.h +++ b/include/wx/helpbase.h @@ -31,11 +31,9 @@ // Defines the API for help controllers class WXDLLEXPORT wxHelpControllerBase: public wxObject { - DECLARE_CLASS(wxHelpControllerBase) - public: inline wxHelpControllerBase() {} - inline ~wxHelpControllerBase() {}; + inline ~wxHelpControllerBase() {} // Must call this to set the filename and server name. // server is only required when implementing TCP/IP-based @@ -47,7 +45,7 @@ public: virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = "") = 0; + virtual bool LoadFile(const wxString& file = wxT("")) = 0; // Displays the contents virtual bool DisplayContents(void) = 0; @@ -59,11 +57,11 @@ public: virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return FALSE; }; // Display the text in a popup, if possible - virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; }; + virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; } // By default, uses KeywordSection to display a topic. Implementations // may override this for more specific behaviour. - virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }; + virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); } virtual bool DisplayBlock(long blockNo) = 0; virtual bool KeywordSearch(const wxString& k) = 0; /// Allows one to override the default settings for the help frame. @@ -80,11 +78,14 @@ public: wxPoint *WXUNUSED(pos) = NULL, bool *WXUNUSED(newFrameEachTime) = NULL) { - return (wxFrame*) NULL;// does nothing by default + return (wxFrame*) NULL; // does nothing by default } - virtual bool Quit(void) = 0; - virtual void OnQuit(void) {}; + virtual bool Quit() = 0; + virtual void OnQuit() {} + +private: + DECLARE_CLASS(wxHelpControllerBase) }; #endif // wxUSE_HELP diff --git a/include/wx/html/helpctrl.h b/include/wx/html/helpctrl.h index f5f285d8b7..e71db3db4c 100644 --- a/include/wx/html/helpctrl.h +++ b/include/wx/html/helpctrl.h @@ -57,7 +57,7 @@ public: virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); } virtual bool Initialize(const wxString& file); virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} - virtual bool LoadFile(const wxString& file = ""); + virtual bool LoadFile(const wxString& file = wxT("")); virtual bool DisplaySection(int sectionNo); virtual bool DisplaySection(const wxString& section) { return Display(section); } virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); } diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h index 38575d5b5a..713d1ef895 100644 --- a/include/wx/html/htmprint.h +++ b/include/wx/html/htmprint.h @@ -98,7 +98,7 @@ enum { class WXDLLEXPORT wxHtmlPrintout : public wxPrintout { public: - wxHtmlPrintout(const wxString& title = "Printout"); + wxHtmlPrintout(const wxString& title = wxT("Printout")); ~wxHtmlPrintout(); void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = TRUE); @@ -176,7 +176,7 @@ private: class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject { public: - wxHtmlEasyPrinting(const wxString& name = "Printing", wxFrame *parent_frame = NULL); + wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxFrame *parent_frame = NULL); ~wxHtmlEasyPrinting(); bool PreviewFile(const wxString &htmlfile); diff --git a/include/wx/listctrl.h b/include/wx/listctrl.h index a89000e868..c57ee5ef67 100644 --- a/include/wx/listctrl.h +++ b/include/wx/listctrl.h @@ -44,7 +44,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_REPORT, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "listctrl" ) + const wxString &name = wxT("listctrl") ) { Create(parent, id, pos, size, style, validator, name); } diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index 688a957481..d8357cb11b 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -53,8 +53,6 @@ enum wxPrinterError class WXDLLEXPORT wxPrinterBase: public wxObject { - DECLARE_CLASS(wxPrinterBase) - public: wxPrinterBase(wxPrintDialogData *data = (wxPrintDialogData *) NULL); virtual ~wxPrinterBase(); @@ -85,6 +83,8 @@ public: static wxWindow* sm_abortWindow; static bool sm_abortIt; +private: + DECLARE_CLASS(wxPrinterBase) }; /* @@ -97,10 +97,8 @@ public: class WXDLLEXPORT wxPrintout: public wxObject { -DECLARE_ABSTRACT_CLASS(wxPrintout) - public: - wxPrintout(const wxString& title = "Printout"); + wxPrintout(const wxString& title = wxT("Printout")); virtual ~wxPrintout(); virtual bool OnBeginDocument(int startPage, int endPage); @@ -149,6 +147,9 @@ private: int m_PPIPrinterY; bool m_isPreview; + +private: + DECLARE_ABSTRACT_CLASS(wxPrintout) }; /* @@ -158,15 +159,13 @@ private: class WXDLLEXPORT wxPreviewCanvas: public wxScrolledWindow { - DECLARE_CLASS(wxPreviewCanvas) - public: wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "canvas"); + const wxString& name = wxT("canvas")); ~wxPreviewCanvas(); void OnPaint(wxPaintEvent& event); @@ -177,6 +176,7 @@ public: private: wxPrintPreviewBase* m_printPreview; + DECLARE_CLASS(wxPreviewCanvas) DECLARE_EVENT_TABLE() }; @@ -187,16 +187,14 @@ private: class WXDLLEXPORT wxPreviewFrame: public wxFrame { - DECLARE_CLASS(wxPreviewFrame) - public: wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, - const wxString& title = "Print Preview", + const wxString& title = wxT("Print Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = "frame"); + const wxString& name = wxT("frame")); ~wxPreviewFrame(); void OnCloseWindow(wxCloseEvent& event); @@ -209,6 +207,7 @@ protected: wxPrintPreviewBase* m_printPreview; private: + DECLARE_CLASS(wxPreviewFrame) DECLARE_EVENT_TABLE() }; @@ -251,7 +250,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "panel"); + const wxString& name = wxT("panel")); ~wxPreviewControlBar(); virtual void CreateButtons(); @@ -392,7 +391,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "dialog") + const wxString& name = wxT("dialog")) : wxDialog(parent, -1, title, pos, size, style, name) { } diff --git a/include/wx/prop.h b/include/wx/prop.h index 6ddf2f3b5f..efc9573399 100644 --- a/include/wx/prop.h +++ b/include/wx/prop.h @@ -43,44 +43,47 @@ class wxPropertyValidatorRegistry; // A storable sheet of values class WXDLLEXPORT wxPropertySheet: public wxObject { - DECLARE_DYNAMIC_CLASS(wxPropertySheet) - public: - wxPropertySheet(const wxString& name = ""); - ~wxPropertySheet(void); +public: + wxPropertySheet(const wxString& name = wxT("")); + ~wxPropertySheet(); - // Set the name of the sheet - inline virtual void SetName(const wxString& name) { m_name=name; } - inline virtual wxString GetName() const { return m_name; } - // Does this sheet contain a property with this name - virtual bool HasProperty(const wxString& name) const; + // Set the name of the sheet + inline virtual void SetName(const wxString& name) { m_name=name; } + inline virtual wxString GetName() const { return m_name; } + + // Does this sheet contain a property with this name + virtual bool HasProperty(const wxString& name) const; - // Set property name to value - virtual bool SetProperty(const wxString& name, const wxPropertyValue& value); + // Set property name to value + virtual bool SetProperty(const wxString& name, const wxPropertyValue& value); - // Remove property from sheet by name, deleting it - virtual void RemoveProperty(const wxString& name); + // Remove property from sheet by name, deleting it + virtual void RemoveProperty(const wxString& name); - // Get the name of the sheet - // Add a property - virtual void AddProperty(wxProperty *property); + // Get the name of the sheet + // Add a property + virtual void AddProperty(wxProperty *property); - // Get property by name - virtual wxProperty *GetProperty(const wxString& name) const; + // Get property by name + virtual wxProperty *GetProperty(const wxString& name) const; - // Clear all properties - virtual void Clear(void); + // Clear all properties + virtual void Clear(); - virtual void UpdateAllViews(wxPropertyView *thisView = NULL); - inline virtual wxList& GetProperties(void) const { return (wxList&) m_properties; } + virtual void UpdateAllViews(wxPropertyView *thisView = NULL); + inline virtual wxList& GetProperties() const { return (wxList&) m_properties; } - // Sets/clears the modified flag for each property value - virtual void SetAllModified(bool flag = TRUE); + // Sets/clears the modified flag for each property value + virtual void SetAllModified(bool flag = TRUE); - protected: - wxObject* m_viewedObject; - wxList m_properties; - wxPropertyView* m_propertyView; - wxString m_name; +protected: + wxObject* m_viewedObject; + wxList m_properties; + wxPropertyView* m_propertyView; + wxString m_name; + +private: + DECLARE_DYNAMIC_CLASS(wxPropertySheet) }; @@ -88,71 +91,69 @@ class WXDLLEXPORT wxPropertySheet: public wxObject // classes: wxPropertyListView, and wxPropertyFormView. class WXDLLEXPORT wxPropertyView: public wxEvtHandler { - DECLARE_DYNAMIC_CLASS(wxPropertyView) - public: - wxPropertyView(long flags = 0); - ~wxPropertyView(void); +public: + wxPropertyView(long flags = 0); + ~wxPropertyView(); - // Associates and shows the view - virtual void ShowView(wxPropertySheet *WXUNUSED(propertySheet), wxWindow *WXUNUSED(panel)) {} + // Associates and shows the view + virtual void ShowView(wxPropertySheet *WXUNUSED(propertySheet), wxWindow *WXUNUSED(panel)) {} - // Update this view of the viewed object, called e.g. by - // the object itself. - virtual bool OnUpdateView(void) {return FALSE;}; + // Update this view of the viewed object, called e.g. by + // the object itself. + virtual bool OnUpdateView() {return FALSE;}; - // Override this to do something as soon as the property changed, - // if the view and validators support it. - virtual void OnPropertyChanged(wxProperty *WXUNUSED(property)) {} + // Override this to do something as soon as the property changed, + // if the view and validators support it. + virtual void OnPropertyChanged(wxProperty *WXUNUSED(property)) {} - virtual void AddRegistry(wxPropertyValidatorRegistry *registry); - inline virtual wxList& GetRegistryList(void) const - { return (wxList&) m_validatorRegistryList; } + virtual void AddRegistry(wxPropertyValidatorRegistry *registry); + inline virtual wxList& GetRegistryList() const + { return (wxList&) m_validatorRegistryList; } - virtual wxPropertyValidator *FindPropertyValidator(wxProperty *property); - inline virtual void SetPropertySheet(wxPropertySheet *sheet) { m_propertySheet = sheet; } - inline virtual wxPropertySheet *GetPropertySheet(void) const { return m_propertySheet; } + virtual wxPropertyValidator *FindPropertyValidator(wxProperty *property); + inline virtual void SetPropertySheet(wxPropertySheet *sheet) { m_propertySheet = sheet; } + inline virtual wxPropertySheet *GetPropertySheet() const { return m_propertySheet; } -/* - virtual void OnOk(void) {}; - virtual void OnCancel(void) {}; - virtual void OnHelp(void) {}; -*/ + inline virtual bool OnClose() { return FALSE; } + inline long GetFlags(void) { return m_buttonFlags; } - inline virtual bool OnClose(void) { return FALSE; } - inline long GetFlags(void) { return m_buttonFlags; } - - protected: - long m_buttonFlags; - wxPropertySheet* m_propertySheet; - wxProperty* m_currentProperty; - wxList m_validatorRegistryList; - wxPropertyValidator* m_currentValidator; +protected: + long m_buttonFlags; + wxPropertySheet* m_propertySheet; + wxProperty* m_currentProperty; + wxList m_validatorRegistryList; + wxPropertyValidator* m_currentValidator; + +private: + DECLARE_DYNAMIC_CLASS(wxPropertyView) }; class WXDLLEXPORT wxPropertyValidator: public wxEvtHandler { - DECLARE_DYNAMIC_CLASS(wxPropertyValidator) - public: - wxPropertyValidator(long flags = 0); - ~wxPropertyValidator(void); +public: + wxPropertyValidator(long flags = 0); + ~wxPropertyValidator(); - inline long GetFlags(void) const { return m_validatorFlags; } - inline void SetValidatorProperty(wxProperty *prop) { m_validatorProperty = prop; } - inline wxProperty *GetValidatorProperty(void) const { return m_validatorProperty; } + inline long GetFlags() const { return m_validatorFlags; } + inline void SetValidatorProperty(wxProperty *prop) { m_validatorProperty = prop; } + inline wxProperty *GetValidatorProperty(void) const { return m_validatorProperty; } - virtual bool StringToFloat (wxChar *s, float *number); - virtual bool StringToDouble (wxChar *s, double *number); - virtual bool StringToInt (wxChar *s, int *number); - virtual bool StringToLong (wxChar *s, long *number); - virtual wxChar *FloatToString (float number); - virtual wxChar *DoubleToString (double number); - virtual wxChar *IntToString (int number); - virtual wxChar *LongToString (long number); + virtual bool StringToFloat (wxChar *s, float *number); + virtual bool StringToDouble (wxChar *s, double *number); + virtual bool StringToInt (wxChar *s, int *number); + virtual bool StringToLong (wxChar *s, long *number); + virtual wxChar *FloatToString (float number); + virtual wxChar *DoubleToString (double number); + virtual wxChar *IntToString (int number); + virtual wxChar *LongToString (long number); - protected: - long m_validatorFlags; - wxProperty* m_validatorProperty; +protected: + long m_validatorFlags; + wxProperty* m_validatorProperty; + +private: + DECLARE_DYNAMIC_CLASS(wxPropertyValidator) }; @@ -160,14 +161,16 @@ class WXDLLEXPORT wxPropertyValidator: public wxEvtHandler class WXDLLEXPORT wxPropertyValidatorRegistry: public wxHashTable { - DECLARE_DYNAMIC_CLASS(wxPropertyValidatorRegistry) - public: - wxPropertyValidatorRegistry(void); - ~wxPropertyValidatorRegistry(void); +public: + wxPropertyValidatorRegistry(); + ~wxPropertyValidatorRegistry(); - virtual void RegisterValidator(const wxString& roleName, wxPropertyValidator *validator); - virtual wxPropertyValidator *GetValidator(const wxString& roleName); - void ClearRegistry(void); + virtual void RegisterValidator(const wxString& roleName, wxPropertyValidator *validator); + virtual wxPropertyValidator *GetValidator(const wxString& roleName); + void ClearRegistry(); + +private: + DECLARE_DYNAMIC_CLASS(wxPropertyValidatorRegistry) }; /* diff --git a/include/wx/proplist.h b/include/wx/proplist.h index b21f36aa09..72e0fad5fd 100644 --- a/include/wx/proplist.h +++ b/include/wx/proplist.h @@ -78,8 +78,7 @@ // Mediates between a physical panel and the property sheet class WXDLLEXPORT wxPropertyListView: public wxPropertyView { - DECLARE_DYNAMIC_CLASS(wxPropertyListView) - public: +public: wxPropertyListView(wxPanel *propPanel = NULL, long flags = wxPROP_BUTTON_DEFAULT); ~wxPropertyListView(void); @@ -186,10 +185,12 @@ public: wxButton* m_windowCancelButton; wxButton* m_windowHelpButton; -DECLARE_EVENT_TABLE() private: - virtual void ShowView(wxPropertySheet *propertySheet, wxWindow *window) - { wxPropertyView::ShowView(propertySheet, window); }; + DECLARE_DYNAMIC_CLASS(wxPropertyListView) + DECLARE_EVENT_TABLE() + + virtual void ShowView(wxPropertySheet *propertySheet, wxWindow *window) + { wxPropertyView::ShowView(propertySheet, window); }; }; class WXDLLEXPORT wxPropertyTextEdit: public wxTextCtrl @@ -202,13 +203,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = _T("text")); + const wxString& name = wxT("text")); void OnSetFocus(); void OnKillFocus(); wxPropertyListView* m_view; +private: DECLARE_CLASS(wxPropertyTextEdit) }; @@ -220,11 +222,9 @@ public: class WXDLLEXPORT wxPropertyListValidator: public wxPropertyValidator { - DECLARE_DYNAMIC_CLASS(wxPropertyListValidator) - protected: - public: +public: wxPropertyListValidator(long flags = wxPROP_ALLOW_TEXT_EDITING): wxPropertyValidator(flags) { } - ~wxPropertyListValidator(void) {} + ~wxPropertyListValidator() {} // Called when the property is selected or deselected: typically displays the value // in the edit control (having chosen a suitable control to display: (non)editable text or listbox) @@ -274,6 +274,9 @@ class WXDLLEXPORT wxPropertyListValidator: public wxPropertyValidator virtual bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); virtual bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + +private: + DECLARE_DYNAMIC_CLASS(wxPropertyListValidator) }; /* @@ -289,7 +292,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = _T("dialogBox")); + const wxString& name = wxT("dialogBox")); void OnCloseWindow(wxCloseEvent& event); void OnDefaultAction(wxControl *item); @@ -301,6 +304,7 @@ public: private: wxPropertyListView* m_view; +private: DECLARE_CLASS(wxPropertyListDialog) DECLARE_EVENT_TABLE() }; @@ -317,7 +321,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = _T("panel")) + const wxString& name = wxT("panel")) : wxPanel(parent, -1, pos, size, style, name) { m_view = v; @@ -337,6 +341,7 @@ public: private: wxPropertyListView* m_view; +private: DECLARE_EVENT_TABLE() DECLARE_CLASS(wxPropertyListPanel) }; @@ -372,6 +377,7 @@ private: wxPropertyListView* m_view; wxPropertyListPanel* m_propertyPanel; +private: DECLARE_EVENT_TABLE() DECLARE_CLASS(wxPropertyListFrame) }; @@ -382,41 +388,40 @@ private: class WXDLLEXPORT wxRealListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxRealListValidator) - public: - // 0.0, 0.0 means no range - wxRealListValidator(float min = 0.0, float max = 0.0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) - { - m_realMin = min; m_realMax = max; - } - ~wxRealListValidator(void) {} +public: + // 0.0, 0.0 means no range + wxRealListValidator(float min = 0.0, float max = 0.0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) + { m_realMin = min; m_realMax = max; } + ~wxRealListValidator() {} - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost. - // Return FALSE if value didn't check out; signal to restore old value. - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost. + // Return FALSE if value didn't check out; signal to restore old value. + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost or view wants to update - // the property list. - // Does the transfer from the property editing area to the property itself - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost or view wants to update + // the property list. + // Does the transfer from the property editing area to the property itself + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - protected: - float m_realMin; - float m_realMax; +protected: + float m_realMin; + float m_realMax; + +private: + DECLARE_DYNAMIC_CLASS(wxRealListValidator) }; class WXDLLEXPORT wxIntegerListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxIntegerListValidator) - public: +public: // 0, 0 means no range wxIntegerListValidator(long min = 0, long max = 0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) { m_integerMin = min; m_integerMax = max; } - ~wxIntegerListValidator(void) {} + ~wxIntegerListValidator() {} bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); @@ -429,156 +434,158 @@ class WXDLLEXPORT wxIntegerListValidator: public wxPropertyListValidator // Does the transfer from the property editing area to the property itself bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - protected: - long m_integerMin; - long m_integerMax; +protected: + long m_integerMin; + long m_integerMax; + +private: + DECLARE_DYNAMIC_CLASS(wxIntegerListValidator) }; class WXDLLEXPORT wxBoolListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxBoolListValidator) - protected: - public: - wxBoolListValidator(long flags = 0):wxPropertyListValidator(flags) - { - } - ~wxBoolListValidator(void) {} +public: + wxBoolListValidator(long flags = 0):wxPropertyListValidator(flags) {} + ~wxBoolListValidator() {} - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost. - // Return FALSE if value didn't check out; signal to restore old value. - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost. + // Return FALSE if value didn't check out; signal to restore old value. + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost or view wants to update - // the property list. - // Does the transfer from the property editing area to the property itself - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost or view wants to update + // the property list. + // Does the transfer from the property editing area to the property itself + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when the property is double clicked. Extra functionality can be provided, - // cycling through possible values. - virtual bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the property is double clicked. Extra functionality can be provided, + // cycling through possible values. + virtual bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + +private: + DECLARE_DYNAMIC_CLASS(wxBoolListValidator) }; class WXDLLEXPORT wxStringListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxStringListValidator) - public: +public: wxStringListValidator(wxStringList *list = NULL, long flags = 0); - ~wxStringListValidator(void) - { - if (m_strings) - delete m_strings; - } + ~wxStringListValidator() + { + if (m_strings) + delete m_strings; + } - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnClearDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost. - // Return FALSE if value didn't check out; signal to restore old value. - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost. + // Return FALSE if value didn't check out; signal to restore old value. + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost or view wants to update - // the property list. - // Does the transfer from the property editing area to the property itself - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost or view wants to update + // the property list. + // Does the transfer from the property editing area to the property itself + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when the property is double clicked. Extra functionality can be provided, - // cycling through possible values. - bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the property is double clicked. Extra functionality can be provided, + // cycling through possible values. + bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - protected: - wxStringList* m_strings; +protected: + wxStringList* m_strings; + +private: + DECLARE_DYNAMIC_CLASS(wxStringListValidator) }; class WXDLLEXPORT wxFilenameListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxFilenameListValidator) - public: - wxFilenameListValidator(wxString message = "Select a file", wxString wildcard = wxALL_FILES_PATTERN, long flags = 0); +public: + wxFilenameListValidator(wxString message = wxT("Select a file"), wxString wildcard = wxALL_FILES_PATTERN, long flags = 0); + ~wxFilenameListValidator(); - ~wxFilenameListValidator(void); + // Called when TICK is pressed or focus is lost. + // Return FALSE if value didn't check out; signal to restore old value. + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost. - // Return FALSE if value didn't check out; signal to restore old value. - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost or view wants to update + // the property list. + // Does the transferance from the property editing area to the property itself + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost or view wants to update - // the property list. - // Does the transferance from the property editing area to the property itself - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the edit (...) button is pressed. + void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when the edit (...) button is pressed. - void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - - protected: - wxString m_filenameWildCard; - wxString m_filenameMessage; +protected: + wxString m_filenameWildCard; + wxString m_filenameMessage; +private: + DECLARE_DYNAMIC_CLASS(wxFilenameListValidator) }; class WXDLLEXPORT wxColourListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxColourListValidator) - protected: - public: - wxColourListValidator(long flags = 0); +public: + wxColourListValidator(long flags = 0); + ~wxColourListValidator(); - ~wxColourListValidator(void); + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - - // Called when the edit (...) button is pressed. - void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the edit (...) button is pressed. + void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + +private: + DECLARE_DYNAMIC_CLASS(wxColourListValidator) }; class WXDLLEXPORT wxListOfStringsListValidator: public wxPropertyListValidator { - DECLARE_DYNAMIC_CLASS(wxListOfStringsListValidator) - protected: - public: - wxListOfStringsListValidator(long flags = 0); +public: + wxListOfStringsListValidator(long flags = 0); + ~wxListOfStringsListValidator() {} - ~wxListOfStringsListValidator(void) - { - } + bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost. + // Return FALSE if value didn't check out; signal to restore old value. + bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost. - // Return FALSE if value didn't check out; signal to restore old value. - bool OnCheckValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when TICK is pressed or focus is lost or view wants to update + // the property list. + // Does the transfer from the property editing area to the property itself + bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when TICK is pressed or focus is lost or view wants to update - // the property list. - // Does the transfer from the property editing area to the property itself - bool OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the property is double clicked. + bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - // Called when the property is double clicked. - bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = wxT("String List Editor")); - bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = wxT("String List Editor")); - - // Called when the edit (...) button is pressed. - void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + // Called when the edit (...) button is pressed. + void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); + +private: + DECLARE_DYNAMIC_CLASS(wxListOfStringsListValidator) }; #endif diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 8441af3fd5..6a21925fe7 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -562,7 +562,7 @@ int wxCmdLineParser::Parse(bool showUsage) optInd = m_data->FindOptionByLongName(name); if ( optInd == wxNOT_FOUND ) { - errorMsg << wxString::Format(_("Unknown long option '%s'"), name.c_str()) << "\n"; + errorMsg << wxString::Format(_("Unknown long option '%s'"), name.c_str()) << wxT("\n"); } } else @@ -571,7 +571,7 @@ int wxCmdLineParser::Parse(bool showUsage) // Print the argument including leading "--" name.Prepend( wxT("--") ); - errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) << "\n"; + errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) << wxT("\n"); } } @@ -592,7 +592,7 @@ int wxCmdLineParser::Parse(bool showUsage) { // we couldn't find a valid option name in the // beginning of this string - errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) << "\n"; + errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) << wxT("\n"); break; } @@ -664,7 +664,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( *p++ != _T('=') ) { - errorMsg << wxString::Format(_("Option '%s' requires a value, '=' expected."), name.c_str()) << "\n"; + errorMsg << wxString::Format(_("Option '%s' requires a value, '=' expected."), name.c_str()) << wxT("\n"); ok = FALSE; } @@ -685,7 +685,7 @@ int wxCmdLineParser::Parse(bool showUsage) { // ... but there is none errorMsg << wxString::Format(_("Option '%s' requires a value."), - name.c_str()) << "\n"; + name.c_str()) << wxT("\n"); ok = FALSE; } @@ -702,7 +702,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( opt.flags & wxCMD_LINE_NEEDS_SEPARATOR ) { errorMsg << wxString::Format(_("Separator expected after the option '%s'."), - name.c_str()) << "\n"; + name.c_str()) << wxT("\n"); ok = FALSE; } @@ -732,7 +732,7 @@ int wxCmdLineParser::Parse(bool showUsage) else { errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."), - value.c_str(), name.c_str()) << "\n"; + value.c_str(), name.c_str()) << wxT("\n"); ok = FALSE; } @@ -746,7 +746,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( !res || *res ) { errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."), - name.c_str(), value.c_str()) << "\n"; + name.c_str(), value.c_str()) << wxT("\n"); ok = FALSE; } @@ -786,7 +786,7 @@ int wxCmdLineParser::Parse(bool showUsage) } else { - errorMsg << wxString::Format(_("Unexpected parameter '%s'"), arg.c_str()) << "\n"; + errorMsg << wxString::Format(_("Unexpected parameter '%s'"), arg.c_str()) << wxT("\n"); ok = FALSE; } @@ -823,7 +823,7 @@ int wxCmdLineParser::Parse(bool showUsage) } errorMsg << wxString::Format(_("The value for the option '%s' must be specified."), - optName.c_str()) << "\n"; + optName.c_str()) << wxT("\n"); ok = FALSE; } @@ -844,7 +844,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL) ) { errorMsg << wxString::Format(_("The required parameter '%s' was not specified."), - param.description.c_str()) << "\n"; + param.description.c_str()) << wxT("\n"); ok = FALSE; } diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 3eabda7f50..9e825fcf6f 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -247,7 +247,7 @@ wxPrintData::wxPrintData() m_printCollate = FALSE; // New, 24/3/99 - m_printerName = ""; + m_printerName = wxT(""); m_colour = TRUE; m_duplexMode = wxDUPLEX_SIMPLEX; m_printQuality = wxPRINT_QUALITY_HIGH; diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index 4b37033048..3167464b51 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -113,14 +113,14 @@ wxString wxDataInputStream::ReadString() char *tmp = new char[len + 1]; m_input->Read(tmp, len); tmp[len] = 0; - wxString s(tmp, m_conv); + wxString ret( (const wxChar*) m_conv.cMB2WX(tmp) ); delete[] tmp; #else - wxString s; + wxString ret; m_input->Read(s.GetWriteBuf(len), len); - s.UngetWriteBuf(); + ret.UngetWriteBuf(); #endif - return s; + return ret; } else return wxEmptyString; diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 37cf7cca0b..1711ccaf45 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -262,7 +262,7 @@ bool wxDocument::SaveAs() if (ext.IsEmpty() || ext == wxT("")) { - fileName += "."; + fileName += wxT("."); fileName += docTemplate->GetDefaultExtension(); } @@ -295,10 +295,10 @@ bool wxDocument::OnSaveDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - wxSTD ofstream store(wxString(file.fn_str()).mb_str()); + wxSTD ofstream store(wxString(file.fn_str()).mb_str()); // ????? if (store.fail() || store.bad()) #else - wxFileOutputStream store(wxString(file.fn_str())); + wxFileOutputStream store( file ); if (store.LastError() != wxSTREAM_NOERROR) #endif { @@ -332,10 +332,10 @@ bool wxDocument::OnOpenDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - wxSTD ifstream store(wxString(file.fn_str()).mb_str()); + wxSTD ifstream store(wxString(file.fn_str()).mb_str()); // ???? if (store.fail() || store.bad()) #else - wxFileInputStream store(wxString(file.fn_str())); + wxFileInputStream store( file ); if (store.LastError() != wxSTREAM_NOERROR) #endif { @@ -839,12 +839,12 @@ void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event)) void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event)) { - CreateDocument(wxString(""), wxDOC_NEW); + CreateDocument( wxT(""), wxDOC_NEW ); } void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event)) { - if ( !CreateDocument(wxString(""), 0) ) + if ( !CreateDocument( wxT(""), 0) ) { OnOpenFileFailure(); } diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 5147f3ad7f..c93a8f5d01 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -474,7 +474,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream) SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE); m_pCurrentGroup = - m_pRootGroup = new wxFileConfigGroup(NULL, "", this); + m_pRootGroup = new wxFileConfigGroup(NULL, wxT(""), this); m_linesHead = m_linesTail = NULL; diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 2307a4a9b7..2838831a96 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1070,7 +1070,7 @@ bool wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& file3) { wxString outfile; - if ( !wxGetTempFileName("cat", outfile) ) + if ( !wxGetTempFileName( wxT("cat"), outfile) ) return FALSE; FILE *fp1 = (FILE *) NULL; diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp index 97cfa0bb1b..7abc8f1e32 100644 --- a/src/common/fs_zip.cpp +++ b/src/common/fs_zip.cpp @@ -179,8 +179,8 @@ wxString wxZipFSHandler::DoFind() while (match == wxEmptyString) { unzGetCurrentFileInfo((unzFile)m_Archive, NULL, namebuf, 1024, NULL, 0, NULL, 0); - for (c = namebuf; *c; c++) if (*c == wxT('\\')) *c = wxT('/'); - namestr = namebuf; + for (c = namebuf; *c; c++) if (*c == '\\') *c = '/'; + namestr = wxString::FromAscii( namebuf ); // TODO what encoding does ZIP use? if (m_AllowDirs) { diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 856c1369e9..7e33316411 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -111,8 +111,8 @@ void PNGLINKAGEMODE wx_png_error(png_structp png_ptr, png_const_charp message) { wxPNGInfoStruct *info = WX_PNG_INFO(png_ptr); - if ( info->verbose ) - wxLogError(wxString(message)); + if (info->verbose) + wxLogError( wxString::FromAscii(message) ); #ifdef USE_FAR_KEYWORD { @@ -129,8 +129,8 @@ void PNGLINKAGEMODE wx_png_warning(png_structp png_ptr, png_const_charp message) { wxPNGInfoStruct *info = WX_PNG_INFO(png_ptr); - if ( info->verbose ) - wxLogWarning(wxString(message)); + if (info->verbose) + wxLogWarning( wxString::FromAscii(message) ); } } // extern "C" diff --git a/src/common/imagpnm.cpp b/src/common/imagpnm.cpp index a11007de33..40f294005f 100644 --- a/src/common/imagpnm.cpp +++ b/src/common/imagpnm.cpp @@ -39,12 +39,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNMHandler,wxImageHandler) void Skip_Comment(wxInputStream &stream) { - wxTextInputStream text_stream(stream); + wxTextInputStream text_stream(stream); - if (stream.Peek()==wxT('#')) + if (stream.Peek()==wxT('#')) { - text_stream.ReadLine(); - Skip_Comment(stream); + text_stream.ReadLine(); + Skip_Comment(stream); } } @@ -129,7 +129,7 @@ bool wxPNMHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool WXUNUS //text_stream << "P6" << endl //<< image->GetWidth() << " " << image->GetHeight() << endl //<< "255" << endl; - text_stream << "P6\n" << image->GetWidth() << " " << image->GetHeight() << "\n255\n"; + text_stream << wxT("P6\n") << image->GetWidth() << wxT(" ") << image->GetHeight() << wxT("\n255\n"); stream.Write(image->GetData(),3*image->GetWidth()*image->GetHeight()); return (stream.LastError()==wxStream_NOERROR); diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 220b20701b..8de461ae2d 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -506,7 +506,7 @@ wxString wxMsgCatalogFile::GetCharset() const return wxEmptyString; } - wxString header(StringAtOfs(m_pTransTable, 0)); + wxString header = wxString::FromAscii( StringAtOfs(m_pTransTable, 0)); wxString charset; int pos = header.Find(wxT("Content-Type: text/plain; charset=")); if ( pos == wxNOT_FOUND ) diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index c3d1807494..49f764e9cb 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -1699,9 +1699,9 @@ bool wxPostScriptDC::StartDoc( const wxString& message ) { wxCHECK_MSG( m_ok, FALSE, wxT("invalid postscript dc") ); - if (m_printData.GetFilename() == "") + if (m_printData.GetFilename() == wxT("")) { - wxString filename = wxGetTempFileName("ps"); + wxString filename = wxGetTempFileName( wxT("ps") ); m_printData.SetFilename(filename); } diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 2adc607c33..8d350f35a3 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -498,13 +498,13 @@ wxString wxFileData::GetFullName() const wxString wxFileData::GetHint() const { wxString s = m_fileName; - s += " "; - if (m_isDir) s += _("