]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_cmndlgs.i
Some tweaks to reflect changes in wxWidgets
[wxWidgets.git] / wxPython / src / _cmndlgs.i
index 242ea66e70d79ff5ae0c83698a82f24631e7024a..3ea7d7badc47529adf30f7d8a5f5d7218c7fbbce 100644 (file)
@@ -98,6 +98,11 @@ instance.", "");
 };
 
 
+wxColour wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL,
+                             const wxColour& colInit = wxNullColour,
+                             const wxString& caption = wxPyEmptyString);
+
+
 //--------------------------------------------------------------------------------
 
 
@@ -120,7 +125,8 @@ MustHaveApp(wxDirDialog);
 class wxDirDialog : public wxDialog {
 public:
     %pythonAppend wxDirDialog   "self._setOORInfo(self)"
-    
+    %pythonAppend wxDirDialog() ""
+   
     DocCtorStr(
         wxDirDialog(wxWindow* parent,
                     const wxString& message = wxPyDirSelectorPromptStr,
@@ -131,6 +137,15 @@ public:
                     const wxString& name = wxPyDirDialogNameStr),
         "Constructor.  Use ShowModal method to show the dialog.", "");
 
+//     %RenameCtor(PreDirDialog, wxDirDialog());
+
+//     bool Create(wxWindow *parent,
+//                 const wxString& title = wxDirSelectorPromptStr,
+//                 const wxString& defaultPath = wxEmptyString,
+//                 long style = wxDD_DEFAULT_STYLE,
+//                 const wxPoint& pos = wxDefaultPosition,
+//                 const wxSize& sz = wxDefaultSize,
+//                 const wxString& name = wxPyDirDialogNameStr);
 
     DocDeclStr(
         wxString , GetPath(),
@@ -140,10 +155,6 @@ public:
         wxString , GetMessage(),
         "Returns the message that will be displayed on the dialog.", "");
     
-    DocDeclStr(
-        long , GetStyle(),
-        "Returns the dialog style.", "");
-    
     DocDeclStr(
         void , SetMessage(const wxString& message),
         "Sets the message that will be displayed on the dialog.", "");
@@ -252,7 +263,6 @@ example::
         void , SetFilterIndex(int filterIndex),
         "Sets the default filter index, starting from zero.", "");
     
-
     DocDeclStr(
         wxString , GetMessage() const,
         "Returns the message that will be displayed on the dialog.", "");
@@ -285,23 +295,22 @@ which will be used when the dialog is first displayed. After the
 dialog is shown, this is the index selected by the user.", "");
 
 
