]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/windows.i
compilation fix for FALSE -> wxItemKind conversion
[wxWidgets.git] / wxPython / src / windows.i
index a72fb75ab5178e4a2ea25831dea10f525687209f..c245360dc643c7525199a7b7bbbdf2d43e8ea221 100644 (file)
@@ -371,12 +371,12 @@ public:
     void SetToolTip(wxToolTip *tooltip);
     wxToolTip* GetToolTip();
 
-    void SetSizer(wxSizer* sizer);
+    void SetSizer(wxSizer* sizer, bool deleteOld=TRUE);
     wxSizer* GetSizer();
 
         // Track if this window is a member of a sizer
-    void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; }
-    wxSizer *GetContainingSizer() const { return m_containingSizer; }
+    void SetContainingSizer(wxSizer* sizer);
+    wxSizer *GetContainingSizer() const;
 
     wxValidator* GetValidator();
     void SetValidator(const wxValidator& validator);
@@ -388,6 +388,7 @@ public:
 #endif
 
     wxSize GetBestSize();
+    wxSize GetMaxSize();
 
     void SetCaret(wxCaret *caret);
     wxCaret *GetCaret();
@@ -427,8 +428,8 @@ public:
     void OnPaint(wxPaintEvent& event);
 #endif
 
-    wxButton* GetDefaultItem();
-    void SetDefaultItem(wxButton *btn);
+    wxWindow* GetDefaultItem();
+    wxWindow* SetDefaultItem(wxWindow *btn);
 };
 
 
@@ -530,14 +531,37 @@ public:
     void GetViewStart(int* OUTPUT, int* OUTPUT);
     %pragma(python) addtoclass = "ViewStart = GetViewStart"
 
-    void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
-    void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
+    %name(CalcScrolledPosition1)wxPoint CalcScrolledPosition(const wxPoint& pt);
+    %name(CalcScrolledPosition2)void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
+
+    %name(CalcUnscrolledPosition1)wxPoint CalcUnscrolledPosition(const wxPoint& pt);
+    %name(CalcUnscrolledPosition2)void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
+
+    %pragma(python) addtoclass = "
+    def CalcScrolledPosition(self, *args):
+        if len(args) == 1:
+            return apply(self.CalcScrolledPosition1, args)
+        elif len(args) == 2:
+            return apply(self.CalcScrolledPosition2, args)
+        else:
+            raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
+
+    def CalcUnscrolledPosition(self, *args):
+        if len(args) == 1:
+            return apply(self.CalcUnscrolledPosition1, args)
+        elif len(args) == 2:
+            return apply(self.CalcUnscrolledPosition2, args)
+        else:
+            raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
+"
 
     void SetScale(double xs, double ys);
     double GetScaleX();
     double GetScaleY();
 
     void AdjustScrollbars();
+
+    bool Layout();
 };
 
 //----------------------------------------------------------------------
@@ -551,12 +575,59 @@ public:
 
     void Append(int id, const wxString& item,
                 const wxString& helpString = wxEmptyString,
-                int checkable = FALSE);
+                wxItemKind kind = wxItem_Normal);
     %name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu,
-                const wxString& helpString = wxEmptyString);
+                                 const wxString& helpString = wxEmptyString);
     %name(AppendItem)void Append(const wxMenuItem* item);
-
+    void AppendCheckItem(int id,
+                         const wxString& text,
+                         const wxString& help = wxEmptyString);
+    void AppendRadioItem(int id,
+                         const wxString& text,
+                         const wxString& help = wxEmptyString);
     void AppendSeparator();
+
+
+    void Insert(size_t pos,
+                int id,
+                const wxString& text,
+                const wxString& help = wxEmptyString,
+                wxItemKind kind = wxItem_Normal);
+    void InsertSeparator(size_t pos);
+    void InsertCheckItem(size_t pos,
+                         int id,
+                         const wxString& text,
+                         const wxString& help = wxEmptyString);
+    void InsertRadioItem(size_t pos,
+                         int id,
+                         const wxString& text,
+                         const wxString& help = wxEmptyString);
+    %name(InsertMenu)void Insert(size_t pos,
+                                 int id,
+                                 const wxString& text,
+                                 wxMenu *submenu,
+                                 const wxString& help = wxEmptyString);
+    %name(InsertItem)bool Insert(size_t pos, wxMenuItem *item);
+
+
+    void Prepend(int id,
+                 const wxString& text,
+                 const wxString& help = wxEmptyString,
+                 wxItemKind kind = wxItem_Normal);
+    void PrependSeparator();
+    void PrependCheckItem(int id,
+                          const wxString& text,
+                          const wxString& help = wxEmptyString);
+    void PrependRadioItem(int id,
+                          const wxString& text,
+                          const wxString& help = wxEmptyString);
+    %name(PrependMenu)void Prepend(int id,
+                                   const wxString& text,
+                                   wxMenu *submenu,
+                                   const wxString& help = wxEmptyString);
+    %name(PrependItem)void Prepend(wxMenuItem *item);
+
+
     void Break();
     void Check(int id, bool flag);
     bool IsChecked(int id);
@@ -578,10 +649,12 @@ public:
 
     bool Delete(int id);
     %name(DeleteItem)bool Delete(wxMenuItem *item);
-    bool Insert(size_t pos, wxMenuItem *item);
     wxMenuItem *Remove(int id);
     %name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
 
+
+
+
     %addmethods {
         void Destroy() { delete self; }
     }
@@ -653,7 +726,8 @@ public:
     wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
                const wxString& text = wxEmptyString,
                const wxString& help = wxEmptyString,
-               bool isCheckable = FALSE, wxMenu* subMenu = NULL);
+               wxItemKind kind = wxItem_Normal,
+               wxMenu* subMenu = NULL);
 
 
     wxMenu *GetMenu();
@@ -663,6 +737,7 @@ public:
     void SetText(const wxString& str);
     wxString GetLabel();
     const wxString& GetText();
+    wxItemKind GetKind();
     void SetCheckable(bool checkable);
     bool IsCheckable();
     bool IsSubMenu();
@@ -679,6 +754,7 @@ public:
     void SetAccel(wxAcceleratorEntry *accel);
 
     static wxString GetLabelFromText(const wxString& text);
+//    static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
 
     // wxOwnerDrawn methods
 #ifdef __WXMSW__