📄 _controls.py
字号:
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
import _controls_
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
wx = _core
#---------------------------------------------------------------------------
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):
"""
A button is a control that contains a text string, and is one of the most
common elements of a GUI. It may be placed on a dialog box or panel, or
indeed almost any other window.
"""
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__(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=ButtonNameStr) -> 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.
"""
_controls_.Button_swiginit(self,_controls_.new_Button(*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=ButtonNameStr) -> bool
Acutally create the GUI Button for 2-phase creation.
"""
return _controls_.Button_Create(*args, **kwargs)
def SetDefault(*args, **kwargs):
"""
SetDefault(self)
This sets the button to be the default item for the panel or dialog box.
"""
return _controls_.Button_SetDefault(*args, **kwargs)
def GetDefaultSize(*args, **kwargs):
"""
GetDefaultSize() -> Size
Returns the default button size for this platform.
"""
return _controls_.Button_GetDefaultSize(*args, **kwargs)
GetDefaultSize = staticmethod(GetDefaultSize)
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_.Button_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
_controls_.Button_swigregister(Button)
cvar = _controls_.cvar
ButtonNameStr = cvar.ButtonNameStr
def PreButton(*args, **kwargs):
"""
PreButton() -> Button
Precreate a Button for 2-phase creation.
"""
val = _controls_.new_PreButton(*args, **kwargs)
return val
def Button_GetDefaultSize(*args):
"""
Button_GetDefaultSize() -> Size
Returns the default button size for this platform.
"""
return _controls_.Button_GetDefaultSize(*args)
def Button_GetClassDefaultAttributes(*args, **kwargs):
"""
Button_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_.Button_GetClassDefaultAttributes(*args, **kwargs)
class BitmapButton(Button):
"""
A Button that contains a bitmap. A bitmap button can be supplied with a
single bitmap, and wxWidgets will draw all button states using this bitmap. If
the application needs more control, additional bitmaps for the selected state,
unpressed focused state, and greyed-out state may be supplied.
"""
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__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=BU_AUTODRAW, Validator validator=DefaultValidator,
String name=ButtonNameStr) -> BitmapButton
Create and show a button with a bitmap for the label.
"""
_controls_.BitmapButton_swiginit(self,_controls_.new_BitmapButton(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=BU_AUTODRAW, Validator validator=DefaultValidator,
String name=ButtonNameStr) -> bool
Acutally create the GUI BitmapButton for 2-phase creation.
"""
return _controls_.BitmapButton_Create(*args, **kwargs)
def GetBitmapLabel(*args, **kwargs):
"""
GetBitmapLabel(self) -> Bitmap
Returns the label bitmap (the one passed to the constructor).
"""
return _controls_.BitmapButton_GetBitmapLabel(*args, **kwargs)
def GetBitmapDisabled(*args, **kwargs):
"""
GetBitmapDisabled(self) -> Bitmap
Returns the bitmap for the disabled state.
"""
return _controls_.BitmapButton_GetBitmapDisabled(*args, **kwargs)
def GetBitmapFocus(*args, **kwargs):
"""
GetBitmapFocus(self) -> Bitmap
Returns the bitmap for the focused state.
"""
return _controls_.BitmapButton_GetBitmapFocus(*args, **kwargs)
def GetBitmapSelected(*args, **kwargs):
"""
GetBitmapSelected(self) -> Bitmap
Returns the bitmap for the selected state.
"""
return _controls_.BitmapButton_GetBitmapSelected(*args, **kwargs)
def GetBitmapHover(*args, **kwargs):
"""
GetBitmapHover(self) -> Bitmap
Returns the bitmap used when the mouse is over the button, may be invalid.
"""
return _controls_.BitmapButton_GetBitmapHover(*args, **kwargs)
def SetBitmapDisabled(*args, **kwargs):
"""
SetBitmapDisabled(self, Bitmap bitmap)
Sets the bitmap for the disabled button appearance.
"""
return _controls_.BitmapButton_SetBitmapDisabled(*args, **kwargs)
def SetBitmapFocus(*args, **kwargs):
"""
SetBitmapFocus(self, Bitmap bitmap)
Sets the bitmap for the button appearance when it has the keyboard focus.
"""
return _controls_.BitmapButton_SetBitmapFocus(*args, **kwargs)
def SetBitmapSelected(*args, **kwargs):
"""
SetBitmapSelected(self, Bitmap bitmap)
Sets the bitmap for the selected (depressed) button appearance.
"""
return _controls_.BitmapButton_SetBitmapSelected(*args, **kwargs)
def SetBitmapLabel(*args, **kwargs):
"""
SetBitmapLabel(self, Bitmap bitmap)
Sets the bitmap label for the button. This is the bitmap used for the
unselected state, and for all other states if no other bitmaps are provided.
"""
return _controls_.BitmapButton_SetBitmapLabel(*args, **kwargs)
def SetBitmapHover(*args, **kwargs):
"""
SetBitmapHover(self, Bitmap hover)
Sets the bitmap to be shown when the mouse is over the button. This function
is new since wxWidgets version 2.7.0 and the hover bitmap is currently only
supported in wxMSW.
"""
return _controls_.BitmapButton_SetBitmapHover(*args, **kwargs)
def SetMargins(*args, **kwargs):
"""SetMargins(self, int x, int y)"""
return _controls_.BitmapButton_SetMargins(*args, **kwargs)
def GetMarginX(*args, **kwargs):
"""GetMarginX(self) -> int"""
return _controls_.BitmapButton_GetMarginX(*args, **kwargs)
def GetMarginY(*args, **kwargs):
"""GetMarginY(self) -> int"""
return _controls_.BitmapButton_GetMarginY(*args, **kwargs)
_controls_.BitmapButton_swigregister(BitmapButton)
def PreBitmapButton(*args, **kwargs):
"""
PreBitmapButton() -> BitmapButton
Precreate a BitmapButton for 2-phase creation.
"""
val = _controls_.new_PreBitmapButton(*args, **kwargs)
return val
#---------------------------------------------------------------------------
CHK_2STATE = _controls_.CHK_2STATE
CHK_3STATE = _controls_.CHK_3STATE
CHK_ALLOW_3RD_STATE_FOR_USER = _controls_.CHK_ALLOW_3RD_STATE_FOR_USER
CHK_UNCHECKED = _controls_.CHK_UNCHECKED
CHK_CHECKED = _controls_.CHK_CHECKED
CHK_UNDETERMINED = _controls_.CHK_UNDETERMINED
class CheckBox(_core.Control):
"""
A checkbox is a labelled box which by default is either on (the
checkmark is visible) or off (no checkmark). Optionally (When the
wx.CHK_3STATE style flag is set) it can have a third state, called the
mixed or undetermined state. Often this is used as a "Does Not
Apply" state.
"""
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):
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -