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>
 
  21 #include <wx/fdrepdlg.h>
 
  24 //----------------------------------------------------------------------
 
  27 %include my_typemaps.i
 
  29 // Import some definitions of other classes, etc.
 
  37 %pragma(python) code = "import wx"
 
  39 //----------------------------------------------------------------------
 
  41 class wxColourData : public wxObject {
 
  48     wxColour GetCustomColour(int i);
 
  49     void SetChooseFull(int flag);
 
  50     void SetColour(const wxColour& colour);
 
  51     void SetCustomColour(int i, const wxColour& colour);
 
  55 class wxColourDialog : public wxDialog {
 
  57     wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
 
  59     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
  61     wxColourData& GetColourData();
 
  66 //----------------------------------------------------------------------
 
  68 class wxDirDialog : public wxDialog {
 
  70     wxDirDialog(wxWindow* parent,
 
  71                 char* message = "Choose a directory",
 
  72                 char* defaultPath = "",
 
  74                 const wxPoint& pos = wxDefaultPosition);
 
  76     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
  79     wxString GetMessage();
 
  81     void SetMessage(const wxString& message);
 
  82     void SetPath(const wxString& path);
 
  87 //----------------------------------------------------------------------
 
  89 class wxFileDialog : public wxDialog {
 
  91     wxFileDialog(wxWindow* parent,
 
  92                  char* message = "Choose a file",
 
  93                  char* defaultDir = "",
 
  94                  char* defaultFile = "",
 
  95                  char* wildcard = "*.*",
 
  97                  const wxPoint& pos = wxDefaultPosition);
 
  99     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 101     wxString GetDirectory();
 
 102     wxString GetFilename();
 
 103     int GetFilterIndex();
 
 104     wxString GetMessage();
 
 107     wxString GetWildcard();
 
 108     void SetDirectory(const wxString& directory);
 
 109     void SetFilename(const wxString& setfilename);
 
 110     void SetFilterIndex(int filterIndex);
 
 111     void SetMessage(const wxString& message);
 
 112     void SetPath(const wxString& path);
 
 113     void SetStyle(long style);
 
 114     void SetWildcard(const wxString& wildCard);
 
 118         PyObject* GetFilenames() {
 
 120             self->GetFilenames(arr);
 
 121             return wxArrayString2PyList_helper(arr);
 
 124         PyObject* GetPaths() {
 
 127             return wxArrayString2PyList_helper(arr);
 
 133 //----------------------------------------------------------------------
 
 135 //TODO: wxMultipleChoiceDialog
 
 137 //----------------------------------------------------------------------
 
 139 class wxSingleChoiceDialog : public wxDialog {
 
 142         // TODO: ignoring clientData for now...
 
 143         //       SWIG is messing up the &/*'s for some reason.
 
 144         wxSingleChoiceDialog(wxWindow* parent,
 
 147                              int LCOUNT, wxString* choices,
 
 148                              //char** clientData = NULL,
 
 149                              long style = wxOK | wxCANCEL | wxCENTRE,
 
 150                              wxPoint* pos = &wxDefaultPosition) {
 
 151             return new wxSingleChoiceDialog(parent, *message, *caption,
 
 152                                             LCOUNT, choices, NULL, style, *pos);
 
 154     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 159     wxString GetStringSelection();
 
 160     void SetSelection(int sel);
 
 165 //----------------------------------------------------------------------
 
 167 class wxTextEntryDialog : public wxDialog {
 
 169     wxTextEntryDialog(wxWindow* parent,
 
 171                       char* caption = "Input Text",
 
 172                       char* defaultValue = "",
 
 173                       long style = wxOK | wxCANCEL | wxCENTRE,
 
 174                       const wxPoint& pos = wxDefaultPosition);
 
 176     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 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);
 
 209     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 211     wxFontData& GetFontData();
 
 216 //----------------------------------------------------------------------
 
 218 class wxMessageDialog : public wxDialog {
 
 220     wxMessageDialog(wxWindow* parent,
 
 222                     char* caption = "Message box",
 
 223                     long style = wxOK | wxCANCEL | wxCENTRE,
 
 224                     const wxPoint& pos = wxDefaultPosition);
 
 225     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 230 //----------------------------------------------------------------------
 
 232 class wxProgressDialog : public wxFrame {
 
 234     wxProgressDialog(const wxString& title,
 
 235                      const wxString& message,
 
 237                      wxWindow* parent = NULL,
 
 238                      int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
 
 239     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 241     bool Update(int value = -1, const char* newmsg = NULL);
 
 245 //----------------------------------------------------------------------
 
 247 enum wxFindReplaceFlags
 
 249     // downward search/replace selected (otherwise - upwards)
 
 252     // whole word search/replace selected
 
 255     // case sensitive search/replace selected (otherwise - case insensitive)
 
 260 enum wxFindReplaceDialogStyles
 
 262     // replace dialog (otherwise find dialog)
 
 263     wxFR_REPLACEDIALOG = 1,
 
 265     // don't allow changing the search direction
 
 268     // don't allow case sensitive searching
 
 269     wxFR_NOMATCHCASE   = 4,
 
 271     // don't allow whole word searching
 
 277     wxEVT_COMMAND_FIND_NEXT,
 
 278     wxEVT_COMMAND_FIND_REPLACE,
 
 279     wxEVT_COMMAND_FIND_REPLACE_ALL,
 
 280     wxEVT_COMMAND_FIND_CLOSE,
 
 283 %pragma(python) code = "
 
 285 def EVT_COMMAND_FIND(win, id, func):
 
 286     win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
 
 288 def EVT_COMMAND_FIND_NEXT(win, id, func):
 
 289     win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
 
 291 def EVT_COMMAND_FIND_REPLACE(win, id, func):
 
 292     win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
 
 294 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
 
 295     win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
 
 297 def EVT_COMMAND_FIND_CLOSE(win, id, func):
 
 298     win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
 
 302 class wxFindDialogEvent : public wxCommandEvent
 
 305     wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
 
 307     wxString GetFindString();
 
 308     const wxString& GetReplaceString();
 
 309     wxFindReplaceDialog *GetDialog();
 
 310     void SetFlags(int flags);
 
 311     void SetFindString(const wxString& str);
 
 312     void SetReplaceString(const wxString& str);
 
 317 class wxFindReplaceData : public wxObject
 
 320     wxFindReplaceData(int flags=0);
 
 321     ~wxFindReplaceData();
 
 323     const wxString& GetFindString();
 
 324     const wxString& GetReplaceString();
 
 326     void SetFlags(int flags);
 
 327     void SetFindString(const wxString& str);
 
 328     void SetReplaceString(const wxString& str);
 
 332 class wxFindReplaceDialog : public wxDialog {
 
 334     wxFindReplaceDialog(wxWindow *parent,
 
 335                         wxFindReplaceData *data,
 
 336                         const wxString &title,
 
 338     %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
 
 340      bool Create(wxWindow *parent,
 
 341                  wxFindReplaceData *data,
 
 342                  const wxString &title,
 
 345     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 346     %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
 
 348     const wxFindReplaceData *GetData();
 
 349     void SetData(wxFindReplaceData *data);
 
 352 //----------------------------------------------------------------------