예제 #1
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: help_window.__init__
        kwds[
            "style"] = wx.MAXIMIZE | wx.CLOSE_BOX | wx.THICK_FRAME | wx.CAPTION
        wx.Dialog.__init__(self, *args, **kwds)
        self.window_1 = wx.SplitterWindow(self,
                                          wx.ID_ANY,
                                          style=wx.SP_3D | wx.SP_BORDER)
        self.window_1_pane_left = wx.Panel(self.window_1, wx.ID_ANY)
        self.html_left = html.HtmlWindow(self.window_1_pane_left,
                                         wx.ID_ANY,
                                         size=(1, 1))
        self.window_1_pane_right = wx.Panel(self.window_1, wx.ID_ANY)
        self.html_right = html.HtmlWindow(self.window_1_pane_right,
                                          wx.ID_ANY,
                                          size=(1, 1))

        #self.Bind(wx.EVT_COself.on_hyperlink,self.html_left)
        self.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.on_hyperlink,
                  self.html_left)
        #self.Bind(wx.EVT_SIZE,self.on_resize)

        self.__set_properties()
        self.__do_layout()
        #self.on_resize(None)
        self.load_htmlpage()
예제 #2
0
    def __init__ ( self, parent, html, scale_dx, scale_dy ):
        """ Initializes the object.
        """
        wx.Frame.__init__( self, parent, -1, 'Help' )
        self.SetBackgroundColour( WindowColor )
        
        # Wrap the dialog around the image button panel:
        sizer        = wx.BoxSizer( wx.VERTICAL )
        html_control = wh.HtmlWindow( self )
        html_control.SetBorders( 2 )
        html_control.SetPage( html )
        sizer.Add( html_control, 1, wx.EXPAND )
        sizer.Add( wx.StaticLine( self, -1 ), 0, wx.EXPAND )
        b_sizer = wx.BoxSizer( wx.HORIZONTAL )
        button  = wx.Button( self, -1, 'OK' )
        wx.EVT_BUTTON( self, button.GetId(), self._on_ok )
        b_sizer.Add( button, 0 )
        sizer.Add( b_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 5 )
        self.SetSizer( sizer )
        self.SetAutoLayout( True )
        self.SetSize( wx.Size( int( scale_dx * screen_dx ), 
                               int( scale_dy * screen_dy ) ) )
 
        # Position and show the dialog:
        position_near( parent, self, align_y = -1 )
        self.Show()
예제 #3
0
 def __init__(self, parent, title, content):
     wx.Frame.__init__(self, parent, -1, title)
     htm = wxhtml.HtmlWindow(self)
     if "gtk2" in wx.PlatformInfo: htm.SetStandardFonts()
     htm.SetPage(content)
     self.SetSize((500, 500))
     self.Fit()
예제 #4
0
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(400, 290))

        panel = wx.Panel(self, -1)

        vbox = wx.BoxSizer(wx.VERTICAL)
        hbox = wx.BoxSizer(wx.HORIZONTAL)

        htmlwin = html.HtmlWindow(panel, -1, style=wx.NO_BORDER)
        htmlwin.SetBackgroundColour(wx.RED)
        htmlwin.SetStandardFonts()
        htmlwin.SetPage(page)

        vbox.Add((-1, 10), 0)
        vbox.Add(htmlwin, 1, wx.EXPAND | wx.ALL, 9)

        bitmap = wx.StaticBitmap(panel, -1, wx.Bitmap('images/newt.png'))
        hbox.Add(bitmap, 1, wx.LEFT | wx.BOTTOM | wx.TOP, 10)
        buttonOk = wx.Button(panel, ID_CLOSE, 'Ok')

        self.Bind(wx.EVT_BUTTON, self.OnClose, id=ID_CLOSE)

        hbox.Add((100, -1), 1, wx.EXPAND | wx.ALIGN_RIGHT)
        hbox.Add(buttonOk, flag=wx.TOP | wx.BOTTOM | wx.RIGHT, border=10)
        vbox.Add(hbox, 0, wx.EXPAND)

        panel.SetSizer(vbox)
        self.Centre()
        self.Show(True)
