]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/configtool/src/configtoolview.cpp
Use native printing dialog for wxPrintDialog,
[wxWidgets.git] / utils / configtool / src / configtoolview.cpp
index 726e509bf4b23b1ecc020d3b253ba16d135bae29..6cd42bc8faded61c77c8956f031b553554919e66 100644 (file)
     #pragma implementation "configtoolview.h"
 #endif
 
     #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__
 
 #ifdef __BORLANDC__
-    #pragma hdrstop
+#pragma hdrstop
 #endif
 
 #include "wx/wfstream.h"
 #endif
 
 #include "wx/wfstream.h"
-
 #include "configtoolview.h"
 #include "configtooldoc.h"
 #include "configtree.h"
 #include "configtoolview.h"
 #include "configtooldoc.h"
 #include "configtree.h"
@@ -96,10 +95,6 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView)
 
 END_EVENT_TABLE()
 
 
 END_EVENT_TABLE()
 
-ctConfigToolView::ctConfigToolView()
-{
-}
-
 // What to do when a view is created. Creates actual
 // windows for displaying the view.
 bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
 // What to do when a view is created. Creates actual
 // windows for displaying the view.
 bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@ -122,11 +117,11 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
     ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
     if (!treeCtrl)
         return;
     ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
     if (!treeCtrl)
         return;
-    
+
     wxASSERT (doc != NULL);
     wxASSERT (doc != NULL);
-    
+
     ctConfigItem* selItem = NULL;
     ctConfigItem* selItem = NULL;
-    
+
     wxTreeItemId sel = treeCtrl->GetSelection();
     if (sel.IsOk())
     {
     wxTreeItemId sel = treeCtrl->GetSelection();
     if (sel.IsOk())
     {
@@ -134,12 +129,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
         if (data)
             selItem = data->GetConfigItem() ;
     }
         if (data)
             selItem = data->GetConfigItem() ;
     }
-    
+
     ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
     int hintOp = ctNoHint;
     if (hint)
         hintOp = hint->m_op;
     ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
     int hintOp = ctNoHint;
     if (hint)
         hintOp = hint->m_op;
-    
+
     switch (hintOp)
     {
     case ctInitialUpdate:
     switch (hintOp)
     {
     case ctInitialUpdate:
@@ -152,12 +147,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
             }
         }
         break;
             }
         }
         break;
-    case ctSelChanged:        
+    case ctSelChanged:
         {
             if (selItem)
             {
                 wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
         {
             if (selItem)
             {
                 wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
-            }            
+            }
         }
         break;
     case ctAllSaved:
         }
         break;
     case ctAllSaved:
@@ -176,14 +171,14 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
             treeCtrl->DeleteAllItems();
             wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
             break;
             treeCtrl->DeleteAllItems();
             wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
             break;
-        }        
+        }
     case ctValueChanged:
         {
             // ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
             wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
     case ctValueChanged:
         {
             // ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
             wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
-        }        
+        }
         break;
         break;
-        
+
     default:
         break;
     }
     default:
         break;
     }
@@ -201,7 +196,7 @@ bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
     wxGetApp().GetDocManager()->ActivateView(this, false);
 
     Activate(false);
     wxGetApp().GetDocManager()->ActivateView(this, false);
 
     Activate(false);
-    
+
     wxGetApp().GetMainFrame()->SetDocument(NULL);
     wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
     wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
     wxGetApp().GetMainFrame()->SetDocument(NULL);
     wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
     wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
@@ -444,7 +439,7 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg)
                 parent = sel->GetParent();
                 insertBefore = sel->FindNextSibling();
             }
                 parent = sel->GetParent();
                 insertBefore = sel->FindNextSibling();
             }
-            
+
             ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
             newItem->InitProperties();
 
             ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
             newItem->InitProperties();
 
