]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_controls.py
wxPageSetupDialog no longer derives from wxDialog
[wxWidgets.git] / wxPython / src / msw / _controls.py
index e79a33ba65c269e881ee27341a85923058e796eb..a5a97e0eb803be18bd2a7ebaa169e7e7a24524a2 100644 (file)
@@ -11,6 +11,7 @@ BU_LEFT = _controls_.BU_LEFT
 BU_TOP = _controls_.BU_TOP
 BU_RIGHT = _controls_.BU_RIGHT
 BU_BOTTOM = _controls_.BU_BOTTOM
+BU_ALIGN_MASK = _controls_.BU_ALIGN_MASK
 BU_EXACTFIT = _controls_.BU_EXACTFIT
 BU_AUTODRAW = _controls_.BU_AUTODRAW
 class Button(_core.Control):
@@ -28,7 +29,11 @@ class Button(_core.Control):
             long style=0, Validator validator=DefaultValidator, 
             String name=ButtonNameStr) -> Button
 
-        Create and show a button.
+        Create and show a button.  The preferred way to create standard
+        buttons is to use a standard ID and an empty label.  In this case
+        wxWigets will automatically use a stock label that coresponds to the
+        ID given.  In additon, the button will be decorated with stock icons
+        under GTK+ 2.
         """
         newobj = _controls_.new_Button(*args, **kwargs)
         self.this = newobj.this
@@ -451,6 +456,8 @@ class Choice(_core.ControlWithItems):
         Create(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
             List choices=[], long style=0, Validator validator=DefaultValidator,
             String name=ChoiceNameStr) -> bool
+
+        Actually create the GUI Choice control for 2-phase creation
         """
         return _controls_.Choice_Create(*args, **kwargs)
 
@@ -567,6 +574,8 @@ class ComboBox(Choice):
             Point pos=DefaultPosition, Size size=DefaultSize,
             List choices=[], long style=0, Validator validator=DefaultValidator,
             String name=ChoiceNameStr) -> bool
+
+        Actually create the GUI wxComboBox control for 2-phase creation
         """
         return _controls_.ComboBox_Create(*args, **kwargs)
 
@@ -1666,7 +1675,11 @@ class TextCtrl(_core.Control):
         return _controls_.TextCtrl_IsMultiLine(*args, **kwargs)
 
     def GetSelection(*args, **kwargs):
-        """GetSelection() -> (from, to)"""
+        """
+        GetSelection() -> (from, to)
+
+        If the return values from and to are the same, there is no selection.
+        """
         return _controls_.TextCtrl_GetSelection(*args, **kwargs)
 
     def GetStringSelection(*args, **kwargs):
@@ -1746,9 +1759,25 @@ class TextCtrl(_core.Control):
         return _controls_.TextCtrl_ShowPosition(*args, **kwargs)
 
     def HitTest(*args, **kwargs):
-        """HitTest(Point pt) -> (result, row, col)"""
+        """
+        HitTest(Point pt) -> (result, row, col)
+
+        Find the row, col coresponding to the character at the point given in
+        pixels. NB: pt is in device coords but is not adjusted for the client
+        area origin nor scrolling.
+        """
         return _controls_.TextCtrl_HitTest(*args, **kwargs)
 
+    def HitTestPos(*args, **kwargs):
+        """
+        HitTestPos(Point pt) -> (result, position)
+
+        Find the character position in the text coresponding to the point
+        given in pixels. NB: pt is in device coords but is not adjusted for
+        the client area origin nor scrolling. 
+        """
+        return _controls_.TextCtrl_HitTestPos(*args, **kwargs)
+
     def Copy(*args, **kwargs):
         """Copy(self)"""
         return _controls_.TextCtrl_Copy(*args, **kwargs)
@@ -2771,6 +2800,10 @@ class BookCtrl(_core.Control):
         """GetPage(self, size_t n) -> Window"""
         return _controls_.BookCtrl_GetPage(*args, **kwargs)
 
+    def GetCurrentPage(*args, **kwargs):
+        """GetCurrentPage(self) -> Window"""
+        return _controls_.BookCtrl_GetCurrentPage(*args, **kwargs)
+
     def GetSelection(*args, **kwargs):
         """GetSelection(self) -> int"""
         return _controls_.BookCtrl_GetSelection(*args, **kwargs)
@@ -2968,17 +3001,18 @@ class Notebook(BookCtrl):
         return _controls_.Notebook_SetTabSize(*args, **kwargs)
 
     def HitTest(*args, **kwargs):
-        """HitTest(Point pt) -> (tab, where)"""
+        """
+        HitTest(Point pt) -> (tab, where)
+
+        Returns the tab which is hit, and flags indicating where using
+        wx.NB_HITTEST flags.
+        """
         return _controls_.Notebook_HitTest(*args, **kwargs)
 
     def CalcSizeFromPage(*args, **kwargs):
         """CalcSizeFromPage(self, Size sizePage) -> Size"""
         return _controls_.Notebook_CalcSizeFromPage(*args, **kwargs)
 
-    def ApplyThemeBackground(*args, **kwargs):
-        """ApplyThemeBackground(self, Window window, Colour colour)"""
-        return _controls_.Notebook_ApplyThemeBackground(*args, **kwargs)
-
     def GetClassDefaultAttributes(*args, **kwargs):
         """
         GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