예제 #5
0
    def __init__(self, title, parent=None):
        wx.Frame.__init__(self,
                          parent=parent,
                          title=title,
                          size=(1000, 500),
                          style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
        self.Show()
        self.bSizer = wx.BoxSizer(wx.VERTICAL)
        self.scroll = wx.lib.scrolledpanel.ScrolledPanel(
            self, -1, size=(1000, 500), pos=(0, 0), style=wx.SIMPLE_BORDER)
        self.scroll.SetupScrolling()
        self.scroll.SetBackgroundColour('#FFFFFF')
        self.scroll.SetForegroundColour('Black')
        self.scroll.SetSizer(self.bSizer)

        txt_style = wx.VSCROLL | wx.HSCROLL | wx.TE_READONLY | wx.BORDER_SIMPLE
        self.html = html.HtmlWindow(self.scroll,
                                    -1,
                                    size=(1000, 500),
                                    pos=(0, 0),
                                    style=txt_style)
        self.html.SetPage("""
        <h2><font color=\"red\">Error</font><font color=\"black\"> / </font><font color=\"green\"> Completions </font></h2>
        <table align=\"center\" border=\"1\" style=\"width:98%;border-spacing:0;border-collapse: collapse;border:1px solid #666666; margin-top:5px; margin-bottom:5px;\">
          <tr bgcolor=\"#e8eff1\" onmouseover=\"this.style.backgroundColor='#d6edf5'\" onmouseout=\"this.style.backgroundColor=''\">
            <th style="width:25%"><font color=\"#7854E0\">Source Name</font></th>
            <th style="width:100%"><font color=\"red\">Error</font><font color=\"black\"> / </font><font color=\"green\"> Completions </font></th> 
          </tr>""" + str(globalvar.html_string) + """
          
        </table>
""")
예제 #6
0
    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)
