Changeset 2509
- Timestamp:
- Oct 31, 2016 6:18:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2502 r2509 2214 2214 self.Bind(wx.EVT_MENU, self.OnExportPDF, id=item.GetId()) 2215 2215 2216 def FillMainMenu(self,menubar ):2216 def FillMainMenu(self,menubar,addhelp=True): 2217 2217 '''Define contents of the main GSAS-II menu for the (main) data tree window. 2218 2218 For the mac, this is also called for the data item windows as well so that … … 2279 2279 menubar.Append(menu=self.MacroMenu, title='Macro') 2280 2280 self._init_Macro() 2281 HelpMenu=G2G.MyHelp(self,helpType='Data tree', 2282 morehelpitems=[('&Tutorials','Tutorials'),]) 2283 menubar.Append(menu=HelpMenu,title='&Help') 2281 if addhelp: 2282 HelpMenu=G2G.MyHelp(self,includeTree=True, 2283 morehelpitems=[('&Tutorials','Tutorials'),]) 2284 menubar.Append(menu=HelpMenu,title='&Help') 2284 2285 2285 2286 def _init_ctrls(self, parent): -
trunk/GSASIIIO.py
r2491 r2509 781 781 if 'dict' in str(type(datum[1]['PythonVersions'])): #patch 782 782 for p in sorted(datum[1]['PythonVersions'],key=lambda s: s.lower()): 783 print(" {:>14s}: {:s}".format(p[0],p[1]))783 print(" {:>14s}: {:s}".format(p[0],p[1])) 784 784 else: 785 785 for p in datum[1]['PythonVersions']: 786 print(" {:<12s} {:s}".format(p[0]+':',p[1]))786 print(" {:>12s} {:s}".format(p[0]+':',p[1])) 787 787 for datus in data[1:]: 788 788 sub = G2frame.PatternTree.AppendItem(Id,datus[0]) -
trunk/GSASIIctrls.py
r2498 r2509 3020 3020 3021 3021 ''' 3022 def __init__(self,frame,helpType=None,helpLbl=None, morehelpitems=[],title=''):3023 wx.Menu.__init__(self, title)3022 def __init__(self,frame,helpType=None,helpLbl=None,includeTree=False,morehelpitems=[]): 3023 wx.Menu.__init__(self,'') 3024 3024 self.HelpById = {} 3025 3025 self.frame = frame … … 3041 3041 frame.Bind(wx.EVT_MENU, self.OnHelpById, helpobj) 3042 3042 self.HelpById[helpobj.GetId()] = indx 3043 # add a help item only when helpType is specified 3043 # add help lookup(s) in gsasii.html 3044 if helpType is not None or includeTree: 3045 self.AppendSeparator() 3046 if includeTree: 3047 if helpLbl is None: helpLbl = helpType 3048 helpobj = self.Append(text='Help on Data tree', 3049 id=wx.ID_ANY, kind=wx.ITEM_NORMAL) 3050 frame.Bind(wx.EVT_MENU, self.OnHelpById, id=helpobj.GetId()) 3051 self.HelpById[helpobj.GetId()] = 'Data tree' 3044 3052 if helpType is not None: 3045 self.AppendSeparator()3046 3053 if helpLbl is None: helpLbl = helpType 3047 3054 helpobj = self.Append(text='Help on '+helpLbl, 3048 3055 id=wx.ID_ANY, kind=wx.ITEM_NORMAL) 3049 frame.Bind(wx.EVT_MENU, self.OnHelpById, helpobj)3056 frame.Bind(wx.EVT_MENU, self.OnHelpById, id=helpobj.GetId()) 3050 3057 self.HelpById[helpobj.GetId()] = helpType 3051 3058 … … 3086 3093 3087 3094 Please cite as: 3088 B.H. Toby & R.B. Von Dreele, J. Appl. Cryst. 46, 544-549 (2013)3095 B.H. Toby & R.B. Von Dreele, J. Appl. Cryst. 46, 544-549 (2013) 3089 3096 For small angle use cite: 3090 R.B. Von Dreele, J. Appl. Cryst. 47, 1748-9 (2014)3097 R.B. Von Dreele, J. Appl. Cryst. 47, 1748-9 (2014) 3091 3098 For DIFFaX use cite: 3092 M.M.J. Treacy, J.M. Newsam & M.W. Deem,3093 3099 M.M.J. Treacy, J.M. Newsam & M.W. Deem, 3100 Proc. Roy. Soc. Lond. A 433, 499-520 (1991) 3094 3101 ''' 3095 3096 3102 info.WebSite = ("https://subversion.xray.aps.anl.gov/trac/pyGSAS","GSAS-II home page") 3097 3103 wx.AboutBox(info) … … 3247 3253 3248 3254 ################################################################################ 3249 class AddHelp(wx.Menu):3250 '''For the Mac: creates an entry to the help menu of type3251 'Help on <helpType>': where helpType is a reference to an HTML page to3252 be opened.3253 3254 NOTE: when appending this menu (menu.Append) be sure to set the title to3255 '&Help' so that wx handles it correctly.3256 '''3257 def __init__(self,frame,helpType,helpLbl=None,title=''):3258 wx.Menu.__init__(self,title)3259 self.frame = frame3260 if helpLbl is None: helpLbl = helpType3261 # add a help item only when helpType is specified3262 helpobj = self.Append(text='Help on '+helpLbl,3263 id=wx.ID_ANY, kind=wx.ITEM_NORMAL)3264 frame.Bind(wx.EVT_MENU, self.OnHelpById, helpobj)3265 self.HelpById = helpType3266 3267 def OnHelpById(self,event):3268 '''Called when Help on... is pressed in a menu. Brings up3269 a web page for documentation.3270 '''3271 ShowHelp(self.HelpById,self.frame)3272 3273 ################################################################################3274 3255 class HelpButton(wx.Button): 3275 3256 '''Create a help button that displays help information. … … 3775 3756 htmlFrame = None 3776 3757 htmlFirstUse = True 3777 helpLocDict = {} 3758 #helpLocDict = {} # to be implemented if we ever split gsasii.html over multiple files 3778 3759 path2GSAS2 = os.path.dirname(os.path.realpath(__file__)) # save location of this file 3779 3760 def ShowHelp(helpType,frame): … … 3781 3762 global htmlFirstUse 3782 3763 # look up a definition for help info from dict 3783 helplink = helpLocDict.get(helpType) 3784 if helplink is None: 3764 #helplink = helpLocDict.get(helpType) 3765 #if helplink is None: 3766 if True: 3785 3767 # no defined link to use, create a default based on key 3786 3768 helplink = 'gsasII.html#'+helpType.replace(' ','_') 3787 helplink = os.path.join(path2GSAS2,'help',helplink)3788 3769 # determine if a web browser or the internal viewer should be used for help info 3789 3770 if GSASIIpath.GetConfigValue('Help_mode'): … … 3792 3773 helpMode = 'browser' 3793 3774 if helpMode == 'internal': 3775 helplink = os.path.join(path2GSAS2,'help',helplink) 3794 3776 try: 3795 3777 htmlPanel.LoadFile(helplink) … … 3802 3784 htmlPanel.LoadFile(helplink) 3803 3785 else: 3786 if sys.platform == "darwin": # for Mac, force use of safari to preserve anchors on file URLs 3787 wb = webbrowser.MacOSXOSAScript('safari') 3788 else: 3789 wb = webbrowser 3790 helplink = os.path.join(path2GSAS2,'help',helplink) 3804 3791 pfx = "file://" 3805 3792 if sys.platform.lower().startswith('win'): 3806 3793 pfx = '' 3794 #if GSASIIpath.GetConfigValue('debug'): print 'Help link=',pfx+helplink 3807 3795 if htmlFirstUse: 3808 w ebbrowser.open_new(pfx+helplink)3796 wb.open_new(pfx+helplink) 3809 3797 htmlFirstUse = False 3810 3798 else: 3811 w ebbrowser.open(pfx+helplink, new=0, autoraise=True)3799 wb.open(pfx+helplink, new=0, autoraise=True) 3812 3800 3813 3801 def ShowWebPage(URL,frame): -
trunk/GSASIIgrid.py
r2504 r2509 1521 1521 self.helpLbl = helpLbl 1522 1522 if sys.platform == "darwin": # mac 1523 self.G2frame.FillMainMenu(menu ) # add the data tree menu items1523 self.G2frame.FillMainMenu(menu,addhelp=False) # add the data tree menu items 1524 1524 if not empty: 1525 1525 menu.Append(wx.Menu(title=''),title='|') # add a separator 1526 1526 1527 1527 def PostfillDataMenu(self,empty=False): 1528 '''Create the "standard" part of data frame menus. Note that on Linux and 1529 Windows, this is the standard help Menu. On Mac, this menu duplicates the 1530 tree menu, but adds an extra help command for the data item and a separator. 1528 '''Add the help menu to the data frame menus. Note that on Linux and 1529 Windows, this is the standard help Menu but without the update commands but adds an extra help 1530 command for the data item. 1531 On Mac, this is the entire help menu including the update commands, a separator and the 1532 extra help command for the data item. 1531 1533 ''' 1532 1534 menu = self.datamenu … … 1536 1538 if not empty: 1537 1539 menu.Append(wx.Menu(title=''),title='|') # add another separator 1538 menu.Append(G2G.AddHelp(self.G2frame,helpType=helpType, helpLbl=helpLbl), 1539 title='&Help') 1540 HelpMenu=G2G.MyHelp(self,helpType=helpType,includeTree=True, 1541 morehelpitems=[('&Tutorials','Tutorials'),]) 1542 menu.Append(menu=HelpMenu,title='&Help') 1540 1543 else: # other 1541 1544 menu.Append(menu=G2G.MyHelp(self,helpType=helpType, helpLbl=helpLbl), -
trunk/GSASIIlog.py
r2133 r2509 391 391 break 392 392 else: 393 print '****** getmenuinfo failed for id=',id,'binding to=',handler393 #print '****** getmenuinfo failed for id=',id,'binding to=',handler 394 394 #raise Exception('debug: getmenuinfo failed') 395 395 return -
trunk/help/gsasII.html
r2362 r2509 2327 2327 for off-line use) are downloaded. 2328 2328 2329 <!--<li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/">2330 <span style='font-weight:normal'>2331 </span></a></strong>2332 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/">exercise files</a>)</li>2333 --!>2334 2335 2329 <p><i>Getting started</i><UL> 2336 2330 <LI><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/StartingGSASII/Starting GSAS.htm"><span style='font-weight:normal'>Starting GSAS-II … … 6395 6389 style='mso-bookmark:Pawley'><o:p> </o:p></span></p> 6396 6390 6397 <p class=MsoNormal><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Mon Jul 4 09:03:37 EDT 2016 <!-- hhmts end -->6391 <p class=MsoNormal><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Mon Oct 31 17:35:19 CDT 2016 <!-- hhmts end --> 6398 6392 </body> 6399 6393
Note: See TracChangeset
for help on using the changeset viewer.