]> git.saurik.com Git - wxWidgets.git/commitdiff
wxID_ANY, wxDefaultSize, wxDefaultPosition, wxNOT_FOUND, true, false, tabs replacements.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 11 Jun 2004 13:14:23 +0000 (13:14 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 11 Jun 2004 13:14:23 +0000 (13:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

135 files changed:
contrib/include/wx/xrc/xh_gauge.h
contrib/include/wx/xrc/xh_menu.h
contrib/include/wx/xrc/xh_scrol.h
contrib/include/wx/xrc/xh_sizer.h
contrib/include/wx/xrc/xh_slidr.h
contrib/include/wx/xrc/xh_spin.h
contrib/include/wx/xrc/xmlres.h
contrib/samples/xrc/custclas.cpp
contrib/samples/xrc/custclas.h
contrib/samples/xrc/derivdlg.cpp
contrib/samples/xrc/derivdlg.h
contrib/samples/xrc/myframe.cpp
contrib/samples/xrc/myframe.h
contrib/samples/xrc/xrcdemo.cpp
contrib/samples/xrc/xrcdemo.h
contrib/src/xrc/xh_bmp.cpp
contrib/src/xrc/xh_bmpbt.cpp
contrib/src/xrc/xh_bttn.cpp
contrib/src/xrc/xh_cald.cpp
contrib/src/xrc/xh_chckb.cpp
contrib/src/xrc/xh_chckl.cpp
contrib/src/xrc/xh_choic.cpp
contrib/src/xrc/xh_combo.cpp
contrib/src/xrc/xh_dlg.cpp
contrib/src/xrc/xh_frame.cpp
contrib/src/xrc/xh_gauge.cpp
contrib/src/xrc/xh_gdctl.cpp
contrib/src/xrc/xh_html.cpp
contrib/src/xrc/xh_listb.cpp
contrib/src/xrc/xh_listc.cpp
contrib/src/xrc/xh_menu.cpp
contrib/src/xrc/xh_notbk.cpp
contrib/src/xrc/xh_panel.cpp
contrib/src/xrc/xh_radbt.cpp
contrib/src/xrc/xh_radbx.cpp
contrib/src/xrc/xh_scrol.cpp
contrib/src/xrc/xh_scwin.cpp
contrib/src/xrc/xh_sizer.cpp
contrib/src/xrc/xh_slidr.cpp
contrib/src/xrc/xh_spin.cpp
contrib/src/xrc/xh_split.cpp
contrib/src/xrc/xh_stbmp.cpp
contrib/src/xrc/xh_stbox.cpp
contrib/src/xrc/xh_stlin.cpp
contrib/src/xrc/xh_sttxt.cpp
contrib/src/xrc/xh_text.cpp
contrib/src/xrc/xh_toolb.cpp
contrib/src/xrc/xh_tree.cpp
contrib/src/xrc/xh_unkwn.cpp
contrib/src/xrc/xh_wizrd.cpp
contrib/src/xrc/xmlres.cpp
contrib/src/xrc/xmlrsall.cpp
contrib/utils/convertrc/convert.cpp
contrib/utils/convertrc/convert.h
contrib/utils/convertrc/rc2wxr.cpp
contrib/utils/convertrc/rc2wxr.h
contrib/utils/convertrc/rc2xml.cpp
contrib/utils/convertrc/rc2xml.h
contrib/utils/convertrc/wxr2xml.cpp
contrib/utils/wxrc/wxrc.cpp
contrib/utils/wxrcedit/edapp.cpp
contrib/utils/wxrcedit/editor.cpp
contrib/utils/wxrcedit/editor.h
contrib/utils/wxrcedit/nodehnd.cpp
contrib/utils/wxrcedit/nodehnd.h
contrib/utils/wxrcedit/nodesdb.cpp
contrib/utils/wxrcedit/nodesdb.h
contrib/utils/wxrcedit/pe_adv.cpp
contrib/utils/wxrcedit/pe_adv.h
contrib/utils/wxrcedit/pe_basic.cpp
contrib/utils/wxrcedit/pe_basic.h
contrib/utils/wxrcedit/preview.cpp
contrib/utils/wxrcedit/preview.h
contrib/utils/wxrcedit/propedit.cpp
contrib/utils/wxrcedit/propedit.h
contrib/utils/wxrcedit/propframe.cpp
contrib/utils/wxrcedit/propframe.h
contrib/utils/wxrcedit/splittree.cpp
contrib/utils/wxrcedit/splittree.h
contrib/utils/wxrcedit/treedt.h
contrib/utils/wxrcedit/xmlhelpr.cpp
contrib/utils/wxrcedit/xmlhelpr.h
include/wx/xrc/xh_gauge.h
include/wx/xrc/xh_menu.h
include/wx/xrc/xh_scrol.h
include/wx/xrc/xh_sizer.h
include/wx/xrc/xh_slidr.h
include/wx/xrc/xh_spin.h
include/wx/xrc/xmlres.h
samples/xrc/custclas.cpp
samples/xrc/custclas.h
samples/xrc/derivdlg.cpp
samples/xrc/derivdlg.h
samples/xrc/myframe.cpp
samples/xrc/myframe.h
samples/xrc/xrcdemo.cpp
samples/xrc/xrcdemo.h
src/xrc/xh_bmp.cpp
src/xrc/xh_bmpbt.cpp
src/xrc/xh_bttn.cpp
src/xrc/xh_cald.cpp
src/xrc/xh_chckb.cpp
src/xrc/xh_chckl.cpp
src/xrc/xh_choic.cpp
src/xrc/xh_combo.cpp
src/xrc/xh_dlg.cpp
src/xrc/xh_frame.cpp
src/xrc/xh_gauge.cpp
src/xrc/xh_gdctl.cpp
src/xrc/xh_html.cpp
src/xrc/xh_listb.cpp
src/xrc/xh_listc.cpp
src/xrc/xh_menu.cpp
src/xrc/xh_notbk.cpp
src/xrc/xh_panel.cpp
src/xrc/xh_radbt.cpp
src/xrc/xh_radbx.cpp
src/xrc/xh_scrol.cpp
src/xrc/xh_scwin.cpp
src/xrc/xh_sizer.cpp
src/xrc/xh_slidr.cpp
src/xrc/xh_spin.cpp
src/xrc/xh_split.cpp
src/xrc/xh_stbmp.cpp
src/xrc/xh_stbox.cpp
src/xrc/xh_stlin.cpp
src/xrc/xh_sttxt.cpp
src/xrc/xh_text.cpp
src/xrc/xh_toolb.cpp
src/xrc/xh_tree.cpp
src/xrc/xh_unkwn.cpp
src/xrc/xh_wizrd.cpp
src/xrc/xmlres.cpp
src/xrc/xmlrsall.cpp
utils/wxrc/wxrc.cpp

index b9c0f669c4ed51d783da55c84bdf80489e057061..3f7a18133617cce0550c499e329dedef38d5dc1f 100644 (file)
@@ -24,7 +24,7 @@
 
 class WXDLLIMPEXP_XRC wxGaugeXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler)
     enum
     {
         wxGAUGE_DEFAULT_RANGE = 100
index 52274fb81bfe87cf5f059fe198158c7a0d637210..c263338705a76eb563a1d11c58adf3460101876f 100644 (file)
@@ -31,7 +31,7 @@ private:
 
 class WXDLLIMPEXP_XRC wxMenuBarXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler)
     public:
         wxMenuBarXmlHandler();
         virtual wxObject *DoCreateResource();
index ef1d3861d8e2ef384b9b898c535d7ccad1eeb2fb..77988eefce86960f6473230b0226c1ed53bcd35e 100644 (file)
@@ -22,7 +22,7 @@
 
 class WXDLLIMPEXP_XRC wxScrollBarXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler)
     enum
     {
         wxSL_DEFAULT_VALUE = 0,
index 7159605584fb71446bdb59f74036854b94bab95c..2e0ad9606abe8c55e1e4167713dd902d96a06772 100644 (file)
@@ -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);
 };
 
 
index 8e425b42949112a87cdb0d89440b423c3bc87070..2eeb587eaf5bf7f654ae56aa8b2f846a76f05021 100644 (file)
@@ -22,7 +22,7 @@
 
 class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler)
     enum
     {
         wxSL_DEFAULT_VALUE = 0,
index ab9590a68b507c69a5c53cd61c4a9d405dc1b9f0..e49b607dd133b98c69bf56b1cf38cb361cf4d5b0 100644 (file)
@@ -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,
index dd62160169d36dd7a309818381ff614254ec5469..76dbd1e972034f76fbdfc47a227182f9ffe0f715 100644 (file)
@@ -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);
index 6735dc3bcece6215f9fddb7bc4eb124b4324c4e0..158234222749b408a45b134c1b9a96c2444bc7d5 100644 (file)
 // 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") );
 }
index 69b01d438773e6c56af34825e8b664220a70f16e..9973ed0161aaac7310f40af33e5db6d065ac9ca0 100644 (file)
@@ -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()
-    
+
 };
 
 //----------------------------------------------------------------------------------------
index ed6c1cd613669f04f5686c6301f2ca929a0800b2..64cda9224f638a85fea630876667fef66be97706 100644 (file)
@@ -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.
 }
index 1e82f6f5b005a0f05d7ffbaf337ae7658a81fe1f..edcf91f5252cffd7f7bf60e0cc111523918f6f6f 100644 (file)
 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 );
 
index a740c29bda892a61f8e54af2ff6ffa81eeb3fed6..cfab7d39f97c3a5f2950f5044da7f10d411ec8b0 100644 (file)
 // 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);
index a773adc30d7751a13114eea2a7197b5babec9525..eb5b2540e0137c6c41eb59bb22811de362ac3a30 100644 (file)
@@ -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);
index 824477921d97e8cb7fdd780103be4e4610900df9..64b0309f60be9f2c2cee52de4f16a83037f86344 100644 (file)
@@ -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;
 }
 
index d41a649ddcf078f847cc40528b57d162451cd03a..134c477a9a531031a96817998d47d8fd3789a11f 100644 (file)
@@ -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();
-    
+
 };
 
 //-----------------------------------------------------------------------------
index c7a1ed9b5a7d276e37b039068de543a36028bf7b..085310436078d9cc0046efbaed2add8d7be9c60b 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_bmp.h"
 #endif
 
 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("")));
 }
 
index 984234d2105fec7f2503954ed19b7373972e0be2..321b36c0b5667af63501b6a448e8cacd1a84d28c 100644 (file)
@@ -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;
 }
 
index 5ed5ee88db3dfd3f2cb4f39582fd2e97e0ac1778..0733bd6f6f25d23d4a313d6af9bdaf5fcd5333d2 100644 (file)
@@ -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;
 }
 
index 29ab1b9b94e0d0dbd02cfe9e0523d38a57f5cb1f..bc7df4efbc0910d3ef602d9fb8e415d76383a03f 100644 (file)
@@ -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;
 }
 
index c7a0e824b64828e34a7f622863d74979d89f8ffb..242a33645be34a04f9b261231d2c5a11a27e3911 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_chckb.h"
 #endif
 
 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;
 }
 
index 522612a2644ac9871155c53a935c279e2ae31084..0dde7f6759578afa0ab82057d43adc0f210bab5a 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_chckl.h"
 #endif
 
 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;
     }
index 15f7c6a77cecc5161bf373bb60105bbd2cd826cf..9b3c33d34e2da62cd58e7c930342d375ed36dcb8 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_choic.h"
 #endif
 
 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 <item>Label</item>
-        
+
         // add to the list
         wxString str = GetNodeContent(m_node);
         if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
index 03fa009eb4923ca3c4bb45b09eb6bf281f4e6cb5..ffde9361980cd7b5ac52983d87d5fc39771cd163 100644 (file)
@@ -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;
     }
index 0fefbf70e6439886926de709856c8ce66d77e34d..7a93c46dc947ba7bab635b0729f93097ee6b9c16 100644 (file)
@@ -70,7 +70,7 @@ wxObject *wxDialogXmlHandler::DoCreateResource()
 
     CreateChildren(dlg);
 
-    if (GetBool(wxT("centered"), FALSE))
+    if (GetBool(wxT("centered"), false))
         dlg->Centre();
 
     return dlg;
index 520b265ca6c878d84d1adcc0a02c53a904e2da2b..795bb43af90bc45c8beddf9f02c2988e9a5f2237 100644 (file)
@@ -75,7 +75,7 @@ wxObject *wxFrameXmlHandler::DoCreateResource()
 
     CreateChildren(frame);
 
-    if (GetBool(wxT("centered"), FALSE))
+    if (GetBool(wxT("centered"), false))
         frame->Centre();
 
     return frame;
index 852f7bbd654afa35e4650505b4116e7a6f05df9f..2f3dad0c44076d5515ba27ebc6722ece16c3c512 100644 (file)
@@ -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,
index 7106b598cfe26cb0e63f935124567035c9be2164..5a8226ebb7c640170c9bc83dabfcb4651fed3ede 100644 (file)
@@ -41,7 +41,7 @@ wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
 wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource()
 {
     XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl)
+
     ctrl->Create(m_parentAsWindow,
                  GetID(),
                  GetText(wxT("defaultfolder")),
index 8fe80d2082160ddb0bb17d10f9236e8466f8aa5e..156370d27ab92ac634fb0f32f904c0159d16996e 100644 (file)
@@ -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;
 }
 
index 68caf3c1b8df06862ec0050240728625cfe8bab8..c0a41a91eb9bb4d7ce30deac2a586f2e2f9919a5 100644 (file)
@@ -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 <item>Label</item>
-        
+
         // add to the list
         wxString str = GetNodeContent(m_node);
         if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
index f133a894f7cfede9cbd0df61b72005beb17493da..f6c9eab2c29e257815132122d8b3fe2912961c18 100644 (file)
@@ -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;
 }
 
index 5df0d5f8d5f779f47feffcd6b7097b285838fde6..dbe2a89e6132d85f186ed75a6fe44d86415d32b8 100644 (file)
@@ -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")))
index 27d6a5ee400975003bc7a61dfb324982f48ef65e..e97598a22515d8c6d91d472c6945940e2bb4fdb3 100644 (file)
@@ -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;
index b4b4c82810db9bfc0f4b6be3d6d46a866462825a..4083dce1d2c78e60e330913d6811cfad57e779fd 100644 (file)
@@ -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;
 }
 
index 85339923931c7d5c8e42ac44e8133bdba386d867..01c5ece4f0dc487dacee7585c982225e405a6bd6 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_radbt.h"
 #endif
 
 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;
 }
 
index 0bff4dda51b134eabe0cc98880e1cf87003888a0..5b950e2e93a777e9202bdd6610ea84e958c4304b 100644 (file)
@@ -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;
     }
index ac99ba1b40046321b7c8c67e821b1b11e49e5321..f1c6fcba19d446772e6b988d8f8ca164819c604c 100644 (file)
@@ -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;
 }
 
index 2ac6d4face3cda2a41cfc4f62ef9c8fc617892f7..275bafed6433295e402d898eba79fd8e77e3f7ff 100644 (file)
@@ -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;
 }
 
index 2e3f3e49083bedd973ef99f151c0d46c91edc06f..1163ab619fc190e1ce9285a3bd8290e5aa247180 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_sizer.h"
 #endif
 
 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);
 }
-   
+
 
 
 
index 10e16450ccadf28ac2a59d0f4bf152484a06c803..e71a5fd41a506ace13cdb00d705141ae3fa128b2 100644 (file)
@@ -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;
 }
 
index 5748e7443a169cdf010e66ceb9b5a9ef8d16ef76..c6ad0fcf92b06e50422ac18aa8a3a6d63ede5fa1 100644 (file)
@@ -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;
 }
 
index 2eef0d3ac4d400199458852b0883df3259370101..5deff63190cdb3c5cae923da775001c6e2d7296e 100644 (file)
@@ -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();
     }
index 04eb5096df7c3228b36d60b1d082f97e2f8fb707..2674322938d16a01ba1a9728aac5ea8db3624cf6 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_stbmp.h"
 #endif
 
 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;
 }
 
index cc357908c9b6843cf7b6d7d0df79dda60a56975b..9a88572d5be1296b0415e4bd04b70987463a9da2 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Brian Gavin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_stbox.h"
 #endif
 
 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;
 }
 
index 7cc5abc08bbae0bd7c48a8fad59b7e076289374e..9d49226eab0fc327dc1730c710f8d16bc8831f93 100644 (file)
@@ -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;
 }
 
index e94e9fdbd254f0a89f3eae2fdeb315cd2ac1e1ed..a65e2b4b4fdcba43b14f6c4637ecb89586f785b3 100644 (file)
@@ -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;
 }
 
index 3e89a272ced29e6342a07953c1058ac534f56749..19bbd601c8501150a3fa8db74d4013a5a354af95 100644 (file)
@@ -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;
 }
 
index 9bc524dc34c25f5751f34bfd583e146c5b39174b..7e44ab77a1eecf220db81f878576e1e616570785 100644 (file)
@@ -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 /*<object class="wxToolBar">*/
     {
         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"))));
 }
 
index f3ee4c65a687b7a4d03e9aeaba2c27446fdff358..a0b32fd6adaea2c0182218fc54f3465fbc169242 100644 (file)
@@ -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;
 }
 
index cad645b68b10634d0332f95642f8602ffc75c978..d8b615cf6e880f0217e61583b7c70631f79f445b 100644 (file)
@@ -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);
index e8cb35444837814b969f75022f50d04ff207a803..aff151cede7c7932bc58a99ea318bf792ab71026 100644 (file)
@@ -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")))
index 4d6b486ad6d1d7cea64d1b73f0b620cabbd330e2..e392d946e2a31debdaeb1c5b83dfa972a5e05418 100644 (file)
@@ -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()
     {
index 0b180c5cbfac1fb8f79ea99d3a1f5782db956e24..5c26749d931e8eb32ec8335d21e97c06f44ac3bd 100644 (file)
@@ -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
index 93d3626de008eaf2403efb3ddad6b7f1015bc8e0..5136d4490c8c7ede87066c529e38ad02d97bd21c 100644 (file)
@@ -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;
 }
index 7c1738fd0149c89c4fe316e1e3ccdd8c3c1b4ca8..b7ae887ec336f2504b141c19ce8ea79501be062e 100644 (file)
@@ -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();
index 9eb0b430ff8337ea88260f2a80b8b573471779df..d31c59a49e587426bcaf347b2cdfb214aa450adf 100644 (file)
@@ -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;
 
 }
 
index 4f55da22724779741b4aa2e57a92df50a33f5445..3250092d7e2f1a45a1532dcea0096be926826f44 100644 (file)
@@ -8,7 +8,7 @@
 #include "wx/file.h"
 #include "stdio.h"
 
-class rc2wxr : public wxObject  
+class rc2wxr : public wxObject
 {
 public:
 rc2wxr();
index fdc82ee0f31a5fd3e14a8d5c563d8748136f7d7d..ca5adde3c481f138cb6106d294ff7d01b5e89bd5 100644 (file)
@@ -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<object class=\"wxRadioButton\""));
@@ -347,15 +347,15 @@ bool rc2xml::Seperator(int ch)
 {
 //if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|')|(ch=='\t'))
     if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='\t'))
-        return TRUE;
+        return true;
 
     if (ch==EOF)
         {
-        m_done=TRUE;
-        return TRUE;
+        m_done=true;
+        return true;
         }
 
-    return FALSE;
+    return false;
 }
 
 void rc2xml::ParseGroupBox(wxString phrase, wxString varname)
@@ -394,7 +394,7 @@ wxString rc2xml::GetToken(bool *listseperator)
 
     if (m_rc.Eof())
     {
-    m_done=TRUE;
+    m_done=true;
     return token;
 }
 
@@ -402,7 +402,7 @@ wxString rc2xml::GetToken(bool *listseperator)
     ReadChar(ch);
     if (ch==EOF)
     {
-    m_done=TRUE;
+    m_done=true;
     return token;
     }
 
@@ -415,7 +415,7 @@ wxString rc2xml::GetToken(bool *listseperator)
 
     if (ch==EOF)
     {
-    m_done=TRUE;
+    m_done=true;
     }
 
 
@@ -426,7 +426,7 @@ wxString rc2xml::GetToken(bool *listseperator)
     }
 
     if (ch == EOF)
-        m_done = TRUE;
+        m_done = true;
 
     if (listseperator)
       *listseperator = (ch == ',');