예제 #7
0
    def __init__(self, parent, title):
        super(AboutFrame, self).__init__(parent=parent, title=title)
        self.parent = parent
        self.text = """
        <html>
        <center><h1>teammaker</h1> version 2.1<br>
        by Bancaldo</td></center><br><br>
        <b>teammaker</b> is a simple App to create balanced teams<br>
        <br>
        python modules:</b><br>
        - <b>wxPython</b> for Graphics<br>
        - <b>django</b> for database and ORM<br>
        <br>
        <b>useful links:</b><br>
        web-site: www.bancaldo.wordpress.com<br>
        web-site: www.bancaldo.altervista.org<br>
        <br>
        <b>last revision:</b> Aug 22, 2017</p><br>
        <b>author:</b> bancaldo
        </html>
        """
        self.SetSize((400, 600))
        html = wxhtml.HtmlWindow(self)
        html.SetPage(self.text)
        self.btn_quit = wx.Button(self, -1, 'quit', (25, 150), (150, -1))
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(html, 1, wx.EXPAND | wx.ALL, 5)
        sizer.Add(self.btn_quit, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        self.SetSizer(sizer)
        self.Centre()
        self.Show()

        # Bind
        self.Bind(wx.EVT_BUTTON, self.on_quit, self.btn_quit)
예제 #8
0
    def __do_layout(self):
        vbox = wx.BoxSizer(wx.VERTICAL)
        hbox = wx.BoxSizer(wx.HORIZONTAL)

        htmlwin = hw.HtmlWindow(self.panel, -1, style=wx.NO_BORDER)
        htmlwin.SetBackgroundColour(wx.RED)
        htmlwin.SetStandardFonts()

        self.httpConnection = HTTPConnection('fr')
        self.httpConnection.get('Kruder und Dorfmeister')
        htmlwin.SetPage(self.httpConnection.page)

        vbox.Add((-1, 10), 0)
        vbox.Add(htmlwin, 1, wx.EXPAND | wx.ALL, 9)

        buttonOk = wx.Button(self.panel, MyFrame.ID_CLOSE, 'Ok')

        self.Bind(wx.EVT_BUTTON, self.OnClose, id=MyFrame.ID_CLOSE)

        hbox.Add((100, -1), 1, wx.EXPAND | wx.ALIGN_RIGHT)
        hbox.Add(buttonOk, flag=wx.TOP | wx.BOTTOM | wx.RIGHT, border=10)
        vbox.Add(hbox, 0, wx.EXPAND)

        self.panel.SetSizer(vbox)
        self.Centre()
        self.Show(True)
예제 #9
0
    def __init__(self, parent, module, title='Models help'):
        wx.Frame.__init__(self, parent, -1, title)
        # self.SetAutoLayout(True)
        self.module = module
        self.sub_modules = True

        sizer = wx.BoxSizer(wx.VERTICAL)
        choice_sizer = wx.BoxSizer(wx.HORIZONTAL)
        choice_sizer.Add(wx.StaticText(self, -1, 'Module: '), 0, wx.CENTER)
        mod_list = self.find_modules(module)

        self.choice = wx.Choice(self, -1, choices=mod_list)
        choice_sizer.Add(self.choice, 0, flag=wx.EXPAND | wx.CENTER, border=20)
        self.Bind(wx.EVT_CHOICE, self.on_choice, self.choice)
        sizer.Add(choice_sizer, 0, wx.EXPAND, border=20)

        self.html_win = html.HtmlWindow(self,
                                        -1,
                                        style=wx.NO_FULL_REPAINT_ON_RESIZE)
        sizer.Add(self.html_win, 1, flag=wx.EXPAND, border=20)

        self.SetSizer(sizer)

        sizer.Fit(self)
        self.Layout()
        size = parent.GetSize()
        x = max(size.y / 2, size.x / 3)
        self.SetSize((x, size.y))

        self.choice.SetSelection(0)
        self.on_choice(None)
예제 #10
0
    def __init__(self, parent, title):
        super(InfoFrame, self).__init__(parent=parent,
                                        title=title,
                                        style=STYLE)
        self.parent = parent
        self.text = """
<html>
<center><h1>FantaManager</h1> versione 2.1<br>
by Bancaldo</td></center><br><br>
<b>Fantamanager</b> e' una semplice applicazione per la creazione<br>
e gestione di una FantaLega<br>
<br>
<b>pacchetti utilizzati:</b><br>
- wxPython</b> for Graphics<br>
- Flask-SQLAlchemy</b> for database and Object Ralation Mapping<br>
<br>
<b>link utili:</b><br>
web-site: www.bancaldo.wordpress.com<br>
web-site: www.bancaldo.altervista.org<br>
<br>
<b>last revision:</b> Feb 22, 2015</p><br>
<b>author:</b> bancaldo
</html>
"""
        self.SetSize((400, 600))
        html = wxhtml.HtmlWindow(self)
        html.SetPage(self.text)
        self.btn_quit = wx.Button(self, -1, 'quit', (25, 150), (150, -1))
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(html, 1, wx.EXPAND | wx.ALL, 5)
        sizer.Add(self.btn_quit, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        self.SetSizer(sizer)
        self.Bind(wx.EVT_BUTTON, self.parent.quit_subframe, self.btn_quit)
        self.Centre()
        self.Show()
예제 #11
0
    def __init__(self, *args, **kwds):
        self.choices = self.sections.keys()
        self.choices.sort()

        # begin wxGlade: PAIMEIdocs.__init__
        kwds["style"] = wx.TAB_TRAVERSAL
        wx.Panel.__init__(self, *args, **kwds)
        self.navigation_staticbox = wx.StaticBox(self, -1, "Navigate")
        self.section_dropdown = wx.Choice(self, -1, choices=self.choices)
        self.load = wx.Button(self, -1, "Load")
        self.back = wx.Button(self, -1, "Back")
        self.forward = wx.Button(self, -1, "Forward")
        self.html_help = html.HtmlWindow(self, -1)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

        self.list_book = kwds["parent"]  # handle to list book.
        self.main_frame = self.list_book.top  # handle to top most frame.

        # bind the dropdown.
        self.Bind(wx.EVT_CHOICE, self.on_section_choice, self.section_dropdown)

        # bind the buttons
        self.Bind(wx.EVT_BUTTON, self.on_back, self.back)
        self.Bind(wx.EVT_BUTTON, self.on_forward, self.forward)
        self.Bind(wx.EVT_BUTTON, self.on_load, self.load)

        # load the default top-level documentation page.
        self.html_help.LoadPage(self.sections["General"])
예제 #12
0
    def __init__(self, parent, id=wx.ID_ANY, style=0, size=(-1 - 1)):
        wx.Panel.__init__(self, parent, id, style=style, size=size)

        self.searchLabel = wx.StaticText(self, label=_('Search Text:'))
        self.search = wx.SearchCtrl(self,
                                    style=wx.TE_PROCESS_ENTER,
                                    value='main screen',
                                    size=(200, -1))
        self.Bind(wx.EVT_TEXT_ENTER, self.doSearch, self.search)
        self.Bind(wx.EVT_TEXT, self.doSearch, self.search)
        self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.doSearch, self.search)

        hs = wx.BoxSizer(wx.HORIZONTAL)
        hs.Add(self.searchLabel, 0, flag=wx.ALIGN_CENTRE_VERTICAL)
        hs.Add(self.search, 1, flag=wx.EXPAND | wx.LEFT, border=4)

        self.vbs = wx.BoxSizer(wx.VERTICAL)

        self.html = html.HtmlWindow(self,
                                    size=(800, 600),
                                    style=wx.BORDER_SUNKEN)
        self.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.doLink, self.html)

        self.vbs.Add(hs, 0, flag=wx.BOTTOM | wx.EXPAND, border=4)
        self.vbs.Add(self.html, 1, flag=wx.EXPAND)

        self.SetSizer(self.vbs)
        self.doSearch()