@@ -3073,7 +3107,7 @@ class NotebookPage(wx.Panel):
         wx.Panel.__init__(self, parent, id, pos, size, style, name)
         self.child = None
         EVT_SIZE(self, self.OnSize)
-        
+
     def OnSize(self, evt):
         if self.child is None:
             children = self.GetChildren()
@@ -3117,6 +3151,10 @@ class Listbook(BookCtrl):
         """IsVertical(self) -> bool"""
         return _controls_.Listbook_IsVertical(*args, **kwargs)
 
+    def GetListView(*args, **kwargs):
+        """GetListView(self) -> ListView"""
+        return _controls_.Listbook_GetListView(*args, **kwargs)
+
 
 class ListbookPtr(Listbook):
     def __init__(self, this):
@@ -3156,6 +3194,80 @@ wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = _controls_.wxEVT_COMMAND_LISTBOOK_PAGE_CH
 EVT_LISTBOOK_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, 1 )
 EVT_LISTBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, 1 )
 
+CHB_DEFAULT = _controls_.CHB_DEFAULT
+CHB_TOP = _controls_.CHB_TOP
+CHB_BOTTOM = _controls_.CHB_BOTTOM
+CHB_LEFT = _controls_.CHB_LEFT
+CHB_RIGHT = _controls_.CHB_RIGHT
+CHB_ALIGN_MASK = _controls_.CHB_ALIGN_MASK
+class Choicebook(BookCtrl):
+    def __repr__(self):
+        return "<%s.%s; proxy of C++ wxChoicebook instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def __init__(self, *args, **kwargs):
+        """
+        __init__(self, Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, 
+            long style=0, String name=EmptyString) -> Choicebook
+        """
+        newobj = _controls_.new_Choicebook(*args, **kwargs)
+        self.this = newobj.this
+        self.thisown = 1
+        del newobj.thisown
+        self._setOORInfo(self)
+
+    def Create(*args, **kwargs):
+        """
+        Create(self, Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize, 
+            long style=0, String name=EmptyString) -> bool
+        """
+        return _controls_.Choicebook_Create(*args, **kwargs)
+
+    def IsVertical(*args, **kwargs):
+        """IsVertical(self) -> bool"""
+        return _controls_.Choicebook_IsVertical(*args, **kwargs)
+
+    def DeleteAllPages(*args, **kwargs):
+        """DeleteAllPages(self) -> bool"""
+        return _controls_.Choicebook_DeleteAllPages(*args, **kwargs)
+
+
+class ChoicebookPtr(Choicebook):
+    def __init__(self, this):
+        self.this = this
+        if not hasattr(self,"thisown"): self.thisown = 0
+        self.__class__ = Choicebook
+_controls_.Choicebook_swigregister(ChoicebookPtr)
+
+def PreChoicebook(*args, **kwargs):
+    """PreChoicebook() -> Choicebook"""
+    val = _controls_.new_PreChoicebook(*args, **kwargs)
+    val.thisown = 1
+    return val
+
+class ChoicebookEvent(BookCtrlEvent):
+    def __repr__(self):
+        return "<%s.%s; proxy of C++ wxChoicebookEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def __init__(self, *args, **kwargs):
+        """
+        __init__(self, wxEventType commandType=wxEVT_NULL, int id=0, int nSel=-1, 
+            int nOldSel=-1) -> ChoicebookEvent
+        """
+        newobj = _controls_.new_ChoicebookEvent(*args, **kwargs)
+        self.this = newobj.this
+        self.thisown = 1
+        del newobj.thisown
+
+class ChoicebookEventPtr(ChoicebookEvent):
+    def __init__(self, this):
+        self.this = this
+        if not hasattr(self,"thisown"): self.thisown = 0
+        self.__class__ = ChoicebookEvent
+_controls_.ChoicebookEvent_swigregister(ChoicebookEventPtr)
+
+wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = _controls_.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
+wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = _controls_.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
+EVT_CHOICEBOOK_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, 1 )
+EVT_CHOICEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, 1 )
+
 #---------------------------------------------------------------------------
 
 class BookCtrlSizer(_core.Sizer):
