Python wx.ScrolledWindow() Examples

The following are 26 code examples of wx.ScrolledWindow(). 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: BasesEtc_w_sizers_Phoenix.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyPanelScrolled.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self.SetSize((400, 300))
        self.SetScrollRate(10, 10)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        sizer_1.Add((0, 0), 0, 0, 0)

        self.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class MyPanelScrolled 
Example #2
Source File: BasesEtc.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyPanelScrolled.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self.SetScrollRate(10, 10)
        
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        
        sizer_1.Add((0, 0), 0, 0, 0)
        
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        
        self.Layout()
        # end wxGlade

# end of class MyPanelScrolled 
Example #3
Source File: main.py    From wxGlade with MIT License 6 votes vote down vote up
def _set_page_size(self, scrolled):
        # set ScrolledWindow and Panel to available size; enable scrolling, if required
        # gets available size for notebook pages
        ws, hs = self.notebook.GetSize()
        ws -= self._notebook_decoration_size[0]
        hs -= self._notebook_decoration_size[1]
        w_scrollbar = wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X)  # width a of a scrollbar

        panel = [w for w in scrolled.GetChildren() if isinstance(w, wx.Panel)][0]
        szr = panel.GetSizer()
        if not szr: return
        wm, hm = szr.GetMinSize()
        if hs<hm:
            # best size is smaller than the available height -> enable scrolling
            scrolled.SetScrollbars(1, 5, 1, int(math.ceil(hm/5.0)))
            panel.SetSize( (ws-w_scrollbar, hm) )
        else:
            panel.SetSize( (ws, hs) ) 
Example #4
Source File: panel.py    From wxGlade with MIT License 6 votes vote down vote up
def properties_changed(self, modified):
        if not modified or "scrollable" in modified:
            if self.scrollable:
                if self.klass == 'wxPanel':
                    self.properties["class"].set('wxScrolledWindow')
                self.properties['scroll_rate'].toggle_active(True)
                self.properties['scroll_rate'].set_blocked(False)
            else:
                if self.klass == 'wxScrolledWindow':
                    self.properties["class"].set('wxPanel')
                self.properties['scroll_rate'].toggle_active(False)
                self.properties['scroll_rate'].set_blocked(True)

        if self.widget and modified:
            if "scrollable" in modified and self.properties["scrollable"].previous_value!=self.scrollable:
                self.recreate_widget()
            elif "scroll_rate" in modified and self.scrollable and isinstance(self.widget, wx.ScrolledWindow):
                self.widget.SetScrollRate( *self.properties["scroll_rate"].get_tuple() )
        EditStylesMixin.properties_changed(self, modified) 
Example #5
Source File: BasesEtc_Classic.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyPanelScrolled.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self.SetScrollRate(10, 10)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        sizer_1.Add((0, 0), 0, 0, 0)

        self.SetSizer(sizer_1)
        sizer_1.Fit(self)

        self.Layout()
        # end wxGlade

# end of class MyPanelScrolled 
Example #6
Source File: panel.py    From wxGlade with MIT License 6 votes vote down vote up
def create_widget(self):
        if self.widget:
            # re-creating -> use old frame
            win = self.widget.GetTopLevelParent()
        else:
            style = wx.DEFAULT_FRAME_STYLE
            if common.pin_design_window: style |= wx.STAY_ON_TOP
            win = wx.Frame( common.main, -1, misc.design_title(self.name), size=(400, 300), style=style )
            import os, compat
            icon = compat.wx_EmptyIcon()
            xpm = os.path.join(config.icons_path, 'panel.xpm')
            icon.CopyFromBitmap(misc.get_xpm_bitmap(xpm))
            win.SetIcon(icon)
            win.Bind(wx.EVT_CLOSE, self.hide_widget)  # CLOSE event of the frame, not the panel
            if wx.Platform == '__WXMSW__':
                win.CentreOnScreen()

        if self.scrollable:
            self.widget = wx.ScrolledWindow(win, self.id, style=0)
        else:
            self.widget = wx.Panel(win, self.id, style=0)
        self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
        self.widget.GetBestSize = self.get_widget_best_size
        #self.widget.SetSize = win.SetSize 