예제 #13
0
    def __init__(self, parent, html, scale_dx, scale_dy):
        """ Initializes the object.
        """
        wx.Frame.__init__(self, parent, -1, "Help", style=wx.SIMPLE_BORDER)
        self.SetBackgroundColour(WindowColor)

        # Wrap the dialog around the image button panel:
        sizer = wx.BoxSizer(wx.VERTICAL)
        html_control = wh.HtmlWindow(self)
        html_control.SetBorders(2)
        html_control.SetPage(html)
        sizer.Add(html_control, 1, wx.EXPAND)
        sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND)
        b_sizer = wx.BoxSizer(wx.HORIZONTAL)
        button = wx.Button(self, -1, "OK")
        self.Bind(wx.EVT_BUTTON, self._on_ok, id=button.GetId())
        b_sizer.Add(button, 0)
        sizer.Add(b_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 5)
        self.SetSizer(sizer)
        self.SetSize(
            wx.Size(int(scale_dx * SystemMetrics().screen_width),
            int(scale_dy * SystemMetrics().screen_height))
        )

        # Position and show the dialog:
        position_window(self, parent=parent)
        self.Show()
예제 #14
0
 def help(self):
     self.splitter = wx.SplitterWindow(self, -1)
     self.panelLeft = wx.Panel(self.splitter,
                               -1)  #, style=wx.BORDER_SUNKEN)
     self.panelRight = wx.Panel(self.splitter, -1)
     vbox2 = wx.BoxSizer(wx.VERTICAL)
     header = wx.Panel(self.panelRight, -1, size=(-1, 25))
     header.SetBackgroundColour('#6f6a59')
     header.SetForegroundColour('WHITE')
     hbox = wx.BoxSizer(wx.HORIZONTAL)
     st = wx.StaticText(header, -1, 'Help')  #, (5, 1))
     font = st.GetFont()
     font.SetPointSize(9)
     st.SetFont(font)
     hbox.Add(st, 1, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
     close = wx.BitmapButton(header,
                             -1,
                             wx.Bitmap('icons/close1.png'),
                             style=wx.NO_BORDER)
     close.SetBackgroundColour('#6f6a59')
     hbox.Add(close, 0)
     header.SetSizer(hbox)
     vbox2.Add(header, 0, wx.EXPAND)
     help = html.HtmlWindow(self.panelRight, -1, style=wx.NO_BORDER)
     help.LoadPage('help.html')
     vbox2.Add(help, 1, wx.EXPAND)
     self.panelRight.SetSizer(vbox2)
     self.panelLeft.SetFocus()
     self.splitter.SplitVertically(self.panelLeft, self.panelRight)
     self.splitter.Unsplit()
     self.Bind(wx.EVT_BUTTON, self.CloseHelp, id=close.GetId())
예제 #15
0
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, u"简单HTML窗口")
        htmlwin = html.HtmlWindow(self)

        htmlwin.SetPage(u"""<h1>一级标题</h1>
        				<b>这是HTML加粗文本</b>
        				<br></br>
        				<i>这是HTML斜体文本</i>""")
