From f80ea77b4a8bac4ab005bfc592f9cd3262ffa397 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 11 Jun 2004 13:14:23 +0000 Subject: [PATCH] wxID_ANY, wxDefaultSize, wxDefaultPosition, wxNOT_FOUND, true, false, tabs replacements. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xrc/xh_gauge.h | 2 +- contrib/include/wx/xrc/xh_menu.h | 2 +- contrib/include/wx/xrc/xh_scrol.h | 2 +- contrib/include/wx/xrc/xh_sizer.h | 4 +- contrib/include/wx/xrc/xh_slidr.h | 2 +- contrib/include/wx/xrc/xh_spin.h | 4 +- contrib/include/wx/xrc/xmlres.h | 14 +- contrib/samples/xrc/custclas.cpp | 62 ++--- contrib/samples/xrc/custclas.h | 26 +- contrib/samples/xrc/derivdlg.cpp | 30 +- contrib/samples/xrc/derivdlg.h | 16 +- contrib/samples/xrc/myframe.cpp | 70 ++--- contrib/samples/xrc/myframe.h | 4 +- contrib/samples/xrc/xrcdemo.cpp | 26 +- contrib/samples/xrc/xrcdemo.h | 8 +- contrib/src/xrc/xh_bmp.cpp | 14 +- contrib/src/xrc/xh_bmpbt.cpp | 12 +- contrib/src/xrc/xh_bttn.cpp | 10 +- contrib/src/xrc/xh_cald.cpp | 12 +- contrib/src/xrc/xh_chckb.cpp | 10 +- contrib/src/xrc/xh_chckl.cpp | 18 +- contrib/src/xrc/xh_choic.cpp | 14 +- contrib/src/xrc/xh_combo.cpp | 12 +- contrib/src/xrc/xh_dlg.cpp | 2 +- contrib/src/xrc/xh_frame.cpp | 2 +- contrib/src/xrc/xh_gauge.cpp | 10 +- contrib/src/xrc/xh_gdctl.cpp | 2 +- contrib/src/xrc/xh_html.cpp | 12 +- contrib/src/xrc/xh_listb.cpp | 14 +- contrib/src/xrc/xh_listc.cpp | 12 +- contrib/src/xrc/xh_menu.cpp | 24 +- contrib/src/xrc/xh_notbk.cpp | 26 +- contrib/src/xrc/xh_panel.cpp | 6 +- contrib/src/xrc/xh_radbt.cpp | 16 +- contrib/src/xrc/xh_radbx.cpp | 12 +- contrib/src/xrc/xh_scrol.cpp | 12 +- contrib/src/xrc/xh_scwin.cpp | 10 +- contrib/src/xrc/xh_sizer.cpp | 68 ++--- contrib/src/xrc/xh_slidr.cpp | 12 +- contrib/src/xrc/xh_spin.cpp | 20 +- contrib/src/xrc/xh_split.cpp | 6 +- contrib/src/xrc/xh_stbmp.cpp | 10 +- contrib/src/xrc/xh_stbox.cpp | 10 +- contrib/src/xrc/xh_stlin.cpp | 10 +- contrib/src/xrc/xh_sttxt.cpp | 10 +- contrib/src/xrc/xh_text.cpp | 8 +- contrib/src/xrc/xh_toolb.cpp | 28 +- contrib/src/xrc/xh_tree.cpp | 10 +- contrib/src/xrc/xh_unkwn.cpp | 4 +- contrib/src/xrc/xh_wizrd.cpp | 6 +- contrib/src/xrc/xmlres.cpp | 40 +-- contrib/src/xrc/xmlrsall.cpp | 10 +- contrib/utils/convertrc/convert.cpp | 24 +- contrib/utils/convertrc/convert.h | 6 +- contrib/utils/convertrc/rc2wxr.cpp | 34 +-- contrib/utils/convertrc/rc2wxr.h | 2 +- contrib/utils/convertrc/rc2xml.cpp | 88 +++--- contrib/utils/convertrc/rc2xml.h | 8 +- contrib/utils/convertrc/wxr2xml.cpp | 54 ++-- contrib/utils/wxrc/wxrc.cpp | 180 ++++++------ contrib/utils/wxrcedit/edapp.cpp | 8 +- contrib/utils/wxrcedit/editor.cpp | 160 +++++------ contrib/utils/wxrcedit/editor.h | 22 +- contrib/utils/wxrcedit/nodehnd.cpp | 40 +-- contrib/utils/wxrcedit/nodehnd.h | 22 +- contrib/utils/wxrcedit/nodesdb.cpp | 32 +-- contrib/utils/wxrcedit/nodesdb.h | 18 +- contrib/utils/wxrcedit/pe_adv.cpp | 50 ++-- contrib/utils/wxrcedit/pe_adv.h | 16 +- contrib/utils/wxrcedit/pe_basic.cpp | 78 +++--- contrib/utils/wxrcedit/pe_basic.h | 32 +-- contrib/utils/wxrcedit/preview.cpp | 94 +++---- contrib/utils/wxrcedit/preview.h | 16 +- contrib/utils/wxrcedit/propedit.cpp | 22 +- contrib/utils/wxrcedit/propedit.h | 32 +-- contrib/utils/wxrcedit/propframe.cpp | 166 +++++------ contrib/utils/wxrcedit/propframe.h | 14 +- contrib/utils/wxrcedit/splittree.cpp | 396 +++++++++++++-------------- contrib/utils/wxrcedit/splittree.h | 64 ++--- contrib/utils/wxrcedit/treedt.h | 2 +- contrib/utils/wxrcedit/xmlhelpr.cpp | 18 +- contrib/utils/wxrcedit/xmlhelpr.h | 2 +- include/wx/xrc/xh_gauge.h | 2 +- include/wx/xrc/xh_menu.h | 2 +- include/wx/xrc/xh_scrol.h | 2 +- include/wx/xrc/xh_sizer.h | 4 +- include/wx/xrc/xh_slidr.h | 2 +- include/wx/xrc/xh_spin.h | 4 +- include/wx/xrc/xmlres.h | 14 +- samples/xrc/custclas.cpp | 62 ++--- samples/xrc/custclas.h | 26 +- samples/xrc/derivdlg.cpp | 30 +- samples/xrc/derivdlg.h | 16 +- samples/xrc/myframe.cpp | 70 ++--- samples/xrc/myframe.h | 4 +- samples/xrc/xrcdemo.cpp | 26 +- samples/xrc/xrcdemo.h | 8 +- src/xrc/xh_bmp.cpp | 14 +- src/xrc/xh_bmpbt.cpp | 12 +- src/xrc/xh_bttn.cpp | 10 +- src/xrc/xh_cald.cpp | 12 +- src/xrc/xh_chckb.cpp | 10 +- src/xrc/xh_chckl.cpp | 18 +- src/xrc/xh_choic.cpp | 14 +- src/xrc/xh_combo.cpp | 12 +- src/xrc/xh_dlg.cpp | 2 +- src/xrc/xh_frame.cpp | 2 +- src/xrc/xh_gauge.cpp | 10 +- src/xrc/xh_gdctl.cpp | 2 +- src/xrc/xh_html.cpp | 12 +- src/xrc/xh_listb.cpp | 14 +- src/xrc/xh_listc.cpp | 12 +- src/xrc/xh_menu.cpp | 24 +- src/xrc/xh_notbk.cpp | 26 +- src/xrc/xh_panel.cpp | 6 +- src/xrc/xh_radbt.cpp | 16 +- src/xrc/xh_radbx.cpp | 12 +- src/xrc/xh_scrol.cpp | 12 +- src/xrc/xh_scwin.cpp | 10 +- src/xrc/xh_sizer.cpp | 68 ++--- src/xrc/xh_slidr.cpp | 12 +- src/xrc/xh_spin.cpp | 20 +- src/xrc/xh_split.cpp | 6 +- src/xrc/xh_stbmp.cpp | 10 +- src/xrc/xh_stbox.cpp | 10 +- src/xrc/xh_stlin.cpp | 10 +- src/xrc/xh_sttxt.cpp | 10 +- src/xrc/xh_text.cpp | 8 +- src/xrc/xh_toolb.cpp | 28 +- src/xrc/xh_tree.cpp | 10 +- src/xrc/xh_unkwn.cpp | 4 +- src/xrc/xh_wizrd.cpp | 6 +- src/xrc/xmlres.cpp | 40 +-- src/xrc/xmlrsall.cpp | 10 +- utils/wxrc/wxrc.cpp | 180 ++++++------ 135 files changed, 1726 insertions(+), 1726 deletions(-) diff --git a/contrib/include/wx/xrc/xh_gauge.h b/contrib/include/wx/xrc/xh_gauge.h index b9c0f669c4..3f7a181336 100644 --- a/contrib/include/wx/xrc/xh_gauge.h +++ b/contrib/include/wx/xrc/xh_gauge.h @@ -24,7 +24,7 @@ class WXDLLIMPEXP_XRC wxGaugeXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler) + DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler) enum { wxGAUGE_DEFAULT_RANGE = 100 diff --git a/contrib/include/wx/xrc/xh_menu.h b/contrib/include/wx/xrc/xh_menu.h index 52274fb81b..c263338705 100644 --- a/contrib/include/wx/xrc/xh_menu.h +++ b/contrib/include/wx/xrc/xh_menu.h @@ -31,7 +31,7 @@ private: class WXDLLIMPEXP_XRC wxMenuBarXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler) + DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler) public: wxMenuBarXmlHandler(); virtual wxObject *DoCreateResource(); diff --git a/contrib/include/wx/xrc/xh_scrol.h b/contrib/include/wx/xrc/xh_scrol.h index ef1d3861d8..77988eefce 100644 --- a/contrib/include/wx/xrc/xh_scrol.h +++ b/contrib/include/wx/xrc/xh_scrol.h @@ -22,7 +22,7 @@ class WXDLLIMPEXP_XRC wxScrollBarXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler) + DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler) enum { wxSL_DEFAULT_VALUE = 0, diff --git a/contrib/include/wx/xrc/xh_sizer.h b/contrib/include/wx/xrc/xh_sizer.h index 7159605584..2e0ad9606a 100644 --- a/contrib/include/wx/xrc/xh_sizer.h +++ b/contrib/include/wx/xrc/xh_sizer.h @@ -33,7 +33,7 @@ public: private: bool m_isInside; bool m_isGBS; - + wxSizer *m_parentSizer; bool IsSizerNode(wxXmlNode *node); @@ -52,7 +52,7 @@ private: wxGBSpan GetGBSpan(const wxString& param); wxSizerItem* MakeSizerItem(); void SetSizerItemAttributes(wxSizerItem* sitem); - void AddSizerItem(wxSizerItem* sitem); + void AddSizerItem(wxSizerItem* sitem); }; diff --git a/contrib/include/wx/xrc/xh_slidr.h b/contrib/include/wx/xrc/xh_slidr.h index 8e425b4294..2eeb587eaf 100644 --- a/contrib/include/wx/xrc/xh_slidr.h +++ b/contrib/include/wx/xrc/xh_slidr.h @@ -22,7 +22,7 @@ class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler) + DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler) enum { wxSL_DEFAULT_VALUE = 0, diff --git a/contrib/include/wx/xrc/xh_spin.h b/contrib/include/wx/xrc/xh_spin.h index ab9590a68b..e49b607dd1 100644 --- a/contrib/include/wx/xrc/xh_spin.h +++ b/contrib/include/wx/xrc/xh_spin.h @@ -21,7 +21,7 @@ #if wxUSE_SPINBTN class WXDLLIMPEXP_XRC wxSpinButtonXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSpinButtonXmlHandler) + DECLARE_DYNAMIC_CLASS(wxSpinButtonXmlHandler) enum { wxSP_DEFAULT_VALUE = 0, @@ -39,7 +39,7 @@ public: #if wxUSE_SPINCTRL class WXDLLIMPEXP_XRC wxSpinCtrlXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSpinCtrlXmlHandler) + DECLARE_DYNAMIC_CLASS(wxSpinCtrlXmlHandler) enum { wxSP_DEFAULT_VALUE = 0, diff --git a/contrib/include/wx/xrc/xmlres.h b/contrib/include/wx/xrc/xmlres.h index dd62160169..76dbd1e972 100644 --- a/contrib/include/wx/xrc/xmlres.h +++ b/contrib/include/wx/xrc/xmlres.h @@ -240,7 +240,7 @@ protected: bool UpdateResources(); // Finds a resource (calls UpdateResources) and returns a node containing it. - wxXmlNode *FindResource(const wxString& name, const wxString& classname, bool recursive = FALSE); + wxXmlNode *FindResource(const wxString& name, const wxString& classname, bool recursive = false); // Helper function: finds a resource (calls UpdateResources) and returns a node containing it. wxXmlNode *DoFindResource(wxXmlNode *parent, const wxString& name, const wxString& classname, bool recursive); @@ -329,8 +329,8 @@ public: // were filled. virtual wxObject *DoCreateResource() = 0; - // Returns TRUE if it understands this node and can create - // a resource from it, FALSE otherwise. + // Returns true if it understands this node and can create + // a resource from it, false otherwise. virtual bool CanHandle(wxXmlNode *node) = 0; // Sets the parent resource. @@ -385,7 +385,7 @@ protected: // - replaces \n, \r, \t by respective chars (according to C syntax) // - replaces _ by & and __ by _ (needed for _File => &File because of XML) // - calls wxGetTranslations (unless disabled in wxXmlResource) - wxString GetText(const wxString& param, bool translate = TRUE); + wxString GetText(const wxString& param, bool translate = true); // Returns the XRCID. int GetID(); @@ -393,8 +393,8 @@ protected: // Returns the resource name. wxString GetName(); - // Gets a bool flag (1, t, yes, on, true are TRUE, everything else is FALSE). - bool GetBool(const wxString& param, bool defaultv = FALSE); + // Gets a bool flag (1, t, yes, on, true are true, everything else is false). + bool GetBool(const wxString& param, bool defaultv = false); // Gets the integer value from the parameter. long GetLong( const wxString& param, long defaultv = 0 ); @@ -428,7 +428,7 @@ protected: void SetupWindow(wxWindow *wnd); // Creates children. - void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE); + void CreateChildren(wxObject *parent, bool this_hnd_only = false); // Helper function. void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL); diff --git a/contrib/samples/xrc/custclas.cpp b/contrib/samples/xrc/custclas.cpp index 6735dc3bce..1582342227 100644 --- a/contrib/samples/xrc/custclas.cpp +++ b/contrib/samples/xrc/custclas.cpp @@ -42,18 +42,18 @@ // Internal constants //----------------------------------------------------------------------------- -// Popup menu (PU) item control IDs. In this example, they aren't hooked up +// Popup menu (PU) item control IDs. In this example, they aren't hooked up // to any functions. Normally you would use these IDs in your event table, so -// that if one of these menu items is clicked, then a certain function is +// that if one of these menu items is clicked, then a certain function is // called. enum { - PU_ADD_RECORD = wxID_HIGHEST + 1, + PU_ADD_RECORD = wxID_HIGHEST + 1, PU_EDIT_RECORD, - PU_DELETE_RECORD + PU_DELETE_RECORD }; // Columns of the listctrl (the leftmost one starts at 0, and so on). -// Allows easier code maintenance if want to add/rearrangement of listctrl's +// Allows easier code maintenance if want to add/rearrangement of listctrl's // columns. enum { RECORD_COLUMN = 0, @@ -71,9 +71,9 @@ IMPLEMENT_DYNAMIC_CLASS( MyResizableListCtrl, wxListCtrl ) // Event table: connect the events to the handler functions to process them //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE( MyResizableListCtrl, wxListCtrl ) - // Something to do when right mouse down - EVT_RIGHT_DOWN( MyResizableListCtrl::ContextSensitiveMenu ) +BEGIN_EVENT_TABLE( MyResizableListCtrl, wxListCtrl ) + // Something to do when right mouse down + EVT_RIGHT_DOWN( MyResizableListCtrl::ContextSensitiveMenu ) // Something to do when resized EVT_SIZE( MyResizableListCtrl::OnSize ) END_EVENT_TABLE() @@ -90,15 +90,15 @@ MyResizableListCtrl::MyResizableListCtrl( wxWindow *parent, wxWindowID id, const wxString& name ) : wxListCtrl( parent, id, pos, size, style, validator, name ) { - - // This listctrl needs to insert its columns in the constructor, since - // as soon as the listctrl is built, it is resized and grafted onto an - // "unknown" XRC placeholder. This induces an OnSize() event, calling the - // overrriden OnSize function for this class, which needs to have 3 + + // This listctrl needs to insert its columns in the constructor, since + // as soon as the listctrl is built, it is resized and grafted onto an + // "unknown" XRC placeholder. This induces an OnSize() event, calling the + // overrriden OnSize function for this class, which needs to have 3 // columns to resize (else an assert on WXGTK debug build). InsertColumn( RECORD_COLUMN, _("Record"), wxLIST_FORMAT_LEFT, 140); InsertColumn( ACTION_COLUMN, _("Action"), wxLIST_FORMAT_LEFT, 70); - InsertColumn( PRIORITY_COLUMN, _("Priority"), wxLIST_FORMAT_LEFT, 70 ); + InsertColumn( PRIORITY_COLUMN, _("Priority"), wxLIST_FORMAT_LEFT, 70 ); } @@ -115,16 +115,16 @@ void MyResizableListCtrl::ContextSensitiveMenu( wxMouseEvent& event ) a_menu.Append( PU_ADD_RECORD, _( "Add a new record...") ); a_menu.Append( PU_EDIT_RECORD, _( "Edit selected record..." ) ); a_menu.Append( PU_DELETE_RECORD, _( "Delete selected record" ) ); - - // If no listctrl rows selected, then disable the menu items that + + // If no listctrl rows selected, then disable the menu items that // require selection if ( GetSelectedItemCount() == 0 ) { - a_menu.Enable( PU_EDIT_RECORD, FALSE ); - a_menu.Enable( PU_DELETE_RECORD, FALSE ); + a_menu.Enable( PU_EDIT_RECORD, false ); + a_menu.Enable( PU_DELETE_RECORD, false ); } - // Show the popup menu (wxWindow::PopupMenu ), at the x,y position - // of the click event + // Show the popup menu (wxWindow::PopupMenu ), at the x,y position + // of the click event PopupMenu( &a_menu, event.GetPosition() ); } @@ -133,28 +133,28 @@ void MyResizableListCtrl::OnSize( wxSizeEvent &event ) { // Call our custom width setting function. SetColumnWidths(); - // REQURED event.Skip() call to allow this event to propagate - // upwards so others can do what they need to do in response to + // REQURED event.Skip() call to allow this event to propagate + // upwards so others can do what they need to do in response to // this size event. event.Skip(); } void MyResizableListCtrl::SetColumnWidths() -{ +{ // Get width of entire listctrl - int leftmostColumnWidth = GetSize().x; - - // Subtract width of other columns, scrollbar, and some padding + int leftmostColumnWidth = GetSize().x; + + // Subtract width of other columns, scrollbar, and some padding leftmostColumnWidth -= GetColumnWidth( ACTION_COLUMN ); leftmostColumnWidth -= GetColumnWidth( PRIORITY_COLUMN ); - leftmostColumnWidth -= wxSystemSettings::GetSystemMetric( wxSYS_VSCROLL_X ); + leftmostColumnWidth -= wxSystemSettings::GetSystemMetric( wxSYS_VSCROLL_X ); leftmostColumnWidth -= 5; - + // Set the column width to the new value. - SetColumnWidth( RECORD_COLUMN, leftmostColumnWidth ); - - // This is just a debug message in case you want to watch the + SetColumnWidth( RECORD_COLUMN, leftmostColumnWidth ); + + // This is just a debug message in case you want to watch the // events scroll by as you resize. wxLogDebug( wxT("Successfully set column widths") ); } diff --git a/contrib/samples/xrc/custclas.h b/contrib/samples/xrc/custclas.h index 69b01d4387..9973ed0161 100644 --- a/contrib/samples/xrc/custclas.h +++ b/contrib/samples/xrc/custclas.h @@ -38,14 +38,14 @@ class MyResizableListCtrl : public wxListCtrl // Very helpful wxWidgets macro required for wxWidgets-RTTI tracing: By using this // you will see "Leaked one object of type myResizeableListCtrl" in the debug log, // along with which line you if was created, but you forget to free the memory. - // NOTE: Using this REQUIRES a default constructor: that means either: giving a + // NOTE: Using this REQUIRES a default constructor: that means either: giving a // default value for all parameters in your constructor, or else having a dummy // MyResizableListCtrl(){} constructor in addition to your regular one. DECLARE_DYNAMIC_CLASS( MyResizableListCtrl ) public: - // Constructor. + // Constructor. /* These parameters are the same as a wxWidgets constructor. \param parent The parent window. @@ -60,33 +60,33 @@ public: column. */ MyResizableListCtrl( wxWindow *parent = NULL, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxLC_REPORT, const wxValidator& validator = wxDefaultValidator, const wxString &name = wxT("myResizableListCtrl") - ); + ); // Destuctor. - ~MyResizableListCtrl(); + ~MyResizableListCtrl(); -protected: +protected: + + // A custom function for a context sensitive menu. + void ContextSensitiveMenu( wxMouseEvent& event ); - // A custom function for a context sensitive menu. - void ContextSensitiveMenu( wxMouseEvent& event ); - // This is a wxWidgets function that we are going to override with our own behaviour. void OnSize( wxSizeEvent &event ); - + // A custom function. What is called in the constructor, and in an OnSize() - void SetColumnWidths(); - + void SetColumnWidths(); + private: // wxWidgets macro, required to be able to use Event tables in the .cpp file. DECLARE_EVENT_TABLE() - + }; //---------------------------------------------------------------------------------------- diff --git a/contrib/samples/xrc/derivdlg.cpp b/contrib/samples/xrc/derivdlg.cpp index ed6c1cd613..64cda9224f 100644 --- a/contrib/samples/xrc/derivdlg.cpp +++ b/contrib/samples/xrc/derivdlg.cpp @@ -49,7 +49,7 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(PreferencesDialog, wxDialog) - EVT_BUTTON( XRCID( "my_button" ), PreferencesDialog::OnMyButtonClicked ) + EVT_BUTTON( XRCID( "my_button" ), PreferencesDialog::OnMyButtonClicked ) EVT_UPDATE_UI(XRCID( "my_checkbox" ), PreferencesDialog::OuUpdateUIMyCheckbox ) // Note that the ID here isn't a XRCID, it is one of the standard wx ID's. EVT_BUTTON( wxID_OK, PreferencesDialog::OnOK ) @@ -60,7 +60,7 @@ END_EVENT_TABLE() //----------------------------------------------------------------------------- // Constructor (Notice how small and easy it is) PreferencesDialog::PreferencesDialog(wxWindow* parent) -{ +{ wxXmlResource::Get()->LoadDialog(this, parent, wxT("derived_dialog")); } @@ -76,29 +76,29 @@ PreferencesDialog::~PreferencesDialog() void PreferencesDialog::OnMyButtonClicked( wxCommandEvent &WXUNUSED(event) ) { // Construct a message dialog. - wxMessageDialog msgDlg(this, _("You clicked on My Button")); - + wxMessageDialog msgDlg(this, _("You clicked on My Button")); + // Show it modally. msgDlg.ShowModal(); } -// Update the enabled/disabled state of the edit/delete buttons depending on +// Update the enabled/disabled state of the edit/delete buttons depending on // whether a row (item) is selected in the listctrl void PreferencesDialog::OuUpdateUIMyCheckbox( wxUpdateUIEvent &WXUNUSED(event) ) { // Get a boolean value of whether the checkbox is checked - bool myCheckBoxIsChecked; + bool myCheckBoxIsChecked; // You could just write: // myCheckBoxIsChecked = event.IsChecked(); - // since the event that was passed into this function already has the - // is a pointer to the right control. However, + // since the event that was passed into this function already has the + // is a pointer to the right control. However, // this is the XRCCTRL way (which is more obvious as to what is going on). myCheckBoxIsChecked = XRCCTRL(*this, "my_checkbox", wxCheckBox)->IsChecked(); - // Now call either Enable(TRUE) or Enable(FALSE) on the textctrl, depending - // on the value of that boolean. - XRCCTRL(*this, "my_textctrl", wxTextCtrl)->Enable(myCheckBoxIsChecked); + // Now call either Enable(true) or Enable(false) on the textctrl, depending + // on the value of that boolean. + XRCCTRL(*this, "my_textctrl", wxTextCtrl)->Enable(myCheckBoxIsChecked); } @@ -108,16 +108,16 @@ void PreferencesDialog::OnOK( wxCommandEvent& WXUNUSED(event) ) wxMessageDialog msgDlg2(this, _("Press OK to close Derived dialog, or Cancel to abort"), _("Overriding base class OK button handler"), wxOK | wxCANCEL | wxCENTER ); - + // Show the message dialog, and if it returns wxID_OK (ie they clicked on OK button)... if (msgDlg2.ShowModal() == wxID_OK) { - // ...then end this Preferences dialog. + // ...then end this Preferences dialog. EndModal( wxID_OK ); // You could also have used event.Skip() which would then skip up // to the wxDialog's event table and see if there was a EVT_BUTTON - // handler for wxID_OK and if there was, then execute that code. + // handler for wxID_OK and if there was, then execute that code. } - + // Otherwise do nothing. } diff --git a/contrib/samples/xrc/derivdlg.h b/contrib/samples/xrc/derivdlg.h index 1e82f6f5b0..edcf91f525 100644 --- a/contrib/samples/xrc/derivdlg.h +++ b/contrib/samples/xrc/derivdlg.h @@ -36,26 +36,26 @@ class PreferencesDialog : public wxDialog { -public: - +public: + // Constructor. /* \param parent The parent window. Simple constructor. - */ + */ PreferencesDialog( wxWindow* parent ); - - // Destructor. + + // Destructor. ~PreferencesDialog(); private: - + // Stuff to do when "My Button" gets clicked void OnMyButtonClicked( wxCommandEvent &event ); - // Stuff to do when a "My Checkbox" gets updated + // Stuff to do when a "My Checkbox" gets updated // (drawn, or it changes its value) void OuUpdateUIMyCheckbox( wxUpdateUIEvent &event ); - + // Override base class functions of a wxDialog. void OnOK( wxCommandEvent &event ); diff --git a/contrib/samples/xrc/myframe.cpp b/contrib/samples/xrc/myframe.cpp index a740c29bda..cfab7d39f9 100644 --- a/contrib/samples/xrc/myframe.cpp +++ b/contrib/samples/xrc/myframe.cpp @@ -76,18 +76,18 @@ // The event tables connect the wxWidgets events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. -// The reason why the menuitems and tools are given the same name in the +// The reason why the menuitems and tools are given the same name in the // XRC file, is that both a tool (a toolbar item) and a menuitem are designed -// to fire the same kind of event (an EVT_MENU) and thus I give them the same -// ID name to help new users emphasize this point which is often overlooked +// to fire the same kind of event (an EVT_MENU) and thus I give them the same +// ID name to help new users emphasize this point which is often overlooked // when starting out with wxWidgets. BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(XRCID("exit_tool_or_menuitem"), MyFrame::OnExitToolOrMenuCommand) - EVT_MENU(XRCID("non_derived_dialog_tool_or_menuitem"), MyFrame::OnNonDerivedDialogToolOrMenuCommand) - EVT_MENU(XRCID("derived_tool_or_menuitem"), MyFrame::OnDerivedDialogToolOrMenuCommand) - EVT_MENU(XRCID("controls_tool_or_menuitem"), MyFrame::OnControlsToolOrMenuCommand) - EVT_MENU(XRCID("uncentered_tool_or_menuitem"), MyFrame::OnUncenteredToolOrMenuCommand) - EVT_MENU(XRCID("custom_class_tool_or_menuitem"), MyFrame::OnCustomClassToolOrMenuCommand) + EVT_MENU(XRCID("non_derived_dialog_tool_or_menuitem"), MyFrame::OnNonDerivedDialogToolOrMenuCommand) + EVT_MENU(XRCID("derived_tool_or_menuitem"), MyFrame::OnDerivedDialogToolOrMenuCommand) + EVT_MENU(XRCID("controls_tool_or_menuitem"), MyFrame::OnControlsToolOrMenuCommand) + EVT_MENU(XRCID("uncentered_tool_or_menuitem"), MyFrame::OnUncenteredToolOrMenuCommand) + EVT_MENU(XRCID("custom_class_tool_or_menuitem"), MyFrame::OnCustomClassToolOrMenuCommand) EVT_MENU(XRCID("platform_property_tool_or_menuitem"), MyFrame::OnPlatformPropertyToolOrMenuCommand) EVT_MENU(XRCID("art_provider_tool_or_menuitem"), MyFrame::OnArtProviderToolOrMenuCommand) EVT_MENU(XRCID("variable_expansion_tool_or_menuitem"), MyFrame::OnVariableExpansionToolOrMenuCommand) @@ -102,12 +102,12 @@ END_EVENT_TABLE() MyFrame::MyFrame(wxWindow* parent) { // Load up this frame from XRC. [Note, instead of making a class's - // constructor take a wxWindow* parent with a default value of NULL, - // we could have just had designed MyFrame class with an empty + // constructor take a wxWindow* parent with a default value of NULL, + // we could have just had designed MyFrame class with an empty // constructor and then written here: // wxXmlResource::Get()->LoadFrame(this, (wxWindow* )NULL, "main_frame"); - // since this frame will always be the top window, and thus parentless. - // However, the current approach has source code that can be recycled + // since this frame will always be the top window, and thus parentless. + // However, the current approach has source code that can be recycled // for other frames that aren't the top level window.] wxXmlResource::Get()->LoadFrame(this, parent, wxT("main_frame")); @@ -121,9 +121,9 @@ MyFrame::MyFrame(wxWindow* parent) // With toolbars, you currently can't create one, and set it later. It // needs to be all in one step. SetToolBar(wxXmlResource::Get()->LoadToolBar(this, wxT("main_toolbar"))); - - // Give the frame a optional statusbar. The '1' just means one field. - // A gripsizer will automatically get put on into the corner, if that + + // Give the frame a optional statusbar. The '1' just means one field. + // A gripsizer will automatically get put on into the corner, if that // is the normal OS behaviour for frames on that platform. Helptext // for menu items and toolbar tools will automatically get displayed // here. @@ -136,8 +136,8 @@ MyFrame::MyFrame(wxWindow* parent) void MyFrame::OnExitToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { - // TRUE is to force the frame to close. - Close(TRUE); + // true is to force the frame to close. + Close(true); } @@ -152,10 +152,10 @@ void MyFrame::OnNonDerivedDialogToolOrMenuCommand(wxCommandEvent& WXUNUSED(event } -void MyFrame::OnDerivedDialogToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) +void MyFrame::OnDerivedDialogToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { // Make an instance of our derived dialog, passing it "this" window - // (the main frame) as the parent of the dialog. This allows the dialog + // (the main frame) as the parent of the dialog. This allows the dialog // to be destructed automatically when the parent is destroyed. PreferencesDialog preferencesDialog(this); // Show the instance of the dialog, modally. @@ -163,19 +163,19 @@ void MyFrame::OnDerivedDialogToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) } -void MyFrame::OnControlsToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) +void MyFrame::OnControlsToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { wxDialog dlg; wxXmlResource::Get()->LoadDialog(&dlg, this, wxT("controls_dialog")); #if wxUSE_LISTCTRL // There is no data in the listctrl. This will add some columns - // and some data. You don't need use any pointers + // and some data. You don't need use any pointers // at all to manipulate the controls, just simply use the XRCCTL(...) macros. // "controls_treectrl" is the name of this control in the XRC. // (1) Insert a column, with the column header of "Name" // (The '_' function around "Name" marks this string as one to translate). - XRCCTRL(dlg, "controls_listctrl", wxListCtrl)->InsertColumn( 0, + XRCCTRL(dlg, "controls_listctrl", wxListCtrl)->InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, ( 200 ) @@ -186,12 +186,12 @@ void MyFrame::OnControlsToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) XRCCTRL(dlg, "controls_listctrl", wxListCtrl)->InsertItem(2,wxT("Leon Li")); #endif -#if wxUSE_TREECTRL +#if wxUSE_TREECTRL // There is no data in the tree ctrl. These lines will add some. - // (1) Instead of having to write out - // XRCCTRL(dlg, "controls_treectrl", wxTreeCtrl)->SomeFunction() + // (1) Instead of having to write out + // XRCCTRL(dlg, "controls_treectrl", wxTreeCtrl)->SomeFunction() // each time (which is also OK), this example code will shown how - // to make a pointer to the XRC control, so we can use + // to make a pointer to the XRC control, so we can use // treectrl->SomeFunction() as a short cut. This is useful if you // will be referring to this control often in the code. wxTreeCtrl* treectrl = XRCCTRL(dlg, "controls_treectrl", wxTreeCtrl); @@ -200,15 +200,15 @@ void MyFrame::OnControlsToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) // (3)Append some items to the root node. treectrl->AppendItem(treectrl->GetRootItem(), _("Evil henchman 1")); treectrl->AppendItem(treectrl->GetRootItem(), _("Evil henchman 2")); - treectrl->AppendItem(treectrl->GetRootItem(), _("Evil accountant")); + treectrl->AppendItem(treectrl->GetRootItem(), _("Evil accountant")); #endif - + // All done. Show the dialog. dlg.ShowModal(); } -void MyFrame::OnUncenteredToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) +void MyFrame::OnUncenteredToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { wxDialog dlg; wxXmlResource::Get()->LoadDialog(&dlg, this, wxT("uncentered_dialog")); @@ -220,16 +220,16 @@ void MyFrame::OnCustomClassToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { wxDialog dlg; wxXmlResource::Get()->LoadDialog(&dlg, this, wxT("custom_class_dialog")); - - // Make an instance of our new custom class. - MyResizableListCtrl* a_myResizableListCtrl = new MyResizableListCtrl(&dlg, - -1, + + // Make an instance of our new custom class. + MyResizableListCtrl* a_myResizableListCtrl = new MyResizableListCtrl(&dlg, + wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT, wxDefaultValidator); - - // "custom_control_placeholder" is the name of the "unknown" tag in the + + // "custom_control_placeholder" is the name of the "unknown" tag in the // custctrl.xrc XRC file. wxXmlResource::Get()->AttachUnknownControl(wxT("custom_control_placeholder"), a_myResizableListCtrl); diff --git a/contrib/samples/xrc/myframe.h b/contrib/samples/xrc/myframe.h index a773adc30d..eb5b2540e0 100644 --- a/contrib/samples/xrc/myframe.h +++ b/contrib/samples/xrc/myframe.h @@ -41,7 +41,7 @@ public: // Constructor. MyFrame( wxWindow* parent=(wxWindow *)NULL); -private: +private: // Event handlers (these functions should _not_ be virtual) void OnExitToolOrMenuCommand(wxCommandEvent& event); @@ -49,7 +49,7 @@ private: void OnNonDerivedDialogToolOrMenuCommand(wxCommandEvent& event); void OnDerivedDialogToolOrMenuCommand(wxCommandEvent& event); void OnControlsToolOrMenuCommand(wxCommandEvent& event); - void OnUncenteredToolOrMenuCommand(wxCommandEvent& event); + void OnUncenteredToolOrMenuCommand(wxCommandEvent& event); void OnCustomClassToolOrMenuCommand(wxCommandEvent& event); void OnPlatformPropertyToolOrMenuCommand(wxCommandEvent& event); void OnArtProviderToolOrMenuCommand(wxCommandEvent& event); diff --git a/contrib/samples/xrc/xrcdemo.cpp b/contrib/samples/xrc/xrcdemo.cpp index 824477921d..64b0309f60 100644 --- a/contrib/samples/xrc/xrcdemo.cpp +++ b/contrib/samples/xrc/xrcdemo.cpp @@ -75,18 +75,18 @@ bool MyApp::OnInit() // you want PNGs, then add a PNG handler, etc. See wxImage::AddHandler() // documentation for the types of image handlers available. wxImage::AddHandler(new wxXPMHandler); - + // Initialize all the XRC handlers. Always required (unless you feel like // going through and initializing a handler of each control type you will // be using (ie initialize the spinctrl handler, initialize the textctrl // handler). However, if you are only using a few control types, it will // save some space to only initialize the ones you will be using. See // wxXRC docs for details. - wxXmlResource::Get()->InitAllHandlers(); - + wxXmlResource::Get()->InitAllHandlers(); + // Load all of the XRC files that will be used. You can put everything - // into one giant XRC file if you wanted, but then they become more - // diffcult to manage, and harder to reuse in later projects. + // into one giant XRC file if you wanted, but then they become more + // diffcult to manage, and harder to reuse in later projects. // The menubar wxXmlResource::Get()->Load(wxT("rc/menu.xrc")); // The toolbar @@ -100,7 +100,7 @@ bool MyApp::OnInit() // Frame example wxXmlResource::Get()->Load(wxT("rc/frame.xrc")); // Uncentered example - wxXmlResource::Get()->Load(wxT("rc/uncenter.xrc")); + wxXmlResource::Get()->Load(wxT("rc/uncenter.xrc")); // Custom class example wxXmlResource::Get()->Load(wxT("rc/custclas.xrc")); // wxArtProvider example @@ -110,15 +110,15 @@ bool MyApp::OnInit() // Variable expansion example wxXmlResource::Get()->Load(wxT("rc/variable.xrc")); - // Make an instance of your derived frame. Passing NULL (the default value + // Make an instance of your derived frame. Passing NULL (the default value // of MyFrame's constructor is NULL) as the frame doesn't have a frame - // since it is the first window. + // since it is the first window. MyFrame *frame = new MyFrame(); - + // Show the frame. - frame->Show(TRUE); - - // Return TRUE to tell program to continue (FALSE would terminate). - return TRUE; + frame->Show(true); + + // Return true to tell program to continue (false would terminate). + return true; } diff --git a/contrib/samples/xrc/xrcdemo.h b/contrib/samples/xrc/xrcdemo.h index d41a649ddc..134c477a9a 100644 --- a/contrib/samples/xrc/xrcdemo.h +++ b/contrib/samples/xrc/xrcdemo.h @@ -39,12 +39,12 @@ class MyApp : public wxApp public: // Override base class virtuals: - // wxApp::OnInit() is called on application startup and is a good place - // for the app initialization (doing it here and not in the ctor - // allows to have an error return: if OnInit() returns false, the + // wxApp::OnInit() is called on application startup and is a good place + // for the app initialization (doing it here and not in the ctor + // allows to have an error return: if OnInit() returns false, the // application terminates) virtual bool OnInit(); - + }; //----------------------------------------------------------------------------- diff --git a/contrib/src/xrc/xh_bmp.cpp b/contrib/src/xrc/xh_bmp.cpp index c7a1ed9b5a..0853104360 100644 --- a/contrib/src/xrc/xh_bmp.cpp +++ b/contrib/src/xrc/xh_bmp.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_bmp.h" #endif @@ -24,13 +24,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapXmlHandler, wxXmlResourceHandler) -wxBitmapXmlHandler::wxBitmapXmlHandler() -: wxXmlResourceHandler() +wxBitmapXmlHandler::wxBitmapXmlHandler() +: wxXmlResourceHandler() { } wxObject *wxBitmapXmlHandler::DoCreateResource() -{ +{ return new wxBitmap(GetBitmap(wxT(""))); } @@ -41,13 +41,13 @@ bool wxBitmapXmlHandler::CanHandle(wxXmlNode *node) IMPLEMENT_DYNAMIC_CLASS(wxIconXmlHandler, wxXmlResourceHandler) -wxIconXmlHandler::wxIconXmlHandler() -: wxXmlResourceHandler() +wxIconXmlHandler::wxIconXmlHandler() +: wxXmlResourceHandler() { } wxObject *wxIconXmlHandler::DoCreateResource() -{ +{ return new wxIcon(GetIcon(wxT(""))); } diff --git a/contrib/src/xrc/xh_bmpbt.cpp b/contrib/src/xrc/xh_bmpbt.cpp index 984234d210..321b36c0b5 100644 --- a/contrib/src/xrc/xh_bmpbt.cpp +++ b/contrib/src/xrc/xh_bmpbt.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_bmpbt.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler, wxXmlResourceHandler) -wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() -: wxXmlResourceHandler() +wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxBU_AUTODRAW); XRC_ADD_STYLE(wxBU_LEFT); @@ -37,7 +37,7 @@ wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() } wxObject *wxBitmapButtonXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(button, wxBitmapButton) button->Create(m_parentAsWindow, @@ -50,14 +50,14 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource() if (GetBool(wxT("default"), 0)) button->SetDefault(); SetupWindow(button); - + if (!GetParamValue(wxT("selected")).IsEmpty()) button->SetBitmapSelected(GetBitmap(wxT("selected"))); if (!GetParamValue(wxT("focus")).IsEmpty()) button->SetBitmapFocus(GetBitmap(wxT("focus"))); if (!GetParamValue(wxT("disabled")).IsEmpty()) button->SetBitmapDisabled(GetBitmap(wxT("disabled"))); - + return button; } diff --git a/contrib/src/xrc/xh_bttn.cpp b/contrib/src/xrc/xh_bttn.cpp index 5ed5ee88db..0733bd6f6f 100644 --- a/contrib/src/xrc/xh_bttn.cpp +++ b/contrib/src/xrc/xh_bttn.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_bttn.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxButtonXmlHandler, wxXmlResourceHandler) -wxButtonXmlHandler::wxButtonXmlHandler() -: wxXmlResourceHandler() +wxButtonXmlHandler::wxButtonXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxBU_LEFT); XRC_ADD_STYLE(wxBU_RIGHT); @@ -36,7 +36,7 @@ wxButtonXmlHandler::wxButtonXmlHandler() } wxObject *wxButtonXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(button, wxButton) button->Create(m_parentAsWindow, @@ -50,7 +50,7 @@ wxObject *wxButtonXmlHandler::DoCreateResource() if (GetBool(wxT("default"), 0)) button->SetDefault(); SetupWindow(button); - + return button; } diff --git a/contrib/src/xrc/xh_cald.cpp b/contrib/src/xrc/xh_cald.cpp index 29ab1b9b94..bc7df4efbc 100644 --- a/contrib/src/xrc/xh_cald.cpp +++ b/contrib/src/xrc/xh_cald.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_cald.h" #endif @@ -29,8 +29,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler, wxXmlResourceHandler) -wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() -: wxXmlResourceHandler() +wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxCAL_SUNDAY_FIRST); XRC_ADD_STYLE(wxCAL_MONDAY_FIRST); @@ -45,7 +45,7 @@ wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() wxObject *wxCalendarCtrlXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(calendar, wxCalendarCtrl); calendar->Create(m_parentAsWindow, @@ -55,9 +55,9 @@ wxObject *wxCalendarCtrlXmlHandler::DoCreateResource() GetPosition(), GetSize(), GetStyle(), GetName()); - + SetupWindow(calendar); - + return calendar; } diff --git a/contrib/src/xrc/xh_chckb.cpp b/contrib/src/xrc/xh_chckb.cpp index c7a0e824b6..242a33645b 100644 --- a/contrib/src/xrc/xh_chckb.cpp +++ b/contrib/src/xrc/xh_chckb.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_chckb.h" #endif @@ -26,14 +26,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler) -wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() -: wxXmlResourceHandler() +wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() +: wxXmlResourceHandler() { AddWindowStyles(); } wxObject *wxCheckBoxXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxCheckBox) control->Create(m_parentAsWindow, @@ -46,7 +46,7 @@ wxObject *wxCheckBoxXmlHandler::DoCreateResource() control->SetValue(GetBool( wxT("checked"))); SetupWindow(control); - + return control; } diff --git a/contrib/src/xrc/xh_chckl.cpp b/contrib/src/xrc/xh_chckl.cpp index 522612a264..0dde7f6759 100644 --- a/contrib/src/xrc/xh_chckl.cpp +++ b/contrib/src/xrc/xh_chckl.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_chckl.h" #endif @@ -28,15 +28,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckListBoxXmlHandler, wxXmlResourceHandler) -wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler() -: wxXmlResourceHandler(), m_insideBox(FALSE) +wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler() +: wxXmlResourceHandler(), m_insideBox(false) { // no styles AddWindowStyles(); } wxObject *wxCheckListBoxXmlHandler::DoCreateResource() -{ +{ if (m_class == wxT("wxCheckListBox") #if WXWIN_COMPATIBILITY_2_4 || m_class == wxT("wxCheckList") @@ -48,7 +48,7 @@ wxObject *wxCheckListBoxXmlHandler::DoCreateResource() wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); #endif // need to build the list of strings from children - m_insideBox = TRUE; + m_insideBox = true; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if (strList.GetCount() > 0) @@ -84,17 +84,17 @@ wxObject *wxCheckListBoxXmlHandler::DoCreateResource() wxString v = n->GetPropVal(wxT("checked"), wxEmptyString); v.MakeLower(); if (v && v == wxT("1")) - control->Check( i, TRUE ); + control->Check( i, true ); - i++; + i++; n = n->GetNext(); } - + SetupWindow(control); if (strings != NULL) delete[] strings; - strList.Clear(); // dump the strings + strList.Clear(); // dump the strings return control; } diff --git a/contrib/src/xrc/xh_choic.cpp b/contrib/src/xrc/xh_choic.cpp index 15f7c6a77c..9b3c33d34e 100644 --- a/contrib/src/xrc/xh_choic.cpp +++ b/contrib/src/xrc/xh_choic.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_choic.h" #endif @@ -25,22 +25,22 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoiceXmlHandler, wxXmlResourceHandler) -wxChoiceXmlHandler::wxChoiceXmlHandler() -: wxXmlResourceHandler() , m_insideBox(FALSE) +wxChoiceXmlHandler::wxChoiceXmlHandler() +: wxXmlResourceHandler() , m_insideBox(false) { XRC_ADD_STYLE(wxCB_SORT); AddWindowStyles(); } wxObject *wxChoiceXmlHandler::DoCreateResource() -{ +{ if( m_class == wxT("wxChoice")) { // find the selection long selection = GetLong(wxT("selection"), -1); // need to build the list of strings from children - m_insideBox = TRUE; + m_insideBox = true; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if (strList.GetCount() > 0) @@ -69,7 +69,7 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() if (strings != NULL) delete[] strings; - strList.Clear(); // dump the strings + strList.Clear(); // dump the strings return control; } @@ -77,7 +77,7 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() { // on the inside now. // handle Label - + // add to the list wxString str = GetNodeContent(m_node); if (m_resource->GetFlags() & wxXRC_USE_LOCALE) diff --git a/contrib/src/xrc/xh_combo.cpp b/contrib/src/xrc/xh_combo.cpp index 03fa009eb4..ffde936198 100644 --- a/contrib/src/xrc/xh_combo.cpp +++ b/contrib/src/xrc/xh_combo.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_combo.h" #endif @@ -27,8 +27,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBoxXmlHandler, wxXmlResourceHandler) -wxComboBoxXmlHandler::wxComboBoxXmlHandler() -: wxXmlResourceHandler() , m_insideBox(FALSE) +wxComboBoxXmlHandler::wxComboBoxXmlHandler() +: wxXmlResourceHandler() , m_insideBox(false) { XRC_ADD_STYLE(wxCB_SIMPLE); XRC_ADD_STYLE(wxCB_SORT); @@ -38,14 +38,14 @@ wxComboBoxXmlHandler::wxComboBoxXmlHandler() } wxObject *wxComboBoxXmlHandler::DoCreateResource() -{ +{ if( m_class == wxT("wxComboBox")) { // find the selection long selection = GetLong( wxT("selection"), -1 ); // need to build the list of strings from children - m_insideBox = TRUE; + m_insideBox = true; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if (strList.GetCount() > 0) @@ -75,7 +75,7 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource() if (strings != NULL) delete[] strings; - strList.Clear(); // dump the strings + strList.Clear(); // dump the strings return control; } diff --git a/contrib/src/xrc/xh_dlg.cpp b/contrib/src/xrc/xh_dlg.cpp index 0fefbf70e6..7a93c46dc9 100644 --- a/contrib/src/xrc/xh_dlg.cpp +++ b/contrib/src/xrc/xh_dlg.cpp @@ -70,7 +70,7 @@ wxObject *wxDialogXmlHandler::DoCreateResource() CreateChildren(dlg); - if (GetBool(wxT("centered"), FALSE)) + if (GetBool(wxT("centered"), false)) dlg->Centre(); return dlg; diff --git a/contrib/src/xrc/xh_frame.cpp b/contrib/src/xrc/xh_frame.cpp index 520b265ca6..795bb43af9 100644 --- a/contrib/src/xrc/xh_frame.cpp +++ b/contrib/src/xrc/xh_frame.cpp @@ -75,7 +75,7 @@ wxObject *wxFrameXmlHandler::DoCreateResource() CreateChildren(frame); - if (GetBool(wxT("centered"), FALSE)) + if (GetBool(wxT("centered"), false)) frame->Centre(); return frame; diff --git a/contrib/src/xrc/xh_gauge.cpp b/contrib/src/xrc/xh_gauge.cpp index 852f7bbd65..2f3dad0c44 100644 --- a/contrib/src/xrc/xh_gauge.cpp +++ b/contrib/src/xrc/xh_gauge.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_gauge.h" #endif @@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler, wxXmlResourceHandler) -wxGaugeXmlHandler::wxGaugeXmlHandler() -: wxXmlResourceHandler() +wxGaugeXmlHandler::wxGaugeXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxGA_HORIZONTAL); XRC_ADD_STYLE(wxGA_VERTICAL); @@ -37,12 +37,12 @@ wxGaugeXmlHandler::wxGaugeXmlHandler() } wxObject *wxGaugeXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxGauge) control->Create(m_parentAsWindow, GetID(), - GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE), + GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE), GetPosition(), GetSize(), GetStyle(), wxDefaultValidator, diff --git a/contrib/src/xrc/xh_gdctl.cpp b/contrib/src/xrc/xh_gdctl.cpp index 7106b598cf..5a8226ebb7 100644 --- a/contrib/src/xrc/xh_gdctl.cpp +++ b/contrib/src/xrc/xh_gdctl.cpp @@ -41,7 +41,7 @@ wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler() wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource() { XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl) - + ctrl->Create(m_parentAsWindow, GetID(), GetText(wxT("defaultfolder")), diff --git a/contrib/src/xrc/xh_html.cpp b/contrib/src/xrc/xh_html.cpp index 8fe80d2082..156370d27a 100644 --- a/contrib/src/xrc/xh_html.cpp +++ b/contrib/src/xrc/xh_html.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_html.h" #endif @@ -28,8 +28,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindowXmlHandler, wxXmlResourceHandler) -wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() -: wxXmlResourceHandler() +wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxHW_SCROLLBAR_NEVER); XRC_ADD_STYLE(wxHW_SCROLLBAR_AUTO); @@ -56,7 +56,7 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource() { wxString url = GetParamValue(wxT("url")); wxFileSystem& fsys = GetCurFileSystem(); - + wxFSFile *f = fsys.OpenFile(url); if (f) { @@ -66,14 +66,14 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource() else control->LoadPage(url); } - + else if (HasParam(wxT("htmlcode"))) { control->SetPage(GetText(wxT("htmlcode"))); } SetupWindow(control); - + return control; } diff --git a/contrib/src/xrc/xh_listb.cpp b/contrib/src/xrc/xh_listb.cpp index 68caf3c1b8..c0a41a91eb 100644 --- a/contrib/src/xrc/xh_listb.cpp +++ b/contrib/src/xrc/xh_listb.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_listb.h" #endif @@ -25,8 +25,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxListBoxXmlHandler, wxXmlResourceHandler) -wxListBoxXmlHandler::wxListBoxXmlHandler() -: wxXmlResourceHandler() , m_insideBox(FALSE) +wxListBoxXmlHandler::wxListBoxXmlHandler() +: wxXmlResourceHandler() , m_insideBox(false) { XRC_ADD_STYLE(wxLB_SINGLE); XRC_ADD_STYLE(wxLB_MULTIPLE); @@ -39,14 +39,14 @@ wxListBoxXmlHandler::wxListBoxXmlHandler() } wxObject *wxListBoxXmlHandler::DoCreateResource() -{ +{ if( m_class == wxT("wxListBox")) { // find the selection long selection = GetLong(wxT("selection"), -1); // need to build the list of strings from children - m_insideBox = TRUE; + m_insideBox = true; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if (strList.GetCount() > 0) @@ -75,7 +75,7 @@ wxObject *wxListBoxXmlHandler::DoCreateResource() if (strings != NULL) delete[] strings; - strList.Clear(); // dump the strings + strList.Clear(); // dump the strings return control; } @@ -83,7 +83,7 @@ wxObject *wxListBoxXmlHandler::DoCreateResource() { // on the inside now. // handle Label - + // add to the list wxString str = GetNodeContent(m_node); if (m_resource->GetFlags() & wxXRC_USE_LOCALE) diff --git a/contrib/src/xrc/xh_listc.cpp b/contrib/src/xrc/xh_listc.cpp index f133a894f7..f6c9eab2c2 100644 --- a/contrib/src/xrc/xh_listc.cpp +++ b/contrib/src/xrc/xh_listc.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_listc.h" #endif @@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxListCtrlXmlHandler, wxXmlResourceHandler) -wxListCtrlXmlHandler::wxListCtrlXmlHandler() -: wxXmlResourceHandler() +wxListCtrlXmlHandler::wxListCtrlXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxLC_LIST); XRC_ADD_STYLE(wxLC_REPORT); @@ -50,7 +50,7 @@ wxListCtrlXmlHandler::wxListCtrlXmlHandler() } wxObject *wxListCtrlXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(list, wxListCtrl) list->Create(m_parentAsWindow, @@ -61,9 +61,9 @@ wxObject *wxListCtrlXmlHandler::DoCreateResource() GetName()); // FIXME: add columns definition - + SetupWindow(list); - + return list; } diff --git a/contrib/src/xrc/xh_menu.cpp b/contrib/src/xrc/xh_menu.cpp index 5df0d5f8d5..dbe2a89e61 100644 --- a/contrib/src/xrc/xh_menu.cpp +++ b/contrib/src/xrc/xh_menu.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_menu.h" #endif @@ -25,8 +25,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuXmlHandler, wxXmlResourceHandler) -wxMenuXmlHandler::wxMenuXmlHandler() : - wxXmlResourceHandler(), m_insideMenu(FALSE) +wxMenuXmlHandler::wxMenuXmlHandler() : + wxXmlResourceHandler(), m_insideMenu(false) { XRC_ADD_STYLE(wxMENU_TEAROFF); } @@ -38,10 +38,10 @@ wxObject *wxMenuXmlHandler::DoCreateResource() wxMenu *menu = new wxMenu(GetStyle()); wxString title = GetText(wxT("label")); wxString help = GetText(wxT("help")); - + bool oldins = m_insideMenu; - m_insideMenu = TRUE; - CreateChildren(menu, TRUE/*only this handler*/); + m_insideMenu = true; + CreateChildren(menu, true/*only this handler*/); m_insideMenu = oldins; wxMenuBar *p_bar = wxDynamicCast(m_parent, wxMenuBar); @@ -60,16 +60,16 @@ wxObject *wxMenuXmlHandler::DoCreateResource() else { wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); - + if (m_class == wxT("separator")) p_menu->AppendSeparator(); else if (m_class == wxT("break")) p_menu->Break(); else /*wxMenuItem*/ - { + { int id = GetID(); wxString label = GetText(wxT("label")); - wxString accel = GetText(wxT("accel"), FALSE); + wxString accel = GetText(wxT("accel"), false); wxString fullLabel = label; if (!accel.IsEmpty()) fullLabel << wxT("\t") << accel; @@ -85,13 +85,13 @@ wxObject *wxMenuXmlHandler::DoCreateResource() wxMenuItem *mitem = new wxMenuItem(p_menu, id, fullLabel, GetText(wxT("help")), kind); - + #if wxCHECK_VERSION(2,3,0) || (defined(__WXMSW__) && wxUSE_OWNER_DRAWN) if (HasParam(wxT("bitmap"))) mitem->SetBitmap(GetBitmap(wxT("bitmap"), wxART_MENU)); #endif p_menu->Append(mitem); - mitem->Enable(GetBool(wxT("enabled"), TRUE)); + mitem->Enable(GetBool(wxT("enabled"), true)); if (kind == wxITEM_CHECK) mitem->Check(GetBool(wxT("checked"))); } @@ -104,7 +104,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource() bool wxMenuXmlHandler::CanHandle(wxXmlNode *node) { return IsOfClass(node, wxT("wxMenu")) || - (m_insideMenu && + (m_insideMenu && (IsOfClass(node, wxT("wxMenuItem")) || IsOfClass(node, wxT("break")) || IsOfClass(node, wxT("separator"))) diff --git a/contrib/src/xrc/xh_notbk.cpp b/contrib/src/xrc/xh_notbk.cpp index 27d6a5ee40..e97598a225 100644 --- a/contrib/src/xrc/xh_notbk.cpp +++ b/contrib/src/xrc/xh_notbk.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_notbk.h" #endif @@ -29,8 +29,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookXmlHandler, wxXmlResourceHandler) -wxNotebookXmlHandler::wxNotebookXmlHandler() -: wxXmlResourceHandler(), m_isInside(FALSE), m_notebook(NULL) +wxNotebookXmlHandler::wxNotebookXmlHandler() +: wxXmlResourceHandler(), m_isInside(false), m_notebook(NULL) { XRC_ADD_STYLE(wxNB_FIXEDWIDTH); XRC_ADD_STYLE(wxNB_LEFT); @@ -40,7 +40,7 @@ wxNotebookXmlHandler::wxNotebookXmlHandler() } wxObject *wxNotebookXmlHandler::DoCreateResource() -{ +{ if (m_class == wxT("notebookpage")) { wxXmlNode *n = GetParamNode(wxT("object")); @@ -51,7 +51,7 @@ wxObject *wxNotebookXmlHandler::DoCreateResource() if (n) { bool old_ins = m_isInside; - m_isInside = FALSE; + m_isInside = false; wxObject *item = CreateResFromNode(n, m_notebook, NULL); m_isInside = old_ins; wxWindow *wnd = wxDynamicCast(item, wxWindow); @@ -59,8 +59,8 @@ wxObject *wxNotebookXmlHandler::DoCreateResource() if (wnd) m_notebook->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected"), 0)); - else - wxLogError(wxT("Error in resource.")); + else + wxLogError(wxT("Error in resource.")); return wnd; } else @@ -69,12 +69,12 @@ wxObject *wxNotebookXmlHandler::DoCreateResource() return NULL; } } - - else + + else { XRC_MAKE_INSTANCE(nb, wxNotebook) - nb->Create(m_parentAsWindow, + nb->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), @@ -83,12 +83,12 @@ wxObject *wxNotebookXmlHandler::DoCreateResource() wxNotebook *old_par = m_notebook; m_notebook = nb; bool old_ins = m_isInside; - m_isInside = TRUE; - CreateChildren(m_notebook, TRUE/*only this handler*/); + m_isInside = true; + CreateChildren(m_notebook, true/*only this handler*/); m_isInside = old_ins; m_notebook = old_par; - if (GetBool(wxT("usenotebooksizer"), FALSE)) + if (GetBool(wxT("usenotebooksizer"), false)) return new wxNotebookSizer(nb); else return nb; diff --git a/contrib/src/xrc/xh_panel.cpp b/contrib/src/xrc/xh_panel.cpp index b4b4c82810..4083dce1d2 100644 --- a/contrib/src/xrc/xh_panel.cpp +++ b/contrib/src/xrc/xh_panel.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_panel.h" #endif @@ -35,7 +35,7 @@ wxPanelXmlHandler::wxPanelXmlHandler() : wxXmlResourceHandler() } wxObject *wxPanelXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(panel, wxPanel) panel->Create(m_parentAsWindow, @@ -46,7 +46,7 @@ wxObject *wxPanelXmlHandler::DoCreateResource() SetupWindow(panel); CreateChildren(panel); - + return panel; } diff --git a/contrib/src/xrc/xh_radbt.cpp b/contrib/src/xrc/xh_radbt.cpp index 8533992393..01c5ece4f0 100644 --- a/contrib/src/xrc/xh_radbt.cpp +++ b/contrib/src/xrc/xh_radbt.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_radbt.h" #endif @@ -26,21 +26,21 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioButtonXmlHandler, wxXmlResourceHandler) -wxRadioButtonXmlHandler::wxRadioButtonXmlHandler() -: wxXmlResourceHandler() +wxRadioButtonXmlHandler::wxRadioButtonXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxRB_GROUP); AddWindowStyles(); } wxObject *wxRadioButtonXmlHandler::DoCreateResource() -{ +{ /* BOBM - implementation note. * once the wxBitmapRadioButton is implemented. - * look for a bitmap property. If not null, - * make it a wxBitmapRadioButton instead of the + * look for a bitmap property. If not null, + * make it a wxBitmapRadioButton instead of the * normal radio button. - */ + */ XRC_MAKE_INSTANCE(control, wxRadioButton) @@ -54,7 +54,7 @@ wxObject *wxRadioButtonXmlHandler::DoCreateResource() control->SetValue(GetBool(wxT("value"), 0)); SetupWindow(control); - + return control; } diff --git a/contrib/src/xrc/xh_radbx.cpp b/contrib/src/xrc/xh_radbx.cpp index 0bff4dda51..5b950e2e93 100644 --- a/contrib/src/xrc/xh_radbx.cpp +++ b/contrib/src/xrc/xh_radbx.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_radbx.h" #endif @@ -27,8 +27,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBoxXmlHandler, wxXmlResourceHandler) -wxRadioBoxXmlHandler::wxRadioBoxXmlHandler() -: wxXmlResourceHandler(), m_insideBox(FALSE) +wxRadioBoxXmlHandler::wxRadioBoxXmlHandler() +: wxXmlResourceHandler(), m_insideBox(false) { XRC_ADD_STYLE(wxRA_SPECIFY_COLS); XRC_ADD_STYLE(wxRA_HORIZONTAL); @@ -38,14 +38,14 @@ wxRadioBoxXmlHandler::wxRadioBoxXmlHandler() } wxObject *wxRadioBoxXmlHandler::DoCreateResource() -{ +{ if( m_class == wxT("wxRadioBox")) { // find the selection long selection = GetLong( wxT("selection"), -1 ); // need to build the list of strings from children - m_insideBox = TRUE; + m_insideBox = true; CreateChildrenPrivately( NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if( strList.GetCount() > 0 ) @@ -76,7 +76,7 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource() if (strings != NULL) delete[] strings; - strList.Clear(); // dump the strings + strList.Clear(); // dump the strings return control; } diff --git a/contrib/src/xrc/xh_scrol.cpp b/contrib/src/xrc/xh_scrol.cpp index ac99ba1b40..f1c6fcba19 100644 --- a/contrib/src/xrc/xh_scrol.cpp +++ b/contrib/src/xrc/xh_scrol.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_scrol.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxScrollBarXmlHandler, wxXmlResourceHandler) -wxScrollBarXmlHandler::wxScrollBarXmlHandler() -: wxXmlResourceHandler() +wxScrollBarXmlHandler::wxScrollBarXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxSB_HORIZONTAL); XRC_ADD_STYLE(wxSB_VERTICAL); @@ -33,7 +33,7 @@ wxScrollBarXmlHandler::wxScrollBarXmlHandler() } wxObject *wxScrollBarXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxScrollBar) control->Create(m_parentAsWindow, @@ -43,14 +43,14 @@ wxObject *wxScrollBarXmlHandler::DoCreateResource() wxDefaultValidator, GetName()); - control->SetScrollbar(GetLong( wxT("value"), 0), + control->SetScrollbar(GetLong( wxT("value"), 0), GetLong( wxT("thumbsize"),1), GetLong( wxT("range"), 10), GetLong( wxT("pagesize"),1)); SetupWindow(control); CreateChildren(control); - + return control; } diff --git a/contrib/src/xrc/xh_scwin.cpp b/contrib/src/xrc/xh_scwin.cpp index 2ac6d4face..275bafed64 100644 --- a/contrib/src/xrc/xh_scwin.cpp +++ b/contrib/src/xrc/xh_scwin.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2002 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_scwin.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindowXmlHandler, wxXmlResourceHandler) -wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() -: wxXmlResourceHandler() +wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxHSCROLL); XRC_ADD_STYLE(wxVSCROLL); @@ -33,7 +33,7 @@ wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() } wxObject *wxScrolledWindowXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxScrolledWindow) control->Create(m_parentAsWindow, @@ -44,7 +44,7 @@ wxObject *wxScrolledWindowXmlHandler::DoCreateResource() SetupWindow(control); CreateChildren(control); - + return control; } diff --git a/contrib/src/xrc/xh_sizer.cpp b/contrib/src/xrc/xh_sizer.cpp index 2e3f3e4908..1163ab619f 100644 --- a/contrib/src/xrc/xh_sizer.cpp +++ b/contrib/src/xrc/xh_sizer.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_sizer.h" #endif @@ -32,12 +32,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxSizerXmlHandler, wxXmlResourceHandler) - - -wxSizerXmlHandler::wxSizerXmlHandler() + + +wxSizerXmlHandler::wxSizerXmlHandler() : wxXmlResourceHandler(), - m_isInside(FALSE), - m_isGBS(FALSE), + m_isInside(false), + m_isGBS(false), m_parentSizer(NULL) { XRC_ADD_STYLE(wxHORIZONTAL); @@ -69,7 +69,7 @@ wxSizerXmlHandler::wxSizerXmlHandler() XRC_ADD_STYLE(wxALIGN_CENTRE_HORIZONTAL); XRC_ADD_STYLE(wxALIGN_CENTER_VERTICAL); XRC_ADD_STYLE(wxALIGN_CENTRE_VERTICAL); - + XRC_ADD_STYLE(wxADJUST_MINSIZE); XRC_ADD_STYLE(wxFIXED_MINSIZE); } @@ -80,16 +80,16 @@ bool wxSizerXmlHandler::CanHandle(wxXmlNode *node) { return ( (!m_isInside && IsSizerNode(node)) || (m_isInside && IsOfClass(node, wxT("sizeritem"))) || - (m_isInside && IsOfClass(node, wxT("spacer"))) + (m_isInside && IsOfClass(node, wxT("spacer"))) ); } - + wxObject* wxSizerXmlHandler::DoCreateResource() -{ +{ if (m_class == wxT("sizeritem")) return Handle_sizeritem(); - + else if (m_class == wxT("spacer")) return Handle_spacer(); @@ -122,13 +122,13 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem() { // create a sizer item for it wxSizerItem* sitem = MakeSizerItem(); - + // now fetch the item to be managed bool old_gbs = m_isGBS; bool old_ins = m_isInside; wxSizer *old_par = m_parentSizer; - m_isInside = FALSE; - if (!IsSizerNode(n)) m_parentSizer = NULL; + m_isInside = false; + if (!IsSizerNode(n)) m_parentSizer = NULL; wxObject *item = CreateResFromNode(n, m_parent, NULL); m_isInside = old_ins; m_parentSizer = old_par; @@ -137,12 +137,12 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem() // and figure out what type it is wxSizer *sizer = wxDynamicCast(item, wxSizer); wxWindow *wnd = wxDynamicCast(item, wxWindow); - + if (sizer) sitem->SetSizer(sizer); else if (wnd) sitem->SetWindow(wnd); - else + else wxLogError(wxT("Error in resource.")); // finally, set other wxSizerItem attributes @@ -166,7 +166,7 @@ wxObject* wxSizerXmlHandler::Handle_spacer() wxSizerItem* sitem = MakeSizerItem(); SetSizerItemAttributes(sitem); sitem->SetSpacer(GetSize()); - AddSizerItem(sitem); + AddSizerItem(sitem); return NULL; } @@ -174,7 +174,7 @@ wxObject* wxSizerXmlHandler::Handle_spacer() wxObject* wxSizerXmlHandler::Handle_sizer() { wxSizer *sizer = NULL; - + wxXmlNode *parentNode = m_node->GetParent(); wxCHECK_MSG(m_parentSizer != NULL || @@ -191,17 +191,17 @@ wxObject* wxSizerXmlHandler::Handle_sizer() else if (m_class == wxT("wxStaticBoxSizer")) sizer = Handle_wxStaticBoxSizer(); - + else if (m_class == wxT("wxGridSizer")) sizer = Handle_wxGridSizer(); - + else if (m_class == wxT("wxFlexGridSizer")) sizer = Handle_wxFlexGridSizer(); else if (m_class == wxT("wxGridBagSizer")) sizer = Handle_wxGridBagSizer(); - + wxSize minsize = GetSize(wxT("minsize")); if (!(minsize == wxDefaultSize)) sizer->SetMinSize(minsize); @@ -212,10 +212,10 @@ wxObject* wxSizerXmlHandler::Handle_sizer() // set new state m_parentSizer = sizer; - m_isInside = TRUE; + m_isInside = true; m_isGBS = (m_class == wxT("wxGridBagSizer")); - - CreateChildren(m_parent, TRUE/*only this handler*/); + + CreateChildren(m_parent, true/*only this handler*/); // restore state m_isInside = old_ins; @@ -223,7 +223,7 @@ wxObject* wxSizerXmlHandler::Handle_sizer() if (m_parentSizer == NULL) // setup window: { - m_parentAsWindow->SetAutoLayout(TRUE); + m_parentAsWindow->SetAutoLayout(true); m_parentAsWindow->SetSizer(sizer); wxXmlNode *nd = m_node; @@ -235,7 +235,7 @@ wxObject* wxSizerXmlHandler::Handle_sizer() if (m_parentAsWindow->GetWindowStyle() & (wxRESIZE_BOX | wxRESIZE_BORDER)) sizer->SetSizeHints(m_parentAsWindow); } - + return sizer; } @@ -243,8 +243,8 @@ wxObject* wxSizerXmlHandler::Handle_sizer() wxSizer* wxSizerXmlHandler::Handle_wxBoxSizer() { return new wxBoxSizer(GetStyle(wxT("orient"), wxHORIZONTAL)); -} - +} + wxSizer* wxSizerXmlHandler::Handle_wxStaticBoxSizer() { return new wxStaticBoxSizer( @@ -256,7 +256,7 @@ wxSizer* wxSizerXmlHandler::Handle_wxStaticBoxSizer() GetName()), GetStyle(wxT("orient"), wxHORIZONTAL)); } - + wxSizer* wxSizerXmlHandler::Handle_wxGridSizer() { return new wxGridSizer(GetLong(wxT("rows")), GetLong(wxT("cols")), @@ -266,7 +266,7 @@ wxSizer* wxSizerXmlHandler::Handle_wxGridSizer() wxSizer* wxSizerXmlHandler::Handle_wxFlexGridSizer() { - wxFlexGridSizer *sizer = + wxFlexGridSizer *sizer = new wxFlexGridSizer(GetLong(wxT("rows")), GetLong(wxT("cols")), GetDimension(wxT("vgap")), GetDimension(wxT("hgap"))); SetGrowables(sizer, wxT("growablerows"), true); @@ -277,7 +277,7 @@ wxSizer* wxSizerXmlHandler::Handle_wxFlexGridSizer() wxSizer* wxSizerXmlHandler::Handle_wxGridBagSizer() { - wxGridBagSizer *sizer = + wxGridBagSizer *sizer = new wxGridBagSizer(GetDimension(wxT("vgap")), GetDimension(wxT("hgap"))); SetGrowables(sizer, wxT("growablerows"), true); SetGrowables(sizer, wxT("growablecols"), false); @@ -345,13 +345,13 @@ void wxSizerXmlHandler::SetSizerItemAttributes(wxSizerItem* sitem) sz = GetSize(wxT("ratio")); if (!(sz == wxDefaultSize)) sitem->SetRatio(sz); - + if (m_isGBS) { wxGBSizerItem* gbsitem = (wxGBSizerItem*)sitem; gbsitem->SetPos(GetGBPos(wxT("cellpos"))); gbsitem->SetSpan(GetGBSpan(wxT("cellspan"))); - } + } } void wxSizerXmlHandler::AddSizerItem(wxSizerItem* sitem) @@ -361,7 +361,7 @@ void wxSizerXmlHandler::AddSizerItem(wxSizerItem* sitem) else m_parentSizer->Add(sitem); } - + diff --git a/contrib/src/xrc/xh_slidr.cpp b/contrib/src/xrc/xh_slidr.cpp index 10e16450cc..e71a5fd41a 100644 --- a/contrib/src/xrc/xh_slidr.cpp +++ b/contrib/src/xrc/xh_slidr.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_slidr.h" #endif @@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxSliderXmlHandler, wxXmlResourceHandler) -wxSliderXmlHandler::wxSliderXmlHandler() -: wxXmlResourceHandler() +wxSliderXmlHandler::wxSliderXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxSL_HORIZONTAL); XRC_ADD_STYLE(wxSL_VERTICAL); @@ -43,12 +43,12 @@ wxSliderXmlHandler::wxSliderXmlHandler() } wxObject *wxSliderXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxSlider) control->Create(m_parentAsWindow, GetID(), - GetLong(wxT("value"), wxSL_DEFAULT_VALUE), + GetLong(wxT("value"), wxSL_DEFAULT_VALUE), GetLong(wxT("min"), wxSL_DEFAULT_MIN), GetLong(wxT("max"), wxSL_DEFAULT_MAX), GetPosition(), GetSize(), @@ -82,7 +82,7 @@ wxObject *wxSliderXmlHandler::DoCreateResource() } SetupWindow(control); - + return control; } diff --git a/contrib/src/xrc/xh_spin.cpp b/contrib/src/xrc/xh_spin.cpp index 5748e7443a..c6ad0fcf92 100644 --- a/contrib/src/xrc/xh_spin.cpp +++ b/contrib/src/xrc/xh_spin.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_spin.h" #endif @@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxSpinButtonXmlHandler, wxXmlResourceHandler) -wxSpinButtonXmlHandler::wxSpinButtonXmlHandler() -: wxXmlResourceHandler() +wxSpinButtonXmlHandler::wxSpinButtonXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxSP_HORIZONTAL); XRC_ADD_STYLE(wxSP_VERTICAL); @@ -37,7 +37,7 @@ wxSpinButtonXmlHandler::wxSpinButtonXmlHandler() } wxObject *wxSpinButtonXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxSpinButton) control->Create(m_parentAsWindow, @@ -50,7 +50,7 @@ wxObject *wxSpinButtonXmlHandler::DoCreateResource() control->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN), GetLong(wxT("max"), wxSP_DEFAULT_MAX)); SetupWindow(control); - + return control; } @@ -65,8 +65,8 @@ bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode *node) IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrlXmlHandler, wxXmlResourceHandler) -wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler() -: wxXmlResourceHandler() +wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxSP_HORIZONTAL); XRC_ADD_STYLE(wxSP_VERTICAL); @@ -75,9 +75,9 @@ wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler() } wxObject *wxSpinCtrlXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(control, wxSpinCtrl) - + control->Create(m_parentAsWindow, GetID(), GetText(wxT("value")), @@ -89,7 +89,7 @@ wxObject *wxSpinCtrlXmlHandler::DoCreateResource() GetName()); SetupWindow(control); - + return control; } diff --git a/contrib/src/xrc/xh_split.cpp b/contrib/src/xrc/xh_split.cpp index 2eef0d3ac4..5deff63190 100644 --- a/contrib/src/xrc/xh_split.cpp +++ b/contrib/src/xrc/xh_split.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2003 panga@freemail.hu, Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_split.h" #endif @@ -60,7 +60,7 @@ wxObject *wxSplitterWindowXmlHandler::DoCreateResource() wxXmlNode *n = m_node->GetChildren(); while (n) { - if ((n->GetType() == wxXML_ELEMENT_NODE) && + if ((n->GetType() == wxXML_ELEMENT_NODE) && (n->GetName() == wxT("object") || n->GetName() == wxT("object_ref"))) { @@ -74,7 +74,7 @@ wxObject *wxSplitterWindowXmlHandler::DoCreateResource() { win2 = win; break; - } + } } n = n->GetNext(); } diff --git a/contrib/src/xrc/xh_stbmp.cpp b/contrib/src/xrc/xh_stbmp.cpp index 04eb5096df..2674322938 100644 --- a/contrib/src/xrc/xh_stbmp.cpp +++ b/contrib/src/xrc/xh_stbmp.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_stbmp.h" #endif @@ -24,14 +24,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmapXmlHandler, wxXmlResourceHandler) -wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler() -: wxXmlResourceHandler() +wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler() +: wxXmlResourceHandler() { AddWindowStyles(); } wxObject *wxStaticBitmapXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(bmp, wxStaticBitmap) bmp->Create(m_parentAsWindow, @@ -42,7 +42,7 @@ wxObject *wxStaticBitmapXmlHandler::DoCreateResource() GetName()); SetupWindow(bmp); - + return bmp; } diff --git a/contrib/src/xrc/xh_stbox.cpp b/contrib/src/xrc/xh_stbox.cpp index cc357908c9..9a88572d5b 100644 --- a/contrib/src/xrc/xh_stbox.cpp +++ b/contrib/src/xrc/xh_stbox.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_stbox.h" #endif @@ -24,14 +24,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBoxXmlHandler, wxXmlResourceHandler) -wxStaticBoxXmlHandler::wxStaticBoxXmlHandler() -: wxXmlResourceHandler() +wxStaticBoxXmlHandler::wxStaticBoxXmlHandler() +: wxXmlResourceHandler() { AddWindowStyles(); } wxObject *wxStaticBoxXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(box, wxStaticBox) box->Create(m_parentAsWindow, @@ -42,7 +42,7 @@ wxObject *wxStaticBoxXmlHandler::DoCreateResource() GetName()); SetupWindow(box); - + return box; } diff --git a/contrib/src/xrc/xh_stlin.cpp b/contrib/src/xrc/xh_stlin.cpp index 7cc5abc08b..9d49226eab 100644 --- a/contrib/src/xrc/xh_stlin.cpp +++ b/contrib/src/xrc/xh_stlin.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_stlin.h" #endif @@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticLineXmlHandler, wxXmlResourceHandler) -wxStaticLineXmlHandler::wxStaticLineXmlHandler() -: wxXmlResourceHandler() +wxStaticLineXmlHandler::wxStaticLineXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxLI_HORIZONTAL); XRC_ADD_STYLE(wxLI_VERTICAL); @@ -35,7 +35,7 @@ wxStaticLineXmlHandler::wxStaticLineXmlHandler() } wxObject *wxStaticLineXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(line, wxStaticLine) line->Create(m_parentAsWindow, @@ -45,7 +45,7 @@ wxObject *wxStaticLineXmlHandler::DoCreateResource() GetName()); SetupWindow(line); - + return line; } diff --git a/contrib/src/xrc/xh_sttxt.cpp b/contrib/src/xrc/xh_sttxt.cpp index e94e9fdbd2..a65e2b4b4f 100644 --- a/contrib/src/xrc/xh_sttxt.cpp +++ b/contrib/src/xrc/xh_sttxt.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_sttxt.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticTextXmlHandler, wxXmlResourceHandler) -wxStaticTextXmlHandler::wxStaticTextXmlHandler() -: wxXmlResourceHandler() +wxStaticTextXmlHandler::wxStaticTextXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxST_NO_AUTORESIZE); XRC_ADD_STYLE(wxALIGN_LEFT); @@ -35,7 +35,7 @@ wxStaticTextXmlHandler::wxStaticTextXmlHandler() } wxObject *wxStaticTextXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(text, wxStaticText) text->Create(m_parentAsWindow, @@ -46,7 +46,7 @@ wxObject *wxStaticTextXmlHandler::DoCreateResource() GetName()); SetupWindow(text); - + return text; } diff --git a/contrib/src/xrc/xh_text.cpp b/contrib/src/xrc/xh_text.cpp index 3e89a272ce..19bbd601c8 100644 --- a/contrib/src/xrc/xh_text.cpp +++ b/contrib/src/xrc/xh_text.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Aleksandras Gluchovas // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_text.h" #endif @@ -24,7 +24,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler, wxXmlResourceHandler) -wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler() +wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler() { XRC_ADD_STYLE(wxTE_NO_VSCROLL); XRC_ADD_STYLE(wxTE_AUTO_SCROLL); @@ -48,7 +48,7 @@ wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler() } wxObject *wxTextCtrlXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(text, wxTextCtrl) text->Create(m_parentAsWindow, @@ -60,7 +60,7 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource() GetName()); SetupWindow(text); - + return text; } diff --git a/contrib/src/xrc/xh_toolb.cpp b/contrib/src/xrc/xh_toolb.cpp index 9bc524dc34..7e44ab77a1 100644 --- a/contrib/src/xrc/xh_toolb.cpp +++ b/contrib/src/xrc/xh_toolb.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_toolb.h" #endif @@ -27,8 +27,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBarXmlHandler, wxXmlResourceHandler) -wxToolBarXmlHandler::wxToolBarXmlHandler() -: wxXmlResourceHandler(), m_isInside(FALSE), m_toolbar(NULL) +wxToolBarXmlHandler::wxToolBarXmlHandler() +: wxXmlResourceHandler(), m_isInside(false), m_toolbar(NULL) { XRC_ADD_STYLE(wxTB_FLAT); XRC_ADD_STYLE(wxTB_DOCKABLE); @@ -43,11 +43,11 @@ wxToolBarXmlHandler::wxToolBarXmlHandler() } wxObject *wxToolBarXmlHandler::DoCreateResource() -{ +{ if (m_class == wxT("tool")) { wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!")); - + if (GetPosition() != wxDefaultPosition) { m_toolbar->AddTool(GetID(), @@ -61,7 +61,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() GetText(wxT("longhelp"))); } else - { + { wxItemKind kind = wxITEM_NORMAL; if (GetBool(wxT("radio"))) kind = wxITEM_RADIO; @@ -70,7 +70,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() wxASSERT_MSG( kind == wxITEM_NORMAL, _T("can't have both toggleable and radion button at once") ); kind = wxITEM_CHECK; - } + } m_toolbar->AddTool(GetID(), GetText(wxT("label")), GetBitmap(wxT("bitmap"), wxART_TOOLBAR), @@ -81,14 +81,14 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() } return m_toolbar; // must return non-NULL } - + else if (m_class == wxT("separator")) { wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: separator not within a toolbar!")); m_toolbar->AddSeparator(); return m_toolbar; // must return non-NULL } - + else /**/ { int style = GetStyle(wxT("style"), wxNO_BORDER | wxTB_HORIZONTAL); @@ -97,7 +97,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() #endif XRC_MAKE_INSTANCE(toolbar, wxToolBar) - + toolbar->Create(m_parentAsWindow, GetID(), GetPosition(), @@ -124,14 +124,14 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() if (children_node == NULL) return toolbar; - m_isInside = TRUE; + m_isInside = true; m_toolbar = toolbar; wxXmlNode *n = children_node; while (n) { - if ((n->GetType() == wxXML_ELEMENT_NODE) && + if ((n->GetType() == wxXML_ELEMENT_NODE) && (n->GetName() == wxT("object") || n->GetName() == wxT("object_ref"))) { wxObject *created = CreateResFromNode(n, toolbar, NULL); @@ -144,7 +144,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() n = n->GetNext(); } - m_isInside = FALSE; + m_isInside = false; m_toolbar = NULL; toolbar->Realize(); @@ -163,7 +163,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() bool wxToolBarXmlHandler::CanHandle(wxXmlNode *node) { return ((!m_isInside && IsOfClass(node, wxT("wxToolBar"))) || - (m_isInside && IsOfClass(node, wxT("tool"))) || + (m_isInside && IsOfClass(node, wxT("tool"))) || (m_isInside && IsOfClass(node, wxT("separator")))); } diff --git a/contrib/src/xrc/xh_tree.cpp b/contrib/src/xrc/xh_tree.cpp index f3ee4c65a6..a0b32fd6ad 100644 --- a/contrib/src/xrc/xh_tree.cpp +++ b/contrib/src/xrc/xh_tree.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_tree.h" #endif @@ -24,8 +24,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrlXmlHandler, wxXmlResourceHandler) -wxTreeCtrlXmlHandler::wxTreeCtrlXmlHandler() -: wxXmlResourceHandler() +wxTreeCtrlXmlHandler::wxTreeCtrlXmlHandler() +: wxXmlResourceHandler() { XRC_ADD_STYLE(wxTR_EDIT_LABELS); XRC_ADD_STYLE(wxTR_NO_BUTTONS); @@ -45,7 +45,7 @@ wxTreeCtrlXmlHandler::wxTreeCtrlXmlHandler() } wxObject *wxTreeCtrlXmlHandler::DoCreateResource() -{ +{ XRC_MAKE_INSTANCE(tree, wxTreeCtrl) tree->Create(m_parentAsWindow, @@ -56,7 +56,7 @@ wxObject *wxTreeCtrlXmlHandler::DoCreateResource() GetName()); SetupWindow(tree); - + return tree; } diff --git a/contrib/src/xrc/xh_unkwn.cpp b/contrib/src/xrc/xh_unkwn.cpp index cad645b68b..d8b615cf6e 100644 --- a/contrib/src/xrc/xh_unkwn.cpp +++ b/contrib/src/xrc/xh_unkwn.cpp @@ -31,7 +31,7 @@ class wxUnknownControlContainer : public wxPanel public: wxUnknownControlContainer(wxWindow *parent, const wxString& controlName, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0) @@ -95,7 +95,7 @@ wxObject *wxUnknownWidgetXmlHandler::DoCreateResource() wxPanel *panel = new wxUnknownControlContainer(m_parentAsWindow, - GetName(), -1, + GetName(), wxID_ANY, GetPosition(), GetSize(), GetStyle(wxT("style"))); SetupWindow(panel); diff --git a/contrib/src/xrc/xh_wizrd.cpp b/contrib/src/xrc/xh_wizrd.cpp index e8cb354448..aff151cede 100644 --- a/contrib/src/xrc/xh_wizrd.cpp +++ b/contrib/src/xrc/xh_wizrd.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_wizrd.h" #endif @@ -35,7 +35,7 @@ wxWizardXmlHandler::wxWizardXmlHandler() : wxXmlResourceHandler() } wxObject *wxWizardXmlHandler::DoCreateResource() -{ +{ if (m_class == wxT("wxWizard")) { XRC_MAKE_INSTANCE(wiz, wxWizard) @@ -92,7 +92,7 @@ wxObject *wxWizardXmlHandler::DoCreateResource() bool wxWizardXmlHandler::CanHandle(wxXmlNode *node) { - return IsOfClass(node, wxT("wxWizard")) || + return IsOfClass(node, wxT("wxWizard")) || (m_wizard != NULL && (IsOfClass(node, wxT("wxWizardPage")) || IsOfClass(node, wxT("wxWizardPageSimple"))) diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index 4d6b486ad6..e392d946e2 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -82,7 +82,7 @@ bool wxXmlResource::Load(const wxString& filemask) wxString fnd; wxXmlResourceDataRecord *drec; bool iswild = wxIsWild(filemask); - bool rt = TRUE; + bool rt = true; #if wxUSE_FILESYSTEM wxFileSystem fsys; @@ -260,7 +260,7 @@ bool wxXmlResource::AttachUnknownControl(const wxString& name, if (!container) { wxLogError(_("Cannot find container for unknown control '%s'."), name.c_str()); - return FALSE; + return false; } return control->Reparent(container); } @@ -274,9 +274,9 @@ static void ProcessPlatformProperty(wxXmlNode *node) wxXmlNode *c = node->GetChildren(); while (c) { - isok = FALSE; + isok = false; if (!c->GetPropVal(wxT("platform"), &s)) - isok = TRUE; + isok = true; else { wxStringTokenizer tkn(s, wxT(" |")); @@ -366,8 +366,8 @@ bool wxXmlResource::UpdateResources() # if wxUSE_FILESYSTEM file = fsys.OpenFile(m_data[i].File); - if (file) - stream = file->GetStream(); + if (file) + stream = file->GetStream(); # else stream = new wxFileInputStream(m_data[i].File); # endif @@ -391,7 +391,7 @@ bool wxXmlResource::UpdateResources() rt = false; } else - { + { long version; int v1, v2, v3, v4; wxString verstr = m_data[i].Doc->GetRoot()->GetPropVal( @@ -411,17 +411,17 @@ bool wxXmlResource::UpdateResources() ProcessPlatformProperty(m_data[i].Doc->GetRoot()); #if wxUSE_FILESYSTEM - m_data[i].Time = file->GetModificationTime(); + m_data[i].Time = file->GetModificationTime(); #else m_data[i].Time = wxDateTime(wxFileModificationTime(m_data[i].File)); #endif - } + } # if wxUSE_FILESYSTEM - wxDELETE(file); - wxUnusedVar(file); + wxDELETE(file); + wxUnusedVar(file); # else - wxDELETE(stream); + wxDELETE(stream); # endif } } @@ -456,7 +456,7 @@ wxXmlNode *wxXmlResource::DoFindResource(wxXmlNode *parent, wxString refName = node->GetPropVal(wxT("ref"), wxEmptyString); if (refName.empty()) continue; - wxXmlNode* refNode = FindResource(refName, wxEmptyString, TRUE); + wxXmlNode* refNode = FindResource(refName, wxEmptyString, true); if (refNode && refNode->GetPropVal(wxT("class"), wxEmptyString) == classname) { @@ -473,7 +473,7 @@ wxXmlNode *wxXmlResource::DoFindResource(wxXmlNode *parent, (node->GetName() == wxT("object") || node->GetName() == wxT("object_ref")) ) { - wxXmlNode* found = DoFindResource(node, name, classname, TRUE); + wxXmlNode* found = DoFindResource(node, name, classname, true); if ( found ) return found; } @@ -565,7 +565,7 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent, if ( node->GetName() == wxT("object_ref") ) { wxString refName = node->GetPropVal(wxT("ref"), wxEmptyString); - wxXmlNode* refNode = FindResource(refName, wxEmptyString, TRUE); + wxXmlNode* refNode = FindResource(refName, wxEmptyString, true); if ( !refNode ) { @@ -1090,7 +1090,7 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param) else if (family == wxT("swiss")) ifamily = wxSWISS; else if (family == wxT("modern")) ifamily = wxMODERN; - bool underlined = GetBool(wxT("underlined"), FALSE); + bool underlined = GetBool(wxT("underlined"), false); wxString encoding = GetParamValue(wxT("encoding")); wxFontMapper mapper; @@ -1107,7 +1107,7 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param) wxStringTokenizer tk(faces, wxT(",")); while (tk.HasMoreTokens()) { - int index = enu.GetFacenames()->Index(tk.GetNextToken(), FALSE); + int index = enu.GetFacenames()->Index(tk.GetNextToken(), false); if (index != wxNOT_FOUND) { facename = (*enu.GetFacenames())[index]; @@ -1136,11 +1136,11 @@ void wxXmlResourceHandler::SetupWindow(wxWindow *wnd) if (HasParam(wxT("fg"))) wnd->SetForegroundColour(GetColour(wxT("fg"))); if (GetBool(wxT("enabled"), 1) == 0) - wnd->Enable(FALSE); + wnd->Enable(false); if (GetBool(wxT("focused"), 0) == 1) wnd->SetFocus(); if (GetBool(wxT("hidden"), 0) == 1) - wnd->Show(FALSE); + wnd->Show(false); #if wxUSE_TOOLTIPS if (HasParam(wxT("tooltip"))) wnd->SetToolTip(GetText(wxT("tooltip"))); @@ -1309,7 +1309,7 @@ public: { AddStdXRCID_Records(); wxXmlResource::AddSubclassFactory(new wxXmlSubclassFactoryCXX); - return TRUE; + return true; } void OnExit() { diff --git a/contrib/src/xrc/xmlrsall.cpp b/contrib/src/xrc/xmlrsall.cpp index 0b180c5cbf..5c26749d93 100644 --- a/contrib/src/xrc/xmlrsall.cpp +++ b/contrib/src/xrc/xmlrsall.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + // -- Already done in xmlres.cpp //#ifdef __GNUG__ //#pragma implementation "xmlres.h" @@ -56,16 +56,16 @@ void wxXmlResource::InitAllHandlers() #endif #if wxUSE_CHECKBOX AddHandler(new wxCheckBoxXmlHandler); -#endif +#endif #if wxUSE_HTML AddHandler(new wxHtmlWindowXmlHandler); -#endif +#endif #if wxUSE_SPINBTN AddHandler(new wxSpinButtonXmlHandler); -#endif +#endif #if wxUSE_SPINCTRL AddHandler(new wxSpinCtrlXmlHandler); -#endif +#endif #if wxUSE_SCROLLBAR AddHandler(new wxScrollBarXmlHandler); #endif diff --git a/contrib/utils/convertrc/convert.cpp b/contrib/utils/convertrc/convert.cpp index 93d3626de0..5136d4490c 100644 --- a/contrib/utils/convertrc/convert.cpp +++ b/contrib/utils/convertrc/convert.cpp @@ -58,17 +58,17 @@ bool wxConvertApp::OnInit() SetAppName(_T("wxConvertApp")); if (HandleCommandLine()) - return TRUE; + return true; // Create the main frame window - m_pFrame = new wxMainFrame(NULL, -1, _T("wxConvertApp"), wxPoint(0, 0), wxSize(500, 400), + m_pFrame = new wxMainFrame(NULL, wxID_ANY, _T("wxConvertApp"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); InitMenu(); - m_pFrame->Show(TRUE); + m_pFrame->Show(true); SetTopWindow(m_pFrame); - return TRUE; + return true; } void wxConvertApp::InitMenu() @@ -122,7 +122,7 @@ wxMainFrame::~wxMainFrame() void wxMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } @@ -192,7 +192,7 @@ bool wxConvertApp::HandleCommandLine() { if (argc != 2) - return FALSE; + return false; //Figure out kind of conversion wxString source,target; @@ -208,18 +208,18 @@ bool wxConvertApp::HandleCommandLine() if ((source.Find(_T(".wxr"))>0)&&(target.Find(_T(".xml"))>0)) { trans_wxr2xml.Convert(source,target); - return TRUE; + return true; } - else if ((source.Find(_T(".rc"))!=-1)&(target.Find(_T(".wxr"))!=-1)) + else if ((source.Find(_T(".rc"))!=wxNOT_FOUND)&(target.Find(_T(".wxr"))!=wxNOT_FOUND)) { trans_rc2wxr.Convert(source,target); - return TRUE; + return true; } - else if ((source.Find(_T(".rc"))!=-1)&(target.Find(_T(".xml"))!=-1)) + else if ((source.Find(_T(".rc"))!=wxNOT_FOUND)&(target.Find(_T(".xml"))!=wxNOT_FOUND)) { trans_rc2xml.Convert(source,target); - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/contrib/utils/convertrc/convert.h b/contrib/utils/convertrc/convert.h index 7c1738fd01..b7ae887ec3 100644 --- a/contrib/utils/convertrc/convert.h +++ b/contrib/utils/convertrc/convert.h @@ -21,17 +21,17 @@ public: void OnWXR2XML(wxCommandEvent& event); void OnRc2Wxr(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); - wxMainFrame(wxWindow* parent, wxWindowID id, + wxMainFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")); virtual ~wxMainFrame(); - + protected: DECLARE_EVENT_TABLE() }; -class wxConvertApp : public wxApp +class wxConvertApp : public wxApp { public: bool HandleCommandLine(); diff --git a/contrib/utils/convertrc/rc2wxr.cpp b/contrib/utils/convertrc/rc2wxr.cpp index 9eb0b430ff..d31c59a49e 100644 --- a/contrib/utils/convertrc/rc2wxr.cpp +++ b/contrib/utils/convertrc/rc2wxr.cpp @@ -77,7 +77,7 @@ rc2wxr::rc2wxr() { -m_done=FALSE; +m_done=false; m_controlid=6000; @@ -511,7 +511,7 @@ bool rc2wxr::Seperator(int ch) if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|')) - return TRUE; + return true; @@ -519,13 +519,13 @@ if (ch==EOF) { -m_done=TRUE; +m_done=true; -return TRUE; +return true; } -return FALSE; +return false; } @@ -595,7 +595,7 @@ if (m_rc.Eof()) { -m_done=TRUE; +m_done=true; return tok; @@ -611,7 +611,7 @@ if (ch==EOF) { -m_done=TRUE; +m_done=true; return tok; @@ -637,7 +637,7 @@ if (ch==EOF) { -m_done=TRUE; +m_done=true; @@ -663,7 +663,7 @@ ReadChar(ch); if (ch==EOF) - m_done=TRUE; + m_done=true; @@ -719,7 +719,7 @@ void rc2wxr::ReadChar(int &ch) { - int result; + int result; result=m_rc.Tell(); @@ -727,7 +727,7 @@ result=m_rc.Tell(); if((result>=m_filesize)) - m_done=TRUE; + m_done=true; @@ -737,13 +737,13 @@ result=m_rc.Read(&ch,1); if((result==-1)) - m_done=TRUE; + m_done=true; if(ch==EOF) - m_done=TRUE; + m_done=true; } @@ -817,13 +817,13 @@ while ((tok!=_T("END"))&(tok!=_T("}"))) if (tok==_T("POPUP")) - { + { ParsePopupMenu(); - wxFprintf(m_wxr,_T(" ],\\\n")); + wxFprintf(m_wxr,_T(" ],\\\n")); - } + } } @@ -1043,7 +1043,7 @@ if (tok.IsNumber()) w=GetToken(); -return TRUE; +return true; } diff --git a/contrib/utils/convertrc/rc2wxr.h b/contrib/utils/convertrc/rc2wxr.h index 4f55da2272..3250092d7e 100644 --- a/contrib/utils/convertrc/rc2wxr.h +++ b/contrib/utils/convertrc/rc2wxr.h @@ -8,7 +8,7 @@ #include "wx/file.h" #include "stdio.h" -class rc2wxr : public wxObject +class rc2wxr : public wxObject { public: rc2wxr(); diff --git a/contrib/utils/convertrc/rc2xml.cpp b/contrib/utils/convertrc/rc2xml.cpp index fdc82ee0f3..ca5adde3c4 100644 --- a/contrib/utils/convertrc/rc2xml.cpp +++ b/contrib/utils/convertrc/rc2xml.cpp @@ -49,7 +49,7 @@ cross platform (wxGTK,etc) rc2xml::rc2xml() { - m_done=FALSE; + m_done=false; m_bitmaplist=new wxList(wxKEY_STRING); m_stringtable=new wxList(wxKEY_STRING); m_iconlist = new wxList(wxKEY_STRING); @@ -83,7 +83,7 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile) result=m_xmlfile.Open(xmlfile.c_str(),_T("w+t")); wxASSERT_MSG(result,_T("Couldn't create XML file")); if (!result) - return FALSE; + return false; /* Write Basic header for XML file */ @@ -94,7 +94,7 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile) ParseResourceHeader(); //Gather all the resource we need for toolbars,menus, and etc FirstPass(); - m_done=FALSE; + m_done=false; m_rc.Seek(0); //Read in dialogs, toolbars,menus SecondPass(); @@ -105,7 +105,7 @@ bool rc2xml::Convert(wxString rcfile, wxString xmlfile) wxMessageBox(_("Conversion complete."), _("Done"), wxOK | wxICON_INFORMATION); -return TRUE; +return true; } @@ -308,9 +308,9 @@ void rc2xml::ParseRadioButton(wxString phrase, wxString varname) bool GotOrs; GotOrs = ReadOrs(token); if (ReadRect(x,y,width,height)) - if (GotOrs==FALSE) + if (GotOrs==false) ReadOrs(token); - if (token.Find(_T("WS_GROUP")) != -1) + if (token.Find(_T("WS_GROUP")) != wxNOT_FOUND) style += _T("wxRB_GROUP"); m_xmlfile.Write(_T("\t\t=m_filesize)) - m_done=TRUE; + m_done=true; result=m_rc.Read(&ch,1); if((result==-1)) - m_done=TRUE; + m_done=true; if(ch==EOF) - m_done=TRUE; + m_done=true; } void rc2xml::ParseComboBox(wxString varname) @@ -521,16 +521,16 @@ void rc2xml::ParseComboBox(wxString varname) bool GotOrs; GotOrs = ReadOrs(token); if (ReadRect(x,y,width,height)) - if (GotOrs==FALSE) + if (GotOrs==false) ReadOrs(token); m_xmlfile.Write(_T("\t\t\n")); @@ -631,7 +631,7 @@ void rc2xml::ParseSlider(wxString WXUNUSED(label), wxString varname) { wxString token,style; ReadOrs(token); - if (token.Find(_T("TBS_VERT"))!=-1) + if (token.Find(_T("TBS_VERT"))!=wxNOT_FOUND) style+=_T("wxSL_VERTICAL"); //MFC RC Default is horizontal else @@ -670,7 +670,7 @@ bool rc2xml::ReadOrs(wxString & orstring) token=PeekToken(); if (token.IsNumber()) - return FALSE; + return false; orstring=GetToken(); while(PeekToken()==_T("|")) @@ -680,7 +680,7 @@ bool rc2xml::ReadOrs(wxString & orstring) //Grab next token orstring+=GetToken(); } - return TRUE; + return true; } //Is it a checkbutton or a radiobutton or a pushbutton or a groupbox @@ -692,15 +692,15 @@ void rc2xml::ParseCtrlButton(wxString label, wxString varname) ReadOrs(token); m_rc.Seek(p); - if (token.Find(_T("BS_AUTOCHECKBOX"))!=-1) + if (token.Find(_T("BS_AUTOCHECKBOX"))!=wxNOT_FOUND) ParseCheckBox(label, varname); - else if ((token.Find(_T("BS_AUTORADIOBUTTON"))!=-1)|| - (token.Find(_T("BS_RADIOBUTTON"))!=-1)) + else if ((token.Find(_T("BS_AUTORADIOBUTTON"))!=wxNOT_FOUND)|| + (token.Find(_T("BS_RADIOBUTTON"))!=wxNOT_FOUND)) ParseRadioButton(label, varname); - else if (token.Find(_T("BS_GROUPBOX"))!=-1) + else if (token.Find(_T("BS_GROUPBOX"))!=wxNOT_FOUND) ParseGroupBox(label, varname); - else // if ((token.Find("BS_PUSHBUTTON")!=-1)|| -// (token.Find("BS_DEFPUSHBUTTON")!=-1)) + else // if ((token.Find("BS_PUSHBUTTON")!=wxNOT_FOUND)|| +// (token.Find("BS_DEFPUSHBUTTON")!=wxNOT_FOUND)) ParsePushButton(label, varname); // make default case } @@ -846,7 +846,7 @@ void rc2xml::ParseSpinCtrl(wxString WXUNUSED(label), wxString varname) wxString token,style; ReadOrs(token); - if (token.Find(_T("UDS_HORZ"))!=-1) + if (token.Find(_T("UDS_HORZ"))!=wxNOT_FOUND) style=_T("wxSP_HORIZONTAL"); //MFC default else @@ -928,7 +928,7 @@ void rc2xml::ParseToolBar(wxString varname) wxLogError(_T("Unable to load bitmap:")+*bitmappath); //Write toolbar to xml file - m_xmlfile.Write(_T(" ")+tip+_T("\n")); - m_xmlfile.Write(_T(" ")+longhelp+_T("\n")); + m_xmlfile.Write(_T("\t\t")+longhelp+_T("\n")); } //Make a bitmap file name buttonname=CleanName(buttonname); @@ -1016,19 +1016,19 @@ bool rc2xml::LookUpString(wxString strid,wxString & st) wxNode *node=m_stringtable->Find(strid); wxString *s; if (node==NULL) - return FALSE; + return false; s=(wxString *)node->GetData(); st=*s; - return TRUE; + return true; } bool rc2xml::SplitHelp(wxString msg, wxString &shorthelp, wxString &longhelp) { int spot; spot=msg.Find(_T("\\n")); - if (spot==-1) + if (spot==wxNOT_FOUND) { shorthelp=msg; longhelp=msg; @@ -1037,7 +1037,7 @@ bool rc2xml::SplitHelp(wxString msg, wxString &shorthelp, wxString &longhelp) longhelp=msg.Left(spot); spot=msg.Length()-spot-2; shorthelp=msg.Right(spot); - return TRUE; + return true; } void rc2xml::ParseMenuItem() @@ -1191,7 +1191,7 @@ kindctrl.MakeUpper(); int p=m_rc.Tell(); ReadOrs(token); m_rc.Seek(p); - if (token.Find(_T("SS_BITMAP"))!=-1) + if (token.Find(_T("SS_BITMAP"))!=wxNOT_FOUND) ParseStaticBitmap(label,varname); else ParseStaticText(label,varname); @@ -1238,7 +1238,7 @@ void rc2xml::ParseScrollBar() ReadOrs(token); -if (token.Find(_T("SBS_VERT"))!=-1) +if (token.Find(_T("SBS_VERT"))!=wxNOT_FOUND) style=_T("wxSB_VERTICAL"); //Default MFC style is horizontal else @@ -1377,7 +1377,7 @@ wxTextFile r; //Read through entire file for ( str = r.GetFirstLine(); !r.Eof(); str = r.GetNextLine() ) { - if (str.Find(_T("#define"))!=-1) + if (str.Find(_T("#define"))!=wxNOT_FOUND) { tok.SetString(str); //Just ignore #define token diff --git a/contrib/utils/convertrc/rc2xml.h b/contrib/utils/convertrc/rc2xml.h index 0b53937bff..0481665f4b 100644 --- a/contrib/utils/convertrc/rc2xml.h +++ b/contrib/utils/convertrc/rc2xml.h @@ -10,7 +10,7 @@ #include -class rc2xml : public wxObject +class rc2xml : public wxObject { public: wxString m_workingpath; @@ -22,8 +22,8 @@ public: ~rc2xml(); protected: - wxString LookUpId(wxString id); - + wxString LookUpId(wxString id); + void ParseResourceHeader(); void WriteBitmap(wxString bitmapname); void ParseListCtrl(wxString label,wxString varname); @@ -37,7 +37,7 @@ protected: wxList * m_iconlist; void ParseIconStatic(); void ParseMenuItem(); - + //Functions bool SplitHelp(wxString msg, wxString &shorthelp, wxString &longhelp); bool LookUpString(wxString strid,wxString & st); diff --git a/contrib/utils/convertrc/wxr2xml.cpp b/contrib/utils/convertrc/wxr2xml.cpp index c15d162a22..1141d30248 100644 --- a/contrib/utils/convertrc/wxr2xml.cpp +++ b/contrib/utils/convertrc/wxr2xml.cpp @@ -48,12 +48,12 @@ bool wxr2xml::Convert(wxString wxrfile, wxString xmlfile) result = m_xmlfile.Open(xmlfile.c_str(), _T("w+t")); wxASSERT_MSG(result, _T("Couldn't create XML file")); if (!result) - return FALSE; + return false; result = m_table.ParseResourceFile(wxrfile); wxASSERT_MSG(result, _T("Couldn't Load WXR file")); if (!result) - return FALSE; + return false; // Write basic xml header m_xmlfile.Write(_T("\n")); m_xmlfile.Write(_T("\n")); @@ -71,7 +71,7 @@ bool wxr2xml::ParseResources() wxHashTable::Node *node; node = m_table.Next(); - while (node) + while (node) { wxItemResource *res = (wxItemResource *) node->GetData(); wxString resType(res->GetType()); @@ -89,7 +89,7 @@ bool wxr2xml::ParseResources() wxLogError(_T("Found unsupported resource ") + resType); node = m_table.Next(); } - return TRUE; + return true; } void wxr2xml::ParsePanel(wxItemResource * res) @@ -117,7 +117,7 @@ void wxr2xml::ParseDialog(wxItemResource * res) void wxr2xml::ParseControls(wxItemResource * res) { wxNode *node = res->GetChildren().GetFirst(); - while (node) + while (node) { wxItemResource *res = (wxItemResource *) node->GetData(); wxString resType(res->GetType()); @@ -405,7 +405,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) if (style & wxNO_FULL_REPAINT_ON_RESIZE) s += _T("wxNO_FULL_REPAINT_ON_RESIZE|"); - if (restype == _T("wxDialog")) + if (restype == _T("wxDialog")) { if (style & wxDIALOG_MODAL) s += _T("wxDIALOG_MODAL|"); @@ -435,7 +435,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxCLIP_CHILDREN|"); } - if (restype == _T("wxPanel")) + if (restype == _T("wxPanel")) { if (style & wxCLIP_CHILDREN) s += _T("wxCLIP_CHILDREN|"); @@ -447,7 +447,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxWS_EX_VALIDATE_RECURSIVELY|"); } - if (restype == _T("wxComboBox")) + if (restype == _T("wxComboBox")) { if (style & wxCB_SORT) s += _T("wxCB_SORT|"); @@ -459,7 +459,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxCB_DROPDOWN|"); } - if (restype == _T("wxGauge")) + if (restype == _T("wxGauge")) { if (style & wxGA_HORIZONTAL) s += _T("wxGA_HORIZONTAL|"); @@ -472,19 +472,19 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxGA_SMOOTH|"); } - if (restype == _T("wxRadioButton")) + if (restype == _T("wxRadioButton")) { if (style & wxRB_GROUP) s += _T("wxRB_GROUP|"); } - if (restype == _T("wxStaticText")) + if (restype == _T("wxStaticText")) { if (style & wxST_NO_AUTORESIZE) s += _T("wxST_NO_AUTORESIZEL|"); } - if (restype == _T("wxRadioBox")) + if (restype == _T("wxRadioBox")) { if (style & wxRA_HORIZONTAL) s += _T("wxRA_HORIZONTAL|"); @@ -496,7 +496,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxRA_VERTICAL|"); } - if (restype == _T("wxListBox")) + if (restype == _T("wxListBox")) { if (style & wxLB_SINGLE) s += _T("wxLB_SINGLE|"); @@ -514,7 +514,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) s += _T("wxLB_SORT|"); } - if (restype == _T("wxTextCtrl")) + if (restype == _T("wxTextCtrl")) { if (style & wxTE_PROCESS_ENTER) s += _T("wxTE_PROCESS_ENTER|"); @@ -535,7 +535,7 @@ wxString wxr2xml::GetStyles(wxItemResource * res) { if (style & wxSB_HORIZONTAL) s += _T("wxSB_HORIZONTAL|"); - if (style & wxSB_VERTICAL) + if (style & wxSB_VERTICAL) s += _T("wxSB_VERTICAL|"); } @@ -598,7 +598,7 @@ void wxr2xml::ParseMenu(wxItemResource * res) { wxItemResource *child; wxNode *node = res->GetChildren().GetFirst(); - // Get Menu + // Get Menu m_xmlfile.Write(_T("\t\t\tGetValue1() << _T("\""); @@ -632,10 +632,10 @@ void wxr2xml::ParseMenuItem(wxItemResource * res) menuname << _T("name = \"menuitem_") << res->GetValue1() << _T("\""); m_xmlfile.Write(menuname); m_xmlfile.Write(_T(">\n")); - m_xmlfile.Write(_T("