📄 _controls.py
字号:
__init__(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=CheckBoxNameStr) -> CheckBox
Creates and shows a CheckBox control
"""
_controls_.CheckBox_swiginit(self,_controls_.new_CheckBox(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=CheckBoxNameStr) -> bool
Actually create the GUI CheckBox for 2-phase creation.
"""
return _controls_.CheckBox_Create(*args, **kwargs)
def GetValue(*args, **kwargs):
"""
GetValue(self) -> bool
Gets the state of a 2-state CheckBox. Returns True if it is checked,
False otherwise.
"""
return _controls_.CheckBox_GetValue(*args, **kwargs)
def IsChecked(*args, **kwargs):
"""
IsChecked(self) -> bool
Similar to GetValue, but raises an exception if it is not a 2-state
CheckBox.
"""
return _controls_.CheckBox_IsChecked(*args, **kwargs)
def SetValue(*args, **kwargs):
"""
SetValue(self, bool state)
Set the state of a 2-state CheckBox. Pass True for checked, False for
unchecked.
"""
return _controls_.CheckBox_SetValue(*args, **kwargs)
def Get3StateValue(*args, **kwargs):
"""
Get3StateValue(self) -> int
Returns wx.CHK_UNCHECKED when the CheckBox is unchecked,
wx.CHK_CHECKED when it is checked and wx.CHK_UNDETERMINED when it's in
the undetermined state. Raises an exceptiion when the function is
used with a 2-state CheckBox.
"""
return _controls_.CheckBox_Get3StateValue(*args, **kwargs)
def Set3StateValue(*args, **kwargs):
"""
Set3StateValue(self, int state)
Sets the CheckBox to the given state. The state parameter can be one
of the following: wx.CHK_UNCHECKED (Check is off), wx.CHK_CHECKED (the
Check is on) or wx.CHK_UNDETERMINED (Check is mixed). Raises an
exception when the CheckBox is a 2-state checkbox and setting the
state to wx.CHK_UNDETERMINED.
"""
return _controls_.CheckBox_Set3StateValue(*args, **kwargs)
def Is3State(*args, **kwargs):
"""
Is3State(self) -> bool
Returns whether or not the CheckBox is a 3-state CheckBox.
"""
return _controls_.CheckBox_Is3State(*args, **kwargs)
def Is3rdStateAllowedForUser(*args, **kwargs):
"""
Is3rdStateAllowedForUser(self) -> bool
Returns whether or not the user can set the CheckBox to the third
state.
"""
return _controls_.CheckBox_Is3rdStateAllowedForUser(*args, **kwargs)
def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or fonts which might look completely out of place on the
user's system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of
the returned font. See `wx.Window.SetWindowVariant` for more about
this.
"""
return _controls_.CheckBox_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
_controls_.CheckBox_swigregister(CheckBox)
CheckBoxNameStr = cvar.CheckBoxNameStr
def PreCheckBox(*args, **kwargs):
"""
PreCheckBox() -> CheckBox
Precreate a CheckBox for 2-phase creation.
"""
val = _controls_.new_PreCheckBox(*args, **kwargs)
return val
def CheckBox_GetClassDefaultAttributes(*args, **kwargs):
"""
CheckBox_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or fonts which might look completely out of place on the
user's system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of
the returned font. See `wx.Window.SetWindowVariant` for more about
this.
"""
return _controls_.CheckBox_GetClassDefaultAttributes(*args, **kwargs)
#---------------------------------------------------------------------------
class Choice(_core.ControlWithItems):
"""
A Choice control is used to select one of a list of strings.
Unlike a `wx.ListBox`, only the selection is visible until the
user pulls down the menu of choices.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
List choices=EmptyList, long style=0, Validator validator=DefaultValidator,
String name=ChoiceNameStr) -> Choice
Create and show a Choice control
"""
_controls_.Choice_swiginit(self,_controls_.new_Choice(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
List choices=EmptyList, 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)
def GetCurrentSelection(*args, **kwargs):
"""
GetCurrentSelection(self) -> int
Unlike `GetSelection` which only returns the accepted selection value,
i.e. the selection in the control once the user closes the dropdown
list, this function returns the current selection. That is, while the
dropdown list is shown, it returns the currently selected item in
it. When it is not shown, its result is the same as for the other
function.
"""
return _controls_.Choice_GetCurrentSelection(*args, **kwargs)
def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or fonts which might look completely out of place on the
user's system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of
the returned font. See `wx.Window.SetWindowVariant` for more about
this.
"""
return _controls_.Choice_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
_controls_.Choice_swigregister(Choice)
ChoiceNameStr = cvar.ChoiceNameStr
def PreChoice(*args, **kwargs):
"""
PreChoice() -> Choice
Precreate a Choice control for 2-phase creation.
"""
val = _controls_.new_PreChoice(*args, **kwargs)
return val
def Choice_GetClassDefaultAttributes(*args, **kwargs):
"""
Choice_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or fonts which might look completely out of place on the
user's system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of
the returned font. See `wx.Window.SetWindowVariant` for more about
this.
"""
return _controls_.Choice_GetClassDefaultAttributes(*args, **kwargs)
#---------------------------------------------------------------------------
class ComboBox(_core.Control,_core.ItemContainer):
"""
A combobox is like a combination of an edit control and a
listbox. It can be displayed as static list with editable or
read-only text field; or a drop-down list with text field.
A combobox permits a single selection only. Combobox items are
numbered from zero.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(Window parent, int id, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
List choices=EmptyList, long style=0, Validator validator=DefaultValidator,
String name=ComboBoxNameStr) -> ComboBox
Constructor, creates and shows a ComboBox control.
"""
_controls_.ComboBox_swiginit(self,_controls_.new_ComboBox(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(Window parent, int id, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
List choices=EmptyList, 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)
def GetValue(*args, **kwargs):
"""
GetValue(self) -> String
Returns the current value in the combobox text field.
"""
return _controls_.ComboBox_GetValue(*args, **kwargs)
def SetValue(*args, **kwargs):
"""SetValue(self, String value)"""
return _controls_.ComboBox_SetValue(*args, **kwargs)
def Copy(*args, **kwargs):
"""
Copy(self)
Copies the selected text to the clipboard.
"""
return _controls_.ComboBox_Copy(*args, **kwargs)
def Cut(*args, **kwargs):
"""
Cut(self)
Copies the selected text to the clipboard and removes the selection.
"""
return _controls_.ComboBox_Cut(*args, **kwargs)
def Paste(*args, **kwargs):
"""
Paste(self)
Pastes text from the clipboard to the text field.
"""
return _controls_.ComboBox_Paste(*args, **kwargs)
def SetInsertionPoint(*args, **kwargs):
"""
SetInsertionPoint(self, long pos)
Sets the insertion point in the combobox text field.
"""
return _controls_.ComboBox_SetInsertionPoint(*args, **kwargs)
def GetInsertionPoint(*args, **kwargs):
"""
GetInsertionPoint(self) -> long
Returns the insertion point for the combobox's text field.
"""
return _controls_.ComboBox_GetInsertionPoint(*args, **kwargs)
def GetLastPosition(*args, **kwargs):
"""
GetLastPosition(self) -> long
Returns the last position in the combobox text field.
"""
return _controls_.ComboBox_GetLastPosition(*args, **kwargs)
def Replace(*args, **kwargs):
"""
Replace(self, long from, long to, String value)
Replaces the text between two positions with the given text, in the
combobox text field.
"""
return _controls_.ComboBox_Replace(*args, **kwargs)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -