]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_controls.py
better root dir for rc uploads
[wxWidgets.git] / wxPython / src / gtk / _controls.py
index aaf4a7c9aaf73401387fe6a2396bc7a898fff417..29a1b2d17dd3b4c554c2e00e5720301f6c8287be 100644 (file)
@@ -502,31 +502,6 @@ class Choice(_core.ControlWithItems):
         """
         return _controls_.Choice_Create(*args, **kwargs)
 
-    def SetSelection(*args, **kwargs):
-        """
-        SetSelection(self, int n)
-
-        Select the n'th item (zero based) in the list.
-        """
-        return _controls_.Choice_SetSelection(*args, **kwargs)
-
-    def SetStringSelection(*args, **kwargs):
-        """
-        SetStringSelection(self, String string) -> bool
-
-        Select the item with the specifed string
-        """
-        return _controls_.Choice_SetStringSelection(*args, **kwargs)
-
-    def SetString(*args, **kwargs):
-        """
-        SetString(self, int n, String string)
-
-        Set the label for the n'th item (zero based) in the list.
-        """
-        return _controls_.Choice_SetString(*args, **kwargs)
-
-    Select = SetSelection 
     def GetClassDefaultAttributes(*args, **kwargs):
         """
         GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
@@ -705,6 +680,15 @@ class ComboBox(_core.Control,_core.ItemContainer):
         """
         return _controls_.ComboBox_SetMark(*args, **kwargs)
 
+    def GetMark(*args, **kwargs):
+        """
+        GetMark(self) -> (from, to)
+
+        Gets the positions of the begining and ending of the selection mark in
+        the combobox text field.
+        """
+        return _controls_.ComboBox_GetMark(*args, **kwargs)
+
     def SetStringSelection(*args, **kwargs):
         """
         SetStringSelection(self, String string) -> bool
@@ -1376,7 +1360,8 @@ class ListBox(_core.ControlWithItems):
         """
         Select(self, int n)
 
-        Sets the item at index 'n' to be the selected item.
+        This is the same as `SetSelection` and exists only because it is
+        slightly more natural for controls which support multiple selection.
         """
         return _controls_.ListBox_Select(*args, **kwargs)
 
@@ -1568,6 +1553,7 @@ TE_DONTWRAP = _controls_.TE_DONTWRAP
 TE_LINEWRAP = _controls_.TE_LINEWRAP
 TE_WORDWRAP = _controls_.TE_WORDWRAP
 TE_RICH2 = _controls_.TE_RICH2
+TE_CAPITALIZE = _controls_.TE_CAPITALIZE
 TEXT_ALIGNMENT_DEFAULT = _controls_.TEXT_ALIGNMENT_DEFAULT
 TEXT_ALIGNMENT_LEFT = _controls_.TEXT_ALIGNMENT_LEFT
 TEXT_ALIGNMENT_CENTRE = _controls_.TEXT_ALIGNMENT_CENTRE
@@ -4755,7 +4741,7 @@ class ListCtrl(_core.Control):
         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.)
