Python wx.html() Examples

The following are 30 code examples of wx.html(). 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: HtmlWindow.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=HW_DEFAULT_STYLE,
        name="htmlWindow"
    ):
        wxHtmlWindow.__init__(self, parent, id, pos, size, style, name)
        self.SetForegroundColour(parent.GetForegroundColour())
        self.SetBackgroundColour(parent.GetBackgroundColour())

        #if wx.html.HW_NO_SELECTION & style:
        #    self.Bind(wx.EVT_MOTION, self.OnIdle)
        #    self.handCursor = wx.StockCursor(wx.CURSOR_HAND)
        #    self.x1, self.y1 = self.GetScrollPixelsPerUnit()
        #    self.isSet = False
        self.Bind(EVT_HTML_LINK_CLICKED, self.OnHtmlLinkClicked) 
Example #2
Source File: Input_Dialog_LAST.py    From topoflow with MIT License 6 votes vote down vote up
def on_Cancel(self, event):

        #----------------------------------------
        #  Event handler for the Cancel button.
        #----------------------------------------
        self.Destroy()

    #   on_Cancel()
    #----------------------------------------------------------------
        
#-----------------------------------------
#  Class for displaying HTML help
#  (now using webbrowser module instead).
#-----------------------------------------        
##class HTML_Help_Window(wx.Frame):
##    def __init__(self, parent, title, html_file):
##        wx.Frame.__init__(self, parent, -1, title,
##                          size=(700,800), pos=(600,50))
##        html = wx.html.HtmlWindow(self)
##        if "gtk2" in wx.PlatformInfo:
##            html.SetStandardFonts()
##
##        html.LoadPage(html_file)

#------------------------------------------------------------- 
Example #3
Source File: BasesEtc_w_sizers_Classic.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: TestPanelWithBasesInFrame.__init__
        kwds["style"] = kwds.get("style", 0)
        TestPanel.__init__(self, *args, **kwds)
        testpanel.TestPanel.__init__(self)

        sizer_2 = wx.BoxSizer(wx.VERTICAL)

        self.notebook_1 = TestNotebookWithBasesInFrame(self, wx.ID_ANY)
        sizer_2.Add(self.notebook_1, 1, wx.EXPAND, 0)

        self.window_1 = SplitterWindowWithBasesInFrame(self, wx.ID_ANY)
        sizer_2.Add(self.window_1, 1, wx.EXPAND, 0)

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

        self.SetSizer(sizer_2)

        self.Layout()
        # end wxGlade

# end of class TestPanelWithBasesInFrame 
Example #4
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: TestPanelWithBasesInFrame.__init__
        kwds["style"] = kwds.get("style", 0)
        TestPanel.__init__(self, *args, **kwds)
        testpanel.TestPanel.__init__(self)

        sizer_2 = wx.BoxSizer(wx.VERTICAL)

        self.notebook_1 = TestNotebookWithBasesInFrame(self, wx.ID_ANY)
        sizer_2.Add(self.notebook_1, 1, wx.EXPAND, 0)

        self.window_1 = SplitterWindowWithBasesInFrame(self, wx.ID_ANY)
        sizer_2.Add(self.window_1, 1, wx.EXPAND, 0)

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

        self.SetSizer(sizer_2)

        self.Layout()
        # end wxGlade

