wxConfig changes to be more logical.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -225,8 +225,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);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@
|
||||
|
||||
ScoreFile::ScoreFile(const char* appName)
|
||||
{
|
||||
#ifdef 0
|
||||
#if 0
|
||||
wxString filename;
|
||||
m_configFilename << "/usr/local/share/" << appName << ".scores";
|
||||
if (access(m_configFilename, F_OK) == 0)
|
||||
@@ -69,11 +69,7 @@ ScoreFile::ScoreFile(const char* appName)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __UNIX__
|
||||
m_config = new wxFileConfig( appName, "" ); // only local
|
||||
#else
|
||||
m_config = new wxFileConfig( "",appName ); // only global
|
||||
#endif
|
||||
m_config = new wxConfig(appName, "wxWindows", appName, "", wxCONFIG_USE_LOCAL_FILE); // only local
|
||||
}
|
||||
|
||||
ScoreFile::~ScoreFile()
|
||||
@@ -132,7 +128,7 @@ wxString ScoreFile::GetPreviousPlayer() const
|
||||
{
|
||||
wxString result;
|
||||
m_config->SetPath("/General");
|
||||
m_config->Read(&result, "LastPlayer");
|
||||
m_config->Read("LastPlayer", &result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -149,10 +145,10 @@ void ScoreFile::ReadPlayersScore(
|
||||
|
||||
m_config->SetPath("/Players");
|
||||
m_config->SetPath(player);
|
||||
if (m_config->Read(&myScore, (const char *) "Score",0L) &&
|
||||
m_config->Read(&myGames, (const char *) "Games",0L) &&
|
||||
m_config->Read(&myWins, (const char *) "Wins",0L) &&
|
||||
m_config->Read(&check, (const char *) "Check",0L))
|
||||
if (m_config->Read("Score", &myScore, 0L) &&
|
||||
m_config->Read("Games", &myGames, 0L) &&
|
||||
m_config->Read("Wins", &myWins, 0L) &&
|
||||
m_config->Read("Check", &check, 0L))
|
||||
{
|
||||
if (check != CalcCheck(player, myGames, myWins, myScore))
|
||||
{
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#ifndef _SCOREFILE_H_
|
||||
#define _SCOREFILE_H_
|
||||
|
||||
#include <wx/config.h>
|
||||
|
||||
class wxConfig;
|
||||
|
||||
class ScoreFile {
|
||||
@@ -28,8 +30,8 @@ public:
|
||||
|
||||
private:
|
||||
long CalcCheck(const char* name, int p1, int p2, int p3);
|
||||
wxString m_configFilename;
|
||||
wxConfig* m_config;
|
||||
wxString m_configFilename;
|
||||
wxConfig* m_config;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -38,7 +38,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(LIST_SMALL_ICON_VIEW, MyFrame::OnSmallIconView)
|
||||
EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView)
|
||||
EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll)
|
||||
EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnSelectAll)
|
||||
EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
|
||||
|
@@ -57,6 +57,10 @@ public:
|
||||
RegImageList();
|
||||
};
|
||||
|
||||
// array of children of the node
|
||||
struct TreeNode;
|
||||
WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// our control
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -90,10 +94,7 @@ public:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
private:
|
||||
// array of children of the node
|
||||
struct TreeNode;
|
||||
WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
||||
|
||||
|
||||
// structure describing a registry key/value
|
||||
struct TreeNode
|
||||
{
|
||||
|
Reference in New Issue
Block a user