1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various utility classes classes
7 // Created: 25-nov-1998
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/config.h>
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
29 static wxString wxPyEmptyStr("");
35 static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
36 PyObject* ret = PyTuple_New(3);
38 PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag));
39 PyTuple_SET_ITEM(ret, 1, PyString_FromString(str));
40 PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index));
46 //---------------------------------------------------------------------------
50 wxConfig(const wxString& appName = wxPyEmptyStr,
51 const wxString& vendorName = wxPyEmptyStr,
52 const wxString& localFilename = wxPyEmptyStr,
53 const wxString& globalFilename = wxPyEmptyStr,
57 //static wxConfigBase * Create();
58 //static wxConfigBase * Get();
59 //static wxConfigBase * Set(wxConfigBase *pConfig);
63 void DontCreateOnDemand();
64 bool DeleteAll(); // This is supposed to have been fixed...
65 bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = TRUE);
66 bool DeleteGroup(const wxString& key);
67 bool Exists(wxString& strName);
68 bool Flush(bool bCurrentOnly = FALSE);
69 wxString GetAppName();
72 // Each of these enumeration methods return a 3-tuple consisting of
73 // the continue flag, the value string, and the index for the next call.
75 PyObject* GetFirstGroup() {
80 cont = self->GetFirstGroup(value, index);
81 return __EnumerationHelper(cont, value, index);
84 PyObject* GetFirstEntry() {
89 cont = self->GetFirstEntry(value, index);
90 return __EnumerationHelper(cont, value, index);
93 PyObject* GetNextGroup(long index) {
97 cont = self->GetNextGroup(value, index);
98 return __EnumerationHelper(cont, value, index);
101 PyObject* GetNextEntry(long index) {
105 cont = self->GetNextEntry(value, index);
106 return __EnumerationHelper(cont, value, index);
111 int GetNumberOfEntries(bool bRecursive = FALSE);
112 int GetNumberOfGroups(bool bRecursive = FALSE);
114 wxString GetVendorName();
115 bool HasEntry(wxString& strName);
116 bool HasGroup(const wxString& strName);
117 bool IsExpandingEnvVars();
118 bool IsRecordingDefaults();
120 wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyStr);
121 %name(ReadInt)long Read(const wxString& key, long defaultVal = 0);
122 %name(ReadFloat)double Read(const wxString& key, double defaultVal = 0.0);
124 void SetAppName(const wxString& appName);
125 void SetExpandEnvVars (bool bDoIt = TRUE);
126 void SetPath(const wxString& strPath);
127 void SetRecordDefaults(bool bDoIt = TRUE);
128 void SetVendorName(const wxString& vendorName);
130 bool Write(const wxString& key, const wxString& value);
131 %name(WriteInt)bool Write(const wxString& key, long value);
132 %name(WriteFloat)bool Write(const wxString& key, double value);
137 //---------------------------------------------------------------------------
138 /////////////////////////////////////////////////////////////////////////////
141 // Revision 1.2 1999/02/20 09:03:02 RD
142 // Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
143 // window handle. If you can get the window handle into the python code,
144 // it should just work... More news on this later.
146 // Added wxImageList, wxToolTip.
148 // Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
149 // wxRegConfig class.
151 // As usual, some bug fixes, tweaks, etc.
153 // Revision 1.1 1998/12/15 20:41:23 RD
154 // Changed the import semantics from "from wxPython import *" to "from
155 // wxPython.wx import *" This is for people who are worried about
156 // namespace pollution, they can use "from wxPython import wx" and then
157 // prefix all the wxPython identifiers with "wx."
159 // Added wxTaskbarIcon for wxMSW.
161 // Made the events work for wxGrid.
165 // Added wxMiniFrame for wxGTK, (untested.)
167 // Changed many of the args and return values that were pointers to gdi
168 // objects to references to reflect changes in the wxWindows API.
170 // Other assorted fixes and additions.