1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the Common Dialog Classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include <wx/colordlg.h>
18 #include <wx/dirdlg.h>
19 #include <wx/fontdlg.h>
20 #include <wx/progdlg.h>
23 //----------------------------------------------------------------------
26 %include my_typemaps.i
28 // Import some definitions of other classes, etc.
35 %pragma(python) code = "import wx"
37 //----------------------------------------------------------------------
39 class wxColourData : public wxObject {
46 wxColour GetCustomColour(int i);
47 void SetChooseFull(int flag);
48 void SetColour(const wxColour& colour);
49 void SetCustomColour(int i, const wxColour& colour);
53 class wxColourDialog : public wxDialog {
55 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
57 wxColourData& GetColourData();
62 //----------------------------------------------------------------------
64 class wxDirDialog : public wxDialog {
66 wxDirDialog(wxWindow* parent,
67 char* message = "Choose a directory",
68 char* defaultPath = "",
70 const wxPoint& pos = wxDefaultPosition);
73 wxString GetMessage();
75 void SetMessage(const wxString& message);
76 void SetPath(const wxString& path);
80 //----------------------------------------------------------------------
82 class wxFileDialog : public wxDialog {
84 wxFileDialog(wxWindow* parent,
85 char* message = "Choose a file",
86 char* defaultDir = "",
87 char* defaultFile = "",
88 char* wildcard = "*.*",
90 const wxPoint& pos = wxDefaultPosition);
92 wxString GetDirectory();
93 wxString GetFilename();
95 wxString GetMessage();
98 wxString GetWildcard();
99 void SetDirectory(const wxString& directory);
100 void SetFilename(const wxString& setfilename);
101 void SetFilterIndex(int filterIndex);
102 void SetMessage(const wxString& message);
103 void SetPath(const wxString& path);
104 void SetStyle(long style);
105 void SetWildcard(const wxString& wildCard);
109 PyObject* GetFilenames() {
111 self->GetFilenames(arr);
112 size_t count = arr.GetCount();
113 PyObject* listObj = PyList_New(0);
114 for(size_t x=0; x<count; x++) {
115 PyObject* name = PyString_FromString(arr[x]);
116 PyList_Append(listObj, name);
121 PyObject* GetPaths() {
124 size_t count = arr.GetCount();
125 PyObject* listObj = PyList_New(0);
126 for(size_t x=0; x<count; x++) {
127 PyObject* name = PyString_FromString(arr[x]);
128 PyList_Append(listObj, name);
136 //----------------------------------------------------------------------
138 //TODO: wxMultipleChoiceDialog
140 //----------------------------------------------------------------------
142 class wxSingleChoiceDialog : public wxDialog {
145 // TODO: ignoring clientData for now...
146 // SWIG is messing up the &/*'s for some reason.
147 wxSingleChoiceDialog(wxWindow* parent,
150 int LCOUNT, wxString* choices,
151 //char** clientData = NULL,
152 long style = wxOK | wxCANCEL | wxCENTRE,
153 wxPoint* pos = &wxDefaultPosition) {
154 return new wxSingleChoiceDialog(parent, *message, *caption,
155 LCOUNT, choices, NULL, style, *pos);
161 wxString GetStringSelection();
162 void SetSelection(int sel);
167 //----------------------------------------------------------------------
169 class wxTextEntryDialog : public wxDialog {
171 wxTextEntryDialog(wxWindow* parent,
173 char* caption = "Input Text",
174 char* defaultValue = "",
175 long style = wxOK | wxCANCEL | wxCENTRE,
176 const wxPoint& pos = wxDefaultPosition);
179 void SetValue(const wxString& value);
183 //----------------------------------------------------------------------
185 class wxFontData : public wxObject {
190 void EnableEffects(bool enable);
191 bool GetAllowSymbols();
192 wxColour GetColour();
193 wxFont GetChosenFont();
194 bool GetEnableEffects();
195 wxFont GetInitialFont();
197 void SetAllowSymbols(bool allowSymbols);
198 void SetChosenFont(const wxFont& font);
199 void SetColour(const wxColour& colour);
200 void SetInitialFont(const wxFont& font);
201 void SetRange(int min, int max);
202 void SetShowHelp(bool showHelp);
206 class wxFontDialog : public wxDialog {
208 wxFontDialog(wxWindow* parent, wxFontData* data);
210 wxFontData& GetFontData();
215 //----------------------------------------------------------------------
217 class wxMessageDialog : public wxDialog {
219 wxMessageDialog(wxWindow* parent,
221 char* caption = "Message box",
222 long style = wxOK | wxCANCEL | wxCENTRE,
223 const wxPoint& pos = wxDefaultPosition);
228 //----------------------------------------------------------------------
230 class wxProgressDialog : public wxFrame {
232 wxProgressDialog(const wxString& title,
233 const wxString& message,
235 wxWindow* parent = NULL,
236 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
239 bool Update(int value = -1, const char* newmsg = NULL);
243 //----------------------------------------------------------------------