]> git.saurik.com Git - wxWidgets.git/commitdiff
Finally whole configtool works regardless of wxUSE_STL value (at least with Borland...
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 27 Jul 2004 19:14:36 +0000 (19:14 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 27 Jul 2004 19:14:36 +0000 (19:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

23 files changed:
utils/configtool/src/appsettings.cpp
utils/configtool/src/configbrowser.cpp
utils/configtool/src/configbrowser.h
utils/configtool/src/configitem.cpp
utils/configtool/src/configitemselector.cpp
utils/configtool/src/configitemselector.h
utils/configtool/src/configtooldoc.cpp
utils/configtool/src/configtoolview.cpp
utils/configtool/src/configtree.cpp
utils/configtool/src/custompropertydialog.cpp
utils/configtool/src/custompropertydialog.h
utils/configtool/src/htmlparser.cpp
utils/configtool/src/mainframe.cpp
utils/configtool/src/mainframe.h
utils/configtool/src/propeditor.cpp
utils/configtool/src/propeditor.h
utils/configtool/src/property.cpp
utils/configtool/src/settingsdialog.cpp
utils/configtool/src/settingsdialog.h
utils/configtool/src/symbols.h
utils/configtool/src/utils.cpp
utils/configtool/src/utils.h
utils/configtool/src/wxconfigtool.cpp

index 56af6008d090612280527fd639854518767a31a2..22b5571acc467d15e312feaabb0ac0cce67a8d06 100644 (file)
 #pragma implementation "appsettings.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
 
-#include "wx/wfstream.h"
 #include "wx/datstrm.h"
-#include "wx/config.h"
-#include "wx/fileconf.h"
 #include "wx/dir.h"
-#include "wx/valgen.h"
 #include "wx/colordlg.h"
 #include "wx/wxhtml.h"
 #include "wx/effects.h"
 #include "wx/spinctrl.h"
 #include "wx/tooltip.h"
 
+#endif
+
+#include "wx/wfstream.h"
+#include "wx/config.h"
+#include "wx/fileconf.h"
+#include "wx/valgen.h"
 #include "utils.h"
 #include "wxconfigtool.h"
 #include "appsettings.h"
index 0eee4d5fa07de35f96d95f0644622340aaa03ea0..b82261ca0ee8321eaf33e8b679de54e6c9fe84a6 100644 (file)
@@ -1,19 +1,28 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        configbrowser.cpp
-// Purpose:     
-// Author:      
+// Purpose:     Configuration browser
+// Author:      Julian Smart
 // Modified by: 
-// Created:     
-// RCS-ID:      
-// Copyright:   
+// Created:     2003-08-14
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
 // Licence:     
 /////////////////////////////////////////////////////////////////////////////
 
-////@begin includes
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+
 #include "wx/wx.h"
 #include "wx/splitter.h"
 #include "wx/treectrl.h"
-////@end includes
+
+#endif
 
 #include "configbrowser.h"
 
index 08c108931f6d99eb1f5edbbd8942fa0a8c01dea0..f7e0e9a40c822f0dbe7da2b8067f3047cca443a7 100644 (file)
@@ -1,11 +1,11 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        configbrowser.h
-// Purpose:     
-// Author:      
+// Purpose:     Configuration browser
+// Author:      Julian Smart
 // Modified by: 
-// Created:     
-// RCS-ID:      
-// Copyright:   
+// Created:     2003-08-14
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
 // Licence:     
 /////////////////////////////////////////////////////////////////////////////
 
@@ -88,7 +88,7 @@ class ctConfigurationBrowserControlPanel: public wxPanel
 
 public:
     /// Constructor
-    ctConfigurationBrowserControlPanel( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL );
+    ctConfigurationBrowserControlPanel( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL );
 
     /// Creates the controls and sizers
     void CreateControls();
index c19655aeb7bba5b4edc2360a7e96ed6d196ea5a8..fdf4ceac4f2841e661d45f0f33c018acf813c35d 100644 (file)
 #pragma implementation "configitem.h"
 #endif
 
-// Includes other headers for precompiled compilation
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
 #include "wx/tokenzr.h"
-
 #include "configitem.h"
 #include "configtree.h"
 #include "configtooldoc.h"
@@ -439,12 +438,14 @@ void ctConfigItem::Attach(ctConfigItem* parent, ctConfigItem* insertBefore)
     if (parent)
     {
         SetParent(parent);
-        wxObjectList::compatibility_iterator node = (wxObjectList::compatibility_iterator)NULL;
         if (insertBefore)
-            node = parent->GetChildren().Member(insertBefore);
-
-        if (node)
-            parent->GetChildren().Insert(node, this);
+        {
+            wxObjectList::compatibility_iterator node = parent->GetChildren().Member(insertBefore);
+            if (node)
+                parent->GetChildren().Insert(node, this);
+            else
+                parent->GetChildren().Append(this);
+        }
         else
             parent->GetChildren().Append(this);
     }
index 111a66c7a0d7466b70d84a575e926c30d83470bb..6b01692a7b282b91c7dfd05a1a3dce600ecf2d58 100644 (file)
 #pragma implementation "configitemselector.h"
 #endif
 
+// For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-    #pragma hdrstop
+#pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
-    #include "wx/wx.h"
-#endif
 
-#include <wx/cshelp.h>
-#include <wx/statline.h>
-#include <wx/splitter.h>
-#include <wx/scrolwin.h>
-#include <wx/spinctrl.h>
-#include <wx/spinbutt.h>
-#include <wx/valgen.h>
-#include <wx/notebook.h>
+#include "wx/statline.h"
+#include "wx/splitter.h"
+#include "wx/scrolwin.h"
+#include "wx/spinctrl.h"
+#include "wx/spinbutt.h"
+
+#endif
 
+#include "wx/cshelp.h"
+#include "wx/notebook.h"
+#include "wx/valgen.h"
 #include "configitemselector.h"
 #include "configtooldoc.h"
 #include "configtoolview.h"
@@ -71,9 +72,9 @@ END_EVENT_TABLE()
  * ctConfigItemsSelector constructor
  */
 
-ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
+ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, const wxString& caption)
 {
-    wxDialog::Create( parent, id, caption, pos, size, style );
+    wxDialog::Create( parent, id, caption);
 
     CreateControls();
     InitSourceConfigList();
@@ -251,7 +252,7 @@ void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item)
         masterList->Append(item->GetName());
     }
 
-    wxNode* node = item->GetChildren().GetFirst();
+    wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst();
     while (node)
     {
         ctConfigItem* child = (ctConfigItem*) node->GetData();
index c19a3af1a1173f831824f1d7ee4feabee4bf628e..80d9950f1bdacda5bbd5bc0be6ac1cb2393b0891 100644 (file)
@@ -52,7 +52,7 @@ class ctConfigItemsSelector: public wxDialog
 {    
 public:
     /// Constructor
-    ctConfigItemsSelector( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Configuration Items Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    ctConfigItemsSelector( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Configuration Items Selector"));
 
     /// Creates the controls and sizers
     void CreateControls();
index 6e7a2762717f6afd63e2faf4bb58b401cd8ab200..122bd5926a5e96496c01521ae427ea3769e073fa 100644 (file)
 #pragma implementation "configtooldoc.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/config.h"
-#include "wx/textfile.h"
+#ifndef WX_PRECOMP
+
 #include "wx/process.h"
 #include "wx/mimetype.h"
 #include "wx/process.h"
-#include "wx/wfstream.h"
 
-#ifdef __BORLANDC__
-#pragma hdrstop
 #endif
 
+#include "wx/textfile.h"
+#include "wx/wfstream.h"
+#include "wx/config.h"
 #include "configtooldoc.h"
 #include "configtoolview.h"
 #include "configtree.h"
@@ -324,7 +325,7 @@ bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int ind
         stream << wxT("<enabled>0</enabled>");
 
     // Output properties
-    wxNode* node = item->GetProperties().GetList().GetFirst();
+    wxObjectList::compatibility_iterator node = item->GetProperties().GetList().GetFirst();
     while (node)
     {
         ctProperty* prop = (ctProperty*) node->GetData();
@@ -551,7 +552,7 @@ void ctConfigToolDoc::ClearDependencies(ctConfigItem* item)
         item = GetTopItem();
 
     item->GetDependents().Clear();
-    for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfigItem* child = (ctConfigItem*) node->GetData();
         ClearDependencies(child);
@@ -616,7 +617,7 @@ void ctConfigToolDoc::RefreshDependencies(ctConfigItem* item)
             otherItem->GetDependents().Append(item);
         }
     }
-    for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfigItem* child = (ctConfigItem*) node->GetData();
         RefreshDependencies(child);
@@ -665,7 +666,7 @@ void ctConfigToolDoc::GenerateSetup(ctConfigItem* item, wxString& str)
         }
     }
 
-    for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfigItem* child = (ctConfigItem*) node->GetData();
         GenerateSetup(child, str);
@@ -695,7 +696,7 @@ wxString ctConfigToolDoc::GenerateConfigureCommand()
     ctConfigItem* platformsFolder = GetTopItem()->FindItem(wxT("Target"));
     if (platformsFolder)
     {
-        for ( wxNode* node = platformsFolder->GetChildren().GetFirst(); node; node = node->GetNext() )
+        for ( wxObjectList::compatibility_iterator node = platformsFolder->GetChildren().GetFirst(); node; node = node->GetNext() )
         {
             ctConfigItem* child = (ctConfigItem*) node->GetData();
             if (child->GetType() == ctTypeBoolRadio && child->IsEnabled())
@@ -769,7 +770,7 @@ void ctConfigToolDoc::GenerateConfigureCommand(ctConfigItem* item, wxString& str
         }
     }
 
-    for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfigItem* child = (ctConfigItem*) node->GetData();
         GenerateConfigureCommand(child, str);
@@ -784,7 +785,8 @@ wxString ctConfigToolDoc::GetFrameworkDir(bool makeUnix)
     {
         // Should probably allow other variables
         // to be used, and maybe expand variables within m_frameworkDir
-        path = wxGetenv(wxT("WXWIN"));
+        wxString pathEnv(wxGetenv(wxT("WXWIN")));
+        path = pathEnv;
 #ifdef __WXMSW__
         if (makeUnix)
             path.Replace(wxT("\\"), wxT("/"));
@@ -828,7 +830,7 @@ ctConfigItem* ctConfigToolDoc::FindNextSibling(ctConfigItem* item)
 {
     if (item->GetParent())
     {
-        wxNode* node = item->GetParent()->GetChildren().Member(item);
+        wxObjectList::compatibility_iterator node = item->GetParent()->GetChildren().Member(item);
         if (node && node->GetNext())
         {
             ctConfigItem* nextItem = (ctConfigItem*) node->GetNext()->GetData();
@@ -1010,7 +1012,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
 
                 // Apply only those that need applying
                 // (those properties in activeState that are not in propsTemp)
-                wxNode* node = m_activeState->GetProperties().GetList().GetFirst();
+                wxObjectList::compatibility_iterator node = m_activeState->GetProperties().GetList().GetFirst();
                 while (node)
                 {
                     ctProperty* prop = (ctProperty*) node->GetData();
@@ -1088,10 +1090,10 @@ void ctConfiguration::operator= (const ctConfiguration& configuration)
 /// Clear children
 void ctConfiguration::Clear()
 {
-    wxNode* node = m_children.GetFirst();
+    wxObjectList::compatibility_iterator node = m_children.GetFirst();
     while (node)
     {
-        wxNode* next = node->GetNext();
+        wxObjectList::compatibility_iterator next = node->GetNext();
         ctConfiguration* child = (ctConfiguration*) node->GetData();
 
         // This should delete 'node' too, assuming
@@ -1153,7 +1155,7 @@ ctConfiguration* ctConfiguration::FindConfiguration(const wxString& name)
     if (GetName() == name)
         return this;
 
-    for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfiguration* child = (ctConfiguration*) node->GetData();
         ctConfiguration* found = child->FindConfiguration(name);
@@ -1168,7 +1170,7 @@ ctConfiguration* ctConfiguration::FindNextSibling()
 {
     if (!GetParent())
         return NULL;
-    wxNode* node = GetParent()->GetChildren().Member(this);
+    wxObjectList::compatibility_iterator node = GetParent()->GetChildren().Member(this);
     if (node && node->GetNext())
     {
         return (ctConfiguration*) node->GetNext()->GetData();
@@ -1181,7 +1183,7 @@ ctConfiguration* ctConfiguration::FindPreviousSibling()
 {
     if (!GetParent())
         return NULL;
-    wxNode* node = GetParent()->GetChildren().Member(this);
+    wxObjectList::compatibility_iterator node = GetParent()->GetChildren().Member(this);
     if (node && node->GetPrevious())
     {
         return (ctConfiguration*) node->GetPrevious()->GetData();
@@ -1194,7 +1196,7 @@ ctConfiguration* ctConfiguration::DeepClone()
 {
     ctConfiguration* newItem = Clone();
 
-    for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() )
+    for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() )
     {
         ctConfiguration* child = (ctConfiguration*) node->GetData();
         ctConfiguration* newChild = child->DeepClone();
index 726e509bf4b23b1ecc020d3b253ba16d135bae29..4d1760e81b099b97533ff640654d7892c88b94f4 100644 (file)
     #pragma implementation "configtoolview.h"
 #endif
 
-// Includes other headers for precompiled compilation
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-    #pragma hdrstop
+#pragma hdrstop
 #endif
 
 #include "wx/wfstream.h"
-
 #include "configtoolview.h"
 #include "configtooldoc.h"
 #include "configtree.h"
index 942457bbbe40429bbb6dc316e3a27e543155c228..7623146bb8f508853208b4ea42475a1e86a3a6d4 100644 (file)
 #pragma implementation "configtree.h"
 #endif
 
-// Includes other headers for precompiled compilation
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/imaglist.h"
 #include "wx/cshelp.h"
+#include "wx/imaglist.h"
 
 // Include XPM icons
 #include "bitmaps/closedfolder.xpm"
index b002d67ced62c41618d24de213a0f4dc41c40769..1791d0865a9c6367c087757f7446a30b66ef5802 100644 (file)
 #pragma implementation "custompropertydialog.h"
 #endif
 
-#include <wx/wx.h>
-#include <wx/cshelp.h>
-#include <wx/statline.h>
-#include <wx/splitter.h>
-#include <wx/scrolwin.h>
-#include <wx/spinctrl.h>
-#include <wx/spinbutt.h>
-#include <wx/valgen.h>
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+
+#include "wx/wx.h"
+#include "wx/statline.h"
+#include "wx/splitter.h"
+#include "wx/scrolwin.h"
+#include "wx/spinctrl.h"
+#include "wx/spinbutt.h"
+
+#endif
+
+#include "wx/cshelp.h"
+#include "wx/valgen.h"
 #include "custompropertydialog.h"
 
 ////@begin XPM images
@@ -56,11 +67,11 @@ END_EVENT_TABLE()
  * ctCustomPropertyDialog constructor
  */
 
-ctCustomPropertyDialog::ctCustomPropertyDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
+ctCustomPropertyDialog::ctCustomPropertyDialog( wxWindow* parent, wxWindowID id, const wxString& caption)
 {
     m_type = wxT("string");
 
-    wxDialog::Create( parent, id, caption, pos, size, style );
+    wxDialog::Create( parent, id, caption);
 
     CreateControls();
 }
@@ -73,6 +84,8 @@ void ctCustomPropertyDialog::CreateControls()
 {
 ////@begin ctCustomPropertyDialog content construction
 
+    wxArrayString items;
+
     ctCustomPropertyDialog* item1 = this;
 
     wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
@@ -87,8 +100,8 @@ void ctCustomPropertyDialog::CreateControls()
     wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0);
     item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
 
-    wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-    item3->Add(item6, 0, wxGROW|wxALL, 5);
+    m_customPropertyName = new wxTextCtrl(item1, wxID_ANY);
+    item3->Add(m_customPropertyName, 0, wxGROW|wxALL, 5);
 
     wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL);
     item3->Add(item7, 0, wxGROW, 5);
@@ -99,15 +112,14 @@ void ctCustomPropertyDialog::CreateControls()
     wxStaticText* item9 = new wxStaticText(item1, wxID_STATIC, _("&Data type:"), wxDefaultPosition, wxDefaultSize, 0);
     item8->Add(item9, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
 
-    wxString item10Strings[] = {
-        _("string"),
-        _("bool"),
-        _("double"),
-        _("long")
-    };
-    wxChoice* item10 = new wxChoice(item1, ID_CUSTOMPROPERTYTYPE, wxDefaultPosition, wxDefaultSize, 4, item10Strings, 0);
-    item10->SetStringSelection(_("string"));
-    item8->Add(item10, 1, wxGROW|wxALL, 5);
+    items.Empty();
+    items.Add(_("string"));
+    items.Add(_("bool"));
+    items.Add(_("double"));
+    items.Add(_("long"));
+    m_customPrototype = new wxChoice(item1, wxID_ANY, wxDefaultPosition, wxDefaultSize, items);
+    m_customPrototype->SetStringSelection(_("string"));
+    item8->Add(m_customPrototype, 1, wxGROW|wxALL, 5);
 
     wxBoxSizer* item11 = new wxBoxSizer(wxVERTICAL);
     item7->Add(item11, 0, wxALIGN_CENTER_VERTICAL, 5);
@@ -115,25 +127,24 @@ void ctCustomPropertyDialog::CreateControls()
     wxStaticText* item12 = new wxStaticText(item1, wxID_STATIC, _("&Editor type:"), wxDefaultPosition, wxDefaultSize, 0);
     item11->Add(item12, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
 
-    wxString item13Strings[] = {
-        _("string"),
-        _("choice"),
-        _("bool"),
-        _("float"),
-        _("integer"),
-        _("configitems")
-    };
-    wxChoice* item13 = new wxChoice(item1, ID_CUSTOMPROPERTYEDITORTYPE, wxDefaultPosition, wxDefaultSize, 6, item13Strings, 0);
-    item13->SetStringSelection(_("string"));
-    item11->Add(item13, 1, wxGROW|wxALL, 5);
+    items.Empty();
+    items.Add(_("string"));
+    items.Add(_("choice"));
+    items.Add(_("bool"));
+    items.Add(_("float"));
+    items.Add(_("integer"));
+    items.Add(_("configitems"));
+    m_customPropertyEditorType = new wxChoice(item1, wxID_ANY, wxDefaultPosition, wxDefaultSize, items);
+    m_customPropertyEditorType->SetStringSelection(_("string"));
+    item11->Add(m_customPropertyEditorType, 1, wxGROW|wxALL, 5);
 
     wxStaticBox* item14Static = new wxStaticBox(item1, wxID_ANY, _("Choices"));
     wxStaticBoxSizer* item14 = new wxStaticBoxSizer(item14Static, wxHORIZONTAL);
     item3->Add(item14, 0, wxGROW|wxALL, 5);
 
     wxString* item15Strings = NULL;
-    wxListBox* item15 = new wxListBox(item1, ID_PROPERTY_CHOICES, wxDefaultPosition, wxDefaultSize, 0, item15Strings, wxLB_SINGLE);
-    item14->Add(item15, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    m_propertyChoices = new wxListBox(item1, ID_PROPERTY_CHOICES, wxDefaultPosition, wxDefaultSize, 0, item15Strings, wxLB_SINGLE);
+    item14->Add(m_propertyChoices, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
 
     wxBoxSizer* item16 = new wxBoxSizer(wxVERTICAL);
     item14->Add(item16, 0, wxALIGN_CENTER_VERTICAL, 5);
@@ -147,8 +158,8 @@ void ctCustomPropertyDialog::CreateControls()
     wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0);
     item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
 
-    wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
-    item3->Add(item20, 1, wxGROW|wxALL, 5);
+    m_customPropertyDescription = new wxTextCtrl(item1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
+    item3->Add(m_customPropertyDescription, 1, wxGROW|wxALL, 5);
 
     wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);
     item3->Add(item21, 0, wxGROW|wxALL, 5);
@@ -170,10 +181,10 @@ void ctCustomPropertyDialog::CreateControls()
 ////@end ctCustomPropertyDialog content construction
 
     // Add validators
-    FindWindow(ID_CUSTOMPROPERTYNAME)->SetValidator(wxGenericValidator(& m_name));
-    FindWindow(ID_CUSTOMPROPERTYTYPE)->SetValidator(wxGenericValidator(& m_type));
-    FindWindow(ID_CUSTOMPROPERTYEDITORTYPE)->SetValidator(wxGenericValidator(& m_editorType));
-    FindWindow(ID_CUSTOMPROPERTYDESCRIPTION)->SetValidator(wxGenericValidator(& m_description));
+    m_customPropertyName->SetValidator(wxGenericValidator(& m_name));
+    m_customPrototype->SetValidator(wxGenericValidator(& m_type));
+    m_customPropertyEditorType->SetValidator(wxGenericValidator(& m_editorType));
+    m_customPropertyDescription->SetValidator(wxGenericValidator(& m_description));
 }
 
 /*!
@@ -191,8 +202,8 @@ bool ctCustomPropertyDialog::ShowToolTips()
 
 void ctCustomPropertyDialog::OnUpdatePropertyChoices( wxUpdateUIEvent& event )
 {
-    wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYTYPE);
-    event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") );
+    if(m_customPrototype)
+        event.Enable( m_customPrototype->GetSelection() > -1 && m_customPrototype->GetStringSelection() == wxT("choice") );
 }
 
 /*!
@@ -201,15 +212,16 @@ void ctCustomPropertyDialog::OnUpdatePropertyChoices( wxUpdateUIEvent& event )
 
 void ctCustomPropertyDialog::OnPropertyChoiceAdd( wxCommandEvent& WXUNUSED(event) )
 {
-    wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYTYPE);
-    if ( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") )
+    if(m_customPrototype)
     {
-        wxString str = wxGetTextFromUser(_T("New choice"), _("Add choice"));
-        if (!str.IsEmpty())
+        if ( m_customPropertyEditorType->GetSelection() > -1 && m_customPropertyEditorType->GetStringSelection() == wxT("choice") )
         {
-            wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES);
-            listBox->Append(str);
-            m_choices.Add(str);
+            wxString str = wxGetTextFromUser(_T("New choice"), _("Add choice"));
+            if (!str.IsEmpty() && m_propertyChoices)
+            {
+                m_propertyChoices->Append(str);
+                m_choices.Add(str);
+            }
         }
     }
 }
@@ -220,8 +232,9 @@ void ctCustomPropertyDialog::OnPropertyChoiceAdd( wxCommandEvent& WXUNUSED(event
 
 void ctCustomPropertyDialog::OnUpdatePropertyChoiceAdd( wxUpdateUIEvent& event )
 {
-    wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYEDITORTYPE);
-    event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") );
+    if(m_customPropertyEditorType)
+        event.Enable( m_customPropertyEditorType->GetSelection() > -1 && 
+                      m_customPropertyEditorType->GetStringSelection() == wxT("choice") );
 }
 
 /*!
@@ -230,12 +243,10 @@ void ctCustomPropertyDialog::OnUpdatePropertyChoiceAdd( wxUpdateUIEvent& event )
 
 void ctCustomPropertyDialog::OnPropertyChoiceRemove( wxCommandEvent& WXUNUSED(event) )
 {
-    /* wxChoice* choice = (wxChoice* ) */ FindWindow(ID_CUSTOMPROPERTYEDITORTYPE);
-    wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES);
-    if (listBox->GetSelection() > -1)
+    if (m_propertyChoices && m_propertyChoices->GetSelection() > -1)
     {
-        listBox->Delete(listBox->GetSelection());
-        m_choices.RemoveAt(listBox->GetSelection());
+        m_propertyChoices->Delete(m_propertyChoices->GetSelection());
+        m_choices.RemoveAt(m_propertyChoices->GetSelection());
     }
 }
 
@@ -245,16 +256,16 @@ void ctCustomPropertyDialog::OnPropertyChoiceRemove( wxCommandEvent& WXUNUSED(ev
 
 void ctCustomPropertyDialog::OnUpdatePropertyChoiceRemove( wxUpdateUIEvent& event )
 {
-    wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYEDITORTYPE);
-    wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES);
-    event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") &&
-                  listBox->GetSelection() > -1 );
+    if (m_customPropertyEditorType && m_propertyChoices)
+        event.Enable( m_customPropertyEditorType->GetSelection() > -1 && 
+                      m_customPropertyEditorType->GetStringSelection() == wxT("choice") &&
+                      m_propertyChoices->GetSelection() > -1 );
 }
 
 void ctCustomPropertyDialog::SetChoices(const wxArrayString& choices)
 {
-    wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES);
     size_t i, len = choices.GetCount();
-    for (i = 0; i < len; i++)
-        listBox->Append(m_choices[i]);
+    if (m_propertyChoices)
+        for (i = 0; i < len; i++)
+            m_propertyChoices->Append(m_choices[i]);
 }
index a756d11fc1fd0930ce018b3f4673107bc747766e..fdde07a57d029f9f76fa49f44f7e27d6c7d262a0 100644 (file)
 
 ////@begin control identifiers
 #define ID_CUSTOMPROPERTYDIALOG 10000
-#define ID_CUSTOMPROPERTYNAME 10003
-#define ID_CUSTOMPROPERTYTYPE 10002
-#define ID_CUSTOMPROPERTYEDITORTYPE 10008
 #define ID_PROPERTY_CHOICES 10001
 #define ID_PROPERTY_CHOICE_ADD 10005
 #define ID_PROPERTY_CHOICE_REMOVE 10006
-#define ID_CUSTOMPROPERTYDESCRIPTION 10004
 ////@end control identifiers
 
 /*!
@@ -53,7 +49,7 @@ class ctCustomPropertyDialog: public wxDialog
 {    
 public:
     /// Constructor
-    ctCustomPropertyDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Edit Custom Property"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    ctCustomPropertyDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Edit Custom Property"));
 
     /// Creates the controls and sizers
     void CreateControls();
@@ -102,11 +98,19 @@ public:
     DECLARE_CLASS( ctCustomPropertyDialog )
     DECLARE_EVENT_TABLE()
 
-    wxString    m_name;
-    wxString    m_type;
-    wxString    m_description;
-    wxString    m_editorType;
+protected:
+    wxString      m_name;
+    wxString      m_type;
+    wxString      m_description;
+    wxString      m_editorType;
     wxArrayString m_choices;
+
+    // Dialog controls
+    wxTextCtrl*   m_customPropertyName;
+    wxTextCtrl*   m_customPropertyDescription;
+    wxChoice*     m_customPrototype;
+    wxChoice*     m_customPropertyEditorType;
+    wxListBox*    m_propertyChoices;
 };
 
 #endif
index 9eba43650b2b61aadc9261e60721d413b3b7aaf5..5e24db20b09c719efa4f3e6c500c3b4fa28d0722 100644 (file)
     #pragma implementation "htmlparser.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/textfile.h"
 #include "wx/wfstream.h"
+#include "wx/textfile.h"
 #include "wx/txtstrm.h"
-
-#include <ctype.h>
-
 #include "htmlparser.h"
 
 /// Useful insertion operators for wxOutputStream.
index 4d5177ae38e8e81e2054e31d18298c3bbee39b88..9926786257c3c0623838c375e242caa8aa33a748 100644 (file)
 #pragma implementation "mainframe.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
+#ifndef WX_PRECOMP
+
+#include "wx/splitter.h"
+
+#endif
+
+#include "wx/cshelp.h"
 #include "wx/html/htmlwin.h"
 #include "wx/notebook.h"
-#include "wx/splitter.h"
-#include "wx/clipbrd.h"
 #include "wx/dataobj.h"
-#include "wx/cshelp.h"
-
+#include "wx/clipbrd.h"
 #include "wxconfigtool.h"
 #include "mainframe.h"
 #include "appsettings.h"
index a80dce014cd68792213c5e7a50d10e6333167f3f..f809d477e163a9ea55f68d1987a9be470484861d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "wx/imaglist.h"
 #include "wx/docview.h"
+#include "wx/notebook.h"
 
 // #define USE_CONFIG_BROWSER_PAGE
 
index b7b05fb696c74c9bcedc249d873286cdc025c60a..27e3e34600e5d3f6c83279e7671c0f98c91d2aa1 100644 (file)
 #pragma implementation "propeditor.h"
 #endif
 
-#include <wx/wx.h>
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/html/htmlwin.h"
+#ifndef WX_PRECOMP
+
 #include "wx/grid.h"
 #include "wx/filedlg.h"
+
+#endif
+
+#include "wx/html/htmlwin.h"
 #include "wx/tokenzr.h"
 #include "wx/valgen.h"
-
 #include "propeditor.h"
 #include "symbols.h"
 #include "utils.h"
 #include "configtooldoc.h"
 #include "configitemselector.h"
+
 #include "bitmaps/ellipsis.xpm"
 
 
@@ -75,8 +81,8 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
     wxTextCtrl *item2 = m_elementTitleTextCtrl;
     item1->Add( item2, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    wxButton *item3a = new wxButton( parent, ctID_ATTRIBUTE_EDITOR_EDIT_DETAILS, wxT("Edit..."));
-    item1->Add( item3a, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 );
+    m_attributeEditorEditDetails = new wxButton( parent, ctID_ATTRIBUTE_EDITOR_EDIT_DETAILS, wxT("Edit..."));
+    item1->Add( m_attributeEditorEditDetails, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 );
 
     item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
 
@@ -103,9 +109,9 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
 
     /// Add help text
     m_elementTitleTextCtrl->SetHelpText(_("The title of the property being edited."));
-    FindWindow(ctID_ATTRIBUTE_EDITOR_EDIT_DETAILS)->SetHelpText(_("Click to use an appropriate editor for the selected property (if any)."));
-    FindWindow(ctID_ATTRIBUTE_EDITOR_GRID)->SetHelpText(_("Shows the properties of the selected item."));
-    FindWindow(ctID_ATTRIBUTE_EDITOR_DESCRIPTION)->SetHelpText(_("Shows a description of the selected property, or a summary of the whole item."));
+    m_attributeEditorEditDetails->SetHelpText(_("Click to use an appropriate editor for the selected property (if any)."));
+    m_attributeEditorGrid->SetHelpText(_("Shows the properties of the selected item."));
+    m_propertyDescriptionWindow->SetHelpText(_("Shows a description of the selected property, or a summary of the whole item."));
 
     /// Set up the grid to display properties
     m_attributeEditorGrid->RegisterDataType(ctGRID_VALUE_STRING,
@@ -205,7 +211,7 @@ void ctPropertyEditor::ShowItem(ctConfigItem* item)
 
         m_attributeEditorGrid->AppendRows(m_item->GetProperties().GetCount());
 
-        wxNode* node = m_item->GetProperties().GetList().GetFirst();
+        wxObjectList::compatibility_iterator node = m_item->GetProperties().GetList().GetFirst();
         int i = 0;
         while (node)
         {
@@ -255,7 +261,7 @@ void ctPropertyEditor::UpdateItem()
     {
         UpdateTitle();
 
-        wxNode* node = m_item->GetProperties().GetList().GetFirst();
+        wxObjectList::compatibility_iterator node = m_item->GetProperties().GetList().GetFirst();
         int i = 0;
         while (node)
         {
@@ -808,7 +814,6 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
     item4->Add( 5, 5, 1, wxALIGN_CENTRE|wxALL, 5 );
 
     wxButton *item5 = new wxButton( parent, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
-    item5->SetDefault();
     item4->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
 
     wxButton *item6 = new wxButton( parent, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -823,7 +828,7 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
 
 
     item3->SetFocus();
-    ((wxButton*) FindWindow(wxID_OK))->SetDefault();
+    item5->SetDefault();
 
     parent->SetSizer(item0);
     item0->Fit(parent);
index ae9f9fab736b6adb3ff9be1ee84a5cfb6c7a06aa..4ebf1f4dd8a548b452066073454adbc736415fa5 100644 (file)
@@ -139,6 +139,8 @@ class ctPropertyEditor: public wxPanel
 DECLARE_EVENT_TABLE()
 
 protected:
+    // Dialog controls
+    wxButton*               m_attributeEditorEditDetails;
     ctPropertyEditorGrid*   m_attributeEditorGrid;
     wxHtmlWindow*           m_propertyDescriptionWindow;
     wxSplitterWindow*       m_splitterWindow;
index 5682362b4f1b1c1a8b33e6e1e5bd2aa21d6f1e10..4200ed6beab0e1dd0b3d1f24e747790c6af18ca3 100644 (file)
 #pragma implementation "property.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
 
 #include "property.h"
 
@@ -27,19 +32,23 @@ void ctProperties::AddProperty(ctProperty* property, const wxString& insertAfter
     if (oldProp)
         m_list.DeleteObject(oldProp);
 
-    wxNode* insertBeforeNode = NULL;
     if (insertAfter)
     {
         ctProperty* insertAfterProp = FindProperty(insertAfter);
         if (insertAfterProp)
         {
-            wxNode* node = m_list.Member(insertAfterProp);
+            wxObjectList::compatibility_iterator node = m_list.Member(insertAfterProp);
             if (node)
-                insertBeforeNode = node->GetNext();
+            {
+                wxObjectList::compatibility_iterator insertBeforeNode = node->GetNext();
+                m_list.Insert(insertBeforeNode, property);
+            }
+            else
+                m_list.Append(property);
         }
+        else
+            m_list.Append(property);
     }
-    if (insertBeforeNode)
-        m_list.Insert(insertBeforeNode, property);
     else
         m_list.Append(property);
 
@@ -68,7 +77,7 @@ void ctProperties::DeleteProperty(const wxString& name)
 
 ctProperty* ctProperties::FindProperty(const wxString& name) const
 {
-    wxNode* node = m_list.GetFirst();
+    wxObjectList::compatibility_iterator node = m_list.GetFirst();
     while (node)
     {
         ctProperty* prop = (ctProperty*) node->GetData();
@@ -111,14 +120,12 @@ ctProperty* ctProperties::FindOrCreateProperty(const wxString& name)
 
 void ctProperties::Clear()
 {
-    m_list.DeleteContents(true);
-    m_list.Clear();
-    m_list.DeleteContents(false);
+    WX_CLEAR_LIST(wxObjectList,m_list);
 }
 
 void ctProperties::Copy(const ctProperties& properties)
 {
-    wxNode* node = properties.m_list.GetFirst();
+    wxObjectList::compatibility_iterator node = properties.m_list.GetFirst();
     while (node)
     {
         ctProperty* prop = (ctProperty*) node->GetData();
@@ -158,7 +165,7 @@ ctProperty* ctProperties::GetNth(int i) const
     wxASSERT( i < (int) GetCount() );
     if (i < (int) GetCount())
     {
-        wxNode* node = m_list.Item(i);
+        wxObjectList::compatibility_iterator node = m_list.Item(i);
         return (ctProperty*) node->GetData();
     }
     return NULL;
index 2739518a7d3a941fa92bb864b353a7d824c4dd69..a01dc52bd9662834315bc3c49e5af4a892ca3e7d 100644 (file)
@@ -1,28 +1,38 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        settingsdialog.cpp
-// Purpose:     
-// Author:      
-// Modified by: 
-// Created:     
-// RCS-ID:      
-// Copyright:   
-// Licence:     
+// Purpose:     Settings dialog
+// Author:      Julian Smart
+// Modified by:
+// Created:     2003-06-12
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "settingsdialog.h"
 #endif
 
-#include "wx/wx.h"
-#include "wx/cshelp.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+
 #include "wx/statline.h"
 #include "wx/splitter.h"
 #include "wx/scrolwin.h"
 #include "wx/spinctrl.h"
 #include "wx/spinbutt.h"
-#include "wx/valgen.h"
-#include "wx/notebook.h"
 
+#endif
+
+#include "wx/cshelp.h"
+#include "wx/notebook.h"
+#include "wx/valgen.h"
 #include "wxconfigtool.h"
 #include "settingsdialog.h"
 
@@ -56,11 +66,10 @@ END_EVENT_TABLE()
  * ctSettingsDialog constructor
  */
 
-ctSettingsDialog::ctSettingsDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
+ctSettingsDialog::ctSettingsDialog( wxWindow* parent )
 {
     SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY);
-    wxDialog::Create( parent, id, caption, pos, size, style );
-
+    wxDialog::Create( parent, wxID_ANY, _("Configuration Settings"));
     CreateControls();
 }
 
@@ -77,12 +86,12 @@ void ctSettingsDialog::CreateControls()
     wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
     item1->SetSizer(item2);
 
-    wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
-    ctGeneralSettingsDialog* item4 = new ctGeneralSettingsDialog(item3, ID_GENERAL_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);
-    item3->AddPage(item4, _("General"));
-    ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(item3, ID_LOCATION_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);
-    item3->AddPage(item11, _("Locations"));
-    item2->Add(item3, 0, wxGROW|wxALL, 5);
+    m_notebook = new wxNotebook(item1, wxID_ANY, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
+    ctGeneralSettingsDialog* item4 = new ctGeneralSettingsDialog(m_notebook, ID_GENERAL_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);
+    m_notebook->AddPage(item4, _("General"));
+    ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(m_notebook, ID_LOCATION_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);
+    m_notebook->AddPage(item11, _("Locations"));
+    item2->Add(m_notebook, 0, wxGROW|wxALL, 5);
 
     wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);
     item2->Add(item21, 0, wxGROW|wxALL, 5);
@@ -136,27 +145,28 @@ void ctSettingsDialog::OnCancel( wxCommandEvent& event )
 
 void ctSettingsDialog::OnHelp( wxCommandEvent& WXUNUSED(event) )
 {
-    wxNotebook* notebook = (wxNotebook*) FindWindow(ID_NOTEBOOK);
-
-    int sel = notebook->GetSelection();
-
-    wxASSERT_MSG( (sel != -1), wxT("A notebook tab should always be selected."));
-
-    wxWindow* page = (wxWindow*) notebook->GetPage(sel);
-
-    wxString helpTopic;
-    if (page->GetId() == ID_GENERAL_SETTINGS_DIALOG)
+    if(m_notebook)
     {
-        helpTopic = wxT("General settings dialog");
-    }
-    else if (page->GetId() == ID_LOCATION_SETTINGS_DIALOG)
-    {
-        helpTopic = wxT("Location settings dialog");
-    }
-
-    if (!helpTopic.IsEmpty())
-    {
-        wxGetApp().GetHelpController().DisplaySection(helpTopic);
+        int sel = m_notebook->GetSelection();
+
+        wxASSERT_MSG( (sel != -1), wxT("A notebook tab should always be selected."));
+
+        wxWindow* page = (wxWindow*) m_notebook->GetPage(sel);
+
+        wxString helpTopic;
+        if (page->GetId() == ID_GENERAL_SETTINGS_DIALOG)
+        {
+            helpTopic = wxT("General settings dialog");
+        }
+        else if (page->GetId() == ID_LOCATION_SETTINGS_DIALOG)
+        {
+            helpTopic = wxT("Location settings dialog");
+        }
+
+        if (!helpTopic.IsEmpty())
+        {
+            wxGetApp().GetHelpController().DisplaySection(helpTopic);
+        }
     }
 }
 
@@ -251,9 +261,9 @@ void ctGeneralSettingsDialog::CreateControls()
     GetSizer()->Fit(this);
 ////@end ctGeneralSettingsDialog content construction
 
-    FindWindow(ID_LOAD_LAST_DOCUMENT)->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_loadLastDocument));
-    FindWindow(ID_SHOW_TOOLTIPS)->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_useToolTips));
-    FindWindow(ID_DEFAULT_FILE_KIND)->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_defaultFileKind));
+    item7->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_loadLastDocument));
+    item8->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_useToolTips));
+    item10->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_defaultFileKind));
 }
 
 /*!
@@ -321,13 +331,13 @@ void ctLocationSettingsDialog::CreateControls()
     wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
     item13->Add(item15, 0, wxGROW, 5);
 
-    wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, wxEmptyString, wxDefaultPosition, wxSize(200, wxDefaultCoord), 0);
-    item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
+    m_wxWinHierarchy = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, wxEmptyString, wxDefaultPosition, wxSize(200, wxDefaultCoord), 0);
+    m_wxWinHierarchy->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
 #if wxUSE_TOOLTIPS
     if (ShowToolTips())
-        item16->SetToolTip(_("Enter the root path of the wxWidgets hierarchy"));
+        m_wxWinHierarchy->SetToolTip(_("Enter the root path of the wxWidgets hierarchy"));
 #endif
-    item15->Add(item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    item15->Add(m_wxWinHierarchy, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
 
     wxButton* item17 = new wxButton(item11, ID_CHOOSE_WXWIN_HIERARCHY, _("&Choose..."), wxDefaultPosition, wxDefaultSize, 0);
     item17->SetHelpText(_("Click to choose the root path of the wxWidgets hierarchy\\n"));
@@ -342,20 +352,20 @@ void ctLocationSettingsDialog::CreateControls()
 
     item18->Add(60, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
 
-    wxCheckBox* item20 = new wxCheckBox(item11, ID_USE_WXWIN, _("&Use WXWIN environment variable"), wxDefaultPosition, wxDefaultSize, 0);
-    item20->SetValue(false);
-    item20->SetHelpText(_("Check to use the value of WXWIN instead"));
+    m_wxWinUse = new wxCheckBox(item11, ID_USE_WXWIN, _("&Use WXWIN environment variable"));
+    m_wxWinUse->SetValue(false);
+    m_wxWinUse->SetHelpText(_("Check to use the value of WXWIN instead"));
 #if wxUSE_TOOLTIPS
     if (ShowToolTips())
-        item20->SetToolTip(_("Check to use the value of WXWIN instead"));
+        m_wxWinUse->SetToolTip(_("Check to use the value of WXWIN instead"));
 #endif
-    item18->Add(item20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+    item18->Add(m_wxWinUse, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
 
     GetSizer()->Fit(this);
 ////@end ctLocationSettingsDialog content construction
 
-    FindWindow(ID_WXWIN_HIERARCHY)->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_frameworkDir));
-    FindWindow(ID_USE_WXWIN)->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_useEnvironmentVariable));
+    m_wxWinHierarchy->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_frameworkDir));
+    m_wxWinUse->SetValidator(wxGenericValidator(& wxGetApp().GetSettings().m_useEnvironmentVariable));
 }
 
 /*!
@@ -364,8 +374,8 @@ void ctLocationSettingsDialog::CreateControls()
 
 void ctLocationSettingsDialog::OnUpdateWxwinHierarchy( wxUpdateUIEvent& event )
 {
-    wxCheckBox* checkbox = (wxCheckBox*) FindWindow(ID_USE_WXWIN);
-    event.Enable(!checkbox->GetValue());
+    if(m_wxWinUse)
+        event.Enable(!m_wxWinUse->GetValue());
 }
 
 /*!
@@ -374,15 +384,16 @@ void ctLocationSettingsDialog::OnUpdateWxwinHierarchy( wxUpdateUIEvent& event )
 
 void ctLocationSettingsDialog::OnChooseWxwinHierarchy( wxCommandEvent& WXUNUSED(event) )
 {
-    wxTextCtrl* textCtrl = (wxTextCtrl*) FindWindow( ID_WXWIN_HIERARCHY );
-    wxASSERT( textCtrl != NULL );
-    wxString defaultPath = textCtrl->GetValue();
-
-    wxDirDialog dialog(this, _("Choose the location of the wxWidgets hierarchy"),
-            defaultPath);
-    if (dialog.ShowModal() == wxID_OK)
+    if (m_wxWinHierarchy)
     {
-        textCtrl->SetValue(dialog.GetPath());
+        wxString defaultPath = m_wxWinHierarchy->GetValue();
+
+        wxDirDialog dialog(this, _("Choose the location of the wxWidgets hierarchy"),
+                defaultPath);
+        if (dialog.ShowModal() == wxID_OK)
+        {
+            m_wxWinHierarchy->SetValue(dialog.GetPath());
+        }
     }
 }
 
@@ -392,8 +403,8 @@ void ctLocationSettingsDialog::OnChooseWxwinHierarchy( wxCommandEvent& WXUNUSED(
 
 void ctLocationSettingsDialog::OnUpdateChooseWxwinHierarchy( wxUpdateUIEvent& event )
 {
-    wxCheckBox* checkbox = (wxCheckBox*) FindWindow(ID_USE_WXWIN);
-    event.Enable(!checkbox->GetValue());
+    if (m_wxWinUse)
+        event.Enable(!m_wxWinUse->GetValue());
 }
 
 /*!
index a58b0645f390540c589e5724c53ace5fb0c09ae5..4005476a8a80249932314c0160929749f9a8574a 100644 (file)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        settingsdialog.h
-// Purpose:     
-// Author:      
-// Modified by: 
-// Created:     
-// RCS-ID:      
-// Copyright:   
-// Licence:     
+// Purpose:     Settings dialog
+// Author:      Julian Smart
+// Modified by:
+// Created:     2002-09-04
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _SETTINGSDIALOG_H_
@@ -57,11 +57,7 @@ class ctSettingsDialog: public wxDialog
 {    
 public:
     /// Constructor
-    ctSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY,
-        const wxString& caption = _("Configuration Settings"),
-        const wxPoint& pos = wxDefaultPosition,
-        const wxSize& size = wxDefaultSize,
-        long style = wxCAPTION|wxSYSTEM_MENU );
+    ctSettingsDialog( wxWindow* parent );
 
     /// Creates the controls and sizers
     void CreateControls();
@@ -88,6 +84,11 @@ public:
 
     DECLARE_CLASS( ctSettingsDialog )
     DECLARE_EVENT_TABLE()
+
+protected:
+
+    // Dialog controls.
+    wxNotebook* m_notebook;
 };
 
 /*!
@@ -153,6 +154,12 @@ public:
 
     DECLARE_CLASS( ctLocationSettingsDialog )
     DECLARE_EVENT_TABLE()
+
+protected:
+
+    // Dialog controls.
+    wxTextCtrl* m_wxWinHierarchy;
+    wxCheckBox* m_wxWinUse;
 };
 
 #endif
index 3f8cd3194bc787309f9f07d1a77644b8268ba67f..596b9e29f2d19a1498d2ecad0293a3ba5d2155d1 100644 (file)
@@ -1,9 +1,9 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        symbols.h
 // Purpose:     Application symbols file
-// Author:      
+// Author:      Julian Smart
 // Modified by:
-// Created:     
+// Created:     2003-06-12
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:
index f4d192038936a96181fc87f101b0d8f76d12490a..78d6aca247ac19fd7ff9955c38d993f366c66005 100644 (file)
 // #pragma implementation
 #endif
 
-#include "wx/wx.h"
-#include "wx/image.h"
-#include "wx/notebook.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#include <math.h>
+
+#ifndef WX_PRECOMP
+
 #include "wx/splitter.h"
-#include "wx/wfstream.h"
 #include "wx/datstrm.h"
 #include "wx/file.h"
 #include "wx/listctrl.h"
-#include "wx/tokenzr.h"
 #include "wx/process.h"
-#include "wx/mimetype.h"
 #include "wx/variant.h"
-#include "wx/cshelp.h"
 #include "wx/cmdline.h"
-#include "wx/imaglist.h"
 
-#include <math.h>
-
-#ifdef __WXMSW__
-#include <windows.h>
-#include "wx/msw/winundef.h"
 #endif
 
+#include "wx/wfstream.h"
+#include "wx/cshelp.h"
+#include "wx/image.h"
+#include "wx/imaglist.h"
+#include "wx/tokenzr.h"
+#include "wx/notebook.h"
+#include "wx/mimetype.h"
 #include "utils.h"
 
 // Returns the image type, or -1, determined from the extension.
@@ -218,10 +223,12 @@ wxString wxGetTempDir()
 #if defined(__WXMAC__) && !defined(__DARWIN__)
     dir = wxMacFindFolder(  (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
 #else // !Mac
-    dir = wxGetenv(_T("TMP"));
+    wxString dirEnv(wxGetenv(_T("TMP")));
+    dir = dirEnv;
     if ( dir.empty() )
     {
-        dir = wxGetenv(_T("TEMP"));
+        wxString envVar(wxGetenv(_T("TEMP")));
+        dir = envVar;
     }
     
     if ( dir.empty() )
@@ -269,14 +276,12 @@ bool apInvokeAppForFile(const wxString& filename)
 
 wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxString& appVariableName)
 {
-    wxString str;
-
     // Try appVariableName
     if (!appVariableName.IsEmpty())
     {
-        str = wxGetenv(appVariableName);
-        if (!str.IsEmpty())
-            return str;
+        wxString strVar(wxGetenv(appVariableName.c_str()));
+        if (!strVar.IsEmpty())
+            return strVar;
     }
 
     if (wxIsAbsolutePath(argv0))
@@ -288,9 +293,9 @@ wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin
         if (currentDir.Last() != wxFILE_SEP_PATH)
             currentDir += wxFILE_SEP_PATH;
 
-        str = currentDir + argv0;
-        if (wxFileExists(str))
-            return wxPathOnly(str);
+        currentDir += argv0;
+        if (wxFileExists(currentDir))
+            return wxPathOnly(currentDir);
     }
 
     // OK, it's neither an absolute path nor a relative path.
@@ -298,9 +303,9 @@ wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin
 
     wxPathList pathList;
     pathList.AddEnvList(wxT("PATH"));
-    str = pathList.FindAbsoluteValidPath(argv0);
-    if (!str.IsEmpty())
-        return wxPathOnly(str);
+    wxString strPath = pathList.FindAbsoluteValidPath(argv0);
+    if (!strPath.IsEmpty())
+        return wxPathOnly(strPath);
 
     // Failed
     return wxEmptyString;
@@ -408,7 +413,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId)
 wxIconTable::wxIconTable(wxImageList* imageList)
 {
     m_imageList = imageList;
-    DeleteContents(true);
+    WX_CLEAR_LIST(wxIconTable,*this);
 }
 
 void wxIconTable::AppendInfo(wxIconInfo* info)
@@ -434,7 +439,7 @@ bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, b
 
 wxIconInfo* wxIconTable::FindInfo(const wxString& name) const
 {
-    wxNode* node = GetFirst();
+    wxObjectList::compatibility_iterator node = GetFirst();
     while (node)
     {
         wxIconInfo* info = (wxIconInfo*) node->GetData();
index 8402525c309de030dbccc9669b7410caab6e87de..1fbc6866ef4cca4d22d50fe92b70d6992270b513 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _AP_UTILS_H_
 #define _AP_UTILS_H_
 
+#include "wx/imaglist.h"
+
 #ifndef DOXYGEN_SKIP
 
 /*!
index e65386b853718426f3e3ee5ba83e43b103169b80..509039926c946ad109f6e6a16400db740adf7a5b 100644 (file)
 #pragma implementation "wxconfigtool.h"
 #endif
 
-#include "wx/wx.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/config.h"
+#ifndef WX_PRECOMP
+
 #include "wx/laywin.h"
-#include "wx/image.h"
 #include "wx/menuitem.h"
 #include "wx/tooltip.h"
+#include "wx/variant.h"
+
+#endif
+
 #include "wx/cshelp.h"
 #include "wx/helphtml.h"
 #include "wx/html/htmprint.h"
 #include "wx/html/htmlwin.h"
+#include "wx/image.h"
 #include "wx/filesys.h"
 #include "wx/fs_mem.h"
 #include "wx/fs_zip.h"
 #include "wx/wfstream.h"
-#include "wx/variant.h"
-
+#include "wx/config.h"
 #include "wxconfigtool.h"
 #include "configtooldoc.h"
 #include "configtoolview.h"
@@ -58,6 +63,7 @@ ctApp::~ctApp()
 
 bool ctApp::OnInit(void)
 {
+
 #if wxUSE_LOG
     wxLog::SetTimestamp(NULL);
 #endif // wxUSE_LOG
@@ -92,7 +98,9 @@ bool ctApp::OnInit(void)
     wxString currentDir = wxGetCwd();
 
     // Use argv to get current app directory
-    m_appDir = apFindAppPath(argv[0], currentDir, wxT("WXCONFIGTOOLDIR"));
+    wxString argv0(argv[0]);
+    wxString appVariableName(wxT("WXCONFIGTOOLDIR"));
+    m_appDir = apFindAppPath(argv0, currentDir, appVariableName);
 
 #ifdef __WXMSW__
     // If the development version, go up a directory.