]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/cmndlgs.i
hopefully fixes focus assertion
[wxWidgets.git] / wxPython / src / cmndlgs.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: cmndlgs.i
3// Purpose: SWIG definitions for the Common Dialog Classes
4//
5// Author: Robin Dunn
6//
7// Created: 7/25/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
03e9bead 13%module cmndlgs
7bf85405 14
03e9bead 15%{
7bf85405
RD
16#include "helpers.h"
17#include <wx/colordlg.h>
18#include <wx/dirdlg.h>
19#include <wx/fontdlg.h>
bb0054cd 20#include <wx/progdlg.h>
7bf85405
RD
21%}
22
23//----------------------------------------------------------------------
24
25%include typemaps.i
26%include my_typemaps.i
27
28// Import some definitions of other classes, etc.
29%import _defs.i
30%import misc.i
31%import gdi.i
32%import windows.i
bb0054cd 33%import frames.i
7bf85405 34
b8b8dda7 35%pragma(python) code = "import wx"
7bf85405
RD
36
37//----------------------------------------------------------------------
38
9416aa89 39class wxColourData : public wxObject {
7bf85405
RD
40public:
41 wxColourData();
42 ~wxColourData();
43
44 bool GetChooseFull();
25832b3f 45 wxColour GetColour();
fb5e0af0 46 wxColour GetCustomColour(int i);
7bf85405
RD
47 void SetChooseFull(int flag);
48 void SetColour(const wxColour& colour);
49 void SetCustomColour(int i, const wxColour& colour);
50};
51
52
53class wxColourDialog : public wxDialog {
54public:
55 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
56
57 wxColourData& GetColourData();
58 int ShowModal();
59};
60
61
62//----------------------------------------------------------------------
63
64class wxDirDialog : public wxDialog {
65public:
66 wxDirDialog(wxWindow* parent,
67 char* message = "Choose a directory",
68 char* defaultPath = "",
69 long style = 0,
b68dc582 70 const wxPoint& pos = wxDefaultPosition);
7bf85405
RD
71
72 wxString GetPath();
73 wxString GetMessage();
74 long GetStyle();
75 void SetMessage(const wxString& message);
76 void SetPath(const wxString& path);
77 int ShowModal();
78};
79
80//----------------------------------------------------------------------
81
82class wxFileDialog : public wxDialog {
83public:
84 wxFileDialog(wxWindow* parent,
85 char* message = "Choose a file",
86 char* defaultDir = "",
87 char* defaultFile = "",
88 char* wildcard = "*.*",
89 long style = 0,
b68dc582 90 const wxPoint& pos = wxDefaultPosition);
7bf85405
RD
91
92 wxString GetDirectory();
93 wxString GetFilename();
94 int GetFilterIndex();
95 wxString GetMessage();
96 wxString GetPath();
97 long GetStyle();
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);
106 int ShowModal();
f6bcfd97
BP
107
108 %addmethods {
109 PyObject* GetFilenames() {
110 wxArrayString arr;
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);
117 }
118 return listObj;
119 }
120
121 PyObject* GetPaths() {
122 wxArrayString arr;
123 self->GetPaths(arr);
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);
129 }
130 return listObj;
131 }
132 }
7bf85405
RD
133};
134
135
136//----------------------------------------------------------------------
137
138//TODO: wxMultipleChoiceDialog
139
140//----------------------------------------------------------------------
141
142class wxSingleChoiceDialog : public wxDialog {
143public:
144 %addmethods {
145 // TODO: ignoring clientData for now...
146 // SWIG is messing up the &/*'s for some reason.
147 wxSingleChoiceDialog(wxWindow* parent,
148 wxString* message,
149 wxString* caption,
eec92d76 150 int LCOUNT, wxString* choices,
7bf85405
RD
151 //char** clientData = NULL,
152 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 153 wxPoint* pos = &wxDefaultPosition) {
7bf85405 154 return new wxSingleChoiceDialog(parent, *message, *caption,
eec92d76 155 LCOUNT, choices, NULL, style, *pos);
7bf85405 156 }
7bf85405 157
09f3d4e6 158 }
9c039d08 159
7bf85405
RD
160 int GetSelection();
161 wxString GetStringSelection();
162 void SetSelection(int sel);
163 int ShowModal();
164};
165
166
167//----------------------------------------------------------------------
168
169class wxTextEntryDialog : public wxDialog {
170public:
171 wxTextEntryDialog(wxWindow* parent,
172 char* message,
173 char* caption = "Input Text",
174 char* defaultValue = "",
175 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 176 const wxPoint& pos = wxDefaultPosition);
7bf85405
RD
177
178 wxString GetValue();
179 void SetValue(const wxString& value);
180 int ShowModal();
181};
182
183//----------------------------------------------------------------------
184
9416aa89 185class wxFontData : public wxObject {
7bf85405
RD
186public:
187 wxFontData();
188 ~wxFontData();
189
190 void EnableEffects(bool enable);
191 bool GetAllowSymbols();
25832b3f 192 wxColour GetColour();
7bf85405
RD
193 wxFont GetChosenFont();
194 bool GetEnableEffects();
195 wxFont GetInitialFont();
196 bool GetShowHelp();
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);
203};
204
205
206class wxFontDialog : public wxDialog {
207public:
0c3d4bfd 208 wxFontDialog(wxWindow* parent, wxFontData* data);
7bf85405
RD
209
210 wxFontData& GetFontData();
211 int ShowModal();
212};
213
214
7bf85405
RD
215//----------------------------------------------------------------------
216
217class wxMessageDialog : public wxDialog {
218public:
219 wxMessageDialog(wxWindow* parent,
220 char* message,
221 char* caption = "Message box",
222 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 223 const wxPoint& pos = wxDefaultPosition);
7bf85405
RD
224
225 int ShowModal();
226};
227
228//----------------------------------------------------------------------
229
bb0054cd
RD
230class wxProgressDialog : public wxFrame {
231public:
232 wxProgressDialog(const wxString& title,
233 const wxString& message,
234 int maximum = 100,
235 wxWindow* parent = NULL,
236 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
7bf85405 237
7bf85405 238
bb0054cd
RD
239 bool Update(int value = -1, const char* newmsg = NULL);
240 void Resume();
241}
242
243//----------------------------------------------------------------------