Python wx.LI_HORIZONTAL Examples

The following are 11 code examples of wx.LI_HORIZONTAL(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def horizontal_rule(parent):
  return _rule(parent, wx.LI_HORIZONTAL) 
Example #2
Source File: display_main.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _draw_horizontal_line(self, sizer):
    line = wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL)
    line.SetSize((10, 10))
    sizer.Add(line, 0, wx.EXPAND) 
Example #3
Source File: styling.py    From pyFileFixity with MIT License 5 votes vote down vote up
def HorizontalRule(parent):
  line = wx.StaticLine(parent, -1, style=wx.LI_HORIZONTAL)
  line.SetSize((10, 10))
  return line 
Example #4
Source File: wx_util.py    From pyFileFixity with MIT License 5 votes vote down vote up
def horizontal_rule(parent):
  return _rule(parent, wx.LI_HORIZONTAL) 
Example #5
Source File: wx_util.py    From Gooey with MIT License 5 votes vote down vote up
def horizontal_rule(parent):
    return _rule(parent, wx.LI_HORIZONTAL) 
Example #6
Source File: item_sizer.py    From iqiyi-parser with MIT License 5 votes vote down vote up
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) 
Example #7
Source File: elecsus_gui.py    From ElecSus with Apache License 2.0 4 votes vote down vote up
def __init__(self,parent,title,id):
		""" Dialog box for selecting advanced fit options which are passed through to lmfit optimisation routines """
		
		wx.Dialog.__init__(self,parent,id,title,size=(500,900))
				
		# main sizer for this dialog box
		panel_sizer = wx.BoxSizer(wx.VERTICAL)
		
		panel_blurb = wx.StaticText(self,wx.ID_ANY,"These are the options given to lmfit when fitting data. \n\n BLURB TO UPDATE LATER",size=(460,-1),style=wx.ALIGN_CENTRE_HORIZONTAL)
		panel_blurb.Wrap(460)
		
		#### UPDATE FOR DIFFERENTIAL EVOLUTION + BOUNDS ON FIT PARAMETERS ####
		
		self.fitopt_labels = ['Max Iterations (maxfev)', 'Max Tolerance [1e-8] (ftol)']
		self.fitopt_argnames = ['maxfev', 'ftol']
		fitopt_defaults = [1000, 15]
		fitopt_increments = [100, 1]
		self.fitopt_scaling = [1, 1e-9]
		fitopt_texts = [ wx.StaticText(self,wx.ID_ANY,label) for label in self.fitopt_labels ]
		self.fitopt_ctrl = [ wx.SpinCtrl(self,value=str(defval),size=(80,-1),min=0,max=10000,initial=defval) for defval,definc in zip(fitopt_defaults, fitopt_increments) ]
		
		panel_sizer.Add((-1,10),0,wx.EXPAND)
		panel_sizer.Add(panel_blurb,0,wx.LEFT|wx.RIGHT,border=20)
		panel_sizer.Add((-1,15),0,wx.EXPAND)
		panel_sizer.Add(wx.StaticLine(self,-1,size=(-1,1),style=wx.LI_HORIZONTAL),0,wx.EXPAND|wx.LEFT|wx.RIGHT,border=20
		)
		panel_sizer.Add((-1,15),0,wx.EXPAND)

		for static,ctrl in zip(fitopt_texts, self.fitopt_ctrl):
			hor_sizer = wx.BoxSizer(wx.HORIZONTAL)
			hor_sizer.Add(static,0,wx.EXPAND|wx.LEFT,border=20)
			hor_sizer.Add((10,-1),1,wx.EXPAND)
			hor_sizer.Add(ctrl,0,wx.EXPAND|wx.RIGHT,border=20)
			panel_sizer.Add(hor_sizer,0,wx.EXPAND)
			panel_sizer.Add((-1,5),0,wx.EXPAND)
			
		# ok and cancel buttons
		btnbar = self.CreateButtonSizer(wx.OK|wx.CANCEL)

		#panel_sizer.Add((-1,10),0,wx.EXPAND)
		#panel_sizer.Add(wx.StaticLine(self,-1,size=(-1,1),style=wx.LI_HORIZONTAL),0, wx.EXPAND|wx.LEFT|wx.RIGHT,border=20)

		panel_sizer.Add((-1,10),1,wx.EXPAND)
		panel_sizer.Add(btnbar,0,wx.ALIGN_CENTER)
		panel_sizer.Add((-1,10),0,wx.EXPAND)
		
		self.SetSizer(panel_sizer)
		self.Layout() 
