本文整理汇总了Python中wx.BU_EXACTFIT属性的典型用法代码示例。如果您正苦于以下问题:Python wx.BU_EXACTFIT属性的具体用法?Python wx.BU_EXACTFIT怎么用?Python wx.BU_EXACTFIT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.BU_EXACTFIT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BU_EXACTFIT [as 别名]
def __init__(self, parent):
wx.Button.__init__(self, parent, _NTB_AXISMENU_BUTTON, "Axes: ",
style=wx.BU_EXACTFIT)
self._toolbar = parent
self._menu =wx.Menu()
self._axisId = []
# First two menu items never change...
self._allId =wx.NewId()
self._invertId =wx.NewId()
self._menu.Append(self._allId, "All", "Select all axes", False)
self._menu.Append(self._invertId, "Invert", "Invert axes selected", False)
self._menu.AppendSeparator()
bind(self, wx.EVT_BUTTON, self._onMenuButton, id=_NTB_AXISMENU_BUTTON)
bind(self, wx.EVT_MENU, self._handleSelectAllAxes, id=self._allId)
bind(self, wx.EVT_MENU, self._handleInvertAxesSelected, id=self._invertId)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BU_EXACTFIT [as 别名]
def __init__(self, parent):
wx.Button.__init__(self, parent, wx.ID_ANY, "Axes: ",
style=wx.BU_EXACTFIT)
self._toolbar = parent
self._menu = wx.Menu()
self._axisId = []
# First two menu items never change...
self._allId = wx.NewId()
self._invertId = wx.NewId()
self._menu.Append(self._allId, "All", "Select all axes", False)
self._menu.Append(self._invertId, "Invert", "Invert axes selected",
False)
self._menu.AppendSeparator()
self.Bind(wx.EVT_BUTTON, self._onMenuButton, id=self.GetId())
self.Bind(wx.EVT_MENU, self._handleSelectAllAxes, id=self._allId)
self.Bind(wx.EVT_MENU, self._handleInvertAxesSelected,
id=self._invertId)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BU_EXACTFIT [as 别名]
def __init__(self, parent):
wx.Button.__init__(self, parent, _NTB_AXISMENU_BUTTON, "Axes: ",
style=wx.BU_EXACTFIT)
self._toolbar = parent
self._menu = wx.Menu()
self._axisId = []
# First two menu items never change...
self._allId = wx.NewId()
self._invertId = wx.NewId()
self._menu.Append(self._allId, "All", "Select all axes", False)
self._menu.Append(self._invertId, "Invert", "Invert axes selected",
False)
self._menu.AppendSeparator()
self.Bind(wx.EVT_BUTTON, self._onMenuButton, id=_NTB_AXISMENU_BUTTON)
self.Bind(wx.EVT_MENU, self._handleSelectAllAxes, id=self._allId)
self.Bind(wx.EVT_MENU, self._handleInvertAxesSelected,
id=self._invertId)
示例4: get_summary_widgets
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BU_EXACTFIT [as 别名]
def get_summary_widgets(self, summary_panel):
"""Return a list of summary widgets suitable for sizer.AddMany."""
self.summary_panel = summary_panel
self.summary_name = wx.StaticText(summary_panel, -1, self.name)
self.summary_name.Bind(wx.EVT_LEFT_UP, self.show_this_panel)
self.summary_status = wx.StaticText(summary_panel, -1, STR_STOPPED)
self.summary_shares_accepted = wx.StaticText(summary_panel, -1, "0")
self.summary_shares_invalid = wx.StaticText(summary_panel, -1, "0")
self.summary_start = wx.Button(summary_panel, -1, self.get_start_stop_state(), style=wx.BU_EXACTFIT)
self.summary_start.Bind(wx.EVT_BUTTON, self.toggle_mining)
self.summary_autostart = wx.CheckBox(summary_panel, -1)
self.summary_autostart.Bind(wx.EVT_CHECKBOX, self.toggle_autostart)
self.summary_autostart.SetValue(self.autostart)
return [
(self.summary_name, 0, wx.ALIGN_CENTER_HORIZONTAL),
(self.summary_status, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_shares_accepted, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_shares_invalid, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
(self.summary_start, 0, wx.ALIGN_CENTER, 0),
(self.summary_autostart, 0, wx.ALIGN_CENTER, 0)
]
示例5: _set_widget_style
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BU_EXACTFIT [as 别名]
def _set_widget_style(self):
"""Set a new widget style if the style has changed.
For some widgets style changes are not possible, so they need to be re-created.
The attribute recreate_on_style_change needs to be True in this case."""
if not self.widget or not self.update_widget_style: return
old_style = self.widget.GetWindowStyleFlag()
new_style = self.style
if old_style == new_style: return
recreate = self.recreate_on_style_change
if self.WX_CLASS == "wxButton" and (old_style & wx.BU_EXACTFIT != new_style & wx.BU_EXACTFIT):
recreate = True # workaround
if not recreate:
# update style without re-creating the widget
self.widget.SetWindowStyleFlag(new_style)
self.widget.Refresh()
return
# some widgets can't be updated, e.g. Gauge can't be switched between horizontal and vertical after creation
# this is for ManagedBase derived classes only
with self.frozen():
focused = misc.focused_widget is self
if self.sel_marker:
self.sel_marker.Destroy()
self.sel_marker = None
old_widget = self.widget
old_widget.Hide()
if self.sizer: si = self.sizer.widget.GetItem(old_widget)
self.create_widget()
if self.sizer: compat.SizerItem_SetWindow(si, self.widget)
compat.DestroyLater(old_widget)
if self.sizer: self.sizer.item_properties_modified(self) # will call toplevel Refresh as well
self.finish_widget_creation(re_add=False)
if self.sizer: self.sizer.layout()
if focused:
misc.focused_widget = self
if self.sel_marker: self.sel_marker.Show(True)