]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/misc2.i
Scripts to make a installer package in a disk image for wxPython and
[wxWidgets.git] / wxPython / src / misc2.i
index 1b32485f919cc55b185edce351c7e3365aaa09e1..ddcb749eb300f3a19392446e2335f5147e1926df 100644 (file)
@@ -20,7 +20,6 @@
 #include <wx/resource.h>
 #include <wx/tooltip.h>
 #include <wx/caret.h>
-#include <wx/fontenum.h>
 #include <wx/tipdlg.h>
 #include <wx/process.h>
 
@@ -56,7 +55,7 @@
     // Put some wx default wxChar* values into wxStrings.
     DECLARE_DEF_STRING(FileSelectorPromptStr);
     DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
-
+    DECLARE_DEF_STRING(DirSelectorPromptStr);
     static const wxString wxPyEmptyString(wxT(""));
 %}
 
@@ -84,6 +83,13 @@ wxString wxSaveFileSelector(const wxString& what,
                             const wxString& default_name = wxPyEmptyString,
                             wxWindow *parent = NULL);
 
+
+wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
+                       const wxString& defaultPath = wxPyEmptyString,
+                       long style = wxDD_DEFAULT_STYLE,
+                       const wxPoint& pos = wxDefaultPosition,
+                       wxWindow *parent = NULL);
+
 wxString wxGetTextFromUser(const wxString& message,
                            const wxString& caption = wxPyEmptyString,
                            const wxString& default_value = wxPyEmptyString,
@@ -170,6 +176,8 @@ bool wxCheckForInterrupt(wxWindow *wnd);
 void wxFlushEvents();
 #endif
 
+wxWindow* wxGetTopLevelParent(wxWindow *win);
+
 //---------------------------------------------------------------------------
 // Resource System
 
@@ -295,6 +303,15 @@ enum wxSystemFeature
     wxSYS_CAN_ICONIZE_FRAME
 };
 
+// values for different screen designs
+enum wxSystemScreen
+{
+    wxSYS_SCREEN_NONE = 0,  //   not yet defined
+    wxSYS_SCREEN_DESKTOP,   //   >= 800x600
+    wxSYS_SCREEN_SMALL,     //   >= 640x480
+    wxSYS_SCREEN_PDA,       //   >= 320x240
+    wxSYS_SCREEN_TINY       //   <
+};
 
 
 class wxSystemSettings {
@@ -311,6 +328,13 @@ public:
     // return true if the port has certain feature
     static bool HasFeature(wxSystemFeature index);
 
+   // Get system screen design (desktop, pda, ..) used for
+   // laying out various dialogs.
+   static wxSystemScreen GetScreen();
+
+   // Override default.
+   static void SetScreen( wxSystemScreen screen );
+
 };
 
 
@@ -365,52 +389,6 @@ public:
 
 //----------------------------------------------------------------------
 
-%{
-class wxPyFontEnumerator : public wxFontEnumerator {
-public:
-    wxPyFontEnumerator() {}
-    ~wxPyFontEnumerator() {}
-
-    DEC_PYCALLBACK_BOOL_STRING(OnFacename);
-    DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding);
-
-    PYPRIVATE;
-};
-
-IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFacename);
-IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
-
-%}
-
-%name(wxFontEnumerator) class wxPyFontEnumerator {
-public:
-    wxPyFontEnumerator();
-    ~wxPyFontEnumerator();
-    void _setCallbackInfo(PyObject* self, PyObject* _class, bool incref);
-    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxFontEnumerator, 0)"
-
-    bool EnumerateFacenames(
-        wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
-        bool fixedWidthOnly = FALSE);
-    bool EnumerateEncodings(const wxString& facename = wxPyEmptyString);
-
-    //wxArrayString* GetEncodings();
-    //wxArrayString* GetFacenames();
-    %addmethods {
-        PyObject* GetEncodings() {
-            wxArrayString* arr = self->GetEncodings();
-            return wxArrayString2PyList_helper(*arr);
-        }
-
-        PyObject* GetFacenames() {
-            wxArrayString* arr = self->GetFacenames();
-            return wxArrayString2PyList_helper(*arr);
-        }
-    }
-};
-
-//----------------------------------------------------------------------
-
 class  wxBusyCursor {
 public:
     wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
@@ -608,7 +586,7 @@ public:
     static void Suspend();
     static void Resume();
 
-    void SetVerbose(bool bVerbose = TRUE);
+    static void SetVerbose(bool bVerbose = TRUE);
 
     static void DontCreateOnDemand();
     static void SetTraceMask(wxTraceMask ulMask);
@@ -619,7 +597,7 @@ public:
     static void SetTimestamp(const wxString& ts);
     static const wxString& GetTimestamp();
 
-    bool GetVerbose() const { return m_bVerbose; }
+    bool GetVerbose() const;
 
     static wxTraceMask GetTraceMask();
     static bool IsAllowedTraceMask(const wxString& mask);
@@ -632,6 +610,7 @@ public:
             return msg;
         }
     }
+
 };
 
 
@@ -671,14 +650,6 @@ public:
 };
 
 
-class wxLogNull
-{
-public:
-    wxLogNull();
-    ~wxLogNull();
-};
-
-
 class wxLogChain : public wxLog
 {
 public:
@@ -702,9 +673,25 @@ void wxLogStatus(const wxString& szFormat);
 %name(wxLogStatusFrame)void wxLogStatus(wxFrame *pFrame, const wxString& szFormat);
 void wxLogSysError(const wxString& szFormat);
 
+// wxLogFatalError helper: show the (fatal) error to the user in a safe way,
+// i.e. without using wxMessageBox() for example because it could crash
+void wxSafeShowMessage(const wxString& title, const wxString& text);
+
+
+
+// Suspress logging while an instance of this class exists
+class wxLogNull
+{
+public:
+    wxLogNull();
+    ~wxLogNull();
+};
+
+
+
 
 %{
-// A Log class that can be derived from in wxPython
+// A wxLog class that can be derived from in wxPython
 class wxPyLog : public wxLog {
 public:
     wxPyLog() : wxLog() {}
@@ -806,11 +793,21 @@ public:
 };
 
 
-enum {
-    wxEXEC_ASYNC    = 0,    // execute the process asynchronously
-    wxEXEC_SYNC     = 1,    //                     synchronously
-    wxEXEC_NOHIDE   = 2     // under Windows, don't hide the child even if it's
-                            // IO is redirected (this is done by default)
+enum
+{
+    // execute the process asynchronously
+    wxEXEC_ASYNC    = 0,
+
+    // execute it synchronously, i.e. wait until it finishes
+    wxEXEC_SYNC     = 1,
+
+    // under Windows, don't hide the child even if it's IO is redirected (this
+    // is done by default)
+    wxEXEC_NOHIDE   = 2,
+
+    // under Unix, if the process is the group leader then killing -pid kills
+    // all children as well as pid
+    wxEXEC_MAKE_GROUP_LEADER = 4
 };
 
 
@@ -1377,7 +1374,7 @@ public:
     void Save(wxConfigBase& config);
 
     void AddFilesToMenu();
-    %name(AddFilesToSingleMenu)void AddFilesToMenu(wxMenu* menu);
+    %name(AddFilesToThisMenu)void AddFilesToMenu(wxMenu* menu);
 
     // Accessors
     wxString GetHistoryFile(int i) const;
@@ -1393,7 +1390,6 @@ public:
 
 
 %init %{
-    wxPyPtrTypeMap_Add("wxFontEnumerator", "wxPyFontEnumerator");
     wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");
     wxPyPtrTypeMap_Add("wxProcess", "wxPyProcess");
 %}