# end of class TestPanelWithBasesInFrame 
Example #5
Source File: objdictedit.py    From CANFestivino with GNU Lesser General Public License v2.1 6 votes vote down vote up
def OnHelpCANFestivalMenu(self, event):
        #self.OpenHtmlFrame("CAN Festival Reference", os.path.join(ScriptDirectory, "doc/canfestival.html"), wx.Size(1000, 600))
        if wx.Platform == '__WXMSW__':
            readerpath = get_acroversion()
            readerexepath = os.path.join(readerpath,"AcroRd32.exe")
            if(os.path.isfile(readerexepath)):
                os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(ScriptDirectory, "doc","manual_en.pdf"))
            else:
                message = wx.MessageDialog(self, _("Check if Acrobat Reader is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                message.ShowModal()
                message.Destroy()
        else:
            try:
                os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16))
            except:
                message = wx.MessageDialog(self, _("Check if xpdf is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                message.ShowModal()
                message.Destroy() 
Example #6
Source File: BasesEtc_Classic.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: TestPanelWithBasesInFrame.__init__
        kwds["style"] = kwds.get("style", 0)
        TestPanel.__init__(self, *args, **kwds)
        testpanel.TestPanel.__init__(self)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

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

        self.window_1 = SplitterWindowWithBasesInFrame(self, wx.ID_ANY)
        sizer_1.Add(self.window_1, 1, wx.EXPAND, 0)

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

        self.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class TestPanelWithBasesInFrame 
Example #7
Source File: BasesEtc_Phoenix.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: TestPanelWithBasesInFrame.__init__
        kwds["style"] = kwds.get("style", 0)
        TestPanel.__init__(self, *args, **kwds)
        testpanel.TestPanel.__init__(self)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

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

        self.window_1 = SplitterWindowWithBasesInFrame(self, wx.ID_ANY)
        sizer_1.Add(self.window_1, 1, wx.EXPAND, 0)

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

        self.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class TestPanelWithBasesInFrame 
Example #8
Source File: ServerPages.py    From admin4 with Apache License 2.0 6 votes vote down vote up
def Go(self):
      lines=[]
      lines.append("<html><body><table>")
      def add(name, txt):
        val=self.getVal(name)
        if val != "":
          val=val.replace('\n', '<br/>')
          lines.append("<tr><td><b>%s</b></td><td>%s</td></tr>" % (txt, val))

      self.SetTitle(self.logline[0])
      for name in LoggingPage.logColNames:
        ci=LoggingPage.logColInfo.get(name)
        if not ci or (len(ci) > 2 and ci[2]): 
          continue
        add(name, xlt(ci[0]))
      lines.append("</table></body></html>")
      self.browser.SetPage("\n".join(lines))
      self.query=self.getVal('query')
      self.EnableControls("QueryTool", self.query) 
Example #9
Source File: panel.py    From admin4 with Apache License 2.0 6 votes vote down vote up
def ResetPage(self, page):
        topSizer = page.GetSizer()
        sizer = topSizer.GetChildren()[0].GetSizer()
        for w in page.GetChildren():
            sizer.Detach(w)
            if isinstance(w, ParamPage):
                if w.IsShown():
                    w.Hide()
            else:
                w.Destroy()
        topSizer.Remove(sizer)
        # Create new windows
        sizer = wx.BoxSizer(wx.VERTICAL)
        # Special case - resize html window
        if g.conf.panic:
            topSizer.Add(sizer, 1, wx.EXPAND)
        else:
            topSizer.Add(sizer, 0, wx.ALL, 5)
        return sizer 
Example #10
Source File: dochtml.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def _init_ctrls(self, prnt):
        self.SetIcon(prnt.icon)
        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)

        self.HtmlContent = UrlClickHtmlWindow(id=ID_HTMLFRAMEHTMLCONTENT,
                                              name='HtmlContent', parent=self, pos=wx.Point(0, 0),
                                              size=wx.Size(-1, -1), style=wx.html.HW_SCROLLBAR_AUTO | wx.html.HW_NO_SELECTION)
        self.HtmlContent.Bind(HtmlWindowUrlClick, self.OnLinkClick) 
Example #11
Source File: commandsdlg.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
def OnSave(self, event):
        dlg = wx.FileDialog(self, "Filename to save as",
            wildcard = "HTML files (*.html)|*.html|All files|*",
            style = wx.SAVE | wx.OVERWRITE_PROMPT)

        if dlg.ShowModal() == wx.ID_OK:
            util.writeToFile(dlg.GetPath(), self.html, self)

        dlg.Destroy() 
Example #12
Source File: dochtml.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
        if event == HtmlWindowUrlClick:
            self.Connect(-1, -1, EVT_HTML_URL_CLICK, handler)
        else:
            wx.html.HtmlWindow.Bind(self, event, handler, source=source, id=id, id2=id2) 
Example #13
Source File: HtmlWindow.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def SetPage(self, html):
        if html.startswith("<md>"):
            html = DecodeMarkdown(html[4:])
        elif html.startswith("<rst>"):
            html = DecodeReST(html[5:])
        wxHtmlWindow.SetPage(
            self,
            '<html><body bgcolor="%s" text="%s">%s</body></html>' % (
                self.GetBackgroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
                self.GetForegroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
                html
            )
        ) 
Example #14
Source File: about.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        wx.Dialog.__init__(self, parent, -1, _('About wxGlade'))
        html = wx.html.HtmlWindow(self, -1, size=(480, 250))
        html.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.OnLinkClicked)
        # it's recommended at least for GTK2 based wxPython
        if "gtk2" in wx.PlatformInfo:
            html.SetStandardFonts()
        bgcolor = misc.color_to_string(self.GetBackgroundColour())
        icon_path = os.path.join(config.icons_path, 'wxglade_small.png')
        html.SetPage( self.text % (bgcolor, icon_path, config.version, config.py_version, config.wx_version) )
        ir = html.GetInternalRepresentation()
        ir.SetIndent(0, wx.html.HTML_INDENT_ALL)
        html.SetSize((ir.GetWidth(), ir.GetHeight()))
        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(html, 0, wx.TOP|wx.ALIGN_CENTER, 10)
        szr.Add(wx.StaticLine(self, -1), 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 20)
        szr2 = wx.BoxSizer(wx.HORIZONTAL)
        btn = wx.Button(self, wx.ID_OK, _("OK"))
        btn.SetDefault()
        szr2.Add(btn)
        if wx.Platform == '__WXGTK__':
            extra_border = 5  # border around a default button
        else:
            extra_border = 0
        szr.Add(szr2, 0, wx.ALL|wx.ALIGN_RIGHT, 20 + extra_border)
        self.SetAutoLayout(True)
        self.SetSizer(szr)
        szr.Fit(self)
        self.Layout()
        if parent: self.CenterOnParent()
        else: self.CenterOnScreen() 