예제 #16
0
    def InitUI(self):

        toolbar = self.CreateToolBar()
        toolbar.AddTool(1, 'Exit', wx.Bitmap('exit.png'))
        toolbar.AddTool(2, 'Help', wx.Bitmap('help.png'))
        toolbar.Realize()

        self.splitter = wx.SplitterWindow(self)
        self.panelLeft = wx.Panel(self.splitter, wx.ID_ANY, style=wx.BORDER_SUNKEN)

        self.panelRight = wx.Panel(self.splitter)
        vbox2 = wx.BoxSizer(wx.VERTICAL)
        header = wx.Panel(self.panelRight, wx.ID_ANY)

        header.SetBackgroundColour('#6f6a59')
        header.SetForegroundColour('white')

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        st = wx.StaticText(header, wx.ID_ANY, 'Help')
        font = st.GetFont()
        font.SetFamily(wx.FONTFAMILY_ROMAN)
        font.SetPointSize(11)
        st.SetFont(font)

        hbox.Add(st, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 8)

        closeBtn = wx.BitmapButton(header, wx.ID_ANY, wx.Bitmap('closebutton.png',
              wx.BITMAP_TYPE_PNG), style=wx.NO_BORDER)
        closeBtn.SetBackgroundColour('#6f6a59')

        hbox.Add(closeBtn, 0, wx.TOP|wx.BOTTOM, 8)
        header.SetSizer(hbox)

        vbox2.Add(header, 0, wx.EXPAND)

        helpWin = html.HtmlWindow(self.panelRight, style=wx.NO_BORDER)
        helpWin.LoadPage('help.html')

        vbox2.Add(helpWin, 1, wx.EXPAND)

        self.panelRight.SetSizer(vbox2)
        self.panelLeft.SetFocus()

        self.splitter.SplitVertically(self.panelLeft, self.panelRight)
        self.splitter.Unsplit()

        self.Bind(wx.EVT_BUTTON, self.CloseHelp, id=closeBtn.GetId())
        self.Bind(wx.EVT_TOOL, self.OnClose, id=1)
        self.Bind(wx.EVT_TOOL, self.OnHelp, id=2)

        self.panelLeft.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)
        self.panelLeft.SetFocus()

        self.CreateStatusBar()

        self.SetTitle('Help')
        self.Centre()
예제 #17
0
def decorate(frame):
    frame.SetTitle("wxPython - Drophash")
    _icon = wx.EmptyIcon()
    _icon.CopyFromBitmap(wx.Bitmap("drophash.ico", wx.BITMAP_TYPE_ANY))
    frame.SetIcon(_icon)
    frame.style = wx.DEFAULT_FRAME_STYLE
    pane = html.HtmlWindow(frame, -1)
    dt = FileDropTarget(pane)
    pane.SetDropTarget(dt)
예제 #18
0
    def __init__(self, parent, title, haxedpage):
        wx.Frame.__init__(self, parent, -1, title, size=(600, 400))

        thisHtml = html.HtmlWindow(self)

        if "gtk2" in wx.PlatformInfo:
            html.SetStandardFonts()

        thisHtml.SetPage(haxedpage)