+         in the second return value (see wx.LIST_HITTEST flags.)
         """
         return _controls_.ListCtrl_HitTest(*args, **kwargs)
 
@@ -4837,7 +4823,7 @@ class ListCtrl(_core.Control):
 
     def IsSelected(self, idx):
         '''return True if the item is selected'''
-        return self.GetItemState(idx, wx.LIST_STATE_SELECTED) != 0
+        return (self.GetItemState(idx, wx.LIST_STATE_SELECTED) & wx.LIST_STATE_SELECTED) != 0
 
     def SetColumnImage(self, col, image):
         item = self.GetColumn(col)
@@ -5228,6 +5214,10 @@ class TreeEvent(_core.NotifyEvent):
         """SetToolTip(self, String toolTip)"""
         return _controls_.TreeEvent_SetToolTip(*args, **kwargs)
 
+    def GetToolTip(*args, **kwargs):
+        """GetToolTip(self) -> String"""
+        return _controls_.TreeEvent_GetToolTip(*args, **kwargs)
+
 
 class TreeEventPtr(TreeEvent):
     def __init__(self, this):
@@ -6359,4 +6349,124 @@ def DragListItem(*args, **kwargs):
     val.thisown = 1
     return val
 
+#---------------------------------------------------------------------------
+
+DP_DEFAULT = _controls_.DP_DEFAULT
+DP_SPIN = _controls_.DP_SPIN
+DP_DROPDOWN = _controls_.DP_DROPDOWN
+DP_SHOWCENTURY = _controls_.DP_SHOWCENTURY
+DP_ALLOWNONE = _controls_.DP_ALLOWNONE
+class DatePickerCtrl(_core.Control):
+    """
+    This control allows the user to select a date. Unlike
+    `wx.calendar.CalendarCtrl`, which is a relatively big control,
+    `wx.DatePickerCtrl` is implemented as a small window showing the
+    currently selected date. The control can be edited using the keyboard,
+    and can also display a popup window for more user-friendly date
+    selection, depending on the styles used and the platform.
+    """
+    def __repr__(self):
+        return "<%s.%s; proxy of C++ wxDatePickerCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def __init__(self, *args, **kwargs):
+        """
+        __init__(self, Window parent, int id=-1, DateTime dt=wxDefaultDateTime, 
+            Point pos=DefaultPosition, Size size=DefaultSize, 
+            long style=wxDP_DEFAULT|wxDP_SHOWCENTURY, 
+            Validator validator=DefaultValidator, 
+            String name=DatePickerCtrlNameStr) -> DatePickerCtrl
+
+        Create a new DatePickerCtrl.
+        """
+        newobj = _controls_.new_DatePickerCtrl(*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=-1, DateTime dt=wxDefaultDateTime, 
+            Point pos=DefaultPosition, Size size=DefaultSize, 
+            long style=wxDP_DEFAULT|wxDP_SHOWCENTURY, 
+            Validator validator=DefaultValidator, 
+            String name=DatePickerCtrlNameStr) -> bool
+
+        Create the GUI parts of the DatePickerCtrl, for use in 2-phase
+        creation.
+        """
+        return _controls_.DatePickerCtrl_Create(*args, **kwargs)
+
+    def SetValue(*args, **kwargs):
+        """
+        SetValue(self, DateTime dt)
+
+        Changes the current value of the control. The date should be valid and
+        included in the currently selected range, if any.
+
+        Calling this method does not result in a date change event.
+        """
+        return _controls_.DatePickerCtrl_SetValue(*args, **kwargs)
+
+    def GetValue(*args, **kwargs):
+        """
+        GetValue(self) -> DateTime
+
+        Returns the currently selected date. If there is no selection or the
+        selection is outside of the current range, an invalid `wx.DateTime`
+        object is returned.
+        """
+        return _controls_.DatePickerCtrl_GetValue(*args, **kwargs)
+
+    def SetRange(*args, **kwargs):
+        """
+        SetRange(self, DateTime dt1, DateTime dt2)
+
+        Sets the valid range for the date selection. If dt1 is valid, it
+        becomes the earliest date (inclusive) accepted by the control. If dt2
+        is valid, it becomes the latest possible date.
+
+        If the current value of the control is outside of the newly set range
+        bounds, the behaviour is undefined.
+        """
+        return _controls_.DatePickerCtrl_SetRange(*args, **kwargs)
+
+    def GetLowerLimit(*args, **kwargs):
+        """
+        GetLowerLimit(self) -> DateTime
+
+        Get the lower limit of the valid range for the date selection, if any.
+        If there is no range or there is no lower limit, then the
+        `wx.DateTime` value returned will be invalid.
+        """
+        return _controls_.DatePickerCtrl_GetLowerLimit(*args, **kwargs)
+
+    def GetUpperLimit(*args, **kwargs):
+        """
+        GetUpperLimit(self) -> DateTime
+
+        Get the upper limit of the valid range for the date selection, if any.
+        If there is no range or there is no upper limit, then the
+        `wx.DateTime` value returned will be invalid.
+        """
+        return _controls_.DatePickerCtrl_GetUpperLimit(*args, **kwargs)
+
+
+class DatePickerCtrlPtr(DatePickerCtrl):
+    def __init__(self, this):
+        self.this = this
+        if not hasattr(self,"thisown"): self.thisown = 0
+        self.__class__ = DatePickerCtrl
+_controls_.DatePickerCtrl_swigregister(DatePickerCtrlPtr)
+DatePickerCtrlNameStr = cvar.DatePickerCtrlNameStr
+
+def PreDatePickerCtrl(*args, **kwargs):
+    """
+    PreDatePickerCtrl() -> DatePickerCtrl
+
+    Precreate a DatePickerCtrl for use in 2-phase creation.
+    """
+    val = _controls_.new_PreDatePickerCtrl(*args, **kwargs)
+    val.thisown = 1
+    return val
+