@@ -458,14 +458,14 @@ wxString rc2xml::GetStringQuote()
 {
     wxString phrase;
     //ASCII code 34 "
-    bool done=FALSE;
+    bool done=false;
     int p,ch=0,lastch=0;
     ReadChar(ch);
 
     while (ch!=34)
         ReadChar(ch);
     ReadChar(ch);
-    while (done==FALSE)
+    while (done==false)
         {
         if ((ch==34)&&(lastch!='\\'))
             {
@@ -477,10 +477,10 @@ wxString rc2xml::GetStringQuote()
             else
     {
                 m_rc.Seek(p);
-                done = TRUE;
+                done = true;
                 }
             }
-         if (done==TRUE)
+         if (done==true)
              break;
          if (ch=='\r')
              ReadChar(ch);                    // skip
@@ -501,15 +501,15 @@ void rc2xml::ReadChar(int &ch)
     result=m_rc.Tell();
 
     if((result>=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<object class=\"wxComboBox\""));
     WriteBasicInfo(x,y,width,height,varname);
-    if (token.Find(_T("CBS_SIMPLE")) != -1)
+    if (token.Find(_T("CBS_SIMPLE")) != wxNOT_FOUND)
         WriteStyle(_T("wxCB_SIMPLE"));
-    if (token.Find(_T("CBS_SORT")) != -1)
+    if (token.Find(_T("CBS_SORT")) != wxNOT_FOUND)
         WriteStyle(_T("wxCB_SORT"));
-    if (token.Find(_T("CBS_DISABLENOSCROLL")) != -1)
+    if (token.Find(_T("CBS_DISABLENOSCROLL")) != wxNOT_FOUND)
         WriteStyle(_T("wxLB_ALWAYS_SB"));
     m_xmlfile.Write(_T("\n\t\t</object>\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("       <object class=\"wxToolBar\""));
+    m_xmlfile.Write(_T("\t<object class=\"wxToolBar\""));
 //Avoid duplicate names this way
     varname.Replace(_T("IDR_"),_T("TB_"));
     WriteName(varname);
@@ -962,7 +962,7 @@ void rc2xml::ParseToolBar(wxString varname)
                 {
                 SplitHelp(msg,tip,longhelp);
                 m_xmlfile.Write(_T("\t\t\t\t<tooltip>")+tip+_T("</tooltip>\n"));
-                m_xmlfile.Write(_T("           <longhelp>")+longhelp+_T("</longhelp>\n"));
+                m_xmlfile.Write(_T("\t\t<longhelp>")+longhelp+_T("</longhelp>\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
index 0b53937bff5c523b510ab84f545073c04245ffa2..0481665f4bb3f3ccf5232326fdeedc838105896f 100644 (file)
@@ -10,7 +10,7 @@
 #include <wx/list.h>
 
 
-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);
index c15d162a224ebf04117964c671d71830a181fb02..1141d302486c5a918bded279da7cebc58e7aac66 100644 (file)
@@ -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("<?xml version=\"1.0\" ?>\n"));
     m_xmlfile.Write(_T("<resource>\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\t<object class=\"wxMenu\" "));
     wxString menuname;
     menuname << _T("name = \"menu_") << res->GetValue1() << _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("                       <label>")
+            m_xmlfile.Write(_T("\t\t\t<label>")
             + FixMenuString(res->GetTitle()) + _T("</label>\n"));
         if (res->GetValue4() != _T(""))
-            m_xmlfile.Write(_T("                       <help>") +
+            m_xmlfile.Write(_T("\t\t\t<help>") +
         res->GetValue4() + _T("</help>\n"));
         if (res->GetValue2())
             m_xmlfile.Write(_T("\t\t\t\t<checkable>1</checkable>\n"));
@@ -682,16 +682,16 @@ void wxr2xml::ParseBitmap(wxItemResource * res)
 void wxr2xml::PanelStuff(wxItemResource * res)
 {
     if ((res->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
-        m_dlgunits = TRUE;
+        m_dlgunits = true;
     else
-        m_dlgunits = FALSE;
+        m_dlgunits = false;
 
     // If this is true ignore fonts, background color and use system
     // defaults instead
     if ((res->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0)
-        m_systemdefaults = TRUE;
+        m_systemdefaults = true;
     else
-        m_systemdefaults = FALSE;
+        m_systemdefaults = false;
 
 }
 
@@ -720,7 +720,7 @@ wxString wxr2xml::GetValue5(wxItemResource *res)
 
 void wxr2xml::ParseBitmapButton(wxItemResource *res)
 {
-    
+
     m_xmlfile.Write(_T("\t\t\t<object class=\"wxBitmapButton\""));
     WriteControlInfo(res);
     // value4 holds bitmap name
@@ -731,7 +731,7 @@ void wxr2xml::ParseBitmapButton(wxItemResource *res)
     bitmapname += _T(".bmp");
     bitmap.SaveFile(bitmapname, wxBITMAP_TYPE_BMP);
     m_xmlfile.Write(_T("\t\t\t\t<bitmap>") + bitmapname + _T("</bitmap>\n"));
-    
+
     m_xmlfile.Write(_T("\t\t\t</object>\n"));
 }
 
@@ -755,10 +755,10 @@ void wxr2xml::WriteFontInfo(wxItemResource *res)
     GetFontFace(font);
     GetFontStyle(font);
     GetFontWeight(font);
-    
+
     if (font.GetUnderlined())
         m_xmlfile.Write(_T("\t\t\t\t<underlined>1</underlined>\n"));
-    
+
     m_xmlfile.Write(_T("\t\t\t</font>\n"));
 }
 
@@ -767,7 +767,7 @@ void wxr2xml::WriteFontInfo(wxItemResource *res)
 void wxr2xml::GetFontFace(wxFont font)
 {
     int family=font.GetFamily();
-    
+
     switch (family)
         {
         case wxDEFAULT:
index ea2c0ffe9c49ec6d12a7d15eaf125024e0d55599..6c284c6dbc7800d6b515b67a43a99b1ee927ad0c 100644 (file)
@@ -36,7 +36,7 @@
 class XRCWidgetData
 {
 public:
-    XRCWidgetData(const wxString& vname,const wxString& vclass) 
+    XRCWidgetData(const wxString& vname,const wxString& vclass)
         : m_class(vclass), m_name(vname)  {}
     const wxString& GetName() const { return m_name; }
     const wxString& GetClass() const { return m_class; }
@@ -50,16 +50,16 @@ WX_DEFINE_OBJARRAY(ArrayOfXRCWidgetData);
 
 class XRCWndClassData
 {
-private: 
+private:
     wxString m_className;
     wxString m_parentClassName;
     ArrayOfXRCWidgetData m_wdata;
-    
+
     void BrowseXmlNode(wxXmlNode* node)
     {
         wxString classValue;
         wxString nameValue;
-        wxXmlNode* children;    
+        wxXmlNode* children;
         while (node)
         {
             if (node->GetName() == _T("object")
@@ -70,19 +70,19 @@ private:
             }
             children = node->GetChildren();
             if (children)
-                    BrowseXmlNode(children);    
+                    BrowseXmlNode(children);
             node = node->GetNext();
         }
     }
-    
+
 public:
     XRCWndClassData(const wxString& className,const wxString& parentClassName, const wxXmlNode* node) :
-        m_className(className) , m_parentClassName(parentClassName) { 
-                        
+        m_className(className) , m_parentClassName(parentClassName) {
+
         BrowseXmlNode(node->GetChildren());
-                
+
     }
-                
+
     const ArrayOfXRCWidgetData& GetWidgetData(){
         return m_wdata;
     }
@@ -99,26 +99,26 @@ public:
         }
         file.Write(_T("\nprivate:\n void InitWidgetsFromXRC(){\n")
                    _T("  wxXmlResource::Get()->LoadObject(this,NULL,\"")
-                   +  m_className 
+                   +  m_className
                    +  _T("\",\"")
-                   +  m_parentClassName 
-                   +  _T("\");\n"));       
+                   +  m_parentClassName
+                   +  _T("\");\n"));
         for(i=0;i<m_wdata.Count();++i){
             const XRCWidgetData& w = m_wdata.Item(i);
-            file.Write( _T("  ") 
-                        + w.GetName() 
+            file.Write( _T("  ")
+                        + w.GetName()
                         + _T(" = XRCCTRL(*this,\"")
-                        + w.GetName() 
+                        + w.GetName()
                         + _T("\",")
                         + w.GetClass()
                         + _T(");\n")
                 );
         }
 file.Write(_T(" }\n"));
-        
+
 file.Write(
         _T("public:\n")
-        + m_className 
+        + m_className
         + _T("::")
         + m_className
         + _T("(){\n")
@@ -135,10 +135,10 @@ class XmlResApp : public wxAppConsole
 {
 public:
     // don't use builtin cmd line parsing:
-    virtual bool OnInit() { return true; } 
+    virtual bool OnInit() { return true; }
     virtual int OnRun();
-    
-private:   
+
+private:
     void ParseParams(const wxCmdLineParser& cmdline);
     void CompileRes();
     wxArrayString PrepareTempFiles();
@@ -153,7 +153,7 @@ private:
     void OutputGettext();
     wxArrayString FindStrings();
     wxArrayString FindStrings(wxXmlNode *node);
-            
+
     bool flagVerbose, flagCPP, flagPython, flagGettext;
     wxString parOutput, parFuncname, parOutputPath;
     wxArrayString parFiles;
@@ -170,7 +170,7 @@ int XmlResApp::OnRun()
 {
     static const wxCmdLineEntryDesc cmdLineDesc[] =
     {
-        { wxCMD_LINE_SWITCH, _T("h"), _T("help"),  _T("show help message"), 
+        { wxCMD_LINE_SWITCH, _T("h"), _T("help"),  _T("show help message"),
               wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
         { wxCMD_LINE_SWITCH, _T("v"), _T("verbose"), _T("be verbose") },
         { wxCMD_LINE_SWITCH, _T("e"), _T("extra-cpp-code"),  _T("output C++ header file with XRC derived classes") },
@@ -183,7 +183,7 @@ int XmlResApp::OnRun()
         { wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers",  _T("output list of neccessary handlers to this file" },
 #endif
         { wxCMD_LINE_PARAM,  NULL, NULL, _T("input file(s)"),
-              wxCMD_LINE_VAL_STRING, 
+              wxCMD_LINE_VAL_STRING,
               wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
 
         { wxCMD_LINE_NONE }
@@ -235,7 +235,7 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
     flagH = flagCPP && cmdline.Found(_T("e"));
 
 
-    if (!cmdline.Found(_T("o"), &parOutput)) 
+    if (!cmdline.Found(_T("o"), &parOutput))
     {
         if (flagGettext)
             parOutput = wxEmptyString;
@@ -258,7 +258,7 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
     }
     if (!parOutputPath) parOutputPath = _T(".");
 
-    if (!cmdline.Found(_T("n"), &parFuncname)) 
+    if (!cmdline.Found(_T("n"), &parFuncname))
         parFuncname = _T("InitXmlResource");
 
     for (size_t i = 0; i < cmdline.GetParamCount(); i++)
@@ -286,7 +286,7 @@ void XmlResApp::CompileRes()
     wxRemoveFile(parOutput);
 
     if (!retCode)
-    {        
+    {
         if (flagCPP){
             MakePackageCPP(files);
             if (flagH)
@@ -297,7 +297,7 @@ void XmlResApp::CompileRes()
         else
             MakePackageZIP(files);
     }
-        
+
     DeleteTempFiles(files);
 }
 
@@ -310,11 +310,11 @@ wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayStrin
     name2.Replace(_T("\\"), _T("_"));
     name2.Replace(_T("*"), _T("_"));
     name2.Replace(_T("?"), _T("_"));
-    
+
     wxString s = wxFileNameFromPath(parOutput) + _T("$") + name2;
 
     if (wxFileExists(s) && flist.Index(s) == wxNOT_FOUND)
-    {        
+    {
         for (int i = 0;; i++)
         {
             s.Printf(wxFileNameFromPath(parOutput) + _T("$%03i-") + name2, i);
@@ -328,21 +328,21 @@ wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayStrin
 wxArrayString XmlResApp::PrepareTempFiles()
 {
     wxArrayString flist;
-    
+
     for (size_t i = 0; i < parFiles.Count(); i++)
     {
-        if (flagVerbose) 
+        if (flagVerbose)
             wxPrintf(_T("processing ") + parFiles[i] +  _T("...\n"));
 
         wxXmlDocument doc;
-        
+
         if (!doc.Load(parFiles[i]))
         {
             wxLogError(_T("Error parsing file ") + parFiles[i]);
             retCode = 1;
             continue;
         }
-        
+
         wxString name, ext, path;
         wxSplitPath(parFiles[i], &path, &name, &ext);
 
@@ -364,11 +364,11 @@ wxArrayString XmlResApp::PrepareTempFiles()
             }
         }
         wxString internalName = GetInternalFileName(parFiles[i], flist);
-        
+
         doc.Save(parOutputPath + wxFILE_SEP_PATH + internalName);
         flist.Add(internalName);
     }
-    
+
     return flist;
 }
 
@@ -378,30 +378,30 @@ static bool NodeContainsFilename(wxXmlNode *node)
 {
    // Any bitmaps:
    if (node->GetName() == _T("bitmap"))
-       return TRUE;
+       return true;
 
    // URLs in wxHtmlWindow:
    if (node->GetName() == _T("url"))
-       return TRUE;
-   
+       return true;
+
    // wxBitmapButton:
    wxXmlNode *parent = node->GetParent();
-   if (parent != NULL && 
+   if (parent != NULL &&
        parent->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
-       (node->GetName() == _T("focus") || 
+       (node->GetName() == _T("focus") ||
         node->GetName() == _T("disabled") ||
         node->GetName() == _T("selected")))
-       return TRUE;
-   
+       return true;
+
    // wxBitmap or wxIcon toplevel resources:
    if (node->GetName() == _T("object"))
    {
        wxString klass = node->GetPropVal(_T("class"), wxEmptyString);
        if (klass == _T("wxBitmap") || klass == _T("wxIcon"))
-           return TRUE;
+           return true;
    }
-   
-   return FALSE;
+
+   return false;
 }
 
 // find all files mentioned in structure, e.g. <bitmap>filename</bitmap>
@@ -417,7 +417,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
     while (n)
     {
         if (containsFilename &&
-            (n->GetType() == wxXML_TEXT_NODE || 
+            (n->GetType() == wxXML_TEXT_NODE ||
              n->GetType() == wxXML_CDATA_SECTION_NODE))
         {
             wxString fullname;
@@ -426,7 +426,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
             else
                 fullname = inputPath + wxFILE_SEP_PATH + n->GetContent();
 
-            if (flagVerbose) 
+            if (flagVerbose)
                 wxPrintf(_T("adding     ") + fullname +  _T("...\n"));
 
             wxString filename = GetInternalFileName(n->GetContent(), flist);
@@ -461,19 +461,19 @@ void XmlResApp::DeleteTempFiles(const wxArrayString& flist)
 void XmlResApp::MakePackageZIP(const wxArrayString& flist)
 {
     wxString files;
-    
+
     for (size_t i = 0; i < flist.Count(); i++)
         files += flist[i] + _T(" ");
     files.RemoveLast();
-    
-    if (flagVerbose) 
+
+    if (flagVerbose)
         wxPrintf(_T("compressing ") + parOutput +  _T("...\n"));
-    
+
     wxString cwd = wxGetCwd();
     wxSetWorkingDirectory(parOutputPath);
-    int execres = wxExecute(_T("zip -9 -j ") + 
-                            wxString(flagVerbose ? _T("") : _T("-q ")) + 
-                            parOutput + _T(" ") + files, TRUE);
+    int execres = wxExecute(_T("zip -9 -j ") +
+                            wxString(flagVerbose ? _T("") : _T("-q ")) +
+                            parOutput + _T(" ") + files, true);
     wxSetWorkingDirectory(cwd);
     if (execres == -1)
     {
@@ -493,16 +493,16 @@ static wxString FileToCppArray(wxString filename, int num)
     wxString snum;
     wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
-    
+
     snum.Printf(_T("%i"), num);
     output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng);
     output += _T("static unsigned char xml_res_file_") + snum + _T("[] = {\n");
     // we cannot use string literals because MSVC is dumb wannabe compiler
     // with arbitrary limitation to 2048 strings :(
-    
+
     unsigned char *buffer = new unsigned char[lng];
     file.Read(buffer, lng);
-    
+
     for (size_t i = 0, linelng = 0; i < lng; i++)
     {
         tmp.Printf(_T("%i"), buffer[i]);
@@ -515,11 +515,11 @@ static wxString FileToCppArray(wxString filename, int num)
         output << tmp;
         linelng += tmp.Length()+1;
     }
-    
+
     delete[] buffer;
-    
+
     output += _T("};\n\n");
-    
+
     return output;
 }
 
@@ -529,9 +529,9 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
     wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
-    if (flagVerbose) 
+    if (flagVerbose)
         wxPrintf(_T("creating C++ source file ") + parOutput +  _T("...\n"));
-    
+
     file.Write(_T("")
 _T("//\n")
 _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
@@ -555,7 +555,7 @@ _T("\n"));
     for (i = 0; i < flist.Count(); i++)
         file.Write(
               FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
-    
+
     file.Write(_T("")
 _T("void ") + parFuncname + wxT("()\n")
 _T("{\n")
@@ -584,7 +584,7 @@ _T("\n"));
         file.Write(_T("    wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
                    GetInternalFileName(parFiles[i], flist) + _T("\"));\n"));
     }
-    
+
     file.Write(_T("}\n"));
 
 
@@ -594,7 +594,7 @@ void XmlResApp::GenCPPHeader()
 {
     wxString fileSpec = (parOutput.BeforeLast('.')).AfterLast('/');
     wxString heaFileName = fileSpec + _T(".h");
-        
+
     wxFFile file(heaFileName, wxT("wt"));
     file.Write(
 _T("//\n")
@@ -602,10 +602,10 @@ _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
 _T("//\n\n")
 _T("#ifndef __")  + fileSpec + _T("_h__\n")
 _T("#define __")  + fileSpec + _T("_h__\n")
-);      
+);
     for(size_t i=0;i<aXRCWndClassData.Count();++i){
-                aXRCWndClassData.Item(i).GenerateHeaderCode(file);              
-    } 
+                aXRCWndClassData.Item(i).GenerateHeaderCode(file);
+    }
     file.Write(
                 _T("\nvoid \n")
                 + parFuncname
@@ -619,13 +619,13 @@ static wxString FileToPythonArray(wxString filename, int num)
     wxString snum;
     wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
-    
+
     snum.Printf(_T("%i"), num);
     output = _T("    xml_res_file_") + snum + _T(" = \"\"\"\\\n");
-    
+
     unsigned char *buffer = new unsigned char[lng];
     file.Read(buffer, lng);
-    
+
     for (size_t i = 0, linelng = 0; i < lng; i++)
     {
         unsigned char c = buffer[i];
@@ -648,11 +648,11 @@ static wxString FileToPythonArray(wxString filename, int num)
         output << tmp;
         linelng += tmp.Length();
     }
-    
+
     delete[] buffer;
-    
+
     output += _T("\"\"\"\n\n");
-    
+
     return output;
 }
 
@@ -662,9 +662,9 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
     wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
-    if (flagVerbose) 
+    if (flagVerbose)
         wxPrintf(_T("creating Python source file ") + parOutput +  _T("...\n"));
-    
+
     file.Write(
        _T("#\n")
        _T("# This file was automatically generated by wxrc, do not edit by hand.\n")
@@ -673,7 +673,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
        _T("from wxPython.xrc import *\n\n")
     );
 
-    
+
     file.Write(_T("def ") + parFuncname + _T("():\n"));
 
     for (i = 0; i < flist.Count(); i++)
@@ -693,16 +693,16 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
 void XmlResApp::OutputGettext()
 {
     wxArrayString str = FindStrings();
-    
+
     wxFFile fout;
     if (parOutput.empty())
         fout.Attach(stdout);
     else
         fout.Open(parOutput, wxT("wt"));
-    
+
     for (size_t i = 0; i < str.GetCount(); i++)
         fout.Write(_T("_(\"") + str[i] + _T("\");\n"));
-    
+
     if (!parOutput) fout.Detach();
 }
 
@@ -714,10 +714,10 @@ wxArrayString XmlResApp::FindStrings()
 
     for (size_t i = 0; i < parFiles.Count(); i++)
     {
-        if (flagVerbose) 
+        if (flagVerbose)
             wxPrintf(_T("processing ") + parFiles[i] +  _T("...\n"));
 
-        wxXmlDocument doc;        
+        wxXmlDocument doc;
         if (!doc.Load(parFiles[i]))
         {
             wxLogError(_T("Error parsing file ") + parFiles[i]);
@@ -727,7 +727,7 @@ wxArrayString XmlResApp::FindStrings()
         a2 = FindStrings(doc.GetRoot());
         WX_APPEND_ARRAY(arr, a2);
     }
-    
+
     return arr;
 }
 
@@ -747,7 +747,7 @@ static wxString ConvertText(const wxString& str)
             else
                 str2 << wxT('&') << *dt;
         }
-        else 
+        else
         {
             switch (*dt)
             {
@@ -759,7 +759,7 @@ static wxString ConvertText(const wxString& str)
                                      (*(dt+1) != 'r'))
                                      str2 << wxT("\\\\");
                                  else
-                                     str2 << wxT("\\");    
+                                     str2 << wxT("\\");
                                  break;
                 case wxT('"')  : str2 << wxT("\\\""); break;
                 default        : str2 << *dt; break;
@@ -778,12 +778,12 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
     wxXmlNode *n = node;
     if (n == NULL) return arr;
     n = n->GetChildren();
-    
+
     while (n)
     {
         if ((node->GetType() == wxXML_ELEMENT_NODE) &&
             // parent is an element, i.e. has subnodes...
-            (n->GetType() == wxXML_TEXT_NODE || 
+            (n->GetType() == wxXML_TEXT_NODE ||
             n->GetType() == wxXML_CDATA_SECTION_NODE) &&
             // ...it is textnode...
             (
@@ -801,14 +801,14 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
         {
             arr.Add(ConvertText(n->GetContent()));
         }
-        
+
         // subnodes:
         if (n->GetType() == wxXML_ELEMENT_NODE)
         {
             wxArrayString a2 = FindStrings(n);
             WX_APPEND_ARRAY(arr, a2);
         }
-        
+
         n = n->GetNext();
     }
     return arr;
index e5771edf697edcb4fada4d2c69ce2a3072649f5d..dc2edda79cfc4e6f84483f424ebd1fc7553c2d13 100644 (file)
@@ -53,9 +53,9 @@ bool MyApp::OnInit()
     wxInitAllImageHandlers();
     wxFrame *frame = new EditorFrame(NULL, arg);
     SetTopWindow(frame);
-    frame->Show(TRUE);
-    PreviewFrame::Get()->Show(TRUE);
-    PropertiesFrame::Get()->Show(TRUE);
-    return TRUE;
+    frame->Show(true);
+    PreviewFrame::Get()->Show(true);
+    PropertiesFrame::Get()->Show(true);
+    return true;
 }
 
index 0f66fa1ec4f73ca3363533511d17179aa38b1210..c41c44d9a6af4d0bd3a5e9630f8f9f4d2846000d 100644 (file)
@@ -101,13 +101,13 @@ class EditorTreeCtrl : public wxTreeCtrl
     public:
         EditorTreeCtrl(wxWindow *parent, int id, EditorFrame *frame)
                  : wxTreeCtrl(parent, id), m_EdFrame(frame) {}
-                 
+
     private:
         EditorFrame *m_EdFrame;
-        
+
         void OnRightClick(wxMouseEvent &event)
         {
-            wxTreeItemId item = 
+            wxTreeItemId item =
                 m_EdFrame->m_TreeCtrl->HitTest(event.GetPosition());
             if (item.IsOk())
             {
@@ -123,7 +123,7 @@ BEGIN_EVENT_TABLE(EditorTreeCtrl, wxTreeCtrl)
 END_EVENT_TABLE()
 
 
-enum 
+enum
 {
     ID_PREVIEW = wxID_HIGHEST + 100,
     ID_NEW,
@@ -133,19 +133,19 @@ enum
     ID_SAVEAS,
     ID_DELETE_NODE,
     ID_EXIT,
-    ID_TREE,    
-    
+    ID_TREE,
+
     ID_CUT,
     ID_PASTE_SYBLING,
     ID_PASTE_CHILD,
     ID_COPY,
 
     ID_NEWDIALOG,
-       ID_NEWFRAME,
+    ID_NEWFRAME,
     ID_NEWPANEL,
     ID_NEWMENU,
     ID_NEWMENUBAR,
-    ID_NEWTOOLBAR,   
+    ID_NEWTOOLBAR,
     ID_NEWNODE = wxID_HIGHEST + 10000, // safely out of XRCID range :)
     ID_NEWSYBNODE = ID_NEWNODE + 20000
 };
@@ -183,16 +183,16 @@ END_EVENT_TABLE()
 EditorFrame *EditorFrame::ms_Instance = NULL;
 
 EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
-    : wxFrame(parent, -1, filename + _("- wxWidgets resources editor"))
+    : wxFrame(parent, wxID_ANY, filename + _("- wxWidgets resources editor"))
 {
     ms_Instance = this;
 
     m_Clipboard = NULL;
-    m_Modified = FALSE;
-    
+    m_Modified = false;
+
     wxConfigBase *cfg = wxConfigBase::Get();
-    
-    SetSize(wxRect(wxPoint(cfg->Read(_T("editor_x"), -1), cfg->Read(_T("editor_y"), -1)),
+
+    SetSize(wxRect(wxPoint(cfg->Read(_T("editor_x"), wxDefaultPosition.x), cfg->Read(_T("editor_y"), wxDefaultPosition.y)),
             wxSize(cfg->Read(_T("editor_w"), 400), cfg->Read(_T("editor_h"), 400))));
 
     m_SelectedNode = NULL;
@@ -215,34 +215,34 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
     menuEdit->AppendSeparator();
     menuEdit->Append(ID_DELETE_NODE,  _T("Delete"));
 
-    menuEdit->Enable(ID_PASTE_SYBLING, FALSE);
-    menuEdit->Enable(ID_PASTE_CHILD, FALSE);
-    
+    menuEdit->Enable(ID_PASTE_SYBLING, false);
+    menuEdit->Enable(ID_PASTE_CHILD, false);
+
     wxMenuBar *menuBar = new wxMenuBar();
     menuBar->Append(menuFile, _T("&File"));
     menuBar->Append(menuEdit, _T("&Edit"));
     SetMenuBar(menuBar);
-  
+
     // Create toolbar:
     wxToolBar *toolBar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT);
     toolBar->SetMargins(2, 2);
     toolBar->SetToolBitmapSize(wxSize(24, 24));
     toolBar -> AddTool(ID_EXIT, wxBITMAP(close), wxNullBitmap,
-                       FALSE, -1, -1, (wxObject *) NULL,
+                       false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL,
                        _("Quit the editor"));
     toolBar -> AddTool(ID_OPEN, wxBITMAP(open), wxNullBitmap,
-                       FALSE, -1, -1, (wxObject *) NULL,
-                       _("Open XML resource file"));   
+                       false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL,
+                       _("Open XML resource file"));
     toolBar -> AddTool(ID_SAVE, wxBITMAP(save), wxNullBitmap,
-                       FALSE, -1, -1, (wxObject *) NULL,
+                       false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL,
                        _("Save XML file"));
     toolBar -> AddTool(ID_PREVIEW, wxBITMAP(preview), wxNullBitmap,
-                       FALSE, -1, -1, (wxObject *) NULL,
-                       _("Preview"));   
+                       false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL,
+                       _("Preview"));
     toolBar -> Realize();
 
     wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
-    
+
     // Create tree control:
     m_TreeCtrl = new EditorTreeCtrl(this, ID_TREE, this);
     wxImageList *imgList = new wxImageList(16, 16);
@@ -255,7 +255,7 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
     m_TreeCtrl->AssignImageList(imgList);
     sizer->Add(m_TreeCtrl, 1, wxEXPAND);
 
-    SetAutoLayout(TRUE);
+    SetAutoLayout(true);
     SetSizer(sizer);
 
     // Load file:
@@ -273,7 +273,7 @@ EditorFrame::~EditorFrame()
     PropertiesFrame::Get()->Close();
 
     wxConfigBase *cfg = wxConfigBase::Get();
-    
+
     cfg->Write(_T("editor_x"), (long)GetPosition().x);
     cfg->Write(_T("editor_y"), (long)GetPosition().y);
     cfg->Write(_T("editor_w"), (long)GetSize().x);
@@ -290,14 +290,14 @@ void EditorFrame::LoadFile(const wxString& filename)
     if (!AskToSave()) return;
 
     delete m_Resource;
-    
+
      // create new resource in order to handle version differences properly
     PreviewFrame::Get()->ResetResource();
-    
+
     m_FileName = wxEmptyString;
     m_Resource = new wxXmlRcEditDocument;
-    m_Modified = FALSE;
-    
+    m_Modified = false;
+
     if (!m_Resource->Load(filename,  wxLocale::GetSystemEncodingName()))
     {
         delete m_Resource;
@@ -321,12 +321,12 @@ void EditorFrame::LoadFile(const wxString& filename)
 void EditorFrame::SaveFile(const wxString& filename)
 {
     m_FileName = filename;
-    
+
     // save it:
     if (!m_Resource->Save(filename))
         wxLogError(_("Error saving ") + filename);
     else
-        m_Modified = FALSE;
+        m_Modified = false;
 
     RefreshTitle();
 }
@@ -334,24 +334,24 @@ void EditorFrame::SaveFile(const wxString& filename)
 
 
 void EditorFrame::NewFile()
-{  
+{
     if (!AskToSave()) return;
 
     delete m_Resource;
-    
+
     m_FileName = wxEmptyString;
     m_Resource = new wxXmlRcEditDocument;
     m_Resource->SetRoot(new wxXmlNode(wxXML_ELEMENT_NODE, _("resource")));
-       
-       m_Resource->SetFileEncoding(_T("utf-8"));
+
+    m_Resource->SetFileEncoding(_T("utf-8"));
 #if !wxUSE_UNICODE
     m_Resource->SetEncoding(wxLocale::GetSystemEncodingName());
 #endif
-    
-       m_Resource->GetRoot()->AddProperty(_T("version"),
+
+    m_Resource->GetRoot()->AddProperty(_T("version"),
                                        WX_XMLRES_CURRENT_VERSION_STRING);
 
-    m_Modified = FALSE;
+    m_Modified = false;
     RefreshTree();
     RefreshTitle();
 }
@@ -373,12 +373,12 @@ void EditorFrame::RefreshTitle()
 void EditorFrame::RefreshTree()
 {
     wxXmlNode *sel = m_SelectedNode;
-    
-    m_TreeCtrl->DeleteAllItems(); 
+
+    m_TreeCtrl->DeleteAllItems();
 
     wxTreeItemId root = m_TreeCtrl->AddRoot(_T("Resource: ") + wxFileNameFromPath(m_FileName), 5, 5);
 
-    wxXmlNode *n = m_Resource->GetRoot()->GetChildren();  
+    wxXmlNode *n = m_Resource->GetRoot()->GetChildren();
     while (n)
     {
         if (n->GetType() == wxXML_ELEMENT_NODE)
@@ -417,32 +417,32 @@ bool EditorFrame::SelectNode(wxXmlNode *node, wxTreeItemId *root)
     XmlTreeData *dt;
     wxXmlNode *nd;
     void* cookie;
-    
+
     item = m_TreeCtrl->GetFirstChild(*root, cookie);
     while (item.IsOk())
     {
         dt = (XmlTreeData*)(m_TreeCtrl->GetItemData(item));
         nd = (dt) ? dt->Node : NULL;
-        if (nd == node) 
+        if (nd == node)
         {
             RecursivelyExpand(m_TreeCtrl, *root);
             m_TreeCtrl->SelectItem(item);
             m_TreeCtrl->EnsureVisible(item);
-            return TRUE; 
+            return true;
         }
-        if (m_TreeCtrl->ItemHasChildren(item) && SelectNode(node, &item)) 
-            return TRUE; 
+        if (m_TreeCtrl->ItemHasChildren(item) && SelectNode(node, &item))
+            return true;
         item = m_TreeCtrl->GetNextChild(*root, cookie);
     }
 
-    return FALSE;
+    return false;
 }
 
 
 
 wxTreeItemId EditorFrame::CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent, wxXmlNode *node)
 {
-    if (!node) 
+    if (!node)
     {
         wxTreeItemId invalid;
         return invalid;
@@ -461,7 +461,7 @@ void EditorFrame::NotifyChanged(int change_type)
     if (change_type & CHANGED_TREE_SELECTED)
     {
         wxTreeItemId sel = m_TreeCtrl->GetSelection();
-        m_TreeCtrl->SetItemText(sel, 
+        m_TreeCtrl->SetItemText(sel,
              NodeHandler::Find(m_SelectedNode)->GetTreeString(m_SelectedNode));
     }
 
@@ -471,13 +471,13 @@ void EditorFrame::NotifyChanged(int change_type)
         int icon = NodeHandler::Find(m_SelectedNode)->GetTreeIcon(m_SelectedNode);
         m_TreeCtrl->SetItemImage(sel, icon);
     }
-    
+
     if (!m_Modified)
     {
-        m_Modified = TRUE;
+        m_Modified = true;
         RefreshTitle();
     }
-    
+
     PreviewFrame::Get()->MakeDirty();
 }
 
@@ -486,8 +486,8 @@ void EditorFrame::NotifyChanged(int change_type)
 void EditorFrame::OnTreeSel(wxTreeEvent& event)
 {
     XmlTreeData *dt = (XmlTreeData*)(m_TreeCtrl->GetItemData(event.GetItem()));
-    wxXmlNode *node = (dt) ? dt->Node : NULL;      
-            
+    wxXmlNode *node = (dt) ? dt->Node : NULL;
+
     m_SelectedNode = node;
     if (node)
         PropertiesFrame::Get()->ShowProps(node);
@@ -512,7 +512,7 @@ void EditorFrame::OnTreeSel(wxTreeEvent& event)
 
 void EditorFrame::OnToolbar(wxCommandEvent& event)
 {
-    switch (event.GetId()) 
+    switch (event.GetId())
     {
         case ID_PREVIEW :
             {
@@ -523,7 +523,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
             }
 
         case ID_EXIT :
-            Close(TRUE);
+            Close(true);
             break;
 
         case ID_NEW :
@@ -581,7 +581,7 @@ void EditorFrame::OnNewNode(wxCommandEvent& event)
 {
     if (event.GetId() >= ID_NEWSYBNODE)
     {
-        XmlTreeData *pardt = 
+        XmlTreeData *pardt =
             (XmlTreeData*)(m_TreeCtrl->GetItemData(
                 m_TreeCtrl->GetItemParent(m_TreeCtrl->GetSelection())));
 
@@ -616,21 +616,21 @@ void EditorFrame::OnNewNode(wxCommandEvent& event)
         wxTreeItemId root = m_TreeCtrl->GetSelection();
         SelectNode(node, &root);
     }
-    
+
     else
     {
         wxString name;
         switch (event.GetId())
         {
             case ID_NEWDIALOG : name = _T("wxDialog"); break;
-                       case ID_NEWFRAME : name = _T("wxFrame"); break;
+            case ID_NEWFRAME : name = _T("wxFrame"); break;
             case ID_NEWPANEL : name = _T("wxPanel"); break;
             case ID_NEWMENU : name = _T("wxMenu"); break;
             case ID_NEWMENUBAR : name = _T("wxMenuBar"); break;
             case ID_NEWTOOLBAR : name = _T("wxToolBar"); break;
             default : return; // never occurs
         }
-        
+
         wxXmlNode *node = new wxXmlNode(wxXML_ELEMENT_NODE, _T("object"));
         node->AddProperty(_T("class"), name);
         m_Resource->GetRoot()->AddChild(node);
@@ -644,22 +644,22 @@ void EditorFrame::OnNewNode(wxCommandEvent& event)
 void EditorFrame::OnRightClickTree(wxPoint pos)
 {
     wxMenu *popup = new wxMenu;
-    
+
     if (m_SelectedNode == NULL || m_SelectedNode == m_Resource->GetRoot())
     {
         popup->Append(ID_NEWDIALOG, _("New wxDialog"));
-               popup->Append(ID_NEWFRAME, _("New wxFrame"));
+        popup->Append(ID_NEWFRAME, _("New wxFrame"));
         popup->Append(ID_NEWPANEL, _("New wxPanel"));
         popup->Append(ID_NEWMENU, _("New wxMenu"));
         popup->Append(ID_NEWMENUBAR, _("New wxMenuBar"));
         popup->Append(ID_NEWTOOLBAR, _("New wxToolBar"));
     }
-    
+
     else
-    {   
+    {
         bool has_children;
         {
-            wxArrayString& arr = 
+            wxArrayString& arr =
                 NodeHandler::Find(NodeHandler::Find(m_SelectedNode)->GetRealNode(m_SelectedNode))->
                     GetChildTypes();
 
@@ -672,7 +672,7 @@ void EditorFrame::OnRightClickTree(wxPoint pos)
                 {
                     news2->Append(i + ID_NEWNODE, arr[i]);
 #ifdef __WXGTK__ // doesn't support Break
-                    if (i % 20 == 19) 
+                    if (i % 20 == 19)
                     {
                         wxMenu *m = new wxMenu;
                         news2->Append(ID_NEWNODE+arr.GetCount(), _("More..."), m);
@@ -687,13 +687,13 @@ void EditorFrame::OnRightClickTree(wxPoint pos)
         }
 
 
-        XmlTreeData *pardt = 
+        XmlTreeData *pardt =
             (XmlTreeData*)(m_TreeCtrl->GetItemData(
                 m_TreeCtrl->GetItemParent(m_TreeCtrl->GetSelection())));
         if (pardt && pardt->Node && pardt->Node != m_Resource->GetRoot())
         {
             wxXmlNode *nd = pardt->Node;
-            wxArrayString& arr = 
+            wxArrayString& arr =
                 NodeHandler::Find(NodeHandler::Find(nd)->GetRealNode(nd))->
                     GetChildTypes();
 
@@ -705,7 +705,7 @@ void EditorFrame::OnRightClickTree(wxPoint pos)
                 {
                     news2->Append(i + ID_NEWSYBNODE, arr[i]);
 #ifdef __WXGTK__ // doesn't support Break
-                    if (i % 20 == 19) 
+                    if (i % 20 == 19)
                     {
                         wxMenu *m = new wxMenu;
                         news2->Append(ID_NEWSYBNODE+arr.GetCount(), _("More..."), m);
@@ -730,7 +730,7 @@ void EditorFrame::OnRightClickTree(wxPoint pos)
         popup->Enable(ID_PASTE_SYBLING, m_Clipboard != NULL);
         popup->Enable(ID_PASTE_CHILD, has_children && m_Clipboard != NULL);
     }
-    
+
     m_TreeCtrl->PopupMenu(popup, pos);
     delete popup;
 }
@@ -745,14 +745,14 @@ void EditorFrame::OnClipboardAction(wxCommandEvent& event)
         case ID_CUT:
             delete m_Clipboard;
             m_Clipboard = new wxXmlNode(*m_SelectedNode);
-            GetMenuBar()->Enable(ID_PASTE_SYBLING, TRUE);
-            GetMenuBar()->Enable(ID_PASTE_CHILD, TRUE);
+            GetMenuBar()->Enable(ID_PASTE_SYBLING, true);
+            GetMenuBar()->Enable(ID_PASTE_CHILD, true);
             if (event.GetId() == ID_CUT) DeleteSelectedNode();
             break;
-            
+
         case ID_PASTE_SYBLING:
             {
-            XmlTreeData *pardt = 
+            XmlTreeData *pardt =
                 (XmlTreeData*)(m_TreeCtrl->GetItemData(
                     m_TreeCtrl->GetItemParent(m_TreeCtrl->GetSelection())));
 
@@ -769,7 +769,7 @@ void EditorFrame::OnClipboardAction(wxCommandEvent& event)
             }
             }
             break;
-            
+
         case ID_PASTE_CHILD:
             wxXmlNode *realnode = NodeHandler::Find(m_SelectedNode)->GetRealNode(m_SelectedNode);
             NodeHandler *hnd = NodeHandler::Find(realnode);
@@ -786,12 +786,12 @@ void EditorFrame::OnClipboardAction(wxCommandEvent& event)
 
 bool EditorFrame::AskToSave()
     // asks the user to save current document (if modified)
-    // returns FALSE if user cancelled the action, TRUE of he choosed
+    // returns false if user cancelled the action, true of he choosed
     // 'yes' or 'no'
 {
-    if (!m_Modified) return TRUE;
-    
-    int res = wxMessageBox(_("File modified. Do you want to save changes?"), _("Save changes"), 
+    if (!m_Modified) return true;
+
+    int res = wxMessageBox(_("File modified. Do you want to save changes?"), _("Save changes"),
                             wxYES_NO | wxCANCEL | wxCENTRE | wxICON_QUESTION);
     if (res == wxYES)
         SaveFile(m_FileName);
index a81f2d08928d3281ae98799574927686af2cc1b2..90917acff90a1a1e4f9a68bcb000dccad55f19ba 100644 (file)
@@ -63,7 +63,7 @@ class EditorFrame : public wxFrame
 {
     public:
         friend class EditorTreeCtrl;
-    
+
         EditorFrame(wxFrame *parent, const wxString& filename);
         ~EditorFrame();
 
@@ -71,31 +71,31 @@ class EditorFrame : public wxFrame
         void NewFile();
         void SaveFile(const wxString& filename);
         wxString GetFileName() { return m_FileName; }
-        
+
         void RefreshTree();
         void RefreshTitle();
         bool SelectNode(wxXmlNode *node, wxTreeItemId *root = NULL);
-        
+
         wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent, wxXmlNode *node);
-  
+
         void NotifyChanged(int change_type);
-        
+
         static EditorFrame *Get() { return ms_Instance; }
-        
+
     private:
         static EditorFrame *ms_Instance;
-    
+
         wxTreeCtrl *m_TreeCtrl;
-        
+
         wxXmlNode *m_SelectedNode;
-        
+
         wxXmlNode *m_Clipboard;
 
         wxString m_FileName;
         wxXmlRcEditDocument *m_Resource;
-        
+
         bool m_Modified;
-        
+
         bool AskToSave();
         void DeleteSelectedNode();
 
index ff5c07cd66355ba43229f9631a56700f74bb2485..2152ad8bb099c64dcf967ec759ba3b160c6d80f5 100644 (file)
 
 
 wxList NodeHandler::ms_Handlers;
-bool NodeHandler::ms_HandlersLoaded = FALSE;
+bool NodeHandler::ms_HandlersLoaded = false;
 
 
 NodeHandler *NodeHandler::Find(wxXmlNode *node)
 {
     if (!ms_HandlersLoaded)
     {
-        ms_HandlersLoaded = TRUE;
-        ms_Handlers.DeleteContents(TRUE);
-        
+        ms_HandlersLoaded = true;
+        ms_Handlers.DeleteContents(true);
+
         NodeInfoArray& arr = NodesDb::Get()->GetNodesInfo();
         NodeHandler *hnd;
         for (size_t i = 0; i < arr.GetCount(); i++)
@@ -63,7 +63,7 @@ NodeHandler *NodeHandler::Find(wxXmlNode *node)
                 hnd = new NodeHandler(&(arr[i]));
             if (hnd) ms_Handlers.Append(hnd);
         }
-        ms_Handlers.Append(new NodeHandlerUnknown);        
+        ms_Handlers.Append(new NodeHandlerUnknown);
     }
 
     wxNode *n = ms_Handlers.GetFirst();
@@ -80,7 +80,7 @@ NodeHandler *NodeHandler::Find(wxXmlNode *node)
 
 
 
-NodeHandler::NodeHandler(NodeInfo *ni) : 
+NodeHandler::NodeHandler(NodeInfo *ni) :
         m_NodeInfo(ni)
 {
 }
@@ -107,12 +107,12 @@ PropertyInfoArray& NodeHandler::GetPropsList(wxXmlNode *WXUNUSED(node))
 
 
 
-wxTreeItemId NodeHandler::CreateTreeNode(wxTreeCtrl *treectrl, 
+wxTreeItemId NodeHandler::CreateTreeNode(wxTreeCtrl *treectrl,
                                          wxTreeItemId parent,
                                          wxXmlNode *node)
 {
     int icon = GetTreeIcon(node);
-    wxTreeItemId item = 
+    wxTreeItemId item =
         treectrl->AppendItem(parent, GetTreeString(node),
                              icon, icon, new XmlTreeData(node));
     if (parent == treectrl->GetRootItem())
@@ -140,14 +140,14 @@ wxArrayString& NodeHandler::GetChildTypes()
     {
         wxString basetype = m_NodeInfo->ChildType;
         NodeInfoArray& arr = NodesDb::Get()->GetNodesInfo();
-        
+
         for (size_t i = 0; i < arr.GetCount(); i++)
         {
             NodeInfo &ni = arr[i];
-            
-            if (ni.NodeClass == basetype && !ni.Abstract) 
+
+            if (ni.NodeClass == basetype && !ni.Abstract)
                 m_ChildTypes.Add(ni.NodeClass);
-            
+
             if (ni.DerivedFrom.Index(basetype) != wxNOT_FOUND && !ni.Abstract)
                 m_ChildTypes.Add(ni.NodeClass);
         }
@@ -172,12 +172,12 @@ void NodeHandler::InsertNode(wxXmlNode *WXUNUSED(parent), wxXmlNode *node, wxXml
 
 
 
-wxTreeItemId NodeHandlerPanel::CreateTreeNode(wxTreeCtrl *treectrl, 
+wxTreeItemId NodeHandlerPanel::CreateTreeNode(wxTreeCtrl *treectrl,
                                          wxTreeItemId parent,
                                          wxXmlNode *node)
 {
     wxTreeItemId root = NodeHandler::CreateTreeNode(treectrl, parent, node);
-    
+
     wxXmlNode *n = XmlFindNode(node, _T("object"));
 
     while (n)
@@ -207,7 +207,7 @@ void NodeHandlerPanel::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode
 
 
 void NodeHandlerSizer::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before)
-{  
+{
     if (XmlGetClass(node) == _T("spacer") || XmlGetClass(node) == _T("sizeritem"))
     {
         if (insert_before)
@@ -244,7 +244,7 @@ int NodeHandlerSizer::GetTreeIcon(wxXmlNode *node)
 
 
 
-wxTreeItemId NodeHandlerSizerItem::CreateTreeNode(wxTreeCtrl *treectrl, 
+wxTreeItemId NodeHandlerSizerItem::CreateTreeNode(wxTreeCtrl *treectrl,
                                          wxTreeItemId parent,
                                          wxXmlNode *node)
 {
@@ -265,11 +265,11 @@ PropertyInfoArray& NodeHandlerSizerItem::GetPropsList(wxXmlNode *node)
     wxXmlNode *nd = GetRealNode(node);
     m_dummy.Add(PropertyInfo(wxEmptyString, wxEmptyString, wxEmptyString));
     size_t pos = m_dummy.GetCount();
-    WX_APPEND_ARRAY(m_dummy, 
+    WX_APPEND_ARRAY(m_dummy,
                     Find(nd)->GetPropsList(nd));
     for (size_t i = pos; i < m_dummy.GetCount(); i++)
         m_dummy[i].Name = _T("object/") + m_dummy[i].Name;
-    
+
     return m_dummy;
 }
 
@@ -302,10 +302,10 @@ wxXmlNode *NodeHandlerSizerItem::GetRealNode(wxXmlNode *node)
 
 
 void NodeHandlerNotebook::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before)
-{  
+{
     {
         wxXmlNode *itemnode;
-        
+
         if (XmlGetClass(node) == _T("notebookpage"))
             itemnode = node;
         else
index bfc98bea7374da4f8cf0e6ac166a94b6146af0da..81d060ade147bf5cf9909ca2c21996aa100e9233 100644 (file)
@@ -32,10 +32,10 @@ class NodeHandler : public wxObject
 {
     public:
         static NodeHandler *Find(wxXmlNode *node);
-    
+
         NodeHandler(NodeInfo *ni);
         virtual ~NodeHandler();
-        
+
         virtual bool CanHandle(wxXmlNode *node);
         virtual wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent,
                                     wxXmlNode *node);
@@ -45,12 +45,12 @@ class NodeHandler : public wxObject
         wxArrayString& GetChildTypes();
         virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
         virtual wxXmlNode *GetRealNode(wxXmlNode *node) { return node; }
-        
+
     protected:
 
         NodeInfo *m_NodeInfo;
         wxArrayString m_ChildTypes;
-        
+
         static wxList ms_Handlers;
         static bool ms_HandlersLoaded;
 };
@@ -60,7 +60,7 @@ class NodeHandlerPanel : public NodeHandler
 {
     public:
         NodeHandlerPanel(NodeInfo *ni) : NodeHandler(ni) {}
-        
+
         virtual wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent,
                                     wxXmlNode *node);
         virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
@@ -72,7 +72,7 @@ class NodeHandlerSizer : public NodeHandlerPanel
 {
     public:
         NodeHandlerSizer(NodeInfo *ni) : NodeHandlerPanel(ni) {}
-        
+
         virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
         virtual int GetTreeIcon(wxXmlNode *node);
 };
@@ -102,7 +102,7 @@ class NodeHandlerNotebook : public NodeHandlerPanel
 {
     public:
         NodeHandlerNotebook(NodeInfo *ni) : NodeHandlerPanel(ni) {}
-        
+
         virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
 };
 
@@ -111,7 +111,7 @@ class NodeHandlerNotebook : public NodeHandlerPanel
 class NodeHandlerNotebookPage : public NodeHandlerSizerItem
 {
     public:
-        NodeHandlerNotebookPage(NodeInfo *ni) : 
+        NodeHandlerNotebookPage(NodeInfo *ni) :
                                         NodeHandlerSizerItem(ni) {}
 };
 
@@ -122,9 +122,9 @@ class NodeHandlerUnknown : public NodeHandler
 {
     public:
         NodeHandlerUnknown() : NodeHandler(new NodeInfo) {}
-        
-        virtual bool CanHandle(wxXmlNode *WXUNUSED(node)) { return TRUE; }
+
+        virtual bool CanHandle(wxXmlNode *WXUNUSED(node)) { return true; }
 };
 
 
-#endif 
+#endif
index 1fe48b08afc2f5387002224b456f28c884882e39..46f11e35c5afbd06191cbad4873b138b43f8349a 100644 (file)
@@ -34,17 +34,17 @@ void NodeInfo::Read(const wxString& filename, wxPathList& list)
 {
     wxString tp;
     wxString nd, cht;
-    bool ab = FALSE;
+    bool ab = false;
     long icn = -1;
 
     NodeClass.Empty();
 
     wxString path = list.FindValidPath(filename);
     if (path.IsEmpty()) return;
-    
+
     wxTextFile tf;
     tf.Open(path);
-    
+
     if (!tf.IsOpened()) return;
 
     for (size_t i = 0; i < tf.GetLineCount(); i++)
@@ -80,8 +80,8 @@ void NodeInfo::Read(const wxString& filename, wxPathList& list)
             tkn.GetNextToken();
             pi.Type = tkn.GetNextToken();
             if (tkn.HasMoreTokens()) pi.MoreInfo = tkn.GetNextToken();
-            
-            bool fnd = FALSE;
+
+            bool fnd = false;
             for (size_t j = 0; j < Props.GetCount(); j++)
             {
                 if (Props[j].Name == pi.Name)
@@ -90,14 +90,14 @@ void NodeInfo::Read(const wxString& filename, wxPathList& list)
                         Props[j].MoreInfo << _T(',') << pi.MoreInfo;
                     else
                         Props[j] = pi;
-                    fnd = TRUE;
+                    fnd = true;
                 }
             }
-            
+
             if (!fnd) Props.Add(pi);
         }
     }
-    
+
     if (!nd.IsEmpty()) NodeClass = nd;
     if (!cht.IsEmpty()) ChildType = cht;
     if (!!tp) Type = tp;
@@ -117,7 +117,7 @@ NodesDb* NodesDb::ms_Instance = NULL;
 
 NodesDb *NodesDb::Get()
 {
-    if (ms_Instance == NULL) 
+    if (ms_Instance == NULL)
     {
         (void)new NodesDb;
     }
@@ -131,7 +131,7 @@ NodesDb::NodesDb()
 
     m_Paths.Add(_T("."));
     m_Paths.Add(_T("./df"));
-#ifdef __UNIX__ 
+#ifdef __UNIX__
     m_Paths.Add(wxGetHomeDir() + _T("/.wxrcedit"));
     #ifdef wxINSTALL_PREFIX
     m_Paths.Add(wxINSTALL_PREFIX _T("/share/wx/wxrcedit"));
@@ -154,7 +154,7 @@ void NodesDb::Load()
 void NodesDb::LoadDir(const wxString& path)
 {
     if (!wxDirExists(path)) return;
-    
+
     wxDir dir(path);
     wxString filename;
     bool cont;
@@ -171,20 +171,20 @@ void NodesDb::LoadDir(const wxString& path)
 
 void NodesDb::LoadFile(const wxString& file)
 {
-    NodeInfo *ni = new NodeInfo; 
+    NodeInfo *ni = new NodeInfo;
     ni->Type = wxEmptyString;
     ni->Icon = 0;
     wxPathList paths;
     size_t i;
-    
+
     for (i = 0; i < m_Paths.GetCount(); i++)
         paths.Add(m_Paths[i]);
-    
+
     ni->Read(file, paths);
-    
+
     // maybe we already parsed it?
     for (i = 0; i < m_Infos.GetCount(); i++)
         if (m_Infos[i].NodeClass == ni->NodeClass) return;
-    
+
     m_Infos.Add(ni);
 }
index 6ed3b24bf6e5020e021c8bb525b7009d3c6db4d0..6c328a0e7985621b0a9229377766956b77f57ea1 100644 (file)
@@ -28,13 +28,13 @@ class PropertyInfo
         PropertyInfo() {}
         PropertyInfo(const wxString& atype, const wxString& aname, const wxString& amoreinfo)
           : Type(atype), Name(aname), MoreInfo(amoreinfo) {}
-       
+
         PropertyInfo& operator=(const PropertyInfo& p)
         {
             Type = p.Type; Name = p.Name; MoreInfo = p.MoreInfo;
             return *this;
         }
-       
+
         wxString Type;
         wxString Name;
         wxString MoreInfo;
@@ -47,13 +47,13 @@ class NodeInfo
 {
     public:
         wxString NodeClass;
-        wxString Type;   
+        wxString Type;
         PropertyInfoArray Props;
         wxArrayString DerivedFrom;
         bool Abstract;
         wxString ChildType;
         int Icon;
-    
+
         void Read(const wxString& filename, wxPathList& list);
 };
 
@@ -65,15 +65,15 @@ class NodesDb
 {
     public:
         NodesDb();
-    
+
         void Load();
         void LoadDir(const wxString& path);
         void LoadFile(const wxString& file);
-        
+
         NodeInfoArray& GetNodesInfo() { return m_Infos; }
-    
+
         static NodesDb *Get();
-    
+
     private:
         static NodesDb *ms_Instance;
         NodeInfoArray m_Infos;
@@ -82,4 +82,4 @@ class NodesDb
 
 
 
-#endif 
+#endif
index 4f7b59f398e0cddce4104b9e2f19fab229291a5e..d463b1adbcd99517371fab3fbc2ee1009a7d3e05 100644 (file)
@@ -36,7 +36,7 @@
 wxWindow* PropEditCtrlFont::CreateEditCtrl()
 {
     PropEditCtrlTxt::CreateEditCtrl();
-    m_TextCtrl->Enable(FALSE);
+    m_TextCtrl->Enable(false);
     return m_TextCtrl;
 }
 
@@ -61,18 +61,18 @@ wxTreeItemId PropEditCtrlFont::CreateTreeEntry(wxTreeItemId parent, const Proper
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlChoice, PropEditCtrl)
-    EVT_CHOICE(-1, PropEditCtrlChoice::OnChoice)
+    EVT_CHOICE(wxID_ANY, PropEditCtrlChoice::OnChoice)
 END_EVENT_TABLE()
 
 wxWindow* PropEditCtrlChoice::CreateEditCtrl()
 {
-    m_Choice = new wxChoice(this, -1);
-    
+    m_Choice = new wxChoice(this, wxID_ANY);
+
     return m_Choice;
 }
 
 
-        
+
 void PropEditCtrlChoice::ReadValue()
 {
     wxStringTokenizer tkn(m_PropInfo->MoreInfo, _T(","));
@@ -96,10 +96,10 @@ void PropEditCtrlChoice::WriteValue()
 
 void PropEditCtrlChoice::OnChoice(wxCommandEvent& WXUNUSED(event))
 {
-    if (CanSave()) 
+    if (CanSave())
     {
         WriteValue();
-        EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);    
+        EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
     }
 }
 
@@ -112,11 +112,11 @@ void PropEditCtrlColor::OnDetails()
     wxColour clr;
     wxString txt = m_TextCtrl->GetValue();
     long unsigned tmp;
-    
+
     if (txt.Length() == 7 && txt[0u] == _T('#') &&
         wxSscanf(txt.c_str(), _T("#%lX"), &tmp) == 1)
-        clr = wxColour((tmp & 0xFF0000) >> 16, 
-                       (tmp & 0x00FF00) >> 8, 
+        clr = wxColour((tmp & 0xFF0000) >> 16,
+                       (tmp & 0x00FF00) >> 8,
                        (tmp & 0x0000FF));
 
     clr = wxGetColourFromUser(NULL, clr);
@@ -143,19 +143,19 @@ void PropEditCtrlFlags::OnDetails()
     wxArrayString arr;
     size_t i;
     int j;
-    
+
     wxStringTokenizer tkn(m_PropInfo->MoreInfo, _T(","));
     while (tkn.HasMoreTokens())
         arr.Add(tkn.GetNextToken());
 
     wxConfigBase *cfg = wxConfigBase::Get();
-    
-    wxDialog dlg(m_PropFrame, -1, _("Flags"), 
-            wxPoint(cfg->Read(_T("flagsdlg_x"), -1), cfg->Read(_T("flagsdlg_y"), -1)),
+
+    wxDialog dlg(m_PropFrame, wxID_ANY, _("Flags"),
+            wxPoint(cfg->Read(_T("flagsdlg_x"), wxDefaultPosition.x), cfg->Read(_T("flagsdlg_y"), wxDefaultPosition.y)),
             wxSize(cfg->Read(_T("flagsdlg_w"), 300), cfg->Read(_T("flagsdlg_h"), 300)),
             wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
     wxSizer *sz = new wxBoxSizer(wxVERTICAL);
-    wxCheckListBox *lbox = new wxCheckListBox(&dlg, -1);
+    wxCheckListBox *lbox = new wxCheckListBox(&dlg, wxID_ANY);
     sz->Add(lbox, 1, wxEXPAND | wxALL, 10);
     wxSizer *sz2 = new wxBoxSizer(wxHORIZONTAL);
     wxButton *btnok = new wxButton(&dlg, wxID_OK, _("OK"));
@@ -165,12 +165,12 @@ void PropEditCtrlFlags::OnDetails()
     sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
 
     dlg.SetSizer(sz);
-    dlg.SetAutoLayout(TRUE);
+    dlg.SetAutoLayout(true);
     dlg.Layout();
-    
+
     for (i = 0; i < arr.GetCount(); i++)
         lbox->Append(arr[i]);
-  
+
     tkn.SetString(txt, _T("| "));
     while (tkn.HasMoreTokens())
     {
@@ -178,12 +178,12 @@ void PropEditCtrlFlags::OnDetails()
         j = arr.Index(t);
         if (j != wxNOT_FOUND) lbox->Check(j);
     }
-            
-    
+
+
     if (dlg.ShowModal() != wxID_OK) return;
-    
+
     txt.Empty();
-    
+
     for (i = 0; i < arr.GetCount(); i++)
         if (lbox->IsChecked(i))
             txt << arr[i] << _T('|');
@@ -216,14 +216,14 @@ void PropEditCtrlFile::OnDetails()
 {
     wxString txt = m_TextCtrl->GetValue();
     txt = wxPathOnly(EditorFrame::Get()->GetFileName()) + _T("/") + txt;
-    wxString name = wxFileSelector(_("Choose file"), 
+    wxString name = wxFileSelector(_("Choose file"),
                                    wxPathOnly(txt),
                                    wxFileNameFromPath(txt),
                                    _T(""),
                                    GetFileTypes(),
                                    wxOPEN | wxFILE_MUST_EXIST);
     if (!name) return;
-    
+
     // compute relative path:
     wxArrayString axrc, afile;
     wxStringTokenizer tkn;
@@ -231,7 +231,7 @@ void PropEditCtrlFile::OnDetails()
     while (tkn.HasMoreTokens()) afile.Add(tkn.GetNextToken());
     tkn.SetString(EditorFrame::Get()->GetFileName(), _T("/\\"));
     while (tkn.HasMoreTokens()) axrc.Add(tkn.GetNextToken());
-    
+
     if (afile.GetCount() == 0 || axrc.GetCount() == 0)
         txt = name;
     else
index 802dbd52ecdbf7d18177547002282cdb0ac8012e..6115554d16de4410eda680d1987c9b28cb011fee 100644 (file)
@@ -25,7 +25,7 @@ class PropEditCtrlFont : public PropEditCtrlTxt
     public:
         PropEditCtrlFont(PropertiesFrame *propFrame)
            : PropEditCtrlTxt(propFrame) {}
-                
+
         virtual wxWindow* CreateEditCtrl();
         virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo);
 };
@@ -37,12 +37,12 @@ class PropEditCtrlChoice : public PropEditCtrl
     public:
         PropEditCtrlChoice(PropertiesFrame *propFrame)
            : PropEditCtrl(propFrame) {}
-                
+
         virtual wxWindow* CreateEditCtrl();
-        
+
         virtual void ReadValue();
         virtual void WriteValue();
-    
+
     protected:
         wxChoice *m_Choice;
 
@@ -57,7 +57,7 @@ class PropEditCtrlColor : public PropEditCtrlTxt
         PropEditCtrlColor(PropertiesFrame *propFrame)
             : PropEditCtrlTxt(propFrame) {}
 
-        virtual bool HasDetails() { return TRUE; }
+        virtual bool HasDetails() { return true; }
         virtual void OnDetails();
 };
 
@@ -70,7 +70,7 @@ class PropEditCtrlFlags : public PropEditCtrlTxt
         PropEditCtrlFlags(PropertiesFrame *propFrame)
             : PropEditCtrlTxt(propFrame) {}
 
-        virtual bool HasDetails() { return TRUE; }
+        virtual bool HasDetails() { return true; }
         virtual void OnDetails();
 };
 
@@ -82,9 +82,9 @@ class PropEditCtrlFile : public PropEditCtrlTxt
         PropEditCtrlFile(PropertiesFrame *propFrame)
             : PropEditCtrlTxt(propFrame) {}
 
-        virtual bool HasDetails() { return TRUE; }
+        virtual bool HasDetails() { return true; }
         virtual void OnDetails();
-        
+
         virtual wxString GetFileTypes();
 };
 
index 9e64192419efb6e8fdd9328b0abe5959e9691fdd..d6cb8b6982bf5b32ea5cbc6cd572826ef1ebb0ba 100644 (file)
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlTxt, PropEditCtrl)
-    EVT_TEXT(-1, PropEditCtrlTxt::OnText)
+    EVT_TEXT(wxID_ANY, PropEditCtrlTxt::OnText)
 END_EVENT_TABLE()
 
 
 wxWindow *PropEditCtrlTxt::CreateEditCtrl()
 {
-    return (m_TextCtrl = new wxTextCtrl(this, -1));
+    return (m_TextCtrl = new wxTextCtrl(this, wxID_ANY));
 }
 
 
 
 void PropEditCtrlTxt::OnText(wxCommandEvent& WXUNUSED(event))
 {
-    if (CanSave()) 
+    if (CanSave())
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
@@ -61,7 +61,7 @@ void PropEditCtrlTxt::WriteValue()
 {
     wxString newv = m_TextCtrl->GetValue();
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
 }
 
 
@@ -82,12 +82,12 @@ wxWindow *PropEditCtrlInt::CreateEditCtrl()
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlBool, PropEditCtrl)
-    EVT_CHOICE(-1, PropEditCtrlBool::OnChoice)
+    EVT_CHOICE(wxID_ANY, PropEditCtrlBool::OnChoice)
 END_EVENT_TABLE()
 
 wxWindow *PropEditCtrlBool::CreateEditCtrl()
 {
-    m_Choice = new wxChoice(this, -1);
+    m_Choice = new wxChoice(this, wxID_ANY);
     m_Choice->Append(_T("false"));
     m_Choice->Append(_T("true"));
     return m_Choice;
@@ -110,7 +110,7 @@ void PropEditCtrlBool::WriteValue()
     wxString newv = m_Choice->GetSelection() == 0 ? _T("0") : _T("1");
 
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
 }
 
 
@@ -128,7 +128,7 @@ wxString PropEditCtrlBool::GetValueAsText(wxTreeItemId ti)
 
 void PropEditCtrlBool::OnChoice(wxCommandEvent& WXUNUSED(event))
 {
-    if (CanSave()) 
+    if (CanSave())
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
@@ -145,7 +145,7 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
     public:
         PropEditCtrlCoordXY(PropertiesFrame *propFrame, int which)
            : PropEditCtrlInt(propFrame), m_which(which) {}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -161,7 +161,7 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             }
             m_TextCtrl->SetValue(m_c[m_which]);
         }
-        
+
         virtual void WriteValue()
         {
             m_c[m_which] = m_TextCtrl->GetValue();
@@ -172,9 +172,9 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             wxString prev = XmlReadValue(GetNode(), m_PropInfo->Name);
             if (prev[prev.Len()-1] == _T('d')) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
@@ -191,16 +191,16 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             }
             return m_c[m_which];
         }
-        
+
         virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             if (m_which == 0) return _T("x"); else return _T("y");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
+
 
-    
     protected:
         wxString m_c[2];
         int m_which;
@@ -212,7 +212,7 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
     public:
         PropEditCtrlCoordDlg(PropertiesFrame *propFrame)
            : PropEditCtrlBool(propFrame) {}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -222,15 +222,15 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
             else
                 m_Choice->SetSelection(0);
         }
-        
+
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name).BeforeFirst(_T('d'));
             if (m_Choice->GetSelection() == 1) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
@@ -242,14 +242,14 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
             else
                 return _("true");
         }
-        
+
         virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             return _T("dlg");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
 };
 
 
@@ -293,14 +293,14 @@ class PropEditCtrlDimX : public PropEditCtrlInt
     public:
         PropEditCtrlDimX(PropertiesFrame *propFrame)
            : PropEditCtrlInt(propFrame){}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
             m_c = s.BeforeFirst(_T('d'));
             m_TextCtrl->SetValue(m_c);
         }
-        
+
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -309,24 +309,24 @@ class PropEditCtrlDimX : public PropEditCtrlInt
             s = m_c;
             if (dlg) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
             return XmlReadValue(GetNode(), pi->Name).BeforeFirst(_T('d'));
         }
-        
+
         virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             return _T("val");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
+
 
-    
     protected:
         wxString m_c;
 };
@@ -379,7 +379,7 @@ void PropEditCtrlXRCID::WriteValue()
     REAL_NODE->DeleteProperty(_T("name"));
     REAL_NODE->AddProperty(_T("name"), s);
 
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
@@ -389,7 +389,7 @@ void PropEditCtrlXRCID::Clear()
 {
     EndEdit();
     REAL_NODE->DeleteProperty(_T("name"));
-    m_TreeCtrl->SetItemBold(m_TreeItem, FALSE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, false);
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
@@ -401,7 +401,7 @@ void PropEditCtrlXRCID::OnDetails()
       #define stdID(id) , wxString(_T(#id))
       stdID(wxID_OK) stdID(wxID_CANCEL)
       stdID(wxID_YES) stdID(wxID_NO)
-      stdID(wxID_APPLY) stdID(wxID_HELP) 
+      stdID(wxID_APPLY) stdID(wxID_HELP)
       stdID(wxID_HELP_CONTEXT)
 
       stdID(wxID_OPEN) stdID(wxID_CLOSE) stdID(wxID_NEW)
@@ -412,20 +412,20 @@ void PropEditCtrlXRCID::OnDetails()
       stdID(wxID_HELP_COMMANDS) stdID(wxID_HELP_PROCEDURES)
       stdID(wxID_CUT) stdID(wxID_COPY) stdID(wxID_PASTE)
       stdID(wxID_CLEAR) stdID(wxID_FIND) stdID(wxID_DUPLICATE)
-      stdID(wxID_SELECTALL) 
+      stdID(wxID_SELECTALL)
       stdID(wxID_STATIC) stdID(wxID_FORWARD) stdID(wxID_BACKWARD)
       stdID(wxID_DEFAULT) stdID(wxID_MORE) stdID(wxID_SETUP)
-      stdID(wxID_RESET) 
+      stdID(wxID_RESET)
       #undef stdID
       };
 
-    wxString s = 
-        wxGetSingleChoice(_("Choose from predefined IDs:"), _("XRCID"), 
+    wxString s =
+        wxGetSingleChoice(_("Choose from predefined IDs:"), _("XRCID"),
                           38/*sizeof choices*/, choices);
     if (!s) return;
     m_TextCtrl->SetValue(s);
     WriteValue();
-    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);    
+    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
 }
 
 
index 5dff7dde762a97b573d0a48d9fa9cc0455834c79..b6e82fc4a508de09f440df3a60d2341cceec32b9 100644 (file)
@@ -25,12 +25,12 @@ class PropEditCtrlNull : public PropEditCtrl
     public:
         PropEditCtrlNull(PropertiesFrame *propFrame)
            : PropEditCtrl(propFrame) {}
-                
+
         virtual void BeginEdit(const wxRect& WXUNUSED(rect), wxTreeItemId WXUNUSED(ti)) {}
         virtual void EndEdit() {}
-                
+
         virtual wxWindow* CreateEditCtrl() {return NULL;}
-        
+
         virtual void ReadValue() {}
         virtual void WriteValue() {}
 };
@@ -42,12 +42,12 @@ class PropEditCtrlTxt : public PropEditCtrl
     public:
         PropEditCtrlTxt(PropertiesFrame *propFrame)
            : PropEditCtrl(propFrame) {}
-                
+
         virtual wxWindow* CreateEditCtrl();
-        
+
         virtual void ReadValue();
         virtual void WriteValue();
-        
+
     protected:
         wxTextCtrl *m_TextCtrl;
 
@@ -63,7 +63,7 @@ class PropEditCtrlInt : public PropEditCtrlTxt
     public:
         PropEditCtrlInt(PropertiesFrame *propFrame)
            : PropEditCtrlTxt(propFrame) {}
-                
+
         virtual wxWindow* CreateEditCtrl();
 };
 
@@ -74,13 +74,13 @@ class PropEditCtrlBool : public PropEditCtrl
     public:
         PropEditCtrlBool(PropertiesFrame *propFrame)
            : PropEditCtrl(propFrame) {}
-                
+
         virtual wxWindow* CreateEditCtrl();
-        
+
         virtual void ReadValue();
         virtual void WriteValue();
         virtual wxString GetValueAsText(wxTreeItemId ti);
-    
+
     protected:
         wxChoice *m_Choice;
 
@@ -94,9 +94,9 @@ class PropEditCtrlCoord : public PropEditCtrlTxt
     public:
         PropEditCtrlCoord(PropertiesFrame *propFrame);
         ~PropEditCtrlCoord();
-    
+
         virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo);
-        
+
     private:
         PropEditCtrl *m_CtrlX, *m_CtrlY, *m_CtrlDlg;
 };
@@ -107,9 +107,9 @@ class PropEditCtrlDim : public PropEditCtrlTxt
     public:
         PropEditCtrlDim(PropertiesFrame *propFrame);
         ~PropEditCtrlDim();
-    
+
         virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo);
-        
+
     private:
         PropEditCtrl *m_CtrlX, *m_CtrlDlg;
 };
@@ -121,11 +121,11 @@ class PropEditCtrlXRCID : public PropEditCtrlTxt
     public:
         PropEditCtrlXRCID(PropertiesFrame *propFrame)
            : PropEditCtrlTxt(propFrame) {}
-                
+
         virtual void ReadValue();
         virtual void WriteValue();
         virtual void Clear();
-        virtual bool HasDetails() { return TRUE; }
+        virtual bool HasDetails() { return true; }
         virtual void OnDetails();
         virtual wxString GetValueAsText(wxTreeItemId ti);
         virtual bool IsPresent(const PropertyInfo& pinfo);
index 0d84d45db5a06d85b60b77ce7a2216216269e2ce..21f3668cf182ee5a553c4dca37ccedd4e35fadd7 100644 (file)
@@ -36,11 +36,11 @@ class MyMenubarHandler : public wxMenuBarXmlHandler
 
         wxObject *DoCreateResource()
         {
-            //wxMenuBar *menubar = new wxMenuBar(GetStyle());            
+            //wxMenuBar *menubar = new wxMenuBar(GetStyle());
             CreateChildren(m_MenuBar);
             return m_MenuBar;
         }
-        
+
     private:
         wxMenuBar *m_MenuBar;
 };
@@ -52,41 +52,41 @@ PreviewFrame* PreviewFrame::ms_Instance = NULL;
 
 PreviewFrame *PreviewFrame::Get()
 {
-    if (ms_Instance == NULL) 
+    if (ms_Instance == NULL)
     {
         (void)new PreviewFrame;
-        ms_Instance->Show(TRUE);
+        ms_Instance->Show(true);
     }
     return ms_Instance;
 }
 
 PreviewFrame::PreviewFrame()
-    : wxFrame(EditorFrame::Get(), -1, _("Preview"),
-              wxDefaultPosition, wxDefaultSize, 
+    : wxFrame(EditorFrame::Get(), wxID_ANY, _("Preview"),
+              wxDefaultPosition, wxDefaultSize,
               wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR
 #ifdef __WXMSW__
               | wxFRAME_TOOL_WINDOW
 #endif
               )
 {
-    m_Dirty = FALSE;
+    m_Dirty = false;
     ms_Instance = this;
     m_Node = NULL;
-    
+
     SetMenuBar(new wxMenuBar());
-    
+
     m_RC = NULL;
     m_TmpFile = wxGetTempFileName(_T("wxrcedit"));
     ResetResource();
 
     wxConfigBase *cfg = wxConfigBase::Get();
-    SetSize(wxRect(wxPoint(cfg->Read(_T("previewframe_x"), -1), cfg->Read(_T("previewframe_y"), -1)),
+    SetSize(wxRect(wxPoint(cfg->Read(_T("previewframe_x"), wxDefaultPosition.x), cfg->Read(_T("previewframe_y"), wxDefaultPosition.y)),
             wxSize(cfg->Read(_T("previewframe_w"), 400), cfg->Read(_T("previewframe_h"), 400))));
 
-    m_Splitter = new wxSplitterWindow(this, -1);
-    m_LogCtrl = new wxTextCtrl(m_Splitter, -1, wxEmptyString, wxDefaultPosition, 
+    m_Splitter = new wxSplitterWindow(this, wxID_ANY);
+    m_LogCtrl = new wxTextCtrl(m_Splitter, wxID_ANY, wxEmptyString, wxDefaultPosition,
                                wxDefaultSize, wxTE_MULTILINE);
-    m_ScrollWin = new wxScrolledWindow(m_Splitter, -1);
+    m_ScrollWin = new wxScrolledWindow(m_Splitter, wxID_ANY);
     m_ScrollWin->SetBackgroundColour(_T("light steel blue"));
     m_Splitter->SplitHorizontally(m_ScrollWin, m_LogCtrl, cfg->Read(_T("previewframe_sash"), 300));
 
@@ -113,26 +113,26 @@ void PreviewFrame::ResetResource()
 
 PreviewFrame::~PreviewFrame()
 {
-    wxConfigBase *cfg = wxConfigBase::Get();  
+    wxConfigBase *cfg = wxConfigBase::Get();
     cfg->Write(_T("previewframe_x"), (long)GetPosition().x);
     cfg->Write(_T("previewframe_y"), (long)GetPosition().y);
     cfg->Write(_T("previewframe_w"), (long)GetSize().x);
     cfg->Write(_T("previewframe_h"), (long)GetSize().y);
     cfg->Write(_T("previewframe_sash"), (long)m_Splitter->GetSashPosition());
-    
+
     ms_Instance = NULL;
-    
+
     delete m_RC;
     wxRemoveFile(m_TmpFile);
 }
 
 
-        
+
 void PreviewFrame::MakeDirty()
 {
     if (m_Node == NULL) return;
     if (m_Dirty) return;
-    m_Dirty = TRUE;
+    m_Dirty = true;
     m_LogCtrl->Clear();
     m_LogCtrl->SetValue(_("Resource modified.\nMove mouse cursor over the preview window to refresh it."));
 }
@@ -153,11 +153,11 @@ void PreviewFrame::Preview(wxXmlNode *node, wxXmlDocument *orig_doc)
        doc.GetRoot()->AddChild(new wxXmlNode(*node));
        doc.SetFileEncoding(orig_doc->GetFileEncoding());
 
-       if (XmlGetClass(doc.GetRoot()->GetChildren()) == _T("wxDialog")) 
-           XmlSetClass(doc.GetRoot()->GetChildren(), _T("wxPanel"));   
+       if (XmlGetClass(doc.GetRoot()->GetChildren()) == _T("wxDialog"))
+           XmlSetClass(doc.GetRoot()->GetChildren(), _T("wxPanel"));
 
-       if (XmlGetClass(doc.GetRoot()->GetChildren()) == _T("wxFrame")) 
-           XmlSetClass(doc.GetRoot()->GetChildren(), _T("wxPanel"));  
+       if (XmlGetClass(doc.GetRoot()->GetChildren()) == _T("wxFrame"))
+           XmlSetClass(doc.GetRoot()->GetChildren(), _T("wxPanel"));
 
        doc.Save(m_TmpFile);
        // wxXmlResource will detect change automatically
@@ -178,10 +178,10 @@ void PreviewFrame::Preview(wxXmlNode *node, wxXmlDocument *orig_doc)
    m_LogCtrl->Clear();
    wxLogTextCtrl mylog(m_LogCtrl);
    wxLog *oldlog = wxLog::SetActiveTarget(&mylog);
-   
+
    wxString oldcwd = wxGetCwd();
    wxSetWorkingDirectory(wxPathOnly(EditorFrame::Get()->GetFileName()));
-   
+
    if (XmlGetClass(node) == _T("wxMenuBar") || XmlGetClass(node) == _T("wxMenu"))
        PreviewMenu();
    else if (XmlGetClass(node) == _T("wxToolBar"))
@@ -189,12 +189,12 @@ void PreviewFrame::Preview(wxXmlNode *node, wxXmlDocument *orig_doc)
    else if (XmlGetClass(node) == _T("wxPanel") || XmlGetClass(node) == _T("wxDialog"))
        PreviewPanel();
    else if (XmlGetClass(node) == _T("wxFrame"))
-          PreviewWXFrame();    
+       PreviewWXFrame();
 
    wxSetWorkingDirectory(oldcwd);
    wxLog::SetActiveTarget(oldlog);
-   
-   m_Dirty = FALSE;
+
+   m_Dirty = false;
 }
 
 
@@ -233,38 +233,38 @@ void PreviewFrame::PreviewPanel()
     else
     {
         m_ScrollWin->SetScrollbars(1, 1, panel->GetSize().x, panel->GetSize().y,
-                                   0, 0, TRUE);
+                                   0, 0, true);
     }
 }
 
 void PreviewFrame::PreviewWXFrame()
 {
-       //for this to work the frame MUST have a child panel!
-
-       wxXmlNode*      child = m_Node;
-       wxString name;
-
-       while( child != NULL)
-       {
-               name = child->GetPropVal(_T("name"), _T("-1"));
-               
-               if(name != _T("-1"))
-               {
-                       wxXmlNode* parent = child->GetParent();
-                       if(parent->GetPropVal(_T("class"),_T("-1")) == _T("wxPanel"))
-                               break;
-               }
-               child = child->GetNext();
-       }
+    //for this to work the frame MUST have a child panel!
+
+    wxXmlNode* child = m_Node;
+    wxString name;
+
+    while( child != NULL)
+    {
+        name = child->GetPropVal(_T("name"), _T("-1"));
+
+        if(name != _T("-1"))
+        {
+            wxXmlNode* parent = child->GetParent();
+            if(parent->GetPropVal(_T("class"),_T("-1")) == _T("wxPanel"))
+                break;
+        }
+        child = child->GetNext();
+    }
 
     wxPanel *panel = m_RC->LoadPanel(m_ScrollWin, name);
-    
+
     if (panel == NULL)
         wxLogError(_("Cannot preview the panel -- XML resource corrupted."));
     else
     {
         m_ScrollWin->SetScrollbars(1, 1, panel->GetSize().x, panel->GetSize().y,
-                                   0, 0, TRUE);
+                                   0, 0, true);
     }
 
 }
index e9e558a8337f6618f63958ef17616801bafe004d..3e237e83e81d5580a295f29356c4f401bfd618e4 100644 (file)
@@ -30,21 +30,21 @@ class PreviewFrame : public wxFrame
     public:
         PreviewFrame();
         ~PreviewFrame();
-        
+
         void Preview(wxXmlNode *node,wxXmlDocument *doc);
         void MakeDirty();
                 // current node updated, needs preview refresh
                 // (will be done once mouse enters preview win)
-      
+
         static PreviewFrame *Get();
         void ResetResource();
-        
+
     private:
         void PreviewMenu();
         void PreviewToolbar();
         void PreviewPanel();
-               void PreviewWXFrame();
-    
+        void PreviewWXFrame();
+
     private:
         static PreviewFrame *ms_Instance;
         wxXmlNode *m_Node;
@@ -52,12 +52,12 @@ class PreviewFrame : public wxFrame
         wxScrolledWindow *m_ScrollWin;
         wxTextCtrl *m_LogCtrl;
         wxSplitterWindow *m_Splitter;
-        
+
         wxXmlResource *m_RC;
         wxString m_TmpFile;
-        
+
         bool m_Dirty;
-        
+
         DECLARE_EVENT_TABLE()
         void OnMouseEnter(wxMouseEvent& event);
 };
index 288dd3ee6c10f6fa2dd5ebfaf82e74f3db163d74..f6c78716a66be10880d000d23f8afec1efbdee70 100644 (file)
@@ -45,7 +45,7 @@ void PropEditCtrl::OnButtonDetails(wxCommandEvent& WXUNUSED(event))
 void PropEditCtrl::OnButtonClear(wxCommandEvent& WXUNUSED(event))
 {
     Clear();
-    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);        
+    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
 }
 
 
@@ -54,7 +54,7 @@ void PropEditCtrl::BeginEdit(const wxRect& rect, wxTreeItemId ti)
     m_PropInfo = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
     m_TreeItem = ti;
 
-    m_CanSave = FALSE;
+    m_CanSave = false;
     if (!m_Created)
     {
         wxSizer *sz = new wxBoxSizer(wxHORIZONTAL);
@@ -62,28 +62,28 @@ void PropEditCtrl::BeginEdit(const wxRect& rect, wxTreeItemId ti)
         sz->Add(m_TheCtrl, 1);
         if (HasDetails())
             sz->Add(new wxButton(this, ID_DETAILS, _T("..."), wxDefaultPosition,
-                    wxSize(16,-1)));
+                    wxSize(16,wxDefaultSize.y)));
         if (HasClearButton())
             sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition,
-                    wxSize(16,-1)));
-        SetAutoLayout(TRUE);
+                    wxSize(16,wxDefaultSize.y)));
+        SetAutoLayout(true);
         SetSizer(sz);
-        m_Created = TRUE;
+        m_Created = true;
     }
 
     m_TheCtrl->SetFocus();
 
     SetSize(rect.x, rect.y, rect.width, rect.height);
-    Show(TRUE);
+    Show(true);
     ReadValue();
-    m_CanSave = TRUE;
+    m_CanSave = true;
 }
 
 
 
 void PropEditCtrl::EndEdit()
 {
-    Show(FALSE);
+    Show(false);
 }
 
 
@@ -93,7 +93,7 @@ wxTreeItemId PropEditCtrl::CreateTreeEntry(wxTreeItemId parent, const PropertyIn
     wxTreeItemId t = m_TreeCtrl->AppendItem(parent, GetPropName(pinfo));
     m_TreeCtrl->SetItemData(t, new PETreeData(this, pinfo));
     if (IsPresent(pinfo))
-        m_TreeCtrl->SetItemBold(t, TRUE);
+        m_TreeCtrl->SetItemBold(t, true);
     return t;
 }
 
@@ -113,7 +113,7 @@ void PropEditCtrl::Clear()
     {
         n->GetParent()->RemoveChild(n);
         delete n;
-        m_TreeCtrl->SetItemBold(m_TreeItem, FALSE);
+        m_TreeCtrl->SetItemBold(m_TreeItem, false);
     }
 }
 
index 8676a3e262902e87521e6654aadcc2cef8e3f2b1..d1197cb0e2deb06808c98e7f317eab747a12a89e 100644 (file)
@@ -29,45 +29,45 @@ class PropEditCtrl : public wxPanel
 {
     public:
         PropEditCtrl(PropertiesFrame *propFrame)
-           : wxPanel(propFrame->m_valueWindow, -1),
-             m_PropFrame(propFrame), m_Created(FALSE), m_TreeCtrl(propFrame->m_tree) 
-             {Show(FALSE);}
-                
+           : wxPanel(propFrame->m_valueWindow, wxID_ANY),
+             m_PropFrame(propFrame), m_Created(false), m_TreeCtrl(propFrame->m_tree)
+             {Show(false);}
+
         virtual void BeginEdit(const wxRect& rect, wxTreeItemId ti);
         virtual void EndEdit();
-        
+
         virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo);
         virtual wxWindow* CreateEditCtrl() = 0;
-        
+
         virtual bool IsPresent(const PropertyInfo& pinfo);
-        
+
         virtual void Clear();
         virtual void ReadValue() = 0;
         virtual void WriteValue() = 0;
         virtual wxString GetValueAsText(wxTreeItemId ti);
         virtual wxString GetPropName(const PropertyInfo& pinfo)
                 { return pinfo.Name.AfterLast(_T('/')); }
-        
-        virtual bool HasDetails() { return FALSE; }
+
+        virtual bool HasDetails() { return false; }
         virtual void OnDetails() {}
-        virtual bool HasClearButton() { return TRUE; }
-        
+        virtual bool HasClearButton() { return true; }
+
         void OnButtonDetails(wxCommandEvent& event);
         void OnButtonClear(wxCommandEvent& event);
-    
+
     protected:
         wxXmlNode *GetNode() { return m_PropFrame->m_Node; }
         bool CanSave() { return m_CanSave; }
-    
+
         PropertiesFrame *m_PropFrame;
         bool m_Created;
         wxTreeCtrl *m_TreeCtrl;
         wxTreeItemId m_TreeItem;
         wxWindow *m_TheCtrl;
         PropertyInfo *m_PropInfo;
-        
+
         bool m_CanSave;
-        
+
         DECLARE_EVENT_TABLE()
 };
 
@@ -76,7 +76,7 @@ class PropEditCtrl : public wxPanel
 class PETreeData : public wxTreeItemData
 {
     public:
-        PETreeData(PropEditCtrl *p, const PropertyInfo& pi) : 
+        PETreeData(PropEditCtrl *p, const PropertyInfo& pi) :
                 wxTreeItemData(),
                 EditCtrl(p), PropInfo(pi) {}
         PropEditCtrl *EditCtrl;
index 1e160c67e7c1900fda0007747d49f5dbf17bf1d5..898cdc1f9a877ebbf4c44cc7f2add0ed42710f83 100644 (file)
@@ -38,52 +38,52 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
         PropsTree(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
             const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS)
             : wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style),
-              m_EditCtrl(NULL) 
-               {
+              m_EditCtrl(NULL)
+        {
 #if 0
             // VS: Don't do it, it is *extremely* ugly.
             //     FIXME: find a better solution.
 
-                       //make text larger so controls will fit properly
-                       wxFont font = GetFont();
-                       font.SetPointSize(font.GetPointSize()*1.5);
-                       SetFont(font);
+            //make text larger so controls will fit properly
+            wxFont font = GetFont();
+            font.SetPointSize(font.GetPointSize()*1.5);
+            SetFont(font);
 #endif
         }
 
-           void OnPaint(wxPaintEvent& event)
+        void OnPaint(wxPaintEvent& event)
         {
-               wxPaintDC dc(this);
+            wxPaintDC dc(this);
 
-               wxTreeCtrl::OnPaint(event);
+            wxTreeCtrl::OnPaint(event);
 
             // Reset the device origin since it may have been set
             dc.SetDeviceOrigin(0, 0);
 
-               wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
-               dc.SetPen(pen);          
+            wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
+            dc.SetPen(pen);
 
-               dc.SetBrush(* wxTRANSPARENT_BRUSH);
+            dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
             wxSize clientSize = GetClientSize();
-               wxRect itemRect;
-               int cy=0;
-               wxTreeItemId h, lastH;
-               for(h=GetFirstVisibleItem();h;h=GetNextVisible(h))
-               {
-                       if (h.IsOk() && GetBoundingRect(h, itemRect))
-                       {
-                               cy = itemRect.GetTop();
-
-                               dc.DrawLine(0, cy, clientSize.x, cy);
-                               lastH = h;
-                       }
-               }
-               if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
-               {
-                       cy = itemRect.GetBottom();
-                       dc.DrawLine(0, cy, clientSize.x, cy);
-               }
+            wxRect itemRect;
+            int cy=0;
+            wxTreeItemId h, lastH;
+            for(h=GetFirstVisibleItem();h;h=GetNextVisible(h))
+            {
+                if (h.IsOk() && GetBoundingRect(h, itemRect))
+                {
+                    cy = itemRect.GetTop();
+
+                    dc.DrawLine(0, cy, clientSize.x, cy);
+                    lastH = h;
+                }
+            }
+            if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
+            {
+                cy = itemRect.GetBottom();
+                dc.DrawLine(0, cy, clientSize.x, cy);
+            }
         }
 
         void OnSelChange(wxTreeEvent& event)
@@ -93,7 +93,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
                 m_EditCtrl->EndEdit();
                 m_EditCtrl = NULL;
             }
-        
+
             wxTreeItemId item = event.GetItem();
             PETreeData *dt = (PETreeData*)GetItemData(item);
             if (dt != NULL)
@@ -102,7 +102,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
                 GetBoundingRect(item, bounding);
 
                 bounding.SetX(0);
-                bounding.SetWidth(GetCompanionWindow()->GetSize().x); 
+                bounding.SetWidth(GetCompanionWindow()->GetSize().x);
                 dt->EditCtrl->BeginEdit(bounding, item);
                 m_EditCtrl = dt->EditCtrl;
             }
@@ -124,22 +124,22 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
             event.Skip();
             if (event.GetOrientation() == wxHORIZONTAL) return;
             if (!m_EditCtrl) return;
-            
+
             wxTreeItemId id = GetSelection();
             wxRect bounding;
             GetBoundingRect(id, bounding);
-            
-            m_EditCtrl->Move(-1, bounding.y);
+
+            m_EditCtrl->Move(wxDefaultPosition.x, bounding.y);
         }
-        
+
         PropEditCtrl *m_EditCtrl;
-        
+
         DECLARE_EVENT_TABLE()
 };
 
 BEGIN_EVENT_TABLE(PropsTree, wxRemotelyScrolledTreeCtrl)
-       EVT_PAINT(PropsTree::OnPaint)
-    EVT_TREE_SEL_CHANGED(-1, PropsTree::OnSelChange)
+    EVT_PAINT(PropsTree::OnPaint)
+    EVT_TREE_SEL_CHANGED(wxID_ANY, PropsTree::OnSelChange)
     EVT_SCROLLWIN(PropsTree::OnScroll)
 END_EVENT_TABLE()
 
@@ -147,34 +147,34 @@ END_EVENT_TABLE()
 class PropsValueWindow: public wxTreeCompanionWindow
 {
     public:
-        PropsValueWindow(wxWindow* parent, wxWindowID id = -1,
+        PropsValueWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
           const wxPoint& pos = wxDefaultPosition,
           const wxSize& sz = wxDefaultSize,
           long style = 0)
            : wxTreeCompanionWindow(parent, id, pos, sz, style) {}
-           
+
         virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
         {
-               if (m_treeCtrl)
-               {
+            if (m_treeCtrl)
+            {
                 PETreeData *data = (PETreeData*)m_treeCtrl->GetItemData(id);
-                       wxString text;
+                wxString text;
                 if (data != NULL) text = data->EditCtrl->GetValueAsText(id);
                 dc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));
                 dc.DrawRectangle(rect);
-                       dc.SetTextForeground(* wxBLACK);
-                       dc.SetBackgroundMode(wxTRANSPARENT);
+                dc.SetTextForeground(* wxBLACK);
+                dc.SetBackgroundMode(wxTRANSPARENT);
 
-                       int textW, textH;
-                       dc.GetTextExtent(text, & textW, & textH);
+                int textW, textH;
+                dc.GetTextExtent(text, & textW, & textH);
 
-                       int x = 5;
-                       int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
+                int x = 5;
+                int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
 
-                       dc.DrawText(text, x, y);
-               }
+                dc.DrawText(text, x, y);
+            }
         }
-        
+
         void OnClick(wxMouseEvent& event)
         {
             int flags;
@@ -189,7 +189,7 @@ class PropsValueWindow: public wxTreeCompanionWindow
 };
 
 BEGIN_EVENT_TABLE(PropsValueWindow, wxTreeCompanionWindow)
-       EVT_LEFT_DOWN(PropsValueWindow::OnClick)
+    EVT_LEFT_DOWN(PropsValueWindow::OnClick)
 END_EVENT_TABLE()
 
 
@@ -202,18 +202,18 @@ PropertiesFrame* PropertiesFrame::ms_Instance = NULL;
 
 PropertiesFrame *PropertiesFrame::Get()
 {
-    if (ms_Instance == NULL) 
+    if (ms_Instance == NULL)
     {
         (void)new PropertiesFrame;
-        ms_Instance->Show(TRUE);
+        ms_Instance->Show(true);
     }
     return ms_Instance;
 }
 
 PropertiesFrame::PropertiesFrame()
-    : wxFrame(EditorFrame::Get(), -1, _("Properties"),
+    : wxFrame(EditorFrame::Get(), wxID_ANY, _("Properties"),
               wxDefaultPosition, wxDefaultSize,
-              wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR 
+              wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR
 #ifdef __WXMSW__
               | wxFRAME_TOOL_WINDOW
 #endif
@@ -222,34 +222,34 @@ PropertiesFrame::PropertiesFrame()
     ms_Instance = this;
     m_Node = NULL;
 
-    m_scrolledWindow = new wxSplitterScrolledWindow(this, -1, wxDefaultPosition,
-               wxDefaultSize, wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
-    m_splitter = new wxThinSplitterWindow(m_scrolledWindow, -1, wxDefaultPosition,
-               wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
-       m_splitter->SetSashSize(2);
-    m_tree = new PropsTree(m_splitter, -1, wxDefaultPosition,
-               wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER );
+    m_scrolledWindow = new wxSplitterScrolledWindow(this, wxID_ANY, wxDefaultPosition,
+        wxDefaultSize, wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
+    m_splitter = new wxThinSplitterWindow(m_scrolledWindow, wxID_ANY, wxDefaultPosition,
+        wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
+    m_splitter->SetSashSize(2);
+    m_tree = new PropsTree(m_splitter, wxID_ANY, wxDefaultPosition,
+        wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER );
     m_tree->SetIndent(2);
 
-    m_valueWindow = new PropsValueWindow(m_splitter, -1, wxDefaultPosition,
-               wxDefaultSize, wxNO_BORDER);
+    m_valueWindow = new PropsValueWindow(m_splitter, wxID_ANY, wxDefaultPosition,
+        wxDefaultSize, wxNO_BORDER);
     m_valueWindow->SetBackgroundColour(m_tree->GetBackgroundColour());
     m_splitter->SplitVertically(m_tree, m_valueWindow, wxConfig::Get()->Read(_T("propertiesframe_sash"), 100));
-       //m_splitter->AdjustScrollbars();
-       m_scrolledWindow->SetTargetWindow(m_tree);
+    //m_splitter->AdjustScrollbars();
+    m_scrolledWindow->SetTargetWindow(m_tree);
 
-       m_scrolledWindow->EnableScrolling(FALSE, FALSE);
+    m_scrolledWindow->EnableScrolling(false, false);
 
-       // Let the two controls know about each other
-       m_valueWindow->SetTreeCtrl(m_tree);
-       m_tree->SetCompanionWindow(m_valueWindow);
+    // Let the two controls know about each other
+    m_valueWindow->SetTreeCtrl(m_tree);
+    m_tree->SetCompanionWindow(m_valueWindow);
 
     wxConfigBase *cfg = wxConfigBase::Get();
-    SetSize(wxRect(wxPoint(cfg->Read(_T("propertiesframe_x"), -1), cfg->Read(_T("propertiesframe_y"), -1)),
+    SetSize(wxRect(wxPoint(cfg->Read(_T("propertiesframe_x"), wxDefaultPosition.x), cfg->Read(_T("propertiesframe_y"), wxDefaultPosition.y)),
             wxSize(cfg->Read(_T("propertiesframe_w"), 200), cfg->Read(_T("propertiesframe_h"), 200))));
-            
 
-    m_EditCtrls.DeleteContents(TRUE);
+
+    m_EditCtrls.DeleteContents(true);
     m_EditCtrls.Put(_T("bool"), new PropEditCtrlBool(this));
     m_EditCtrls.Put(_T("coord"), new PropEditCtrlCoord(this));
     m_EditCtrls.Put(_T("color"), new PropEditCtrlColor(this));
@@ -264,7 +264,7 @@ PropertiesFrame::PropertiesFrame()
     m_EditCtrls.Put(_T("file"), new PropEditCtrlFile(this));
     m_EditCtrls.Put(_T("imagefile"), new PropEditCtrlImageFile(this));
     m_EditCtrls.Put(_T(""), new PropEditCtrlNull(this));
-            
+
     ClearProps();
 }
 
@@ -272,26 +272,26 @@ PropertiesFrame::PropertiesFrame()
 
 PropertiesFrame::~PropertiesFrame()
 {
-    wxConfigBase *cfg = wxConfigBase::Get();  
+    wxConfigBase *cfg = wxConfigBase::Get();
     cfg->Write(_T("propertiesframe_x"), (long)GetPosition().x);
     cfg->Write(_T("propertiesframe_y"), (long)GetPosition().y);
     cfg->Write(_T("propertiesframe_w"), (long)GetSize().x);
     cfg->Write(_T("propertiesframe_h"), (long)GetSize().y);
     cfg->Write(_T("propertiesframe_sash"), (long)m_splitter->GetSashPosition());
-    
+
     ms_Instance = NULL;
 }
 
 
-        
+
 void PropertiesFrame::ShowProps(wxXmlNode *node)
 {
    m_Node = node;
-   
+
    ClearProps();
    AddSingleProp(PropertyInfo(_T("xmlid"), _T("XRCID"), wxEmptyString));
    AddProps(NodeHandler::Find(node)->GetPropsList(node));
-   
+
    m_tree->Expand(m_tree->GetRootItem());
    m_valueWindow->Refresh();
 }
@@ -321,7 +321,7 @@ void PropertiesFrame::AddSingleProp(const PropertyInfo& pinfo, wxTreeItemId *roo
     wxTreeItemId tid;
     if (root != NULL) tid = *root;
     else tid = m_tree->GetRootItem();
-    
+
     if (pec == NULL)
         wxLogError(_("Unknown property type '%s'!"), pinfo.Type.c_str());
     else
index 8f9cd7c74aa7535d1efa982faaaa88a5fad2877b..4cb6bcb437654c85056c9d1443e993928a5361c5 100644 (file)
@@ -27,15 +27,15 @@ class PropertiesFrame : public wxFrame
     public:
         PropertiesFrame();
         ~PropertiesFrame();
-        
+
         void ShowProps(wxXmlNode *node);
-        
+
         void ClearProps();
         void AddProps(PropertyInfoArray& plist);
         void AddSingleProp(const PropertyInfo& pinfo, wxTreeItemId *root = NULL);
-      
+
         static PropertiesFrame *Get();
-           
+
     private:
 
         static PropertiesFrame *ms_Instance;
@@ -43,11 +43,11 @@ class PropertiesFrame : public wxFrame
 
         wxRemotelyScrolledTreeCtrl *m_tree;
         wxThinSplitterWindow *m_splitter;
-           wxSplitterScrolledWindow *m_scrolledWindow;
+        wxSplitterScrolledWindow *m_scrolledWindow;
         wxTreeCompanionWindow *m_valueWindow;
-        
+
         wxHashTable m_EditCtrls;
-        
+
         friend class PropEditCtrl;
 };
 
index 1a32486541ae71226a7ade084d49b009da37db60..ace263423c94bdd16589a3f05405e7cf995e96b1 100644 (file)
@@ -58,17 +58,17 @@ BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxGenericTreeCtrl)
 #else
 BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
 #endif
-       EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
-       EVT_TREE_ITEM_EXPANDED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
-       EVT_TREE_ITEM_COLLAPSED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
-       EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
+    EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
+    EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
+    EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
+    EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
 END_EVENT_TABLE()
 
 wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
         const wxSize& sz, long style):
         wxTreeCtrl(parent, id, pt, sz, style)
 {
-       m_companionWindow = NULL;
+    m_companionWindow = NULL;
 }
 
 wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
@@ -80,7 +80,7 @@ void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 #if defined(__WXMSW__) && USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
-        ::ShowScrollBar((HWND) GetHWND(), SB_VERT, FALSE);
+        ::ShowScrollBar((HWND) GetHWND(), SB_VERT, false);
     }
     else
 #endif
@@ -103,9 +103,9 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
         win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, 0, noUnitsX, 0, xPos, 0, noRefresh);
 
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-           if (scrolledWindow)
-           {
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
             scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
         }
     }
@@ -163,13 +163,13 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
         scrolledWindow->GetViewStart(& x2, & y2);
         * y = y2;
     }
-       else
+    else
 #endif
-       {
-               // x is wrong since the horizontal scrollbar is controlled by the
-               // tree control, but we probably don't need it.
+    {
+        // x is wrong since the horizontal scrollbar is controlled by the
+        // tree control, but we probably don't need it.
         scrolledWindow->GetViewStart(x, y);
-       }
+    }
 }
 
 // In case we're using the generic tree control.
@@ -178,7 +178,7 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 {
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
 
@@ -207,9 +207,9 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
 #endif
     {
-           UINT sbCode = SB_THUMBPOSITION;
-           HWND vertScrollBar = 0;
-           MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar);
+        UINT sbCode = SB_THUMBPOSITION;
+        HWND vertScrollBar = 0;
+        MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar);
     }
 #if USE_GENERIC_TREECTRL
     else
@@ -218,39 +218,39 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
 #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
-               win->Refresh();
-               /* Doesn't work yet because scrolling is ignored by Scroll
+        win->Refresh();
+        /* Doesn't work yet because scrolling is ignored by Scroll
         int xppu, yppu;
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-           if (scrolledWindow)
-           {
-                       scrolledWindow->GetScrollPixelsPerUnit(& xppu, & yppu);
-                       win->Scroll(-1, posVert*yppu);
-               }
-               */
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
+            scrolledWindow->GetScrollPixelsPerUnit(& xppu, & yppu);
+            win->Scroll(-1, posVert*yppu);
+        }
+        */
     }
 #endif
 }
 
 void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
 {
-       HideVScrollbar();
-       AdjustRemoteScrollbars();
-       event.Skip();
+    HideVScrollbar();
+    AdjustRemoteScrollbars();
+    event.Skip();
 }
 
 void wxRemotelyScrolledTreeCtrl::OnExpand(wxTreeEvent& event)
 {
-       AdjustRemoteScrollbars();
-       event.Skip();
+    AdjustRemoteScrollbars();
+    event.Skip();
 
     // If we don't have this, we get some bits of lines still remaining
     if (event.GetEventType() == wxEVT_COMMAND_TREE_ITEM_COLLAPSED)
         Refresh();
 
-       // Pass on the event
-       if (m_companionWindow)
-               m_companionWindow->GetEventHandler()->ProcessEvent(event);
+    // Pass on the event
+    if (m_companionWindow)
+        m_companionWindow->GetEventHandler()->ProcessEvent(event);
 }
 
 // Adjust the containing wxScrolledWindow's scrollbars appropriately
@@ -258,50 +258,50 @@ void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
 {
 #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
-       {
-               // This is for the generic tree control.
-               // It calls SetScrollbars which has been overridden
-               // to adjust the parent scrolled window vertical
-               // scrollbar.
-               ((wxGenericTreeCtrl*) this)->AdjustMyScrollbars();
+    {
+        // This is for the generic tree control.
+        // It calls SetScrollbars which has been overridden
+        // to adjust the parent scrolled window vertical
+        // scrollbar.
+        ((wxGenericTreeCtrl*) this)->AdjustMyScrollbars();
         return;
-       }
-       else
+    }
+    else
 #endif
-       {
-               // This is for the wxMSW tree control
-               wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-               if (scrolledWindow)
-               {
-                       wxRect itemRect;
-                       if (GetBoundingRect(GetRootItem(), itemRect))
-                       {
+    {
+        // This is for the wxMSW tree control
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
+            wxRect itemRect;
+            if (GetBoundingRect(GetRootItem(), itemRect))
+            {
                 // Actually, the real height seems to be 1 less than reported
                 // (e.g. 16 instead of 16)
                 int itemHeight = itemRect.GetHeight() - 1;
-                               
-                               int w, h;
-                               GetClientSize(&w, &h);
-                               
-                               wxRect rect(0, 0, 0, 0);
-                               CalcTreeSize(rect);
+
+                int w, h;
+                GetClientSize(&w, &h);
+
+                wxRect rect(0, 0, 0, 0);
+                CalcTreeSize(rect);
 
                 double f = ((double) (rect.GetHeight()) / (double) itemHeight)  ;
                 int treeViewHeight = (int) ceil(f);
-                               
-                               int scrollPixelsPerLine = itemHeight;
-                               int scrollPos = - (itemRect.y / itemHeight);
-                               
-                               scrolledWindow->SetScrollbars(0, scrollPixelsPerLine, 0, treeViewHeight, 0, scrollPos);
-                               
-                               // Ensure that when a scrollbar becomes hidden or visible,
-                               // the contained window sizes are right.
-                               // Problem: this is called too early (?)
-                               wxSizeEvent event(scrolledWindow->GetSize(), scrolledWindow->GetId());
-                               scrolledWindow->GetEventHandler()->ProcessEvent(event);
-                       }
-               }
-       }
+
+                int scrollPixelsPerLine = itemHeight;
+                int scrollPos = - (itemRect.y / itemHeight);
+
+                scrolledWindow->SetScrollbars(0, scrollPixelsPerLine, 0, treeViewHeight, 0, scrollPos);
+
+                // Ensure that when a scrollbar becomes hidden or visible,
+                // the contained window sizes are right.
+                // Problem: this is called too early (?)
+                wxSizeEvent event(scrolledWindow->GetSize(), scrolledWindow->GetId());
+                scrolledWindow->GetEventHandler()->ProcessEvent(event);
+            }
+        }
+    }
 }
 
 
@@ -314,10 +314,10 @@ static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
     int bottom1 = rect1.GetBottom();
     int right2 = rect2.GetRight();
     int bottom2 = rect2.GetBottom();
-    
+
     wxPoint topLeft = wxPoint(wxMin(rect1.x, rect2.x), wxMin(rect1.y, rect2.y));
     wxPoint bottomRight = wxPoint(wxMax(right1, right2), wxMax(bottom1, bottom2));
-    
+
     rect.x = topLeft.x; rect.y = topLeft.y;
     rect.SetRight(bottomRight.x);
     rect.SetBottom(bottomRight.y);
@@ -330,40 +330,40 @@ static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
 // correctly
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxRect& rect)
 {
-       CalcTreeSize(GetRootItem(), rect);
+    CalcTreeSize(GetRootItem(), rect);
 }
 
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& rect)
 {
-       // More efficient implementation would be to find the last item (but how?)
-       // Q: is the bounding rect relative to the top of the virtual tree workspace
-       // or the top of the window? How would we convert?
-       wxRect itemSize;
-       if (GetBoundingRect(id, itemSize))
-       {
-               rect = CombineRectangles(rect, itemSize);
-       }
-
-       void* cookie;
-       wxTreeItemId childId = GetFirstChild(id, cookie);
-       while (childId)
-       {
-               CalcTreeSize(childId, rect);
-               childId = GetNextChild(childId, cookie);
-       }
+    // More efficient implementation would be to find the last item (but how?)
+    // Q: is the bounding rect relative to the top of the virtual tree workspace
+    // or the top of the window? How would we convert?
+    wxRect itemSize;
+    if (GetBoundingRect(id, itemSize))
+    {
+        rect = CombineRectangles(rect, itemSize);
+    }
+
+    void* cookie;
+    wxTreeItemId childId = GetFirstChild(id, cookie);
+    while (childId)
+    {
+        CalcTreeSize(childId, rect);
+        childId = GetNextChild(childId, cookie);
+    }
 }
 
 // Find the scrolled window that contains this control
 wxScrolledWindow* wxRemotelyScrolledTreeCtrl::GetScrolledWindow() const
 {
-       wxWindow* parent = wxWindow::GetParent();
-       while (parent)
-       {
-               if (parent->IsKindOf(CLASSINFO(wxScrolledWindow)))
-                       return (wxScrolledWindow*) parent;
-               parent = parent->GetParent();
-       }
-       return NULL;
+    wxWindow* parent = wxWindow::GetParent();
+    while (parent)
+    {
+        if (parent->IsKindOf(CLASSINFO(wxScrolledWindow)))
+            return (wxScrolledWindow*) parent;
+        parent = parent->GetParent();
+    }
+    return NULL;
 }
 
 void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
@@ -393,77 +393,77 @@ void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
 IMPLEMENT_CLASS(wxTreeCompanionWindow, wxWindow)
 
 BEGIN_EVENT_TABLE(wxTreeCompanionWindow, wxWindow)
-       EVT_PAINT(wxTreeCompanionWindow::OnPaint)
-       EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
-       EVT_TREE_ITEM_EXPANDED(-1, wxTreeCompanionWindow::OnExpand)
-       EVT_TREE_ITEM_COLLAPSED(-1, wxTreeCompanionWindow::OnExpand)
+    EVT_PAINT(wxTreeCompanionWindow::OnPaint)
+    EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
+    EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxTreeCompanionWindow::OnExpand)
+    EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxTreeCompanionWindow::OnExpand)
 END_EVENT_TABLE()
 
 wxTreeCompanionWindow::wxTreeCompanionWindow(wxWindow* parent, wxWindowID id,
       const wxPoint& pos,
       const wxSize& sz,
       long style):
-       wxWindow(parent, id, pos, sz, style)
+    wxWindow(parent, id, pos, sz, style)
 {
-       m_treeCtrl = NULL;
+    m_treeCtrl = NULL;
 }
 
 void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
 {
-       // TEST CODE
+    // TEST CODE
 #if 1
-       if (m_treeCtrl)
-       {
-               wxString text = m_treeCtrl->GetItemText(id);
-               dc.SetTextForeground(* wxBLACK);
-               dc.SetBackgroundMode(wxTRANSPARENT);
+    if (m_treeCtrl)
+    {
+        wxString text = m_treeCtrl->GetItemText(id);
+        dc.SetTextForeground(* wxBLACK);
+        dc.SetBackgroundMode(wxTRANSPARENT);
 
-               int textW, textH;
-               dc.GetTextExtent(text, & textW, & textH);
+        int textW, textH;
+        dc.GetTextExtent(text, & textW, & textH);
 
-               int x = 5;
-               int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
+        int x = 5;
+        int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
 
-               dc.DrawText(text, x, y);
-       }
+        dc.DrawText(text, x, y);
+    }
 #endif
 }
 
 void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
-       wxPaintDC dc(this);
+    wxPaintDC dc(this);
 
     if (!m_treeCtrl)
         return;
 
-        wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
-       dc.SetPen(pen);
-       dc.SetBrush(* wxTRANSPARENT_BRUSH);
-       wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
-       dc.SetFont(font);
+    wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
+    dc.SetPen(pen);
+    dc.SetBrush(* wxTRANSPARENT_BRUSH);
+    wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+    dc.SetFont(font);
 
     wxSize clientSize = GetClientSize();
-       wxRect itemRect;
-       wxTreeItemId h, lastH;
-       for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
-       {
-               if (m_treeCtrl->GetBoundingRect(h, itemRect))
-               {
-                       int cy = itemRect.GetTop();
-                       wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
-
-                       lastH = h;
-
-                       // Draw the actual item
-                       DrawItem(dc, h, drawItemRect);
-                       dc.DrawLine(0, cy, clientSize.x, cy);
-               }
-       }
-       if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
-       {
-               int cy = itemRect.GetBottom();
-               dc.DrawLine(0, cy, clientSize.x, cy);
-       }
+    wxRect itemRect;
+    wxTreeItemId h, lastH;
+    for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
+    {
+        if (m_treeCtrl->GetBoundingRect(h, itemRect))
+        {
+            int cy = itemRect.GetTop();
+            wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
+
+            lastH = h;
+
+            // Draw the actual item
+            DrawItem(dc, h, drawItemRect);
+            dc.DrawLine(0, cy, clientSize.x, cy);
+        }
+    }
+    if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
+    {
+        int cy = itemRect.GetBottom();
+        dc.DrawLine(0, cy, clientSize.x, cy);
+    }
 }
 
 void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
@@ -477,15 +477,15 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
     if (!m_treeCtrl)
         return;
 
-       // TODO: scroll the window physically instead of just refreshing.
-       Refresh(TRUE);
+    // TODO: scroll the window physically instead of just refreshing.
+    Refresh(true);
 }
 
 void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
 {
-       // TODO: something more optimized than simply refresh the whole
-       // window when the tree is expanded/collapsed. Tricky.
-       Refresh();
+    // TODO: something more optimized than simply refresh the whole
+    // window when the tree is expanded/collapsed. Tricky.
+    Refresh();
 }
 
 /*
@@ -495,7 +495,7 @@ void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
 IMPLEMENT_CLASS(wxThinSplitterWindow, wxSplitterWindow)
 
 BEGIN_EVENT_TABLE(wxThinSplitterWindow, wxSplitterWindow)
-       EVT_SIZE(wxThinSplitterWindow::OnSize)
+    EVT_SIZE(wxThinSplitterWindow::OnSize)
 END_EVENT_TABLE()
 
 wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id,
@@ -512,9 +512,9 @@ wxThinSplitterWindow::~wxThinSplitterWindow()
 
 void wxThinSplitterWindow::SizeWindows()
 {
-       // The client size may have changed inbetween
-       // the sizing of the first window and the sizing of
-       // the second. So repeat SizeWindows.
+    // The client size may have changed inbetween
+    // the sizing of the first window and the sizing of
+    // the second. So repeat SizeWindows.
     wxSplitterWindow::SizeWindows();
     wxSplitterWindow::SizeWindows();
 }
@@ -522,7 +522,7 @@ void wxThinSplitterWindow::SizeWindows()
 // Tests for x, y over sash
 bool wxThinSplitterWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
 {
-       return wxSplitterWindow::SashHitTest(x, y, 4);
+    return wxSplitterWindow::SashHitTest(x, y, 4);
 }
 
 void wxThinSplitterWindow::DrawSash(wxDC& dc)
@@ -535,42 +535,42 @@ void wxThinSplitterWindow::DrawSash(wxDC& dc)
     int w, h;
     GetClientSize(&w, &h);
 
-       if ( m_splitMode == wxSPLIT_VERTICAL )
-       {
-               dc.SetPen(* m_facePen);
-               dc.SetBrush(* m_faceBrush);
-               int h1 = h-1;
-               int y1 = 0;
-               if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
-                       h1 += 1; // Not sure why this is necessary...
-               if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
-               {
-                       y1 = 2; h1 -= 3;
-               }
-               dc.DrawRectangle(GetSashPosition(), y1, GetSashSize(), h1);
-       }
-       else
-       {
-               dc.SetPen(* m_facePen);
-               dc.SetBrush(* m_faceBrush);
-               int w1 = w-1;
-               int x1 = 0;
-               if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
-                       w1 ++;
-               if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
-               {
-                       x1 = 2; w1 -= 3;
-               }
-               dc.DrawRectangle(x1, GetSashPosition(), w1, GetSashSize());
-       }
-       
+    if ( m_splitMode == wxSPLIT_VERTICAL )
+    {
+        dc.SetPen(* m_facePen);
+        dc.SetBrush(* m_faceBrush);
+        int h1 = h-1;
+        int y1 = 0;
+        if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
+            h1 += 1; // Not sure why this is necessary...
+        if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
+        {
+            y1 = 2; h1 -= 3;
+        }
+        dc.DrawRectangle(GetSashPosition(), y1, GetSashSize(), h1);
+    }
+    else
+    {
+        dc.SetPen(* m_facePen);
+        dc.SetBrush(* m_faceBrush);
+        int w1 = w-1;
+        int x1 = 0;
+        if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
+            w1 ++;
+        if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
+        {
+            x1 = 2; w1 -= 3;
+        }
+        dc.DrawRectangle(x1, GetSashPosition(), w1, GetSashSize());
+    }
+
     dc.SetPen(wxNullPen);
     dc.SetBrush(wxNullBrush);
 }
 
 void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
 {
-       wxSplitterWindow::OnSize(event);
+    wxSplitterWindow::OnSize(event);
 }
 
 /*
@@ -580,8 +580,8 @@ void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
 IMPLEMENT_CLASS(wxSplitterScrolledWindow, wxScrolledWindow)
 
 BEGIN_EVENT_TABLE(wxSplitterScrolledWindow, wxScrolledWindow)
-       EVT_SCROLLWIN(wxSplitterScrolledWindow::OnScroll)
-       EVT_SIZE(wxSplitterScrolledWindow::OnSize)
+    EVT_SCROLLWIN(wxSplitterScrolledWindow::OnScroll)
+    EVT_SIZE(wxSplitterScrolledWindow::OnSize)
 END_EVENT_TABLE()
 
 wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id,
@@ -594,48 +594,48 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID
 
 void wxSplitterScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
 {
-       wxSize sz = GetClientSize();
-       if (GetChildren().GetFirst())
-       {
-               ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
-       }
+    wxSize sz = GetClientSize();
+    if (GetChildren().GetFirst())
+    {
+        ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
+    }
 }
 
 void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
 {
     // Ensure that events being propagated back up the window hierarchy
     // don't cause an infinite loop
-    static bool inOnScroll = FALSE;
+    static bool inOnScroll = false;
     if (inOnScroll)
     {
         event.Skip();
         return;
     }
-    inOnScroll = TRUE;
-    
+    inOnScroll = true;
+
     int orient = event.GetOrientation();
 
     int nScrollInc = CalcScrollInc(event);
     if (nScrollInc == 0)
     {
-        inOnScroll = FALSE;
+        inOnScroll = false;
         return;
     }
 
     if (orient == wxHORIZONTAL)
     {
-        inOnScroll = FALSE;
+        inOnScroll = false;
         event.Skip();
         return;
 #if 0
         int newPos = m_xScrollPosition + nScrollInc;
-        SetScrollPos(wxHORIZONTAL, newPos, TRUE );
+        SetScrollPos(wxHORIZONTAL, newPos, true );
 #endif
     }
     else
     {
         int newPos = m_yScrollPosition + nScrollInc;
-        SetScrollPos(wxVERTICAL, newPos, TRUE );
+        SetScrollPos(wxVERTICAL, newPos, true );
     }
 
     if (orient == wxHORIZONTAL)
@@ -668,6 +668,6 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
     m_targetWindow->MacUpdateImmediately() ;
 #endif
 
-    inOnScroll = FALSE;
+    inOnScroll = false;
 }
 
index 4d39434da76ed0aa00a338cdff29bd684d72ff49..85b38d2d2b04705c724263dd0828ca5fcd187aa6 100644 (file)
@@ -15,7 +15,7 @@
 #define _WX_SPLITTREE_H_
 
 #if defined(__GNUG__) && !defined(__APPLE__)
-       #pragma interface "splittree.h"
+    #pragma interface "splittree.h"
 #endif
 
 // Set this to 1 to use generic tree control (doesn't yet work properly)
@@ -48,15 +48,15 @@ class wxSplitterScrolledWindow;
 
 class wxRemotelyScrolledTreeCtrl: public wxTreeCtrl
 {
-       DECLARE_CLASS(wxRemotelyScrolledTreeCtrl)
+    DECLARE_CLASS(wxRemotelyScrolledTreeCtrl)
 public:
     wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
         const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS);
-       ~wxRemotelyScrolledTreeCtrl();
+    ~wxRemotelyScrolledTreeCtrl();
 
 //// Events
-       void OnSize(wxSizeEvent& event);
-       void OnExpand(wxTreeEvent& event);
+    void OnSize(wxSizeEvent& event);
+    void OnExpand(wxTreeEvent& event);
     void OnScroll(wxScrollWinEvent& event);
 
 //// Overrides
@@ -69,7 +69,7 @@ public:
     virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
                              int noUnitsX, int noUnitsY,
                              int xPos = 0, int yPos = 0,
-                             bool noRefresh = FALSE );
+                             bool noRefresh = false );
 
     // In case we're using the generic tree control.
     // Get the view start
@@ -82,18 +82,18 @@ public:
     virtual int GetScrollPos(int orient) const;
 
 //// Helpers
-       void HideVScrollbar();
+    void HideVScrollbar();
 
-       // Calculate the tree overall size so we can set the scrollbar
-       // correctly
-       void CalcTreeSize(wxRect& rect);
-       void CalcTreeSize(const wxTreeItemId& id, wxRect& rect);
+    // Calculate the tree overall size so we can set the scrollbar
+    // correctly
+    void CalcTreeSize(wxRect& rect);
+    void CalcTreeSize(const wxTreeItemId& id, wxRect& rect);
 
-       // Adjust the containing wxScrolledWindow's scrollbars appropriately
-       void AdjustRemoteScrollbars();
+    // Adjust the containing wxScrolledWindow's scrollbars appropriately
+    void AdjustRemoteScrollbars();
 
-       // Find the scrolled window that contains this control
-       wxScrolledWindow* GetScrolledWindow() const;
+    // Find the scrolled window that contains this control
+    wxScrolledWindow* GetScrolledWindow() const;
 
     // Scroll to the given line (in scroll units where each unit is
     // the height of an item)
@@ -101,15 +101,15 @@ public:
 
 //// Accessors
 
-       // The companion window is one which will get notified when certain
-       // events happen such as node expansion
-       void SetCompanionWindow(wxWindow* companion) { m_companionWindow = companion; }
-       wxWindow* GetCompanionWindow() const { return m_companionWindow; }
+    // The companion window is one which will get notified when certain
+    // events happen such as node expansion
+    void SetCompanionWindow(wxWindow* companion) { m_companionWindow = companion; }
+    wxWindow* GetCompanionWindow() const { return m_companionWindow; }
 
 
     DECLARE_EVENT_TABLE()
 protected:
-       wxWindow*       m_companionWindow;
+    wxWindow* m_companionWindow;
 };
 
 /*
@@ -123,28 +123,28 @@ class wxTreeCompanionWindow: public wxWindow
 public:
     DECLARE_CLASS(wxTreeCompanionWindow)
 
-    wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
+    wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
       const wxPoint& pos = wxDefaultPosition,
       const wxSize& sz = wxDefaultSize,
       long style = 0);
 
 //// Overrides
-       virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect);
+    virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect);
 
 //// Events
-       void OnPaint(wxPaintEvent& event);    
+    void OnPaint(wxPaintEvent& event);
     void OnScroll(wxScrollWinEvent& event);
-       void OnExpand(wxTreeEvent& event);
+    void OnExpand(wxTreeEvent& event);
 
 //// Operations
 
 //// Accessors
-       wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; };
-       void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl) { m_treeCtrl = treeCtrl; }
+    wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; };
+    void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl) { m_treeCtrl = treeCtrl; }
 
 //// Data members
 protected:
-       wxRemotelyScrolledTreeCtrl*     m_treeCtrl;
+    wxRemotelyScrolledTreeCtrl* m_treeCtrl;
 
     DECLARE_EVENT_TABLE()
 };
@@ -162,7 +162,7 @@ class wxThinSplitterWindow: public wxSplitterWindow
 public:
     DECLARE_DYNAMIC_CLASS(wxThinSplitterWindow)
 
-    wxThinSplitterWindow(wxWindow* parent, wxWindowID id = -1,
+    wxThinSplitterWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
       const wxPoint& pos = wxDefaultPosition,
       const wxSize& sz = wxDefaultSize,
       long style = wxSP_3D | wxCLIP_CHILDREN);
@@ -174,10 +174,10 @@ public:
     // Tests for x, y over sash. Overriding this allows us to increase
     // the tolerance.
     bool SashHitTest(int x, int y, int tolerance = 2);
-       void DrawSash(wxDC& dc);
+    void DrawSash(wxDC& dc);
 
 //// Events
-    
+
     void OnSize(wxSizeEvent& event);
 
 //// Operations
@@ -203,7 +203,7 @@ class wxSplitterScrolledWindow: public wxScrolledWindow
 public:
     DECLARE_DYNAMIC_CLASS(wxSplitterScrolledWindow)
 
-    wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = -1,
+    wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
       const wxPoint& pos = wxDefaultPosition,
       const wxSize& sz = wxDefaultSize,
       long style = 0);
@@ -211,7 +211,7 @@ public:
 //// Overrides
 
 //// Events
-    
+
     void OnScroll(wxScrollWinEvent& event);
     void OnSize(wxSizeEvent& event);
 
index 436086630540530f671e700343e5463508a5fc06..5eba66c47541544f378d47e9d86cee042f2865f0 100644 (file)
@@ -22,7 +22,7 @@ class WXDLLEXPORT wxXmlNode;
 class XmlTreeData : public wxTreeItemData
 {
     public:
-        XmlTreeData(wxXmlNode *n) : Node(n) {}        
+        XmlTreeData(wxXmlNode *n) : Node(n) {}
         wxXmlNode *Node;
 };
 
index 73a69129c671fb0a98741353d1ee1d65340d5b8f..a8fa0886af253da04529c30efcc6ca48a776df9a 100644 (file)
@@ -29,7 +29,7 @@ wxXmlNode *XmlFindNodeSimple(wxXmlNode *parent, const wxString& param)
     if (param.IsEmpty()) return parent;
 
     wxXmlNode *n = parent->GetChildren();
-    
+
     while (n)
     {
         if (n->GetType() == wxXML_ELEMENT_NODE && n->GetName() == param)
@@ -68,13 +68,13 @@ wxXmlNode *XmlCreateNode(wxXmlNode *parent, const wxString& name)
         nm = tkn.GetNextToken();
         n = XmlFindNodeSimple(parent, nm);
         if (n) continue;
-        
+
         // n == NULL:
         n = new wxXmlNode(wxXML_ELEMENT_NODE, nm);
-        parent->AddChild(n);        
+        parent->AddChild(n);
     }
     n->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString));
-    
+
     return n;
 }
 
@@ -85,12 +85,12 @@ void XmlWriteValue(wxXmlNode *parent, const wxString& name, const wxString& valu
     wxXmlNode *n = XmlFindNode(parent, name);
     if (n == NULL)
         n = XmlCreateNode(parent, name);
-    
+
     n = n->GetChildren();
-    
+
     while (n)
     {
-        if (n->GetType() == wxXML_TEXT_NODE || 
+        if (n->GetType() == wxXML_TEXT_NODE ||
             n->GetType() == wxXML_CDATA_SECTION_NODE)
         {
             n->SetContent(value);
@@ -107,10 +107,10 @@ wxString XmlReadValue(wxXmlNode *parent, const wxString& name)
     wxXmlNode *n = XmlFindNode(parent, name);
     if (n == NULL) return wxEmptyString;
     n = n->GetChildren();
-    
+
     while (n)
     {
-        if (n->GetType() == wxXML_TEXT_NODE || 
+        if (n->GetType() == wxXML_TEXT_NODE ||
             n->GetType() == wxXML_CDATA_SECTION_NODE)
             return n->GetContent();
         n = n->GetNext();
index 67300429c28e2047767a6660de7f17f2001d9f3b..26d19f76350627f526abcd659cf4af430e53e8e9 100644 (file)
@@ -28,4 +28,4 @@ wxXmlNode *XmlFindNodeSimple(wxXmlNode *parent, const wxString& path);
 wxString XmlGetClass(wxXmlNode *parent);
 void XmlSetClass(wxXmlNode *parent, const wxString& classname);
 
-#endif 
+#endif
index b9c0f669c4ed51d783da55c84bdf80489e057061..3f7a18133617cce0550c499e329dedef38d5dc1f 100644 (file)
@@ -24,7 +24,7 @@
 
 class WXDLLIMPEXP_XRC wxGaugeXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler)
     enum
     {
         wxGAUGE_DEFAULT_RANGE = 100
index 52274fb81bfe87cf5f059fe198158c7a0d637210..c263338705a76eb563a1d11c58adf3460101876f 100644 (file)
@@ -31,7 +31,7 @@ private:
 
 class WXDLLIMPEXP_XRC wxMenuBarXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler)
     public:
         wxMenuBarXmlHandler();
         virtual wxObject *DoCreateResource();
index ef1d3861d8e2ef384b9b898c535d7ccad1eeb2fb..77988eefce86960f6473230b0226c1ed53bcd35e 100644 (file)
@@ -22,7 +22,7 @@
 
 class WXDLLIMPEXP_XRC wxScrollBarXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler)
     enum
     {
         wxSL_DEFAULT_VALUE = 0,
index 7159605584fb71446bdb59f74036854b94bab95c..2e0ad9606abe8c55e1e4167713dd902d96a06772 100644 (file)
@@ -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);
 };
 
 
index 8e425b42949112a87cdb0d89440b423c3bc87070..2eeb587eaf5bf7f654ae56aa8b2f846a76f05021 100644 (file)
@@ -22,7 +22,7 @@
 
 class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler
 {
-       DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler)
+    DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler)
     enum
     {
         wxSL_DEFAULT_VALUE = 0,
index ab9590a68b507c69a5c53cd61c4a9d405dc1b9f0..e49b607dd133b98c69bf56b1cf38cb361cf4d5b0 100644 (file)
@@ -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,
index dd62160169d36dd7a309818381ff614254ec5469..76dbd1e972034f76fbdfc47a227182f9ffe0f715 100644 (file)
@@ -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);
index 6735dc3bcece6215f9fddb7bc4eb124b4324c4e0..158234222749b408a45b134c1b9a96c2444bc7d5 100644 (file)
 // 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") );
 }
index 69b01d438773e6c56af34825e8b664220a70f16e..9973ed0161aaac7310f40af33e5db6d065ac9ca0 100644 (file)
@@ -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()
-    
+
 };
 
 //----------------------------------------------------------------------------------------
index ed6c1cd613669f04f5686c6301f2ca929a0800b2..64cda9224f638a85fea630876667fef66be97706 100644 (file)
@@ -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.
 }
index 1e82f6f5b005a0f05d7ffbaf337ae7658a81fe1f..edcf91f5252cffd7f7bf60e0cc111523918f6f6f 100644 (file)
 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 );
 
index a740c29bda892a61f8e54af2ff6ffa81eeb3fed6..cfab7d39f97c3a5f2950f5044da7f10d411ec8b0 100644 (file)
 // 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);
index a773adc30d7751a13114eea2a7197b5babec9525..eb5b2540e0137c6c41eb59bb22811de362ac3a30 100644 (file)
@@ -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);
index 824477921d97e8cb7fdd780103be4e4610900df9..64b0309f60be9f2c2cee52de4f16a83037f86344 100644 (file)
@@ -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;
 }
 
index d41a649ddcf078f847cc40528b57d162451cd03a..134c477a9a531031a96817998d47d8fd3789a11f 100644 (file)
@@ -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();
-    
+
 };
 
 //-----------------------------------------------------------------------------
index c7a1ed9b5a7d276e37b039068de543a36028bf7b..085310436078d9cc0046efbaed2add8d7be9c60b 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_bmp.h"
 #endif
 
 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("")));
 }
 
index 984234d2105fec7f2503954ed19b7373972e0be2..321b36c0b5667af63501b6a448e8cacd1a84d28c 100644 (file)
@@ -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;
 }
 
index 5ed5ee88db3dfd3f2cb4f39582fd2e97e0ac1778..0733bd6f6f25d23d4a313d6af9bdaf5fcd5333d2 100644 (file)
@@ -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;
 }
 
index 29ab1b9b94e0d0dbd02cfe9e0523d38a57f5cb1f..bc7df4efbc0910d3ef602d9fb8e415d76383a03f 100644 (file)
@@ -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;
 }
 
index c7a0e824b64828e34a7f622863d74979d89f8ffb..242a33645be34a04f9b261231d2c5a11a27e3911 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_chckb.h"
 #endif
 
 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;
 }
 
index 522612a2644ac9871155c53a935c279e2ae31084..0dde7f6759578afa0ab82057d43adc0f210bab5a 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_chckl.h"
 #endif
 
 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;
     }
index 15f7c6a77cecc5161bf373bb60105bbd2cd826cf..9b3c33d34e2da62cd58e7c930342d375ed36dcb8 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_choic.h"
 #endif
 
 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 <item>Label</item>
-        
+
         // add to the list
         wxString str = GetNodeContent(m_node);
         if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
index 03fa009eb4923ca3c4bb45b09eb6bf281f4e6cb5..ffde9361980cd7b5ac52983d87d5fc39771cd163 100644 (file)
@@ -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;
     }
index 0fefbf70e6439886926de709856c8ce66d77e34d..7a93c46dc947ba7bab635b0729f93097ee6b9c16 100644 (file)
@@ -70,7 +70,7 @@ wxObject *wxDialogXmlHandler::DoCreateResource()
 
     CreateChildren(dlg);
 
-    if (GetBool(wxT("centered"), FALSE))
+    if (GetBool(wxT("centered"), false))
         dlg->Centre();
 
     return dlg;
index 520b265ca6c878d84d1adcc0a02c53a904e2da2b..795bb43af90bc45c8beddf9f02c2988e9a5f2237 100644 (file)
@@ -75,7 +75,7 @@ wxObject *wxFrameXmlHandler::DoCreateResource()
 
     CreateChildren(frame);
 
-    if (GetBool(wxT("centered"), FALSE))
+    if (GetBool(wxT("centered"), false))
         frame->Centre();
 
     return frame;
index 852f7bbd654afa35e4650505b4116e7a6f05df9f..2f3dad0c44076d5515ba27ebc6722ece16c3c512 100644 (file)
@@ -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,
index 7106b598cfe26cb0e63f935124567035c9be2164..5a8226ebb7c640170c9bc83dabfcb4651fed3ede 100644 (file)
@@ -41,7 +41,7 @@ wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
 wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource()
 {
     XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl)
+
     ctrl->Create(m_parentAsWindow,
                  GetID(),
                  GetText(wxT("defaultfolder")),
index 8fe80d2082160ddb0bb17d10f9236e8466f8aa5e..156370d27ab92ac634fb0f32f904c0159d16996e 100644 (file)
@@ -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;
 }
 
index 68caf3c1b8df06862ec0050240728625cfe8bab8..c0a41a91eb9bb4d7ce30deac2a586f2e2f9919a5 100644 (file)
@@ -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 <item>Label</item>
-        
+
         // add to the list
         wxString str = GetNodeContent(m_node);
         if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
index f133a894f7cfede9cbd0df61b72005beb17493da..f6c9eab2c29e257815132122d8b3fe2912961c18 100644 (file)
@@ -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;
 }
 
index 5df0d5f8d5f779f47feffcd6b7097b285838fde6..dbe2a89e6132d85f186ed75a6fe44d86415d32b8 100644 (file)
@@ -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")))
index 27d6a5ee400975003bc7a61dfb324982f48ef65e..e97598a22515d8c6d91d472c6945940e2bb4fdb3 100644 (file)
@@ -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;
index b4b4c82810db9bfc0f4b6be3d6d46a866462825a..4083dce1d2c78e60e330913d6811cfad57e779fd 100644 (file)
@@ -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;
 }
 
index 85339923931c7d5c8e42ac44e8133bdba386d867..01c5ece4f0dc487dacee7585c982225e405a6bd6 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_radbt.h"
 #endif
 
 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;
 }
 
index 0bff4dda51b134eabe0cc98880e1cf87003888a0..5b950e2e93a777e9202bdd6610ea84e958c4304b 100644 (file)
@@ -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;
     }
index ac99ba1b40046321b7c8c67e821b1b11e49e5321..f1c6fcba19d446772e6b988d8f8ca164819c604c 100644 (file)
@@ -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;
 }
 
index 2ac6d4face3cda2a41cfc4f62ef9c8fc617892f7..275bafed6433295e402d898eba79fd8e77e3f7ff 100644 (file)
@@ -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;
 }
 
index 2e3f3e49083bedd973ef99f151c0d46c91edc06f..1163ab619fc190e1ce9285a3bd8290e5aa247180 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_sizer.h"
 #endif
 
 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);
 }
-   
+
 
 
 
index 10e16450ccadf28ac2a59d0f4bf152484a06c803..e71a5fd41a506ace13cdb00d705141ae3fa128b2 100644 (file)
@@ -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;
 }
 
index 5748e7443a169cdf010e66ceb9b5a9ef8d16ef76..c6ad0fcf92b06e50422ac18aa8a3a6d63ede5fa1 100644 (file)
@@ -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;
 }
 
index 2eef0d3ac4d400199458852b0883df3259370101..5deff63190cdb3c5cae923da775001c6e2d7296e 100644 (file)
@@ -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();
     }
index 04eb5096df7c3228b36d60b1d082f97e2f8fb707..2674322938d16a01ba1a9728aac5ea8db3624cf6 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_stbmp.h"
 #endif
 
 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;
 }
 
index cc357908c9b6843cf7b6d7d0df79dda60a56975b..9a88572d5be1296b0415e4bd04b70987463a9da2 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright:   (c) 2000 Brian Gavin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_stbox.h"
 #endif
 
 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;
 }
 
index 7cc5abc08bbae0bd7c48a8fad59b7e076289374e..9d49226eab0fc327dc1730c710f8d16bc8831f93 100644 (file)
@@ -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;
 }
 
index e94e9fdbd254f0a89f3eae2fdeb315cd2ac1e1ed..a65e2b4b4fdcba43b14f6c4637ecb89586f785b3 100644 (file)
@@ -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;
 }
 
index 3e89a272ced29e6342a07953c1058ac534f56749..19bbd601c8501150a3fa8db74d4013a5a354af95 100644 (file)
@@ -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;
 }
 
index 9bc524dc34c25f5751f34bfd583e146c5b39174b..7e44ab77a1eecf220db81f878576e1e616570785 100644 (file)
@@ -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 /*<object class="wxToolBar">*/
     {
         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"))));
 }
 
index f3ee4c65a687b7a4d03e9aeaba2c27446fdff358..a0b32fd6adaea2c0182218fc54f3465fbc169242 100644 (file)
@@ -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;
 }
 
index cad645b68b10634d0332f95642f8602ffc75c978..d8b615cf6e880f0217e61583b7c70631f79f445b 100644 (file)
@@ -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);
index e8cb35444837814b969f75022f50d04ff207a803..aff151cede7c7932bc58a99ea318bf792ab71026 100644 (file)
@@ -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")))
index 4d6b486ad6d1d7cea64d1b73f0b620cabbd330e2..e392d946e2a31debdaeb1c5b83dfa972a5e05418 100644 (file)
@@ -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()
     {
index 0b180c5cbfac1fb8f79ea99d3a1f5782db956e24..5c26749d931e8eb32ec8335d21e97c06f44ac3bd 100644 (file)
@@ -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
index ea2c0ffe9c49ec6d12a7d15eaf125024e0d55599..6c284c6dbc7800d6b515b67a43a99b1ee927ad0c 100644 (file)
@@ -36,7 +36,7 @@
 class XRCWidgetData
 {
 public:
-    XRCWidgetData(const wxString& vname,const wxString& vclass) 
+    XRCWidgetData(const wxString& vname,const wxString& vclass)
         : m_class(vclass), m_name(vname)  {}
     const wxString& GetName() const { return m_name; }
     const wxString& GetClass() const { return m_class; }
@@ -50,16 +50,16 @@ WX_DEFINE_OBJARRAY(ArrayOfXRCWidgetData);
 
 class XRCWndClassData
 {
-private: 
+private:
     wxString m_className;
     wxString m_parentClassName;
     ArrayOfXRCWidgetData m_wdata;
-    
+
     void BrowseXmlNode(wxXmlNode* node)
     {
         wxString classValue;
         wxString nameValue;
-        wxXmlNode* children;    
+        wxXmlNode* children;
         while (node)
         {
             if (node->GetName() == _T("object")
@@ -70,19 +70,19 @@ private:
             }
             children = node->GetChildren();
             if (children)
-                    BrowseXmlNode(children);    
+                    BrowseXmlNode(children);
             node = node->GetNext();
         }
     }
-    
+
 public:
     XRCWndClassData(const wxString& className,const wxString& parentClassName, const wxXmlNode* node) :
-        m_className(className) , m_parentClassName(parentClassName) { 
-                        
+        m_className(className) , m_parentClassName(parentClassName) {
+
         BrowseXmlNode(node->GetChildren());
-                
+
     }
-                
+
     const ArrayOfXRCWidgetData& GetWidgetData(){
         return m_wdata;
     }
@@ -99,26 +99,26 @@ public:
         }
         file.Write(_T("\nprivate:\n void InitWidgetsFromXRC(){\n")
                    _T("  wxXmlResource::Get()->LoadObject(this,NULL,\"")
-                   +  m_className 
+                   +  m_className
                    +  _T("\",\"")
-                   +  m_parentClassName 
-                   +  _T("\");\n"));       
+                   +  m_parentClassName
+                   +  _T("\");\n"));
         for(i=0;i<m_wdata.Count();++i){
             const XRCWidgetData& w = m_wdata.Item(i);
-            file.Write( _T("  ") 
-                        + w.GetName() 
+            file.Write( _T("  ")
+                        + w.GetName()
                         + _T(" = XRCCTRL(*this,\"")
-                        + w.GetName() 
+                        + w.GetName()
                         + _T("\",")
                         + w.GetClass()
                         + _T(");\n")
                 );
         }
 file.Write(_T(" }\n"));
-        
+
 file.Write(
         _T("public:\n")
-        + m_className 
+        + m_className
         + _T("::")
         + m_className
         + _T("(){\n")
@@ -135,10 +135,10 @@ class XmlResApp : public wxAppConsole
 {
 public:
     // don't use builtin cmd line parsing:
-    virtual bool OnInit() { return true; } 
+    virtual bool OnInit() { return true; }
     virtual int OnRun();
-    
-private:   
+
+private:
     void ParseParams(const wxCmdLineParser& cmdline);
     void CompileRes();
     wxArrayString PrepareTempFiles();
@@ -153,7 +153,7 @@ private:
     void OutputGettext();
     wxArrayString FindStrings();
     wxArrayString FindStrings(wxXmlNode *node);
-            
+
     bool flagVerbose, flagCPP, flagPython, flagGettext;
     wxString parOutput, parFuncname, parOutputPath;
     wxArrayString parFiles;
@@ -170,7 +170,7 @@ int XmlResApp::OnRun()
 {
     static const wxCmdLineEntryDesc cmdLineDesc[] =
     {
-        { wxCMD_LINE_SWITCH, _T("h"), _T("help"),  _T("show help message"), 
+        { wxCMD_LINE_SWITCH, _T("h"), _T("help"),  _T("show help message"),
               wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
         { wxCMD_LINE_SWITCH, _T("v"), _T("verbose"), _T("be verbose") },
         { wxCMD_LINE_SWITCH, _T("e"), _T("extra-cpp-code"),  _T("output C++ header file with XRC derived classes") },
@@ -183,7 +183,7 @@ int XmlResApp::OnRun()
         { wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers",  _T("output list of neccessary handlers to this file" },
 #endif
         { wxCMD_LINE_PARAM,  NULL, NULL, _T("input file(s)"),
-              wxCMD_LINE_VAL_STRING, 
+              wxCMD_LINE_VAL_STRING,
               wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
 
         { wxCMD_LINE_NONE }
@@ -235,7 +235,7 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
     flagH = flagCPP && cmdline.Found(_T("e"));
 
 
-    if (!cmdline.Found(_T("o"), &parOutput)) 
+    if (!cmdline.Found(_T("o"), &parOutput))
     {
         if (flagGettext)
             parOutput = wxEmptyString;
@@ -258,7 +258,7 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
     }
     if (!parOutputPath) parOutputPath = _T(".");
 
-    if (!cmdline.Found(_T("n"), &parFuncname)) 
+    if (!cmdline.Found(_T("n"), &parFuncname))
         parFuncname = _T("InitXmlResource");
 
     for (size_t i = 0; i < cmdline.GetParamCount(); i++)
@@ -286,7 +286,7 @@ void XmlResApp::CompileRes()
     wxRemoveFile(parOutput);
 
     if (!retCode)
-    {        
+    {
         if (flagCPP){
             MakePackageCPP(files);
             if (flagH)
@@ -297,7 +297,7 @@ void XmlResApp::CompileRes()
         else
             MakePackageZIP(files);
     }
-        
+
     DeleteTempFiles(files);
 }
 
@@ -310,11 +310,11 @@ wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayStrin
     name2.Replace(_T("\\"), _T("_"));
     name2.Replace(_T("*"), _T("_"));
     name2.Replace(_T("?"), _T("_"));
-    
+
     wxString s = wxFileNameFromPath(parOutput) + _T("$") + name2;
 
     if (wxFileExists(s) && flist.Index(s) == wxNOT_FOUND)
-    {        
+    {
         for (int i = 0;; i++)
         {
             s.Printf(wxFileNameFromPath(parOutput) + _T("$%03i-") + name2, i);
@@ -328,21 +328,21 @@ wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayStrin
 wxArrayString XmlResApp::PrepareTempFiles()
 {
     wxArrayString flist;
-    
+
     for (size_t i = 0; i < parFiles.Count(); i++)
     {
-        if (flagVerbose) 
+        if (flagVerbose)
             wxPrintf(_T("processing ") + parFiles[i] +  _T("...\n"));
 
         wxXmlDocument doc;
-        
+
         if (!doc.Load(parFiles[i]))
         {
             wxLogError(_T("Error parsing file ") + parFiles[i]);
             retCode = 1;
             continue;
         }
-        
+
         wxString name, ext, path;
         wxSplitPath(parFiles[i], &path, &name, &ext);
 
@@ -364,11 +364,11 @@ wxArrayString XmlResApp::PrepareTempFiles()
             }
         }
         wxString internalName = GetInternalFileName(parFiles[i], flist);
-        
+
         doc.Save(parOutputPath + wxFILE_SEP_PATH + internalName);
         flist.Add(internalName);
     }
-    
+
     return flist;
 }
 
@@ -378,30 +378,30 @@ static bool NodeContainsFilename(wxXmlNode *node)
 {
    // Any bitmaps:
    if (node->GetName() == _T("bitmap"))
-       return TRUE;
+       return true;
 
    // URLs in wxHtmlWindow:
    if (node->GetName() == _T("url"))
-       return TRUE;
-   
+       return true;
+
    // wxBitmapButton:
    wxXmlNode *parent = node->GetParent();
-   if (parent != NULL && 
+   if (parent != NULL &&
        parent->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
-       (node->GetName() == _T("focus") || 
+       (node->GetName() == _T("focus") ||
         node->GetName() == _T("disabled") ||
         node->GetName() == _T("selected")))
-       return TRUE;
-   
+       return true;
+
    // wxBitmap or wxIcon toplevel resources:
    if (node->GetName() == _T("object"))
    {
        wxString klass = node->GetPropVal(_T("class"), wxEmptyString);
        if (klass == _T("wxBitmap") || klass == _T("wxIcon"))
-           return TRUE;
+           return true;
    }
-   
-   return FALSE;
+
+   return false;
 }
 
 // find all files mentioned in structure, e.g. <bitmap>filename</bitmap>
@@ -417,7 +417,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
     while (n)
     {
         if (containsFilename &&
-            (n->GetType() == wxXML_TEXT_NODE || 
+            (n->GetType() == wxXML_TEXT_NODE ||
              n->GetType() == wxXML_CDATA_SECTION_NODE))
         {
             wxString fullname;
@@ -426,7 +426,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
             else
                 fullname = inputPath + wxFILE_SEP_PATH + n->GetContent();
 
-            if (flagVerbose) 
+            if (flagVerbose)
                 wxPrintf(_T("adding     ") + fullname +  _T("...\n"));
 
             wxString filename = GetInternalFileName(n->GetContent(), flist);
@@ -461,19 +461,19 @@ void XmlResApp::DeleteTempFiles(const wxArrayString& flist)
 void XmlResApp::MakePackageZIP(const wxArrayString& flist)
 {
     wxString files;
-    
+
     for (size_t i = 0; i < flist.Count(); i++)
         files += flist[i] + _T(" ");
     files.RemoveLast();
-    
-    if (flagVerbose) 
+
+    if (flagVerbose)
         wxPrintf(_T("compressing ") + parOutput +  _T("...\n"));
-    
+
     wxString cwd = wxGetCwd();
     wxSetWorkingDirectory(parOutputPath);
-    int execres = wxExecute(_T("zip -9 -j ") + 
-                            wxString(flagVerbose ? _T("") : _T("-q ")) + 
-                            parOutput + _T(" ") + files, TRUE);
+    int execres = wxExecute(_T("zip -9 -j ") +
+                            wxString(flagVerbose ? _T("") : _T("-q ")) +
+                            parOutput + _T(" ") + files, true);
     wxSetWorkingDirectory(cwd);
     if (execres == -1)
     {
@@ -493,16 +493,16 @@ static wxString FileToCppArray(wxString filename, int num)
     wxString snum;
     wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
-    
+
     snum.Printf(_T("%i"), num);
     output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng);
     output += _T("static unsigned char xml_res_file_") + snum + _T("[] = {\n");
     // we cannot use string literals because MSVC is dumb wannabe compiler
     // with arbitrary limitation to 2048 strings :(
-    
+
     unsigned char *buffer = new unsigned char[lng];
     file.Read(buffer, lng);
-    
+
     for (size_t i = 0, linelng = 0; i < lng; i++)
     {
         tmp.Printf(_T("%i"), buffer[i]);
@@ -515,11 +515,11 @@ static wxString FileToCppArray(wxString filename, int num)
         output << tmp;
         linelng += tmp.Length()+1;
     }
-    
+
     delete[] buffer;
-    
+
     output += _T("};\n\n");
-    
+
     return output;
 }
 
@@ -529,9 +529,9 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
     wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
-    if (flagVerbose) 
+    if (flagVerbose)
         wxPrintf(_T("creating C++ source file ") + parOutput +  _T("...\n"));
-    
+
     file.Write(_T("")
 _T("//\n")
 _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
@@ -555,7 +555,7 @@ _T("\n"));
     for (i = 0; i < flist.Count(); i++)
         file.Write(
               FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
-    
+
     file.Write(_T("")
 _T("void ") + parFuncname + wxT("()\n")
 _T("{\n")
@@ -584,7 +584,7 @@ _T("\n"));
         file.Write(_T("    wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
                    GetInternalFileName(parFiles[i], flist) + _T("\"));\n"));
     }
-    
+
     file.Write(_T("}\n"));
 
 
@@ -594,7 +594,7 @@ void XmlResApp::GenCPPHeader()
 {
     wxString fileSpec = (parOutput.BeforeLast('.')).AfterLast('/');
     wxString heaFileName = fileSpec + _T(".h");
-        
+
     wxFFile file(heaFileName, wxT("wt"));
     file.Write(
 _T("//\n")
@@ -602,10 +602,10 @@ _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
 _T("//\n\n")
 _T("#ifndef __")  + fileSpec + _T("_h__\n")
 _T("#define __")  + fileSpec + _T("_h__\n")
-);      
+);
     for(size_t i=0;i<aXRCWndClassData.Count();++i){
-                aXRCWndClassData.Item(i).GenerateHeaderCode(file);              
-    } 
+                aXRCWndClassData.Item(i).GenerateHeaderCode(file);
+    }
     file.Write(
                 _T("\nvoid \n")
                 + parFuncname
@@ -619,13 +619,13 @@ static wxString FileToPythonArray(wxString filename, int num)
     wxString snum;
     wxFFile file(filename, wxT("rb"));
     size_t lng = file.Length();
-    
+
     snum.Printf(_T("%i"), num);
     output = _T("    xml_res_file_") + snum + _T(" = \"\"\"\\\n");
-    
+
     unsigned char *buffer = new unsigned char[lng];
     file.Read(buffer, lng);
-    
+
     for (size_t i = 0, linelng = 0; i < lng; i++)
     {
         unsigned char c = buffer[i];
@@ -648,11 +648,11 @@ static wxString FileToPythonArray(wxString filename, int num)
         output << tmp;
         linelng += tmp.Length();
     }
-    
+
     delete[] buffer;
-    
+
     output += _T("\"\"\"\n\n");
-    
+
     return output;
 }
 
@@ -662,9 +662,9 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
     wxFFile file(parOutput, wxT("wt"));
     size_t i;
 
-    if (flagVerbose) 
+    if (flagVerbose)
         wxPrintf(_T("creating Python source file ") + parOutput +  _T("...\n"));
-    
+
     file.Write(
        _T("#\n")
        _T("# This file was automatically generated by wxrc, do not edit by hand.\n")
@@ -673,7 +673,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
        _T("from wxPython.xrc import *\n\n")
     );
 
-    
+
     file.Write(_T("def ") + parFuncname + _T("():\n"));
 
     for (i = 0; i < flist.Count(); i++)
@@ -693,16 +693,16 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
 void XmlResApp::OutputGettext()
 {
     wxArrayString str = FindStrings();
-    
+
     wxFFile fout;
     if (parOutput.empty())
         fout.Attach(stdout);
     else
         fout.Open(parOutput, wxT("wt"));
-    
+
     for (size_t i = 0; i < str.GetCount(); i++)
         fout.Write(_T("_(\"") + str[i] + _T("\");\n"));
-    
+
     if (!parOutput) fout.Detach();
 }
 
@@ -714,10 +714,10 @@ wxArrayString XmlResApp::FindStrings()
 
     for (size_t i = 0; i < parFiles.Count(); i++)
     {
-        if (flagVerbose) 
+        if (flagVerbose)
             wxPrintf(_T("processing ") + parFiles[i] +  _T("...\n"));
 
-        wxXmlDocument doc;        
+        wxXmlDocument doc;
         if (!doc.Load(parFiles[i]))
         {
             wxLogError(_T("Error parsing file ") + parFiles[i]);
@@ -727,7 +727,7 @@ wxArrayString XmlResApp::FindStrings()
         a2 = FindStrings(doc.GetRoot());
         WX_APPEND_ARRAY(arr, a2);
     }
-    
+
     return arr;
 }
 
@@ -747,7 +747,7 @@ static wxString ConvertText(const wxString& str)
             else
                 str2 << wxT('&') << *dt;
         }
-        else 
+        else
         {
             switch (*dt)
             {
@@ -759,7 +759,7 @@ static wxString ConvertText(const wxString& str)
                                      (*(dt+1) != 'r'))
                                      str2 << wxT("\\\\");
                                  else
-                                     str2 << wxT("\\");    
+                                     str2 << wxT("\\");
                                  break;
                 case wxT('"')  : str2 << wxT("\\\""); break;
                 default        : str2 << *dt; break;
@@ -778,12 +778,12 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
     wxXmlNode *n = node;
     if (n == NULL) return arr;
     n = n->GetChildren();
-    
+
     while (n)
     {
         if ((node->GetType() == wxXML_ELEMENT_NODE) &&
             // parent is an element, i.e. has subnodes...
-            (n->GetType() == wxXML_TEXT_NODE || 
+            (n->GetType() == wxXML_TEXT_NODE ||
             n->GetType() == wxXML_CDATA_SECTION_NODE) &&
             // ...it is textnode...
             (
@@ -801,14 +801,14 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
         {
             arr.Add(ConvertText(n->GetContent()));
         }
-        
+
         // subnodes:
         if (n->GetType() == wxXML_ELEMENT_NODE)
         {
             wxArrayString a2 = FindStrings(n);
             WX_APPEND_ARRAY(arr, a2);
         }
-        
+
         n = n->GetNext();
     }
     return arr;