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 enum { wxCHOICEDLG_STYLE };
 
 137 class wxMultiChoiceDialog : public wxDialog
 
 140     wxMultiChoiceDialog(wxWindow *parent,
 
 141                         const wxString& message,
 
 142                         const wxString& caption,
 
 143                         int LCOUNT, wxString *choices,
 
 144                         long style = wxCHOICEDLG_STYLE,
 
 145                         const wxPoint& pos = wxDefaultPosition);
 
 147     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 149     void SetSelections(const wxArrayInt& selections);
 
 151     // wxArrayInt GetSelections() const;
 
 153         PyObject* GetSelections() {
 
 154             return wxArrayInt2PyList_helper(self->GetSelections());
 
 160 //----------------------------------------------------------------------
 
 162 class wxSingleChoiceDialog : public wxDialog {
 
 165         // TODO: ignoring clientData for now...
 
 166         //       SWIG is messing up the &/*'s for some reason.
 
 167         wxSingleChoiceDialog(wxWindow* parent,
 
 170                              int LCOUNT, wxString* choices,
 
 171                              //char** clientData = NULL,
 
 172                              long style = wxCHOICEDLG_STYLE,
 
 173                              wxPoint* pos = &wxDefaultPosition) {
 
 174             return new wxSingleChoiceDialog(parent, *message, *caption,
 
 175                                             LCOUNT, choices, NULL, style, *pos);
 
 177     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 182     wxString GetStringSelection();
 
 183     void SetSelection(int sel);
 
 188 //----------------------------------------------------------------------
 
 190 class wxTextEntryDialog : public wxDialog {
 
 192     wxTextEntryDialog(wxWindow* parent,
 
 194                       char* caption = "Input Text",
 
 195                       char* defaultValue = "",
 
 196                       long style = wxOK | wxCANCEL | wxCENTRE,
 
 197                       const wxPoint& pos = wxDefaultPosition);
 
 199     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 202     void SetValue(const wxString& value);
 
 206 //----------------------------------------------------------------------
 
 208 class wxFontData : public wxObject {
 
 213     void EnableEffects(bool enable);
 
 214     bool GetAllowSymbols();
 
 215     wxColour GetColour();
 
 216     wxFont GetChosenFont();
 
 217     bool GetEnableEffects();
 
 218     wxFont GetInitialFont();
 
 220     void SetAllowSymbols(bool allowSymbols);
 
 221     void SetChosenFont(const wxFont& font);
 
 222     void SetColour(const wxColour& colour);
 
 223     void SetInitialFont(const wxFont& font);
 
 224     void SetRange(int min, int max);
 
 225     void SetShowHelp(bool showHelp);
 
 229 class wxFontDialog : public wxDialog {
 
 231     wxFontDialog(wxWindow* parent, wxFontData* data);
 
 232     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 234     wxFontData& GetFontData();
 
 239 //----------------------------------------------------------------------
 
 241 class wxMessageDialog : public wxDialog {
 
 243     wxMessageDialog(wxWindow* parent,
 
 245                     char* caption = "Message box",
 
 246                     long style = wxOK | wxCANCEL | wxCENTRE,
 
 247                     const wxPoint& pos = wxDefaultPosition);
 
 248     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 253 //----------------------------------------------------------------------
 
 255 class wxProgressDialog : public wxFrame {
 
 257     wxProgressDialog(const wxString& title,
 
 258                      const wxString& message,
 
 260                      wxWindow* parent = NULL,
 
 261                      int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
 
 262     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 264     bool Update(int value = -1, const char* newmsg = NULL);
 
 268 //----------------------------------------------------------------------
 
 270 enum wxFindReplaceFlags
 
 272     // downward search/replace selected (otherwise - upwards)
 
 275     // whole word search/replace selected
 
 278     // case sensitive search/replace selected (otherwise - case insensitive)
 
 283 enum wxFindReplaceDialogStyles
 
 285     // replace dialog (otherwise find dialog)
 
 286     wxFR_REPLACEDIALOG = 1,
 
 288     // don't allow changing the search direction
 
 291     // don't allow case sensitive searching
 
 292     wxFR_NOMATCHCASE   = 4,
 
 294     // don't allow whole word searching
 
 300     wxEVT_COMMAND_FIND_NEXT,
 
 301     wxEVT_COMMAND_FIND_REPLACE,
 
 302     wxEVT_COMMAND_FIND_REPLACE_ALL,
 
 303     wxEVT_COMMAND_FIND_CLOSE,
 
 306 %pragma(python) code = "
 
 308 def EVT_COMMAND_FIND(win, id, func):
 
 309     win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
 
 311 def EVT_COMMAND_FIND_NEXT(win, id, func):
 
 312     win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
 
 314 def EVT_COMMAND_FIND_REPLACE(win, id, func):
 
 315     win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
 
 317 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
 
 318     win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
 
 320 def EVT_COMMAND_FIND_CLOSE(win, id, func):
 
 321     win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
 
 325 class wxFindDialogEvent : public wxCommandEvent
 
 328     wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
 
 330     wxString GetFindString();
 
 331     const wxString& GetReplaceString();
 
 332     wxFindReplaceDialog *GetDialog();
 
 333     void SetFlags(int flags);
 
 334     void SetFindString(const wxString& str);
 
 335     void SetReplaceString(const wxString& str);
 
 340 class wxFindReplaceData : public wxObject
 
 343     wxFindReplaceData(int flags=0);
 
 344     ~wxFindReplaceData();
 
 346     const wxString& GetFindString();
 
 347     const wxString& GetReplaceString();
 
 349     void SetFlags(int flags);
 
 350     void SetFindString(const wxString& str);
 
 351     void SetReplaceString(const wxString& str);
 
 355 class wxFindReplaceDialog : public wxDialog {
 
 357     wxFindReplaceDialog(wxWindow *parent,
 
 358                         wxFindReplaceData *data,
 
 359                         const wxString &title,
 
 361     %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
 
 363      bool Create(wxWindow *parent,
 
 364                  wxFindReplaceData *data,
 
 365                  const wxString &title,
 
 368     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 369     %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
 
 371     const wxFindReplaceData *GetData();
 
 372     void SetData(wxFindReplaceData *data);
 
 375 //----------------------------------------------------------------------