@@ -635,7 +630,7 @@ void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& WXUNUSED(event))
         {
             ctConfigItem* parent = sel;
             ctConfigItem* insertBefore = NULL;
         {
             ctConfigItem* parent = sel;
             ctConfigItem* insertBefore = NULL;
-            
+
             ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
             ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
                 NULL, newItem, parent, insertBefore);
             ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
             ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
                 NULL, newItem, parent, insertBefore);
@@ -767,7 +762,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
             wxString oldType = property->GetVariant().GetType();
             wxString oldEditorType = property->GetEditorType();
             wxArrayString oldChoices = property->GetChoices();
             wxString oldType = property->GetVariant().GetType();
             wxString oldEditorType = property->GetEditorType();
             wxArrayString oldChoices = property->GetChoices();
-            
+
             ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
                 wxID_ANY, _("Edit custom property"));
             dialog.SetPropertyName(oldName);
             ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
                 wxID_ANY, _("Edit custom property"));
             dialog.SetPropertyName(oldName);
@@ -780,7 +775,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
                 wxString editorType = dialog.GetEditorType();
                 wxArrayString choices = dialog.GetChoices();
                 wxString descr = dialog.GetPropertyDescription();
                 wxString editorType = dialog.GetEditorType();
                 wxArrayString choices = dialog.GetChoices();
                 wxString descr = dialog.GetPropertyDescription();
-                
+
                 if (name != oldName && sel->GetProperties().FindProperty(name))
                 {
                     wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
                 if (name != oldName && sel->GetProperties().FindProperty(name))
                 {
                     wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
@@ -814,7 +809,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
 
                 if (descr != oldDescription)
                     property->SetDescription(descr);
 
                 if (descr != oldDescription)
                     property->SetDescription(descr);
-                
+
                 editor->ShowItem(sel);
                 OnChangeFilename();
             }
                 editor->ShowItem(sel);
                 OnChangeFilename();
             }
@@ -918,12 +913,12 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
     if (path.IsEmpty())
         path = doc->GetFrameworkDir(false);
     wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
     if (path.IsEmpty())
         path = doc->GetFrameworkDir(false);
     wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
-    
+
     wxFileDialog dialog(wxTheApp->GetTopWindow(),
         _("Save Setup File As"),
         path, filename ,
         wildcard, wxSAVE|wxOVERWRITE_PROMPT);
     wxFileDialog dialog(wxTheApp->GetTopWindow(),
         _("Save Setup File As"),
         path, filename ,
         wildcard, wxSAVE|wxOVERWRITE_PROMPT);
-    
+
     if (dialog.ShowModal() == wxID_OK)
     {
         wxString fullPath = dialog.GetPath();
     if (dialog.ShowModal() == wxID_OK)
     {
         wxString fullPath = dialog.GetPath();
@@ -937,7 +932,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
         }
 
         stream << setupStr;
         }
 
         stream << setupStr;
-    }    
+    }
 }
 
 void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
 }
 
 void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
@@ -950,12 +945,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
     if (path.IsEmpty())
         path = doc->GetFrameworkDir(false);
     wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
     if (path.IsEmpty())
         path = doc->GetFrameworkDir(false);
     wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
-    
+
     wxFileDialog dialog(wxTheApp->GetTopWindow(),
         _("Save Configure Command File As"),
         path, filename ,
         wildcard, wxSAVE|wxOVERWRITE_PROMPT);
     wxFileDialog dialog(wxTheApp->GetTopWindow(),
         _("Save Configure Command File As"),
         path, filename ,
         wildcard, wxSAVE|wxOVERWRITE_PROMPT);
-    
+
     if (dialog.ShowModal() == wxID_OK)
     {
         wxString fullPath = dialog.GetPath();
     if (dialog.ShowModal() == wxID_OK)
     {
         wxString fullPath = dialog.GetPath();
@@ -969,7 +964,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
         }
 
         stream << configureStr;
         }
 
         stream << configureStr;
-    }    
+    }
 }
 
 void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)
 }
 
 void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)