Example #15
Source File: ServerPages.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def AddExtraControls(self, res):
      self.browser=wx.html.HtmlWindow(self)
      res.AttachUnknownControl("HtmlWindow", self.browser) 
Example #16
Source File: objdictedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def _init_ctrls(self, prnt):
            wx.Frame.__init__(self, id=ID_HTMLFRAME, name='HtmlFrame',
                  parent=prnt, pos=wx.Point(320, 231), size=wx.Size(853, 616),
                  style=wx.DEFAULT_FRAME_STYLE, title='')
            self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
            
            self.HtmlContent = UrlClickHtmlWindow(id=ID_HTMLFRAMEHTMLCONTENT,
                  name='HtmlContent', parent=self, pos=wx.Point(0, 0),
                  size=wx.Size(-1, -1), style=wx.html.HW_SCROLLBAR_AUTO|wx.html.HW_NO_SELECTION)
            self.HtmlContent.Bind(HtmlWindowUrlClick, self.OnLinkClick) 
Example #17
Source File: About.py    From nodemcu-pyflasher with MIT License 5 votes vote down vote up
def __init__(self, parent):
        wx.Dialog.__init__(self, parent, wx.ID_ANY, "About NodeMCU PyFlasher")
        html = HtmlWindow(self, wx.ID_ANY, size=(420, -1))
        if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo:
            html.SetStandardFonts()
        txt = self.text.format(self._get_bundle_dir(), __version__)
        html.SetPage(txt)
        ir = html.GetInternalRepresentation()
        html.SetSize((ir.GetWidth() + 25, ir.GetHeight() + 25))
        self.SetClientSize(html.GetSize())
        self.CentreOnParent(wx.BOTH) 
