]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/config/conftest.cpp
very minor changes
[wxWidgets.git] / samples / config / conftest.cpp
index b44a5b33c4bd6a80c1571e5b04f7da812b283161..6c47dc4bd61c551abe6ec20c01451ba31ff3ab66 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        conftest.cpp
 // Purpose:     demo of wxConfig and related classes
 // Author:      Vadim Zeitlin
-// Modified by: 
+// Modified by:
 // Created:     03.08.98
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
@@ -41,7 +41,7 @@ class MyFrame: public wxFrame
 public:
   MyFrame();
   virtual ~MyFrame();
-    
+
   // callbacks
   void OnQuit(wxCommandEvent& event);
   void OnAbout(wxCommandEvent& event);
@@ -127,7 +127,7 @@ int MyApp::OnExit()
   // clean up: Set() returns the active config object as Get() does, but unlike
   // Get() it doesn't try to create one if there is none (definitely not what
   // we want here!)
-  delete wxConfigBase::Set(NULL);
+  delete wxConfigBase::Set((wxConfigBase *) NULL);
 
   return 0;
 }
@@ -138,7 +138,7 @@ int MyApp::OnExit()
 
 // main frame ctor
 MyFrame::MyFrame()
-       : wxFrame(NULL, -1, "wxConfig Demo")
+       : wxFrame((wxFrame *) NULL, -1, "wxConfig Demo")
 {
   // menu
   wxMenu *file_menu = new wxMenu;
@@ -202,14 +202,16 @@ void MyFrame::OnAbout(wxCommandEvent&)
 
 void MyFrame::OnDelete(wxCommandEvent&)
 {
-  if ( wxConfigBase::Get()->DeleteAll() ) {
-    wxLogMessage("Config file/registry key successfully deleted.");
-
-    delete wxConfigBase::Set(NULL);
-    wxConfigBase::DontCreateOnDemand();
-  }
-  else
-    wxLogError("Deleting config file/registry key failed.");
+    if ( wxConfigBase::Get()->DeleteAll() ) {
+        wxLogMessage("Config file/registry key successfully deleted.");
+
+        delete wxConfigBase::Set((wxConfigBase *) NULL);
+        wxConfigBase::DontCreateOnDemand();
+    }
+    else
+    {
+        wxLogError("Deleting config file/registry key failed.");
+    }
 }
 
 MyFrame::~MyFrame()
@@ -225,8 +227,8 @@ MyFrame::~MyFrame()
   int x, y, w, h;
   GetClientSize(&w, &h);
   GetPosition(&x, &y);
-  pConfig->Write("/MainFrame/x", x);
-  pConfig->Write("/MainFrame/y", y);
-  pConfig->Write("/MainFrame/w", w);
-  pConfig->Write("/MainFrame/h", h);
+  pConfig->Write("/MainFrame/x", (long) x);
+  pConfig->Write("/MainFrame/y", (long) y);
+  pConfig->Write("/MainFrame/w", (long) w);
+  pConfig->Write("/MainFrame/h", (long) h);
 }