예제 #19
0
    def __init__(self,
                 parent,
                 id=-1,
                 component={},
                 logType=0,
                 evalSpace={},
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icHtmlPanel.
        @type parent: C{wxWindow}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        #   Атрибуты сайзера
        self.sizer = None
        self.bSizerAdd = False
        icSpcDefStruct(SPC_IC_HTML_PANEL, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        pos = component['position']
        size = component['size']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        style = component['style']
        self.source = component['file']

        wx.Panel.__init__(self,
                          parent,
                          id,
                          pos,
                          size,
                          style=style,
                          name=self.name)
        hwin = html.HtmlWindow(self, -1)

        if self.source not in [None, '', 'None']:
            hwin.LoadPage(self.source)

        if fgr is not None:
            hwin.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            hwin.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(hwin, 1, wx.EXPAND)
        self.SetSizer(sizer)
        self.BindICEvt()
예제 #20
0
    def __init__(self, parent, filepath):
        wx.Frame.__init__(self, parent, -1, "HTML Viewer", size=(600, 600))

        html = hl.HtmlWindow(self)
        self.Maximize(False)

        #if "gtk2" in wx.PlatformInfo:
        #    html.SetStandardFonts()

        html.LoadPage(filepath)
예제 #21
0
 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
예제 #22
0
    def __init__(self, parent, id, data, caption, size=(640, 480)):
        '''
        Constructor

        Arguments
        parent:  Parent window.
        id:      ID for the window.
        data:    html data to be displayed.
        caption: Caption for the window.

        Keyword Argument
        size:    Size tuple for the window.
        '''

        self.data = data

        wx.Dialog.__init__(self,
                           parent,
                           id,
                           caption,
                           size=size,
                           style=wx.DEFAULT_FRAME_STYLE
                           | wx.NO_FULL_REPAINT_ON_RESIZE)

        self.html = Html.HtmlWindow(self, wx.ID_ANY)

        self.printer = Html.HtmlEasyPrinting()

        self.box = wx.BoxSizer(wx.VERTICAL)
        self.box.Add(self.html, 1, wx.GROW)

        subbox = wx.BoxSizer(wx.HORIZONTAL)

        # Save File
        btn = wx.Button(self, wx.ID_ANY, _('Save File'))
        self.Bind(wx.EVT_BUTTON, self.OnSaveFile, btn)
        subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
        # Print
        btn = wx.Button(self, wx.ID_ANY, _('Print'))
        self.Bind(wx.EVT_BUTTON, self.OnPrint, btn)
        subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
        # View Source
        btn = wx.Button(self, wx.ID_ANY, _('View Source'))
        self.Bind(wx.EVT_BUTTON, self.OnViewSource, btn)
        subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
        # Quit
        btn = wx.Button(self, wx.ID_CLOSE, _('Close'))
        self.Bind(wx.EVT_BUTTON, self.OnClose, btn)
        subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)

        self.box.Add(subbox, 0, wx.GROW)
        self.SetSizer(self.box)
        self.SetAutoLayout(True)

        self.html.SetPage(data)
예제 #23
0
    def __init__(self, parent, id):
        '''
        Initialisation for the main frame.

        Arguments
        parent: The parent window of the frame.
        id:     The ID to give the frame.
        '''
        self.displayCache = None
        size = geocacher.config().mainWinSize
        # check that the Current location is in the db
        if geocacher.config().currentLocation not in geocacher.db(
        ).getLocationNameList():
            geocacher.config().currentLocation = geocacher.db(
            ).getLocationNameList()[0]
        wx.Frame.__init__(self,
                          parent,
                          wx.ID_ANY,
                          _("Geocacher"),
                          size=(size),
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.NO_FULL_REPAINT_ON_RESIZE)
        self.Bind(wx.EVT_CLOSE, self.OnQuit)
        self.SetIcon(
            wx.Icon(
                os.path.join(geocacher.getBasePath(), 'gfx',
                             'treasure_chest.ico'), wx.BITMAP_TYPE_ICO))
        self.buildStatusBar()

        self.buildMenu()

        self.buildToolBar()

        self.splitter = wx.SplitterWindow(self,
                                          wx.ID_ANY,
                                          style=wx.SP_LIVE_UPDATE
                                          | wx.SP_BORDER)
        self.cacheGrid = CacheGrid(self.splitter)
        self.Description = Html.HtmlWindow(self.splitter,
                                           wx.ID_ANY,
                                           name="Description Pannel")
        self.splitter.SetMinimumPaneSize(20)
        self.splitter.SplitHorizontally(self.cacheGrid, self.Description,
                                        geocacher.config().detailSplit)

        self.updateStatus()

        self.displayedCache = None
        self.updateDetail(geocacher.config().displayedCache)

        Publisher.subscribe(self.updateDetailMsg, 'cache.selected')
        Publisher.subscribe(self.NewLocationMsg, 'location.new')
        Publisher.subscribe(self.popStatusMsg, 'status.pop')
        Publisher.subscribe(self.pushStatusMsg, 'status.push')
        Publisher.subscribe(self.updateStatusMsg, 'status.update')
예제 #24
0
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(570, 400))

        toolbar = self.CreateToolBar()
        # toolbar.AddLabelTool(1, 'Exit', wx.Bitmap('icons/exit.png'))
        toolbar.AddTool(1, 'Exit', wx.Bitmap('icons/exit.png'))
        toolbar.AddTool(2, 'Help', wx.Bitmap('icons/help.png'))
        toolbar.Realize()

        self.splitter = wx.SplitterWindow(self, -1)
        self.panelLeft = wx.Panel(self.splitter, -1, style=wx.BORDER_SUNKEN)

        self.panelRight = wx.Panel(self.splitter, -1)
        vbox2 = wx.BoxSizer(wx.VERTICAL)
        header = wx.Panel(self.panelRight, -1, size=(-1, 20))
        header.SetBackgroundColour('#6f6a59')
        header.SetForegroundColour('WHITE')
        hbox = wx.BoxSizer(wx.HORIZONTAL)

        st = wx.StaticText(header, -1, 'Help', (5, 5))
        font = st.GetFont()
        font.SetPointSize(9)
        st.SetFont(font)
        hbox.Add(st, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5)

        close = wx.BitmapButton(header,
                                -1,
                                wx.Bitmap('icons/fileclose.png',
                                          wx.BITMAP_TYPE_PNG),
                                style=wx.NO_BORDER)
        close.SetBackgroundColour('#6f6a59')
        hbox.Add(close, 0)
        header.SetSizer(hbox)

        vbox2.Add(header, 0, wx.EXPAND)

        help = html.HtmlWindow(self.panelRight, -1, style=wx.NO_BORDER)
        help.LoadPage('help.html')
        vbox2.Add(help, 1, wx.EXPAND)
        self.panelRight.SetSizer(vbox2)
        self.panelLeft.SetFocus()

        self.splitter.SplitVertically(self.panelLeft, self.panelRight)
        self.splitter.Unsplit()

        self.Bind(wx.EVT_BUTTON, self.CloseHelp, id=close.GetId())
        self.Bind(wx.EVT_TOOL, self.OnClose, id=1)
        self.Bind(wx.EVT_TOOL, self.OnHelp, id=2)

        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)

        self.CreateStatusBar()

        self.Centre()
        self.Show(True)