Example #18
Source File: About.py    From nodemcu-pyflasher with MIT License 5 votes vote down vote up
def _get_bundle_dir():
        # set by PyInstaller, see http://pyinstaller.readthedocs.io/en/v3.2/runtime-information.html
        if getattr(sys, 'frozen', False):
            # noinspection PyUnresolvedReferences,PyProtectedMember
            return sys._MEIPASS
        else:
            return os.path.dirname(os.path.abspath(__file__)) 
Example #19
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
def __init__(self, parent, id_):
        super(SCTPanel, self).__init__(parent=parent, id=id_)

        # Logo
        self.img_logo = self.get_logo()
        self.sizer_logo_sct = wx.BoxSizer(wx.VERTICAL)
        self.sizer_logo_sct.Add(self.img_logo, 0, wx.ALL, 5)

        # Citation
        txt_sct_citation = wx.VSCROLL | \
                           wx.HSCROLL | wx.TE_READONLY | \
                           wx.BORDER_SIMPLE
        html_sct_citation = html.HtmlWindow(self, wx.ID_ANY,
                                            size=(280, 115),
                                            style=txt_sct_citation)
        html_sct_citation.SetPage(self.DESCRIPTION_SCT)
        self.sizer_logo_sct.Add(html_sct_citation, 0, wx.ALL, 5)

        # Help button
        button_help = wx.Button(self, id=id_, label="Help")
        button_help.Bind(wx.EVT_BUTTON, self.tutorial)
        self.sizer_logo_sct.Add(button_help, 0, wx.ALL, 5)

        # Get function-specific description
        self.html_desc = self.get_description()

        # Organize boxes
        self.sizer_logo_text = wx.BoxSizer(wx.HORIZONTAL)  # create main box
        self.sizer_logo_text.Add(self.sizer_logo_sct, 0, wx.ALL, 5)
        # TODO: increase the width of the description box
        self.sizer_logo_text.Add(self.html_desc, 0, wx.ALL, 5)

        self.sizer_h = wx.BoxSizer(wx.HORIZONTAL)
        self.sizer_h.Add(self.sizer_logo_text) 
Example #20
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
def get_description(self):
        txt_style = wx.VSCROLL | \
                    wx.HSCROLL | wx.TE_READONLY | \
                    wx.BORDER_SIMPLE
        htmlw = html.HtmlWindow(self, wx.ID_ANY,
                                size=(280, 208),
                                style=txt_style)
        htmlw.SetPage(self.DESCRIPTION)
        return htmlw 
Example #21
Source File: app.py    From thotkeeper with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def _HTMLize(self, title, author, date, text):
        title = title or '(no title)'
        author = author or '(no author)'
        date = date or '(no date)'
        paragraphs = ''.join(['<p align="justify">' + x + '</p>\n'
                              for x in text.split('\n')])
        return (f'<html><body>'
                f'<h2>{title}</h2>'
                f'<p><i>by <b>{author}</b>, on <b>{date}</b></i></p>'
                f'{paragraphs}'
                f'</body></html>') 
Example #22
Source File: guicontrols.py    From wfuzz with GNU General Public License v2.0 5 votes vote down vote up
def CreateHTMLCtrl(self):
        ctrl = wx.html.HtmlWindow(self, -1, wx.DefaultPosition, wx.Size(400, 300))
        if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo:
            ctrl.SetStandardFonts()

        ctrl.SetPage("")

        return ctrl 
Example #23
Source File: objdictedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
            if event == HtmlWindowUrlClick:
                self.Connect(-1, -1, EVT_HTML_URL_CLICK, handler)
            else:
                wx.html.HtmlWindow.Bind(event, handler, source=source, id=id, id2=id2)
    