Example #8
Source File: MakeTorrent.py    From BitTorrent with GNU General Public License v3.0 4 votes vote down vote up
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() 
Example #9
Source File: SettingsWindow.py    From BitTorrent with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent, *a, **k):
        SettingsPanel.__init__(self, parent, *a, **k)

        # widgets
        self.confirm_checkbutton = CheckButton(
            self,
            _("Confirm before quitting %s")%app_name,
            self.settings_window,
            'confirm_quit',
            self.settings_window.config['confirm_quit'])

        # sizers
        self.sizer.AddFirst(self.confirm_checkbutton)

        if os.name == 'nt':
            # widgets
            self.enforce_checkbutton = CheckButton(
                self,
                _("Enforce .torrent associations on startup"),
                self.settings_window,
                'enforce_association',
                self.settings_window.config['enforce_association'])

            self.startup_checkbutton = CheckButton(
                self,
                _("Launch BitTorrent when Windows starts"),
                self.settings_window,
                'launch_on_startup',
                self.settings_window.config['launch_on_startup'])

            self.start_minimized_checkbutton = CheckButton(
                self,
                _("Start minimized"),
                self.settings_window,
                'start_minimized',
                self.settings_window.config['start_minimized'])

            self.minimize_checkbutton = CheckButton(
                self,
                _("Minimize to the system tray"),
                self.settings_window,
                'minimize_to_tray',
                self.settings_window.config['minimize_to_tray'])

            self.quit_checkbutton = CheckButton(
                self,
                _("Close to the system tray"),
                self.settings_window,
                'close_to_tray',
                self.settings_window.config['close_to_tray'])

            # sizers
            self.sizer.Add(wx.StaticLine(self, style=wx.LI_HORIZONTAL), flag=wx.GROW)
            self.sizer.Add(self.enforce_checkbutton)
            self.sizer.Add(wx.StaticLine(self, style=wx.LI_HORIZONTAL), flag=wx.GROW)
            self.sizer.Add(self.startup_checkbutton)
            self.sizer.Add(self.start_minimized_checkbutton)
            self.sizer.Add(wx.StaticLine(self, style=wx.LI_HORIZONTAL), flag=wx.GROW)
            self.sizer.Add(self.minimize_checkbutton)
            self.sizer.Add(self.quit_checkbutton) 
Example #10
Source File: frame_merger.py    From iqiyi-parser with MIT License 4 votes vote down vote up
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) 
Example #11
Source File: frame_downloader.py    From iqiyi-parser with MIT License 4 votes vote down vote up
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title='视频下载器', pos=wx.DefaultPosition,
                          size=wx.Size(-1, 420), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
        self.SetBackgroundColour(wx.Colour(240, 240, 240))
        self.SetMinSize(wx.Size(390, 420))
        self.SetMaxSize(wx.Size(390, 420))
        self.global_sizer = wx.BoxSizer(wx.VERTICAL)

        self.sizer_items = wx.BoxSizer(wx.VERTICAL)
        self.sizer_blocks = wx.WrapSizer(wx.HORIZONTAL)
        self.sizer_total = wx.BoxSizer(wx.HORIZONTAL)

        self.text_name = None
        self.gauge_total = None
        self.text_speed = None
        self.text_percent = None
        self.total = None
        self.text_progress = wx.StaticText(self, wx.ID_ANY, '', wx.DefaultPosition,
                                          wx.DefaultSize, wx.ALIGN_RIGHT)

        self.text_title = wx.StaticText(self, wx.ID_ANY, '', wx.DefaultPosition,
                                          wx.Size(150, -1), wx.ALIGN_LEFT)

        staticline1 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        staticline2 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        staticline3 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)

        self.sizer_top = wx.BoxSizer(wx.HORIZONTAL)

        # self.global_sizer.Add(self.text_title, 0, wx.EXPAND | wx.ALL, 5)
        self.sizer_top.Add(self.text_title, 2, wx.EXPAND | wx.ALL, 5)
        self.sizer_top.Add(self.text_progress, 1, wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, 5)

        self.global_sizer.Add(self.sizer_top, 0, wx.EXPAND | wx.ALL, 5)

        self.global_sizer.Add(staticline1, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_items, 1, wx.ALL | wx.EXPAND, 3)
        self.global_sizer.Add(staticline2, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_blocks, 0, wx.ALL | wx.EXPAND, 5)
        self.global_sizer.Add(staticline3, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_total, 0, wx.ALL | wx.EXPAND, 5)

        self.menu_bar = MainMenuBar(0)
        self.SetMenuBar(self.menu_bar)

        self.SetSizer(self.global_sizer)
        self.Layout()
        self.Center(wx.BOTH)

        self.items_list = []
        self.items_dict = {}
        self.block_list = []

        self.timer = wx.Timer()

        self.timer.SetOwner(self, wx.ID_ANY)