Example #7
Source File: panel.py    From wxGlade with MIT License 6 votes vote down vote up
def initialize():
    "initialization function for the module: returns a wxBitmapButton to be added to the main palette"
    common.widget_classes['EditPanel'] = EditPanel
    common.widgets['EditPanel'] = builder
    common.widgets_from_xml['EditPanel'] = xml_builder

    common.widget_classes['EditScrolledWindow'] = EditPanel
    common.widgets_from_xml['EditScrolledWindow'] = xml_builder

    common.widget_classes['EditTopLevelPanel'] = EditTopLevelPanel
    common.widgets_from_xml['EditTopLevelPanel'] = xml_toplevel_builder
    common.widget_classes['EditTopLevelScrolledWindow'] = EditTopLevelPanel
    common.widgets_from_xml['EditTopLevelScrolledWindow'] = xml_toplevel_builder

    # these are for backwards compatibility (may be removed someday...)
    common.widgets_from_xml['SplitterPane'] = xml_builder
    common.widgets_from_xml['NotebookPane'] = xml_builder
    return common.make_object_button('EditPanel', 'panel.xpm', tip='Add a Panel/ScrolledWindow') 
Example #8
Source File: ConfigEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
def _create_ModuleLibraryEditor(self, prnt):
        self.ModuleLibraryEditor = wx.ScrolledWindow(prnt,
                                                     style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
        self.ModuleLibraryEditor.Bind(wx.EVT_SIZE, self.OnResize)

        self.ModuleLibrarySizer = LibraryEditorSizer(
            self.ModuleLibraryEditor,
            self.Controler.GetModulesLibraryInstance(),
            [
                ("ImportButton", "ImportESI", _("Import ESI file"), None),
                ("AddButton", "ImportDatabase", _("Add file from ESI files database"), self.OnAddButton),
                ("DeleteButton", "remove_element", _("Remove file from library"), None)
            ])
        self.ModuleLibrarySizer.SetControlMinSize(wx.Size(0, 200))
        self.ModuleLibraryEditor.SetSizer(self.ModuleLibrarySizer)

        return self.ModuleLibraryEditor 
Example #9
Source File: ConfigEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def _create_MasterStateEditor(self, prnt):
        self.MasterStateEditor = wx.ScrolledWindow(prnt, style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
        self.MasterStateEditor.Bind(wx.EVT_SIZE, self.OnResize)

        self.MasterStateEditor_Panel_Main_Sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
        self.MasterStateEditor_Panel_Main_Sizer.AddGrowableCol(0)
        self.MasterStateEditor_Panel_Main_Sizer.AddGrowableRow(0)

        self.MasterStateEditor_Panel = MasterStatePanelClass(self.MasterStateEditor, self.Controler)

        self.MasterStateEditor_Panel_Main_Sizer.AddSizer(self.MasterStateEditor_Panel, border=10, flag=wx.GROW)

        self.MasterStateEditor.SetSizer(self.MasterStateEditor_Panel_Main_Sizer)
        return self.MasterStateEditor 
Example #10
Source File: ConfigEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def _create_EtherCATManagementEditor(self, prnt):
        self.EtherCATManagementEditor = wx.ScrolledWindow(prnt,
                                                          style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
        self.EtherCATManagementEditor.Bind(wx.EVT_SIZE, self.OnResize)

        self.EtherCATManagermentEditor_Main_Sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
        self.EtherCATManagermentEditor_Main_Sizer.AddGrowableCol(0)
        self.EtherCATManagermentEditor_Main_Sizer.AddGrowableRow(0)

        self.EtherCATManagementTreebook = EtherCATManagementTreebook(self.EtherCATManagementEditor, self.Controler, self)

        self.EtherCATManagermentEditor_Main_Sizer.AddSizer(self.EtherCATManagementTreebook, border=10, flag=wx.GROW)

        self.EtherCATManagementEditor.SetSizer(self.EtherCATManagermentEditor_Main_Sizer)
        return self.EtherCATManagementEditor 
Example #11
Source File: EtherCATManagementEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, controler, node_editor):
        """
        Constructor
        @param parent: Reference to the parent wx.ScrolledWindow object
        @param controler: _EthercatSlaveCTN class in EthercatSlave.py
        @param node_editor: Reference to Beremiz frame
        """
        wx.Treebook.__init__(self, parent, -1, size=wx.DefaultSize, style=wx.BK_DEFAULT)
        self.parent = parent
        self.Controler = controler
        self.NodeEditor = node_editor

        self.EtherCATManagementClassObject = {}

        # fill EtherCAT Management Treebook
        panels = [
            ("Slave State",        SlaveStatePanelClass, []),
            ("SDO Management",     SDOPanelClass, []),
            ("PDO Monitoring",     PDOPanelClass, []),
            ("ESC Management",     EEPROMAccessPanel, [
                ("Smart View", SlaveSiiSmartView),
                ("Hex View", HexView)]),
            ("Register Access",     RegisterAccessPanel, [])
        ]
        for pname, pclass, subs in panels:
            self.AddPage(pclass(self, self.Controler), pname)
            for spname, spclass in subs:
                self.AddSubPage(spclass(self, self.Controler), spname)


# -------------------------------------------------------------------------------
#                    For SlaveState Panel
# ------------------------------------------------------------------------------- 
Example #12
Source File: test_editing.py    From wxGlade with MIT License 5 votes vote down vote up
def test_editing_2(self):
        basename = 'Test_Editing'
        infilename = self._get_casefile_path( '%s.wxg'%basename )
        common.main._open_app(infilename, use_progress_dialog=False, add_to_history=False)
        wx.SafeYield()
        app = common.root  # shortcut
        common.app_tree.show_toplevel( None, app.children[0] )
        # ensure that there's no overlap of elements
        self.check_no_overlap(app.children[0])

        # cut static box sizer
        widget = app.find_widget_from_path("app/frame/notebook_1/panel_1/sizer_2/sizer_1")
        parent = widget.parent
        index = widget.index
        data = self.simulate_cut(widget)
        # paste again
        self.simulate_paste(parent, index, data)

        # insert panel into splitter; change "Scrollable" to test re-creation
        widget = app.find_widget_from_path("app/frame/notebook_1/window_1/SLOT 1")
        import widgets.panel.panel
        panel = widgets.panel.panel.builder(widget.parent, widget.index)
        self.assertTrue(isinstance(panel.widget, wx.Panel))
        panel.properties["scrollable"].set(True, notify=True)
        self.assertTrue(isinstance(panel.widget, wx.ScrolledWindow))

        # set span of button inside gridbag sizer
        widget = app.find_widget_from_path("app/frame/notebook_1/window_1/window_1_pane_1/grid_sizer_1/button_3")
        widget.properties["span"].set((2,2), notify=True) 
Example #13
Source File: test_editing.py    From wxGlade with MIT License 5 votes vote down vote up
def test_editing_1(self):
        basename = 'Test_Editing'
        infilename = self._get_casefile_path( '%s.wxg'%basename )
        common.main._open_app(infilename, use_progress_dialog=False, add_to_history=False)
        wx.SafeYield()
        app = common.root  # shortcut
        common.app_tree.show_toplevel( None, app.children[0] )
        # ensure that there's no overlap of elements
        self.check_no_overlap(app.children[0])

        # cut static box sizer
        widget = app.find_widget_from_path("app/frame/notebook_1/panel_1/sizer_2/sizer_1")
        parent = widget.parent
        index = widget.index
        data = self.simulate_cut(widget)
        # paste again
        self.simulate_paste(parent, index, data)

        # insert panel into splitter; change "Scrollable" to test re-creation
        widget = app.find_widget_from_path("app/frame/notebook_1/window_1/SLOT 1")
        import widgets.panel.panel
        panel = widgets.panel.panel.builder(widget.parent, widget.index)
        self.assertTrue(isinstance(panel.widget, wx.Panel))
        panel.properties["scrollable"].set(True, notify=True)
        self.assertTrue(isinstance(panel.widget, wx.ScrolledWindow))
        #panel.widget.GetSize()
        #wx.Size(404, 659)
        #self.sleep(1.0)

        # set span of button inside gridbag sizer
        widget = app.find_widget_from_path("app/frame/notebook_1/window_1/window_1_pane_1/grid_sizer_1/button_3")
        widget.properties["span"].set((2,2), notify=True)
        #self.sleep(1.0)

        # XXX test change_sizer

        ## save and check .wxg file
        #generated_filename = self._get_outputfile_path(infilename)
        #common.main._save_app(generated_filename)
        #self._compare_files(infilename, generated_filename) 
Example #14
Source File: BasesEtc.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: wxPanel.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self.SetScrollRate(10, 10)
        self.Layout()
        # end wxGlade

# end of class wxPanel 
Example #15
Source File: chronolapsegui.py    From chronolapse with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: webcamPreviewDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.THICK_FRAME
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_1 = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
        self.previewbitmap = wx.StaticBitmap(self.panel_1, wx.ID_ANY, wx.NullBitmap)
        self.previewokbutton = wx.Button(self, wx.ID_OK, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
Example #16
Source File: panel.py    From wxGlade with MIT License 5 votes vote down vote up
def create_widget(self):
        # to be done: use ScrolledWindow only if scrolling is required
        if self.scrollable:
            self.widget = wx.ScrolledWindow(self.parent_window.widget, self.id, style=0)
        else:
            self.widget = wx.Panel(self.parent_window.widget, self.id, style=0)
        self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
        self.widget.GetBestSize = self.get_widget_best_size
        if not self.parent.IS_SIZER:
            def GetBestSize():
                if self.widget and self.widget.GetSizer():
                    return self.widget.GetSizer().GetMinSize()
                return self.widget.__class__.GetBestSize(self.widget)
            self.widget.GetBestSize = GetBestSize 
Example #17
Source File: main.py    From wxGlade with MIT License 5 votes vote down vote up
def start_page(self, name):
        # create a ScrolledWindow and a Panel; with only ScrolledWindow, scrolling on gtk 3 does not work
        scrolled = wx.ScrolledWindow( self.notebook, name=name)
        panel = wx.Panel(scrolled, name="%s properties"%name)
        if wx.VERSION[0]<3:
            panel.SetBackgroundColour(scrolled.GetBackgroundColour())
        return panel 
Example #18
Source File: edit_windows.py    From wxGlade with MIT License 5 votes vote down vote up
def _find_widget_by_pos(self, w, x,y, level=1):
        "helper for find_widget_by_pos; w is the parent window/widget"
        if w.HasMultiplePages():
            page = w.GetPage(w.GetSelection())
            x0,y0,width,height = w.GetRect()
            return self._find_widget_by_pos(page, x-x0,y-y0, level+1)
        ret = []
        # check the widget itself
        if w.IsTopLevel():  # for a Frame, Rect is the screen position
            x0,y0,width,height = w.GetClientRect()
        else:
            x0,y0,width,height = w.GetRect() # c.GetClientRect()
        if x0 <= x <= x0+width and y0 <= y <= y0+height:
            ret.append(w)
        # check the children; these are relative to this widget, so adjust x/y
        x -= x0
        y -= y0
        for c in w.GetChildren():
            x0,y0,width,height = c.GetRect() # c.GetClientRect()
            if x0 <= x <= x0+width and y0 <= y <= y0+height:
                ret.append(c)
            if isinstance(c, wx.ScrolledWindow):
                ret += self._find_widget_by_pos(c, x-x0,y-y0, level+1)
            else:
                ret += self._find_widget_by_pos(c, x,y, level+1)
        return ret 
Example #19
Source File: edit_windows.py    From wxGlade with MIT License 5 votes vote down vote up
def recreate_widget(self):
        "currently used by EditTopLevelPanel to re-create after switch between ScrolledWindow and Panel"
        # also by EditStaticText
        old_widget = self.widget
        size = self.widget.GetSize()
        with self.frozen():
            self.parent.destroying_child_widget(self, self.index)
            self.create_widget()
            if self.IS_TOPLEVEL_WINDOW: self.widget.SetSize(size)   # do this for IS_TOPLEVEL only?
            old_widget.Hide()
            if self.sel_marker:
                self.sel_marker.Destroy()
                self.sel_marker = None

            sizer = old_widget.GetSizer()
            if sizer:
                self.widget.SetSizer(sizer)
                old_widget.SetSizer(None, False)
                sizer.SetContainingWindow(self.widget)
                self._reparent_widget(sizer)
            else:
                for child in self.widget.GetChildren():
                    # actually, for now a panel may only have a sizer as child, so this code is not executed
                    self._reparent_widget(child)
            compat.DestroyLater(old_widget)
            self.finish_widget_creation(0)
            self.parent.child_widget_created(self, 0) 
Example #20
Source File: edit_windows.py    From wxGlade with MIT License 5 votes vote down vote up
def is_visible(self):
        if not self.widget: return False
        if not self.widget.IsShown() and not isinstance(self.widget, wx.ScrolledWindow): return False
        if self.IS_TOPLEVEL:
            return self.widget.GetTopLevelParent().IsShown()
        parent = self.parent
        if parent: return parent.is_visible()
        return self.widget.GetParent().IsShown() 
Example #21
Source File: panel.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent, id = -1):
        if wx.Platform != '__WXMAC__':   # some problems with this style on macs
            wx.Notebook.__init__(self, parent, id, style=wx.NB_BOTTOM)
        else:
            wx.Notebook.__init__(self, parent, id)
        global panel
        g.panel = panel = self
        self.modified = False

        # Set common button size for parameter buttons
        bTmp = wx.Button(self, -1, '')
        import params
        params.buttonSize = (self.DLG_SZE(buttonSize)[0], bTmp.GetSize()[1])
        bTmp.Destroy()
        del bTmp

        # List of child windows
        self.pages = []
        # Create scrolled windows for pages
        self.page1 = wx.ScrolledWindow(self, -1)
        sizer = wx.BoxSizer()
        sizer.Add(wx.BoxSizer())         # dummy sizer
        self.page1.SetAutoLayout(True)
        self.page1.SetSizer(sizer)
        self.AddPage(self.page1, 'Properties')
        # Second page
        self.page2 = wx.ScrolledWindow(self, -1)
        self.page2.Hide()
        sizer = wx.BoxSizer()
        sizer.Add(wx.BoxSizer())         # dummy sizer
        self.page2.SetAutoLayout(True)
        self.page2.SetSizer(sizer)
        # Cache for already used panels
        self.pageCache = {}             # cached property panels
        self.stylePageCache = {}        # cached style panels

    # Delete child windows and recreate page sizer 
Example #22
Source File: DialogUtils.py    From kicad_mmccoo with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent, singleton=True, cols=1):
        wx.Window.__init__(self, parent, wx.ID_ANY)

        self.singleton = singleton

        self.boxes = []

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(self.sizer)


        self.buttonwin = wx.Window(self)
        self.buttonsizer = wx.BoxSizer(wx.HORIZONTAL)
        self.buttonwin.SetSizer(self.buttonsizer)
        self.sizer.Add(self.buttonwin)

        if (not singleton):
            self.value = Set()

            self.selectall = wx.Button(self.buttonwin, label="select all");
            self.selectall.Bind(wx.EVT_BUTTON, self.OnSelectAllNone)
            self.buttonsizer.Add(self.selectall)

            self.selectnone = wx.Button(self.buttonwin, label="select none");
            self.selectnone.Bind(wx.EVT_BUTTON, self.OnSelectAllNone)
            self.buttonsizer.Add(self.selectnone)

        self.scrolled = wx.ScrolledWindow(self, wx.ID_ANY)
        self.sizer.Add(self.scrolled, proportion=1, flag=wx.EXPAND|wx.ALL)

        fontsz = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPixelSize()
        self.scrolled.SetScrollRate(fontsz.x, fontsz.y)

        self.scrollsizer = wx.GridSizer(cols=cols, hgap=5, vgap=5)
        self.scrolled.SetSizer(self.scrollsizer) 
Example #23
Source File: Viewer.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def _init_Editor(self, prnt):
        self.Editor = wx.ScrolledWindow(prnt, name="Viewer",
                                        pos=wx.Point(0, 0), size=wx.Size(0, 0),
                                        style=wx.HSCROLL | wx.VSCROLL)
        self.Editor.ParentWindow = self

    # Create a new Viewer 
Example #24
Source File: BasesEtc_Phoenix.py    From wxGlade with MIT License 4 votes vote down vote up
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.SetSize((400, 300))
        self.SetTitle("frame")

        # Menu Bar
        self.frame_menubar = wx.MenuBar()
        self.SetMenuBar(self.frame_menubar)
        # Menu Bar end

        self.frame_statusbar = self.CreateStatusBar(1)
        self.frame_statusbar.SetStatusWidths([-1])
        # statusbar fields
        frame_statusbar_fields = ["frame_statusbar"]
        for i in range(len(frame_statusbar_fields)):
            self.frame_statusbar.SetStatusText(frame_statusbar_fields[i], i)

        # Tool Bar
        self.frame_toolbar = wx.ToolBar(self, -1)
        self.SetToolBar(self.frame_toolbar)
        self.frame_toolbar.Realize()
        # Tool Bar end

        self.panel_x = wx.Panel(self, wx.ID_ANY)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.notebook_1 = wx.Notebook(self.panel_x, wx.ID_ANY)
        sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)

        self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.notebook_1.AddPage(self.notebook_1_pane_1, "notebook_1_pane_1")

        sizer_1.Add((20, 20), 0, 0, 0)

        self.window_1 = wx.SplitterWindow(self.panel_x, wx.ID_ANY)
        self.window_1.SetMinimumPaneSize(20)
        sizer_1.Add(self.window_1, 1, wx.EXPAND, 0)

        self.window_1_pane_1 = wx.Panel(self.window_1, wx.ID_ANY)

        self.window_1_pane_2_scrolled = wx.ScrolledWindow(self.window_1, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
        self.window_1_pane_2_scrolled.SetScrollRate(10, 10)

        self.html = wx.html.HtmlWindow(self.panel_x, wx.ID_ANY)
        sizer_1.Add(self.html, 1, wx.ALL | wx.EXPAND, 3)

        self.window_1.SplitVertically(self.window_1_pane_1, self.window_1_pane_2_scrolled)

        self.panel_x.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class MyFrame 
Example #25
Source File: BasesEtc_Classic.py    From wxGlade with MIT License 4 votes vote down vote up
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.SetSize((400, 300))
        self.SetTitle("frame")

        # Menu Bar
        self.frame_menubar = wx.MenuBar()
        self.SetMenuBar(self.frame_menubar)
        # Menu Bar end

        self.frame_statusbar = self.CreateStatusBar(1)
        self.frame_statusbar.SetStatusWidths([-1])
        # statusbar fields
        frame_statusbar_fields = ["frame_statusbar"]
        for i in range(len(frame_statusbar_fields)):
            self.frame_statusbar.SetStatusText(frame_statusbar_fields[i], i)

        # Tool Bar
        self.frame_toolbar = wx.ToolBar(self, -1)
        self.SetToolBar(self.frame_toolbar)
        self.frame_toolbar.Realize()
        # Tool Bar end

        self.panel_x = wx.Panel(self, wx.ID_ANY)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.notebook_1 = wx.Notebook(self.panel_x, wx.ID_ANY)
        sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)

        self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.notebook_1.AddPage(self.notebook_1_pane_1, "notebook_1_pane_1")

        sizer_1.Add((20, 20), 0, 0, 0)

        self.window_1 = wx.SplitterWindow(self.panel_x, wx.ID_ANY)
        self.window_1.SetMinimumPaneSize(20)
        sizer_1.Add(self.window_1, 1, wx.EXPAND, 0)

        self.window_1_pane_1 = wx.Panel(self.window_1, wx.ID_ANY)

        self.window_1_pane_2_scrolled = wx.ScrolledWindow(self.window_1, wx.ID_ANY, style=wx.TAB_TRAVERSAL)
        self.window_1_pane_2_scrolled.SetScrollRate(10, 10)

        self.html = wx.html.HtmlWindow(self.panel_x, wx.ID_ANY)
        sizer_1.Add(self.html, 1, wx.ALL | wx.EXPAND, 3)

        self.window_1.SplitVertically(self.window_1_pane_1, self.window_1_pane_2_scrolled)

        self.panel_x.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class MyFrame 
