#!/usr/bin/python import wx import wx.html as html from wx.lib.splitter import MultiSplitterWindow import os import sys class HelpWindow(wx.Frame): """ """ def __init__(self, parent, id, title= 'HelpWindow', pageToOpen=None): wx.Frame.__init__(self, parent, id, title, size=(850, 530)) """ contains help info """ path = os.path.dirname(__file__) temp_path = os.path.join(path,'images') ico_file = os.path.join(temp_path,'ball.ico') if os.path.isfile(ico_file): self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) else: temp_path = os.path.join(os.getcwd(),'images') ico_file = os.path.join(temp_path,'ball.ico') if os.path.isfile(ico_file): self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) else: ico_file = os.path.join(os.path.dirname(os.path.sys.path[0]), 'images', 'ball.ico') if os.path.isfile(ico_file): self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) splitter = MultiSplitterWindow(self, style=wx.SP_LIVE_UPDATE) rpanel = wx.Panel(splitter, -1) lpanel = wx.Panel(splitter, -1,style=wx.BORDER_SUNKEN) vbox = wx.BoxSizer(wx.VERTICAL) header = wx.Panel(rpanel, -1) header.SetBackgroundColour('#6666FF') header.SetForegroundColour('WHITE') hbox = wx.BoxSizer(wx.HORIZONTAL) st = wx.StaticText(header, -1, 'Contents', (5, 5)) font = st.GetFont() font.SetPointSize(10) st.SetFont(font) hbox.Add(st, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5) header.SetSizer(hbox) vbox.Add(header, 0, wx.EXPAND) vboxl= wx.BoxSizer(wx.VERTICAL) headerl = wx.Panel(lpanel, -1, size=(-1, 20)) headerl.SetBackgroundColour('#6666FF') headerl.SetForegroundColour('WHITE') hboxl = wx.BoxSizer(wx.HORIZONTAL) lst = wx.StaticText(headerl, -1, 'Menu', (5, 5)) fontl = lst.GetFont() fontl.SetPointSize(10) lst.SetFont(fontl) hboxl.Add(lst, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5) headerl.SetSizer(hboxl) vboxl.Add(headerl, 0, wx.EXPAND) self.lhelp = html.HtmlWindow(lpanel, -1, style=wx.NO_BORDER) self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, size=(500,-1)) import sans.models as models # get the media path path = models.get_data_path(media='media') if not os.path.isdir(path): path = os.path.dirname(os.path.sys.path[0]) self.path = os.path.join(path,"model_functions.html") self.path_pd = os.path.join(path,"pd_help.html") self.path_sm = os.path.join(path,"smear_computation.html") page1="""
Select topic on Menu
""" if not os.path.isfile(os.path.join(path, "change_scale_help.html")): path = os.path.join(os.path.dirname(os.path.sys.path[0]), 'media') page = """