@@ -4203,6 +4315,9 @@ EVT_LIST_COL_DRAGGING      = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_DRAGGING
 EVT_LIST_COL_END_DRAG      = wx.PyEventBinder(wxEVT_COMMAND_LIST_COL_END_DRAG     , 1)
 EVT_LIST_ITEM_FOCUSED      = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_FOCUSED     , 1)
 
+EVT_LIST_GET_INFO = wx._deprecated(EVT_LIST_GET_INFO)
+EVT_LIST_SET_INFO = wx._deprecated(EVT_LIST_SET_INFO)
+
 #---------------------------------------------------------------------------
 
 class ListCtrl(_core.Control):
@@ -4295,7 +4410,7 @@ class ListCtrl(_core.Control):
         return _controls_.ListCtrl_SetItemState(*args, **kwargs)
 
     def SetItemImage(*args, **kwargs):
-        """SetItemImage(self, long item, int image, int selImage) -> bool"""
+        """SetItemImage(self, long item, int image, int selImage=-1) -> bool"""
         return _controls_.ListCtrl_SetItemImage(*args, **kwargs)
 
     def GetItemText(*args, **kwargs):
@@ -4450,7 +4565,12 @@ class ListCtrl(_core.Control):
         return _controls_.ListCtrl_FindItemAtPos(*args, **kwargs)
 
     def HitTest(*args, **kwargs):
-        """HitTest(Point point) -> (item, where)"""
+        """
+        HitTest(Point point) -> (item, where)
+
+        Determines which item (if any) is at the specified point, giving
+         in the second return value (see wxLIST_HITTEST_... flags.)
+        """
         return _controls_.ListCtrl_HitTest(*args, **kwargs)
 
     def InsertItem(*args, **kwargs):
@@ -5248,13 +5368,28 @@ class TreeCtrl(_core.Control):
         return _controls_.TreeCtrl_SortChildren(*args, **kwargs)
 
     def HitTest(*args, **kwargs):
-        """HitTest(Point point) -> (item, where)"""
+        """
+        HitTest(Point point) -> (item, where)
+
+        Determine which item (if any) belongs the given point.  The coordinates
+        specified are relative to the client area of tree ctrl and the where return
+        value is set to a bitmask of wxTREE_HITTEST_xxx constants.
+
+        """
         return _controls_.TreeCtrl_HitTest(*args, **kwargs)
 
     def GetBoundingRect(*args, **kwargs):
         """GetBoundingRect(self, TreeItemId item, bool textOnly=False) -> PyObject"""
         return _controls_.TreeCtrl_GetBoundingRect(*args, **kwargs)
 
+    def SetState(*args, **kwargs):
+        """SetState(self, TreeItemId node, int state)"""
+        return _controls_.TreeCtrl_SetState(*args, **kwargs)
+
+    def GetState(*args, **kwargs):
+        """GetState(self, TreeItemId node) -> int"""
+        return _controls_.TreeCtrl_GetState(*args, **kwargs)
+
     def GetClassDefaultAttributes(*args, **kwargs):
         """
         GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
@@ -5399,7 +5534,15 @@ class GenericDirCtrl(_core.Control):
         return _controls_.GenericDirCtrl_GetFilterListCtrl(*args, **kwargs)
 
     def FindChild(*args, **kwargs):
-        """FindChild(wxTreeItemId parentId, wxString path) -> (item, done)"""
+        """
+        FindChild(wxTreeItemId parentId, wxString path) -> (item, done)
+
+        Find the child that matches the first part of 'path'.  E.g. if a child
+        path is "/usr" and 'path' is "/usr/include" then the child for
+        /usr is returned.  If the path string has been used (we're at the
+        leaf), done is set to True.
+
+        """
         return _controls_.GenericDirCtrl_FindChild(*args, **kwargs)
 
     def DoResize(*args, **kwargs):