-    DocStr(GetFilenames,
-        "Returns a list of filenames chosen in the dialog.  This function
+    %extend {
+        DocStr(GetFilenames,
+               "Returns a list of filenames chosen in the dialog.  This function
 should only be used with the dialogs which have wx.MULTIPLE style, use
 GetFilename for the others.", "");
-
-    DocStr(GetPaths,
-        "Fills the array paths with the full paths of the files chosen. This
-function should only be used with the dialogs which have wx.MULTIPLE
-style, use GetPath for the others.", "");   
-    
-    %extend {
         PyObject* GetFilenames() {
             wxArrayString arr;
             self->GetFilenames(arr);
             return wxArrayString2PyList_helper(arr);
         }
 
+        DocStr(GetPaths,
+               "Fills the array paths with the full paths of the files chosen. This
+function should only be used with the dialogs which have wx.MULTIPLE
+style, use GetPath for the others.", "");   
+    
         PyObject* GetPaths() {
             wxArrayString arr;
             self->GetPaths(arr);
@@ -354,21 +363,34 @@ public:
                             int choices=0, wxString* choices_array=NULL,
                             long style = wxCHOICEDLG_STYLE,
                             const wxPoint& pos = wxDefaultPosition),
-        "__init__(Window parent, String message, String caption,
-    List choices=[], long style=CHOICEDLG_STYLE,
+        "__init__(self, Window parent, String message, String caption,
+    List choices=EmptyList, long style=CHOICEDLG_STYLE,
     Point pos=DefaultPosition) -> MultiChoiceDialog",
-        "Constructor.  Use ShowModal method to show the dialog.", "");
+        "Constructor.  Use the `ShowModal` method to show the dialog.
+
+    :param parent: The parent window.
+    :param message: Text to display above the list of selections.
+    :param caption: Text to use in the title bar of the dialog.
+    :param choices: A list of strings or unicode objects that the
+        user is allowed to choose from.
+    :param style: Styles to apply to the dialog.  The default value is
+        equivallent to wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CANCEL|wx.CENTER.
+    :param pos: Where to position the dialog (not used on Windows)
+
+", "");
 
     
     DocDeclAStr(
         void, SetSelections(const wxArrayInt& selections),
         "SetSelections(List selections)",
         "Specify the items in the list that should be selected, using a list of
-integers.", "");
+integers.  The list should specify the indexes of the items that
+should be selected.", "");
 
     DocAStr(GetSelections,
             "GetSelections() -> [selections]",
-            "Returns a list of integers representing the items that are selected.", "");
+            "Returns a list of integers representing the items that are selected.
+If an item is selected then its index will appear in the list.", "");
     %extend {
         PyObject* GetSelections() {
             return wxArrayInt2PyList_helper(self->GetSelections());
@@ -390,7 +412,7 @@ public:
 
     DocAStr(wxSingleChoiceDialog,
             "__init__(Window parent, String message, String caption,
-    List choices=[], long style=CHOICEDLG_STYLE,
+    List choices=EmptyList, long style=CHOICEDLG_STYLE,
     Point pos=DefaultPosition) -> SingleChoiceDialog",
             "Constructor.  Use ShowModal method to show the dialog.", "");
 
@@ -430,6 +452,8 @@ DocStr(wxTextEntryDialog,
 
 MustHaveApp(wxTextEntryDialog);
 
+enum { wxTextEntryDialogStyle };
+
 class wxTextEntryDialog : public wxDialog {
 public:
     %pythonAppend wxTextEntryDialog   "self._setOORInfo(self)"
@@ -439,7 +463,7 @@ public:
                           const wxString& message,
                           const wxString& caption = wxPyGetTextFromUserPromptStr,
                           const wxString& defaultValue = wxPyEmptyString,
-                          long style = wxOK | wxCANCEL | wxCENTRE,
+                          long style = wxTextEntryDialogStyle,
                           const wxPoint& pos = wxDefaultPosition),
         "Constructor.  Use ShowModal method to show the dialog.", "");
 
@@ -455,6 +479,21 @@ or the original value if the user has pressed Cancel.", "");
 
 //---------------------------------------------------------------------------
 
+MAKE_CONST_WXSTRING(GetPasswordFromUserPromptStr);
+
+class wxPasswordEntryDialog : public wxTextEntryDialog
+{
+public:
+    wxPasswordEntryDialog(wxWindow *parent,
+                      const wxString& message,
+                      const wxString& caption = wxPyGetPasswordFromUserPromptStr,
+                      const wxString& value = wxPyEmptyString,
+                      long style = wxTextEntryDialogStyle,
+                      const wxPoint& pos = wxDefaultPosition);
+};
+
+//---------------------------------------------------------------------------
+
 
 DocStr(wxFontData,
        "This class holds a variety of information related to font dialogs and
@@ -561,6 +600,11 @@ wx.FontDialog.", "");
 };
 
 
+wxFont wxGetFontFromUser(wxWindow *parent = NULL,
+                         const wxFont& fontInit = wxNullFont,
+                         const wxString& caption = wxPyEmptyString);
+
+
 //---------------------------------------------------------------------------
 
 
@@ -627,7 +671,13 @@ Window Styles
     wx.PD_CAN_ABORT          This flag tells the dialog that it should have
                              a \"Cancel\" button which the user may press. If
                              this happens, the next call to Update() will
-                             return false.
+                             return False in the first component of its return
+                             value.
+
+    wx.PD_CAN_SKIP           This flag tells the dialog that it should have a
+                             \"Skip\" button which the user may press. If this
+                             happens, the next call to Update() will return
+                             True in the second component of its return value.
 
     wx.PD_ELAPSED_TIME       This flag tells the dialog that it should show
                              elapsed time (since creating the dialog).
@@ -637,10 +687,15 @@ Window Styles
 
     wx.PD_REMAINING_TIME     This flag tells the dialog that it should show
                              remaining time.
+
+    wx.PD_SMOOTH             Uses the wx.GA_SMOOTH style on the embedded
+                             wx.Gauge widget.
     ====================     =============================================
 ");
 
 
+// TODO: wxPD_CAN_SKIP
+
 MustHaveApp(wxProgressDialog);
 
 class wxProgressDialog : public wxFrame {
@@ -657,15 +712,25 @@ public:
 for other windows, or, if wx.PD_APP_MODAL flag is not given, for its
 parent window only.", "");
 
-    DocDeclStr(
-        virtual bool , Update(int value, const wxString& newmsg = wxPyEmptyString),
+    // TODO: support getting the skipped value back in the return value, but
+    // only if style is set.  This is so the API doesn't change for existing
+    // users...
+    DocDeclAStr(
+        virtual bool , Update(int value, const wxString& newmsg = wxPyEmptyString,
+                              bool *OUTPUT),
+        "Update(self, int value, String newmsg) --> (continue, skip)",
         "Updates the dialog, setting the progress bar to the new value and, if
-given changes the message above it. Returns true unless the Cancel
-button has been pressed.
-
-If false is returned, the application can either immediately destroy
-the dialog or ask the user for the confirmation and if the abort is
-not confirmed the dialog may be resumed with Resume function.", "");
+given changes the message above it. The value given should be less
+than or equal to the maximum value given to the constructor and the
+dialog is closed if it is equal to the maximum.  Returns a tuple of
+boolean values, ``(continue, skip)`` where ``continue`` is ``True``
+unless the Cancel button has been pressed, and ``skip`` is ``False``
+unless the Skip button (if any) has been pressed.
+
+If the ``continue`` return value is ``false``, the application can either
+immediately destroy the dialog or ask the user for confirmation, and if the
+abort is not confirmed the dialog may be resumed with `Resume` function.
+", "");
     
     DocDeclStr(
         void , Resume(),