예제 #25
0
    def __init__(self, parent):
        wx.Notebook.__init__(self, parent, size=(450, 400))

        # Attributes
        self.doc = html.HtmlWindow(self)
        self.code = PythonStc(self)

        # Setup
        self.AddPage(self.doc, "Info")
        self.AddPage(self.code, "Demo Code")
        self.doc.SetFont(wx.FFont(12, wx.MODERN))
예제 #26
0
    def __init__(self, parent, title):
        super(HelpFrame, self).__init__(parent=parent,
                                        title=title,
                                        style=STYLE)
        self.parent = parent
        self.text = """
<html>
<center><b>FantaLega</b></center><br><br>
<b>1) Importare i voti</b><br>
I voti sono reperibili sul mio blog: www.bancaldo.wordpress.com<br>
<b>2) Creare una nuova Lega</b><br>
Dal menu Leghe, impostando le opzioni di lega:<br>
budget squadra, massimo numero di cambi, offset giornate<br>
(indica l'offset di giornata tra campionato reale e fantalega), ecc.<br>
<b>3) Creare le Squadre</b><br>
Dal menu Squadre, associandole alle leghe esistenti, cliccando<br>
l'apposita checkbox 'Associa a Leghe esistenti'.<br>
<b>4) Iniziare l'asta</b><br>
Create le squadre e' necessario eseguire l'Asta.<br>
Dal menu lega scegliere Inizia Asta e comporre le squadre.<br>
Ad ogni giocatore associare la squadra acquirente ed il prezzo d'asta,<br>
per aggiornare il budget della squadra stessa e non rischiare di sforare
dal monte fantamilioni.<br>
<b>5) Calendario</b><br>
Creare un nuovo calendario per la lega creata<br>
dal menu calendario > crea calendario<br>
E' possibile consultare anche le giornate di lega selezionando la giornata.<br>
<b>6) Formazioni</b><br>
Inserire le formazioni per ogni squadra dal menu Formazione, scegliendo<br>
la giornata ed il modulo, con il quale verranno calcolati i punteggi.<br>
E' possibile consultare il punteggio di una formazione per una determinata<br>
giornata, dallo stesso menu, o modificare la formazione inserita.<br>
<b>7) Punteggi</b><br>
I punteggi si calcolano scegliendo la giornata da menu calendario > punteggi<br>
e premendo il pulsante <Calcola>. In caso di punteggi gia' calcolati,<br>
questi verranno sovrascritti<br>
<b>8) Restart</b><br>
Per ricominciare tutto da capo, e' sufficiente eliminare il file fantalega.db,
ad applicazione spenta.<br>
L'applicazione puo' gestire piu' leghe contemporaneamente.<br><br>
bancaldo<br>
</html>
        """
        self.SetSize((600, 800))
        html = wxhtml.HtmlWindow(self)
        html.SetPage(self.text)
        self.btn_quit = wx.Button(self, -1, 'quit', (25, 150), (150, -1))
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(html, 1, wx.EXPAND | wx.ALL, 5)
        sizer.Add(self.btn_quit, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        self.SetSizer(sizer)
        self.Bind(wx.EVT_BUTTON, self.parent.quit_subframe, self.btn_quit)
        self.Centre()
        self.Show()
예제 #27
0
    def get_description(self):
        txt_style = wx.VSCROLL | \
                    wx.HSCROLL | wx.TE_READONLY | \
                    wx.BORDER_SIMPLE
        htmlw = html.HtmlWindow(self, wx.ID_ANY,
                                size=(400, 220),
                                style=txt_style)
        htmlw.SetPage(self.DESCRIPTION + self.DESCRIPTION_SCT)
        htmlw.SetStandardFonts(size=10, normal_face="Noto Sans")

        return htmlw
예제 #28
0
    def __init__(self, parent, id=-1, size=wx.DefaultSize):

        import About

        wx.Panel.__init__(self, parent, id, size=size)
        self.html = html.HtmlWindow(self, -1, (5, 5), (400, 350))
        py_version = sys.version.split()[0]
        self.html.SetPage(About.MyAboutBox.text %
                          (wx.VERSION_STRING, py_version))
        ir = self.html.GetInternalRepresentation()
        self.html.SetSize((ir.GetWidth() + 5, ir.GetHeight() + 5))
        self.Fit()
 def layout(self):
     #
     self.SetIcon(logo.get_icon())
     
     #
     wx.StaticLine(parent=self.panel, id=-1, pos=(0, 0), size=(500, -1))
     wx.StaticText(parent=self.panel, id=-1, pos=(10, 5), size=(-1, -1),
                   label='To choose a user, please click the image.')
     self.search_res = wxhtml.HtmlWindow(parent=self.panel, id=-1, 
                                         pos=(10, 30), size=(480, 260),
                                         style=wxhtml.HW_SCROLLBAR_AUTO)
     self.search_res.SetPage('<b>Searching, please wait...</b>')
예제 #30
0
    def __init__(self, parent, title, source):
        """
        @type parent: C{wx.Window}
        @param parent: The parent window.
        @type title: C{str}
        @param title: The title of the dialog.
        @type source: C{str}
        @param source: The path to the source of the HTML.
        """
        wx.Frame.__init__(self, parent, wx.NewId(), title=title)

        content = wxHTML.HtmlWindow(self, wx.NewId())
        content.LoadPage(source)