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     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
  59     wxColourData& GetColourData();
 
  64 //----------------------------------------------------------------------
 
  66 class wxDirDialog : public wxDialog {
 
  68     wxDirDialog(wxWindow* parent,
 
  69                 char* message = "Choose a directory",
 
  70                 char* defaultPath = "",
 
  72                 const wxPoint& pos = wxDefaultPosition);
 
  74     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
  77     wxString GetMessage();
 
  79     void SetMessage(const wxString& message);
 
  80     void SetPath(const wxString& path);
 
  84 //----------------------------------------------------------------------
 
  86 class wxFileDialog : public wxDialog {
 
  88     wxFileDialog(wxWindow* parent,
 
  89                  char* message = "Choose a file",
 
  90                  char* defaultDir = "",
 
  91                  char* defaultFile = "",
 
  92                  char* wildcard = "*.*",
 
  94                  const wxPoint& pos = wxDefaultPosition);
 
  96     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
  98     wxString GetDirectory();
 
  99     wxString GetFilename();
 
 100     int GetFilterIndex();
 
 101     wxString GetMessage();
 
 104     wxString GetWildcard();
 
 105     void SetDirectory(const wxString& directory);
 
 106     void SetFilename(const wxString& setfilename);
 
 107     void SetFilterIndex(int filterIndex);
 
 108     void SetMessage(const wxString& message);
 
 109     void SetPath(const wxString& path);
 
 110     void SetStyle(long style);
 
 111     void SetWildcard(const wxString& wildCard);
 
 115         PyObject* GetFilenames() {
 
 117             self->GetFilenames(arr);
 
 118             size_t count = arr.GetCount();
 
 119             PyObject* listObj = PyList_New(0);
 
 120             for(size_t x=0; x<count; x++) {
 
 121                 PyObject* name = PyString_FromString(arr[x]);
 
 122                 PyList_Append(listObj, name);
 
 127         PyObject* GetPaths() {
 
 130             size_t count = arr.GetCount();
 
 131             PyObject* listObj = PyList_New(0);
 
 132             for(size_t x=0; x<count; x++) {
 
 133                 PyObject* name = PyString_FromString(arr[x]);
 
 134                 PyList_Append(listObj, name);
 
 142 //----------------------------------------------------------------------
 
 144 //TODO: wxMultipleChoiceDialog
 
 146 //----------------------------------------------------------------------
 
 148 class wxSingleChoiceDialog : public wxDialog {
 
 151         // TODO: ignoring clientData for now...
 
 152         //       SWIG is messing up the &/*'s for some reason.
 
 153         wxSingleChoiceDialog(wxWindow* parent,
 
 156                              int LCOUNT, wxString* choices,
 
 157                              //char** clientData = NULL,
 
 158                              long style = wxOK | wxCANCEL | wxCENTRE,
 
 159                              wxPoint* pos = &wxDefaultPosition) {
 
 160             return new wxSingleChoiceDialog(parent, *message, *caption,
 
 161                                             LCOUNT, choices, NULL, style, *pos);
 
 165     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
 168     wxString GetStringSelection();
 
 169     void SetSelection(int sel);
 
 174 //----------------------------------------------------------------------
 
 176 class wxTextEntryDialog : public wxDialog {
 
 178     wxTextEntryDialog(wxWindow* parent,
 
 180                       char* caption = "Input Text",
 
 181                       char* defaultValue = "",
 
 182                       long style = wxOK | wxCANCEL | wxCENTRE,
 
 183                       const wxPoint& pos = wxDefaultPosition);
 
 185     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
 188     void SetValue(const wxString& value);
 
 192 //----------------------------------------------------------------------
 
 194 class wxFontData : public wxObject {
 
 199     void EnableEffects(bool enable);
 
 200     bool GetAllowSymbols();
 
 201     wxColour GetColour();
 
 202     wxFont GetChosenFont();
 
 203     bool GetEnableEffects();
 
 204     wxFont GetInitialFont();
 
 206     void SetAllowSymbols(bool allowSymbols);
 
 207     void SetChosenFont(const wxFont& font);
 
 208     void SetColour(const wxColour& colour);
 
 209     void SetInitialFont(const wxFont& font);
 
 210     void SetRange(int min, int max);
 
 211     void SetShowHelp(bool showHelp);
 
 215 class wxFontDialog : public wxDialog {
 
 217     wxFontDialog(wxWindow* parent, wxFontData* data);
 
 219     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
 221     wxFontData& GetFontData();
 
 226 //----------------------------------------------------------------------
 
 228 class wxMessageDialog : public wxDialog {
 
 230     wxMessageDialog(wxWindow* parent,
 
 232                     char* caption = "Message box",
 
 233                     long style = wxOK | wxCANCEL | wxCENTRE,
 
 234                     const wxPoint& pos = wxDefaultPosition);
 
 236     %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
 
 241 //----------------------------------------------------------------------
 
 243 class wxProgressDialog : public wxFrame {
 
 245     wxProgressDialog(const wxString& title,
 
 246                      const wxString& message,
 
 248                      wxWindow* parent = NULL,
 
 249                      int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
 
 252     bool Update(int value = -1, const char* newmsg = NULL);
 
 256 //----------------------------------------------------------------------