// 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>
public:
MyFrame();
virtual ~MyFrame();
-
+
// callbacks
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
// 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;
}
// main frame ctor
MyFrame::MyFrame()
- : wxFrame(NULL, -1, "wxConfig Demo")
+ : wxFrame((wxFrame *) NULL, -1, "wxConfig Demo")
{
// menu
wxMenu *file_menu = new wxMenu;
void MyFrame::OnDelete(wxCommandEvent&)
{
+ // VZ: it seems that DeleteAll() wreaks havoc on NT. Disabled until I
+ // investigate it further, do _not_ compile this code in meanwhile!
+#if 0
if ( wxConfigBase::Get()->DeleteAll() ) {
wxLogMessage("Config file/registry key successfully deleted.");
- delete wxConfigBase::Set(NULL);
+ delete wxConfigBase::Set((wxConfigBase *) NULL);
wxConfigBase::DontCreateOnDemand();
}
else
+#endif // 0
wxLogError("Deleting config file/registry key failed.");
}
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);
}