本文整理汇总了Python中wx.Gauge方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Gauge方法的具体用法?Python wx.Gauge怎么用?Python wx.Gauge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.Gauge方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_components
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def _init_components(self):
self.cancel_button = self.button(_('cancel'), wx.ID_CANCEL, event_id=events.WINDOW_CANCEL)
self.stop_button = self.button(_('stop'), wx.ID_OK, event_id=events.WINDOW_STOP)
self.start_button = self.button(_('start'), wx.ID_OK, event_id=int(events.WINDOW_START))
self.close_button = self.button(_("close"), wx.ID_OK, event_id=int(events.WINDOW_CLOSE))
self.restart_button = self.button(_('restart'), wx.ID_OK, event_id=int(events.WINDOW_RESTART))
self.edit_button = self.button(_('edit'), wx.ID_OK, event_id=int(events.WINDOW_EDIT))
self.progress_bar = wx.Gauge(self, range=100)
self.buttons = [self.cancel_button, self.start_button,
self.stop_button, self.close_button,
self.restart_button, self.edit_button]
if self.buildSpec['disable_stop_button']:
self.stop_button.Enable(False)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetTitle("frame_1")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.gauge_1 = wx.Gauge(self, wx.ID_ANY, 10)
sizer_1.Add(self.gauge_1, 0, 0, 0)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
self.Layout()
# end wxGlade
# end of class MyFrame
示例3: initTotal
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def initTotal(self, total):
self.total = total if total > 0 else 0
self.gauge_total = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize,
wx.GA_HORIZONTAL)
self.gauge_total.SetValue(0)
self.text_percent = wx.StaticText(self, wx.ID_ANY, '0%', wx.DefaultPosition,
wx.Size(42, -1), wx.ALIGN_RIGHT)
self.text_speed = wx.StaticText(self, wx.ID_ANY, '0B/s', wx.DefaultPosition, wx.Size(65, -1),
wx.ALIGN_RIGHT)
self.text_percent.Wrap(-1)
self.text_speed.Wrap(-1)
self.sizer_total.Add(self.text_percent, 0, wx.ALL, 5)
self.sizer_total.Add(self.gauge_total, 5, wx.ALL | wx.EXPAND, 5)
self.sizer_total.Add(self.text_speed, 0, wx.ALL, 5)
示例4: _init_components
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def _init_components(self):
self.cancel_button = self.button(i18n._('cancel'), wx.ID_CANCEL, event_id=int(events.WINDOW_CANCEL))
self.stop_button = self.button(i18n._('stop'), wx.ID_OK, event_id=int(events.WINDOW_STOP))
self.start_button = self.button(i18n._('start'), wx.ID_OK, event_id=int(events.WINDOW_START))
self.close_button = self.button(i18n._("close"), wx.ID_OK, event_id=int(events.WINDOW_CLOSE))
self.restart_button = self.button(i18n._('restart'), wx.ID_OK, event_id=int(events.WINDOW_RESTART))
self.edit_button = self.button(i18n._('edit'), wx.ID_OK, event_id=int(events.WINDOW_EDIT))
self.progress_bar = wx.Gauge(self, range=100)
self.buttons = [self.cancel_button, self.start_button,
self.stop_button, self.close_button,
self.restart_button, self.edit_button]
示例5: create_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def create_widget(self):
self.widget = wx.Gauge(self.parent_window.widget, self.id, self.range, style=self.style)
if self.range>=3: self.widget.SetValue(self.range//3)
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, parent, title, total_byte, dlm):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=title, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE)
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
self.global_sizer = wx.BoxSizer(wx.VERTICAL)
self.gauge_progress = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL)
self.gauge_progress.SetValue(524)
self.global_sizer.Add(self.gauge_progress, 0, wx.ALL | wx.EXPAND, 5)
sizer_info = wx.BoxSizer(wx.HORIZONTAL)
self.text_percent = wx.StaticText(self, wx.ID_ANY, u"0.0%", wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_LEFT)
self.text_percent.Wrap(-1)
sizer_info.Add(self.text_percent, 1, wx.ALL, 5)
self.total_byte = total_byte
self.format_int = '%0' + str(len(str(self.total_byte))) + 'd/%0' + str(len(str(self.total_byte))) + 'd'
self.text_progress = wx.StaticText(self, wx.ID_ANY, self.format_int % (0, self.total_byte), wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_RIGHT)
self.text_progress.Wrap(-1)
sizer_info.Add(self.text_progress, 1, wx.ALIGN_RIGHT | wx.ALL, 5)
self.global_sizer.Add(sizer_info, 1, wx.EXPAND, 5)
self.SetSizer(self.global_sizer)
self.Layout()
self.global_sizer.Fit(self)
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.onClose)
self.timer = wx.Timer()
self.timer.SetOwner(self, wx.ID_ANY)
self.dlm = dlm
示例7: initWidget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def initWidget(self, **kwargs):
name = kwargs.get('name', '')
current = kwargs.get('current', 0)
percent = current*100.0 / self.total if self.total > 0 else 0
speed = format_byte(kwargs.get('speed', 0), '%.1f%s/S')
self.text_name = wx.StaticText(self.parent, wx.ID_ANY, name, wx.DefaultPosition, wx.Size(20, -1),
wx.ALIGN_RIGHT)
self.text_percent = wx.StaticText(self.parent, wx.ID_ANY, str(round(percent, 1)) + '%', wx.DefaultPosition,
wx.Size(40, -1), wx.ALIGN_RIGHT)
self.text_speed = wx.StaticText(self.parent, wx.ID_ANY, speed, wx.DefaultPosition, wx.Size(65, -1),
wx.ALIGN_RIGHT)
self.text_name.Wrap(-1)
self.text_percent.Wrap(-1)
self.text_speed.Wrap(-1)
self.gauge_progress = wx.Gauge(self.parent, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize,
wx.GA_HORIZONTAL)
self.gauge_progress.SetValue(int(percent*100))
self.Add(self.text_name, 0, wx.ALIGN_RIGHT | wx.ALL, 5)
self.Add(self.gauge_progress, 5, wx.ALL, 5)
self.Add(self.text_percent, 0, wx.ALL, 5)
self.Add(self.text_speed, 0, wx.ALL, 5)
# self.Add(self.text_progress, 0, wx.ALL, 5)
staticline1 = wx.StaticLine(self.parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
self.Add(staticline1, 0, wx.EXPAND | wx.ALL, 2)
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, parent, fontsize, maximum, title, formatting_string, vertical=False):
wx.Frame.__init__(self, parent, style=wx.NO_BORDER)
if isinstance(maximum, list):
self.list_maximum = maximum
self.list_title = title
self.list_formatting_string = formatting_string
else:
self.list_maximum = [maximum]
self.list_title = [title]
self.list_formatting_string = [formatting_string]
self.labels = []
self.titles = []
self.gauges = []
self.sizer = wx.GridBagSizer(5, 5)
for i in range(len(self.list_maximum)):
if vertical:
if title:
self.titles.append(wx.StaticText(self, label=self.list_title[i] + ':', style=wx.ALIGN_LEFT))
self.labels.append(wx.StaticText(self, style=wx.ALIGN_RIGHT))
self.gauges.append(wx.Gauge(self, range=self.list_maximum[i]))
else:
if title:
self.titles.append(wx.StaticText(self, label=self.list_title[i], style=wx.ALIGN_CENTER))
self.labels.append(wx.StaticText(self, style=wx.ALIGN_CENTRE_HORIZONTAL))
self.gauges.append(wx.Gauge(self, range=self.list_maximum[i], style=wx.GA_VERTICAL))
font = wx.Font(fontsize, wx.DEFAULT, wx.NORMAL, wx.BOLD)
self.labels[i].SetFont(font)
if title:
self.titles[i].SetFont(font)
if vertical:
if title:
self.sizer.Add(self.titles[i], pos=(i, 0), flag=wx.ALL|wx.ALIGN_BOTTOM)
self.sizer.Add(self.gauges[i], pos=(i, 1), flag=wx.ALL|wx.EXPAND)
self.sizer.Add(self.labels[i], pos=(i, 2), flag=wx.ALL|wx.ALIGN_BOTTOM)
else:
if title:
self.sizer.Add(self.titles[i], pos=(0, i), flag=wx.ALL|wx.ALIGN_CENTER)
extra = wx.BoxSizer(wx.HORIZONTAL)
extra.AddStretchSpacer()
extra.Add(self.gauges[i], flag=wx.EXPAND)
extra.AddStretchSpacer()
self.sizer.Add(extra, pos=(1, i), flag=wx.ALL|wx.EXPAND)
self.sizer.Add(self.labels[i], pos=(2, i), flag=wx.ALL|wx.ALIGN_CENTER)
self.sizer.AddGrowableCol(i, 0)
if vertical:
self.sizer.AddGrowableCol(1, 1)
else:
self.sizer.AddGrowableRow(1)
self.SetSizer(self.sizer)
self.sizer.Fit(self)
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, parent, file_list, announce, piece_length, title,
comment, config):
BTDialog.__init__(self, parent=parent, size=(400,-1))
self.parent = parent
self.SetTitle(_("Building torrents..."))
self.file_list = file_list
self.announce = deunicode(announce)
self.piece_length = piece_length
self.title = deunicode(title)
self.comment = deunicode(comment)
self.config = config
self.flag = Event() # ???
self.vbox = VSizer()
self.label = wx.StaticText(self, label=_("Checking file sizes..."))
#self.label.set_line_wrap(True)
self.vbox.AddFirst(self.label, flag=wx.ALIGN_LEFT)
self.progressbar = wx.Gauge(self, range = 1000, size=(400, 25), style = wx.GA_SMOOTH)
self.vbox.Add(self.progressbar, flag=wx.GROW)
self.vbox.Add(wx.StaticLine(self, style=wx.LI_HORIZONTAL), flag=wx.GROW)
self.action_area = wx.BoxSizer(wx.HORIZONTAL)
self.cancelbutton = wx.Button(self, label=_("&Abort"))
self.cancelbutton.Bind(wx.EVT_BUTTON, self.cancel)
self.action_area.Add(self.cancelbutton,
flag=wx.LEFT|wx.RIGHT|wx.BOTTOM, border=SPACING)
self.done_button = wx.Button(self, label=_("&Ok"))
self.done_button.Bind(wx.EVT_BUTTON, self.cancel)
self.action_area.Add(self.done_button,
flag=wx.LEFT|wx.RIGHT|wx.BOTTOM, border=SPACING)
self.action_area.Show(self.done_button, False)
self.seed_button = wx.Button(self, label=_("&Start seeding"))
self.seed_button.Bind(wx.EVT_BUTTON, self.seed)
self.action_area.Add(self.seed_button,
flag=wx.RIGHT|wx.BOTTOM, border=SPACING)
self.action_area.Show(self.seed_button, False)
self.Bind(wx.EVT_CLOSE, self.cancel)
self.vbox.Add(self.action_area, flag=wx.ALIGN_RIGHT,
border=0)
self.SetSizerAndFit(self.vbox)
self.Show()
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, parent):
wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u'FFMPEG 输出窗口', pos=wx.DefaultPosition,
size=wx.Size(427, 450), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
self.SetSizeHints(wx.Size(427, 381), wx.DefaultSize)
self.SetBackgroundColour(wx.Colour(240, 240, 240))
sizer = wx.BoxSizer(wx.VERTICAL)
self.textctrl_output = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(427, 381),
wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)
self.textctrl_output.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "宋体"))
self.staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
self.text_remain = wx.StaticText(self, wx.ID_ANY, u"估计还剩 00:00:00", wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_RIGHT)
self.text_remain.Wrap(-1)
self.gauge_progress = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL)
self.gauge_progress.SetValue(0)
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
self.text_percent = wx.StaticText(self, wx.ID_ANY, u"0.0%", wx.DefaultPosition, wx.DefaultSize, 0)
self.text_percent.Wrap(-1)
self.text_size = wx.StaticText(self, wx.ID_ANY, u"0kb", wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_RIGHT)
self.text_size.Wrap(-1)
sizer_1.Add(self.text_percent, 1, wx.ALL | wx.EXPAND, 2)
sizer_1.Add(self.text_size, 1, wx.ALL | wx.EXPAND, 2)
sizer.Add(self.textctrl_output, 1, wx.ALL | wx.EXPAND, 2)
sizer.Add(self.staticline, 0, wx.EXPAND | wx.ALL, 5)
sizer.Add(self.text_remain, 0, wx.ALL | wx.EXPAND, 2)
sizer.Add(self.gauge_progress, 0, wx.ALL | wx.EXPAND, 2)
sizer.Add(sizer_1, 0, wx.ALL | wx.EXPAND, 3)
self.menu_bar = MergerMenuBar(0)
self.SetMenuBar(self.menu_bar)
self.SetSizer(sizer)
self.Layout()
self.Centre(wx.BOTH)
self.textctrl_output.Connect(-1, -1, EVT_OUTPUT_APPEND, self.AppendText)
self.gauge_progress.Connect(-1, -1, EVT_OUTPUT_UPDATE, self.update)
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Gauge [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: Controller.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((499, 505))
self.button_controller_control = wx.Button(self, wx.ID_ANY, _("Start Controller"))
self.text_controller_status = wx.TextCtrl(self, wx.ID_ANY, "")
self.button_device_connect = wx.Button(self, wx.ID_ANY, _("Connection"))
self.text_connection_status = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_device = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_location = wx.TextCtrl(self, wx.ID_ANY, "")
self.gauge_buffer = wx.Gauge(self, wx.ID_ANY, 10)
self.checkbox_limit_buffer = wx.CheckBox(self, wx.ID_ANY, _("Limit Write Buffer"))
self.text_buffer_length = wx.TextCtrl(self, wx.ID_ANY, "")
self.spin_packet_buffer_max = wx.SpinCtrl(self, wx.ID_ANY, "1500", min=1, max=100000)
self.button_buffer_viewer = wx.BitmapButton(self, wx.ID_ANY, icons8_comments_50.GetBitmap())
self.packet_count_text = wx.TextCtrl(self, wx.ID_ANY, "")
self.rejected_packet_count_text = wx.TextCtrl(self, wx.ID_ANY, "")
self.packet_text_text = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_0 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_1 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_desc = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_2 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_3 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_4 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_byte_5 = wx.TextCtrl(self, wx.ID_ANY, "")
self.button_pause = wx.BitmapButton(self, wx.ID_ANY, icons8_pause_50.GetBitmap())
self.button_stop = wx.BitmapButton(self, wx.ID_ANY, icons8_stop_sign_50.GetBitmap())
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.on_button_connect, self.button_device_connect)
self.Bind(wx.EVT_CHECKBOX, self.on_check_limit_packet_buffer, self.checkbox_limit_buffer)
self.Bind(wx.EVT_SPINCTRL, self.on_spin_packet_buffer_max, self.spin_packet_buffer_max)
self.Bind(wx.EVT_TEXT, self.on_spin_packet_buffer_max, self.spin_packet_buffer_max)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_packet_buffer_max, self.spin_packet_buffer_max)
self.Bind(wx.EVT_BUTTON, lambda e: self.device.open('window', "BufferView", None, -1, ""), self.button_buffer_viewer)
self.Bind(wx.EVT_BUTTON, self.on_button_pause_resume, self.button_pause)
self.Bind(wx.EVT_BUTTON, self.on_button_emergency_stop, self.button_stop)
# end wxGlade
self.Bind(wx.EVT_CLOSE, self.on_close, self)
self.Bind(wx.EVT_RIGHT_DOWN, self.on_controller_menu, self)
self.buffer_max = 1
self.last_control_state = None