Example #26
Source File: Bling.py    From BitTorrent with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent, *a, **k):
        wx.Panel.__init__(self, parent, *a, **k)

        self.stats = {}

        self.sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.scrolled_window = wx.ScrolledWindow(self)
        self.scrolled_window.SetScrollRate(1, 1)
        self.sizer.Add(self.scrolled_window, flag=wx.GROW, proportion=1)

        self.scroll_sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.panel = wx.Panel(self.scrolled_window)
        self.scroll_sizer.Add(self.panel, flag=wx.GROW, proportion=1)

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

        self.left = wx.GridSizer(6, 2, SPACING, SPACING)
        self.outer.Add(self.left, flag=wx.ALL, border=SPACING)

        self.right = wx.GridSizer(6, 2, SPACING, SPACING)
        self.outer.Add(self.right, flag=wx.ALL, border=SPACING)

        self.add_row(self.left, "total_downrate", _("Total Download Rate:"))
        self.add_row(self.left, "total_uprate", _("Total Upload Rate:"))

        self.add_blank_row(self.left)

        self.add_row(self.left, "total_downtotal", _("Total Downloaded:"))
        self.add_row(self.left, "total_uptotal", _("Total Uploaded:"))

        self.add_row(self.right, "num_torrents", _("Torrents:"))
        self.add_row(self.right, "num_running_torrents", _("Running Torrents:"))

        self.add_blank_row(self.right)

        self.add_row(self.right, "num_connections", _("Total Connections:"))
        self.add_row(self.right, "avg_connections", _("Connections per Torrent:"))

        self.panel.SetSizerAndFit(self.outer)
        self.scrolled_window.SetSizer(self.scroll_sizer)
        self.SetSizerAndFit(self.sizer)

        # this fixes background repaint issues on XP w/ themes
        def OnSize(event):
            self.Refresh()
            event.Skip()
        self.Bind(wx.EVT_SIZE, OnSize)