#-------------------------------------------------------------------------------
#                                Html Frame
#------------------------------------------------------------------------------- 
Example #24
Source File: archiveplayer.py    From webarchiveplayer with GNU General Public License v3.0 5 votes vote down vote up
def init_controls(self, contents=None, title=None, player_url=PLAYER_URL):
        self.menu_bar  = wx.MenuBar()
        self.help_menu = wx.Menu()

        self.help_menu.Append(wx.ID_EXIT,   "&QUIT")

        if wx.Platform != "__WXMAC__":
            self.menu_bar.Append(self.help_menu, "File")

        self.Bind(wx.EVT_MENU, self.quit, id=wx.ID_EXIT)
        self.SetMenuBar(self.menu_bar)

        self.html = wx.html.HtmlWindow(self)
        self.html.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.on_load_url)

        if not title:
            title = 'Web Archive Player ' + __version__

        self.SetTitle(title)

        if not contents:
            contents = DEFAULT_HTML_PAGE

        contents = contents.format(version=__version__,
                                   pywb_version=pywb_version,
                                   player_url=player_url,
                                   info_url=INFO_URL)

        self.html.SetPage(contents)

        # set later
        self.archiveplayer = None 
Example #25
Source File: objdictedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def OnAboutMenu(self, event):
        self.OpenHtmlFrame(_("About CAN Festival"), os.path.join(ScriptDirectory, "doc/about.html"), wx.Size(500, 450)) 
Example #26
Source File: networkedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
            if event == HtmlWindowUrlClick:
                self.Connect(-1, -1, EVT_HTML_URL_CLICK, handler)
            else:
                wx.html.HtmlWindow.Bind(event, handler, source=source, id=id, id2=id2)
    
#-------------------------------------------------------------------------------
#                                Html Frame
#------------------------------------------------------------------------------- 
Example #27
Source File: networkedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def OnHelpCANFestivalMenu(self, event):
        #self.OpenHtmlFrame("CAN Festival Reference", os.path.join(ScriptDirectory, "doc/canfestival.html"), wx.Size(1000, 600))
        if wx.Platform == '__WXMSW__':
            readerpath = get_acroversion()
            readerexepath = os.path.join(readerpath,"AcroRd32.exe")
            if(os.path.isfile(readerexepath)):
                os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(ScriptDirectory, "doc","manual_en.pdf"))
        else:
            os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16)) 
Example #28
Source File: networkedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def OnAboutMenu(self, event):
        self.OpenHtmlFrame(_("About CAN Festival"), os.path.join(ScriptDirectory, "doc/about.html"), wx.Size(500, 450)) 
Example #29
Source File: BasesEtc.py    From wxGlade with MIT License 4 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameWithBases.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        TestFrame.__init__(self, *args, **kwds)
        testframe.TestFrame.__init__(self)
        self.SetSize((400, 300))
        self.SetTitle("frame")
        
        # Menu Bar
        self.frame_copy_menubar = wx.MenuBar()
        self.SetMenuBar(self.frame_copy_menubar)
        # Menu Bar end
        
        self.frame_copy_statusbar = self.CreateStatusBar(1)
        self.frame_copy_statusbar.SetStatusWidths([-1])
        # statusbar fields
        frame_copy_statusbar_fields = ["frame_copy_statusbar"]
        for i in range(len(frame_copy_statusbar_fields)):
            self.frame_copy_statusbar.SetStatusText(frame_copy_statusbar_fields[i], i)
        
        # Tool Bar
        self.frame_copy_toolbar = wx.ToolBar(self, -1)
        self.frame_copy_toolbar.Realize()
        self.SetToolBar(self.frame_copy_toolbar)
        # Tool Bar end
        
        self.panel_1 = wx.Panel(self, wx.ID_ANY)
        
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        
        self.notebook_1 = wx.Notebook(self.panel_1, 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")
        
        self.window_1 = wx.SplitterWindow(self.panel_1, 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 = wx.Panel(self.window_1, wx.ID_ANY)
        
        self.html = CustomWidget(self.panel_1, 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)
        
        self.panel_1.SetSizer(sizer_1)
        
        self.Layout()
        # end wxGlade

# end of class MyFrameWithBases 
Example #30
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