Python wx.WrapSizer() Examples

The following are 3 code examples of wx.WrapSizer(). 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: optionsframe.py    From youtube-dl-gui with The Unlicense 6 votes vote down vote up
def _set_layout(self):
        main_sizer = wx.BoxSizer(wx.HORIZONTAL)
        vertical_sizer = wx.BoxSizer(wx.VERTICAL)

        vertical_sizer.Add(self.cmdline_args_label)
        vertical_sizer.Add(self.cmdline_args_textctrl, 1, wx.EXPAND | wx.ALL, border=5)

        vertical_sizer.Add(self.extra_opts_label, flag=wx.TOP, border=5)

        extra_opts_sizer = wx.WrapSizer()
        extra_opts_sizer.Add(self.youtube_dl_debug_checkbox)
        extra_opts_sizer.AddSpacer((5, -1))
        extra_opts_sizer.Add(self.ignore_errors_checkbox)
        extra_opts_sizer.AddSpacer((5, -1))
        extra_opts_sizer.Add(self.ignore_config_checkbox)
        extra_opts_sizer.AddSpacer((5, -1))
        extra_opts_sizer.Add(self.no_mtime_checkbox)
        extra_opts_sizer.AddSpacer((5, -1))
        extra_opts_sizer.Add(self.native_hls_checkbox)

        vertical_sizer.Add(extra_opts_sizer, flag=wx.ALL, border=5)

        main_sizer.Add(vertical_sizer, 1, wx.EXPAND | wx.ALL, border=5)
        self.SetSizer(main_sizer) 
Example #2
Source File: gui.py    From superpaper with MIT License 5 votes vote down vote up
def create_sizer_diaginch_override(self):
        self.sizer_setting_diaginch.Clear(True)
        # statbox_parent_diaginch = self.sizer_setting_diaginch.GetStaticBox()
        statbox_parent_diaginch = self
        self.cb_diaginch = wx.CheckBox(statbox_parent_diaginch, -1, "Input display sizes manually")
        self.cb_diaginch.Bind(wx.EVT_CHECKBOX, self.onCheckboxDiaginch)
        st_diaginch = wx.StaticText(
            statbox_parent_diaginch, -1,
            "Display diagonal sizes (inches):"
        )
        st_diaginch.Disable()
        self.sizer_setting_diaginch.Add(self.cb_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 0)
        self.sizer_setting_diaginch.Add(st_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 10)
        # diag size data for fields
        diags = [str(dsp.diagonal_size()[1]) for dsp in self.display_sys.disp_list]
        # sizer for textctrls
        tc_list_sizer_diag = wx.WrapSizer(wx.HORIZONTAL)
        self.tc_list_diaginch = self.list_of_textctrl(statbox_parent_diaginch, wpproc.NUM_DISPLAYS, fraction=2/5)
        for tc, diag in zip(self.tc_list_diaginch, diags):
            tc_list_sizer_diag.Add(tc, 0, wx.ALIGN_LEFT|wx.ALL, 5)
            tc.ChangeValue(diag)
            tc.Disable()
        self.button_diaginch_save = wx.Button(statbox_parent_diaginch, label="Save")
        self.button_diaginch_save.Bind(wx.EVT_BUTTON, self.onSaveDiagInch)
        tc_list_sizer_diag.Add(self.button_diaginch_save, 0, wx.ALL, 5)
        self.button_diaginch_save.Disable()
        self.sizer_setting_diaginch.Add(tc_list_sizer_diag, 0, wx.ALIGN_LEFT|wx.LEFT, 5)
        self.sizer_setting_adv.Layout()
        self.sizer_main.Layout()
        self.sizer_main.Fit(self.frame)
        # Check cb according to DisplaySystem 'use_user_diags'
        self.cb_diaginch.SetValue(self.display_sys.use_user_diags)
        # Update sizer content based on new cb state
        self.onCheckboxDiaginch(None) 
Example #3
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)