Changeset 18cdddb in sasview for theoryview/perspectives
- Timestamp:
- Feb 22, 2011 12:39:12 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- d376d31
- Parents:
- e715e4f
- Location:
- theoryview/perspectives/theory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
theoryview/perspectives/theory/help_panel.py
r2f60121 r18cdddb 7 7 8 8 class HelpWindow(wx.Frame): 9 def __init__(self, parent, id, title= 'HelpWindow', pageToOpen=None):9 def __init__(self, parent, id, title= 'HelpWindow', pageToOpen=None): 10 10 wx.Frame.__init__(self, parent, id, title, size=(850, 500)) 11 11 """ … … 27 27 font.SetPointSize(10) 28 28 st.SetFont(font) 29 hbox.Add(st, 1, wx.TOP |wx.BOTTOM|wx.LEFT, 5)29 hbox.Add(st, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5) 30 30 header.SetSizer(hbox) 31 31 vbox.Add(header, 0, wx.EXPAND) … … 41 41 fontl.SetPointSize(10) 42 42 lst.SetFont(fontl) 43 hboxl.Add(lst, 1, wx.TOP |wx.BOTTOM|wx.LEFT, 5)43 hboxl.Add(lst, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5) 44 44 headerl.SetSizer(hboxl) 45 45 vboxl.Add(headerl, 0, wx.EXPAND) 46 46 self.lhelp = html.HtmlWindow(lpanel, -1, style=wx.NO_BORDER) 47 self.rhelp = html.HtmlWindow(rpanel, -1, 48 style=wx.NO_BORDER, size=(500, -1)) 49 page1 = """<html> 47 self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, size=(500,-1)) 48 49 import sans.models as models 50 # get the media path 51 path = models.get_data_path(media='media') 52 self.path = os.path.join(path,"model_functions.html") 53 54 page1="""<html> 50 55 <body> 51 56 <p>Select topic on Menu</p> 52 57 </body> 53 58 </html>""" 54 page ="""<html>59 page="""<html> 55 60 <body> 56 61 <ul> 57 <li><a href =" media/model_functions.html" target ="showframe">Model Functions</a><br></li>62 <li><a href ="%s" target ="showframe">Model Functions</a><br></li> 58 63 </ul> 59 64 </body> 60 </html>""" 65 </html>""" % self.path 66 61 67 self.rhelp.SetPage(page1) 62 68 self.lhelp.SetPage(page) 63 self.lhelp.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.OnLinkClicked) 69 self.lhelp.Bind(wx.html.EVT_HTML_LINK_CLICKED,self.OnLinkClicked ) 70 64 71 #open the help frame a the current page 65 if pageToOpen != None: 66 self.rhelp.LoadPage(str(pageToOpen)) 67 vbox.Add(self.rhelp, 1, wx.EXPAND) 72 if pageToOpen!= None: 73 self.rhelp.LoadPage(str( pageToOpen)) 74 75 vbox.Add(self.rhelp,1, wx.EXPAND) 68 76 vboxl.Add(self.lhelp, 1, wx.EXPAND) 69 77 rpanel.SetSizer(vbox) 70 78 lpanel.SetSizer(vboxl) 71 79 lpanel.SetFocus() 80 72 81 vbox1 = wx.BoxSizer(wx.HORIZONTAL) 73 vbox1.Add(splitter, 1,wx.EXPAND)82 vbox1.Add(splitter,1,wx.EXPAND) 74 83 splitter.AppendWindow(lpanel, 200) 75 84 splitter.AppendWindow(rpanel) 76 85 self.SetSizer(vbox1) 86 77 87 self.Centre() 78 88 self.Show(True) … … 83 93 84 94 """ 85 self.rhelp.LoadPage( "media/modelfunction.html")95 self.rhelp.LoadPage(self.path)#"media/modelfunction.html") 86 96 87 97 def OnLinkClicked(self, event): -
theoryview/perspectives/theory/model_panel.py
r946d1b1 r18cdddb 1 1 import os 2 2 import wx 3 3 import wx.lib.newevent … … 528 528 """ 529 529 from help_panel import HelpWindow 530 import sans.models as models 531 # Get models help model_function path 532 path = models.get_data_path(media='media') 533 model_path = os.path.join(path,"model_functions.html") 530 534 531 535 if self.model == None: … … 533 537 else: 534 538 name = self.model.name 535 frame = HelpWindow(None, -1, pageToOpen= "media/model_functions.html")539 frame = HelpWindow(None, -1, pageToOpen=model_path) 536 540 frame.Show(True) 537 541 if frame.rhelp.HasAnchor(name): … … 541 545 msg +="Please.Search in the Help window" 542 546 wx.PostEvent(self.parent, StatusEvent(status = msg )) 547 543 548 544 549 def set_range(self, qmin_x, qmax_x, npts):
Note: See TracChangeset
for help on using the changeset viewer.