- Timestamp:
- Jun 22, 2015 1:23:56 PM (10 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:
- 4cf8db9
- Parents:
- 0c17d96 (diff), 038ccfe6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/guiframe/acknowledgebox.py
r0ea31ca rc8d22ec 21 21 (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))): 22 22 fObj, path, descr = imp.find_module('local_config', [path]) 23 config = imp.load_module('local_config', fObj, path, descr) 23 config = imp.load_module('local_config', fObj, path, descr) 24 24 else: 25 25 # Try simply importing local_config 26 26 import local_config as config 27 27 except: 28 # Didn't find local config, load the default 28 # Didn't find local config, load the default 29 29 import config 30 30 31 31 32 32 class DialogAcknowledge(wx.Dialog): 33 33 """ 34 34 "Acknowledgement" Dialog Box 35 35 36 36 Shows the current method for acknowledging SasView in 37 37 scholarly publications. 38 38 39 39 """ 40 40 41 41 def __init__(self, *args, **kwds): 42 42 43 43 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 44 44 wx.Dialog.__init__(self, *args, **kwds) 45 45 46 46 self.ack = wx.TextCtrl(self, style=wx.TE_LEFT|wx.TE_MULTILINE|wx.TE_BESTWRAP|wx.TE_READONLY|wx.TE_NO_VSCROLL) 47 47 self.ack.SetValue(config._acknowledgement_publications) 48 self.ack.SetMinSize((-1, 55))48 self.ack.SetMinSize((-1, 55)) 49 49 self.preamble = wx.StaticText(self, -1, config._acknowledgement_preamble) 50 50 items = [config._acknowledgement_preamble_bullet1, 51 51 config._acknowledgement_preamble_bullet2, 52 config._acknowledgement_preamble_bullet3] 52 config._acknowledgement_preamble_bullet3, 53 config._acknowledgement_preamble_bullet4] 53 54 self.list1 = wx.StaticText(self, -1, "\t(1) " + items[0]) 54 55 self.list2 = wx.StaticText(self, -1, "\t(2) " + items[1]) 55 56 self.list3 = wx.StaticText(self, -1, "\t(3) " + items[2]) 57 self.list4 = wx.StaticText(self, -1, "\t(4) " + items[3]) 56 58 self.static_line = wx.StaticLine(self, 0) 57 59 self.__set_properties() 58 60 self.__do_layout() 59 61 60 62 def __set_properties(self): 61 63 """ 64 :TODO - add method documentation 62 65 """ 63 66 # begin wxGlade: DialogAbout.__set_properties … … 70 73 def __do_layout(self): 71 74 """ 75 :TODO - add method documentation 72 76 """ 73 77 # begin wxGlade: DialogAbout.__do_layout … … 78 82 sizer_titles.Add(self.list2, 0, wx.ALL|wx.EXPAND, 5) 79 83 sizer_titles.Add(self.list3, 0, wx.ALL|wx.EXPAND, 5) 84 sizer_titles.Add(self.list4, 0, wx.ALL|wx.EXPAND, 5) 80 85 sizer_titles.Add(self.static_line, 0, wx.ALL|wx.EXPAND, 0) 81 86 sizer_titles.Add(self.ack, 0, wx.ALL|wx.EXPAND, 5) … … 86 91 self.Centre() 87 92 # end wxGlade 88 93 89 94 90 95 ##### testing code ############################################################ 91 96 class MyApp(wx.App): 92 97 """ 98 Class for running module as stand alone for testing 93 99 """ 94 100 def OnInit(self): 95 101 """ 102 Defines an init when running as standalone 96 103 """ 97 104 wx.InitAllImageHandlers() -
src/sas/guiframe/config.py
r0ea31ca rc8d22ec 9 9 __version__ = '0.0.0' 10 10 __build__ = '1' 11 __download_page__ = 'http://sourceforge.net/projects/sasview/files/' 12 __update_URL__ = ['svn.code.sf.net', 13 '/p/sasview/code/trunk/sasview.latestversion'] 11 __download_page__ = 'https://github.com/SasView/sasview/releases' 12 __update_URL__ = ['https://github.com/SasView/sasview.git'] 14 13 15 14 … … 21 20 22 21 # Debug message should be written to a file? 23 __EVT_DEBUG_2_FILE__ 22 __EVT_DEBUG_2_FILE__ = False 24 23 __EVT_DEBUG_FILENAME__ = "debug.log" 25 24 … … 36 35 '''Reference the following website: http://www.sasview.org''' 37 36 _acknowledgement_preamble_bullet3 =\ 38 '''Send us your reference for our records: sansdanse@gmail.com''' 37 '''Reference the model you used if appropriate (see documentation for refs)''' 38 _acknowledgement_preamble_bullet4 =\ 39 '''Send us your reference for our records: developers@sasview.org''' 39 40 _acknowledgement_publications = \ 40 '''This work benefited from the use of the SasView application, originally 41 '''This work benefited from the use of the SasView application, originally 41 42 developed under NSF award DMR-0520547. 42 43 ''' 43 44 _acknowledgement = \ 44 45 '''This work originally developed as part of the DANSE project funded by the NSF 45 under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS 46 under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS 46 47 and ILL. 47 48 … … 85 86 PLUGINS_WLIST = [] 86 87 PLUGIN_STATE_EXTENSIONS = [] 87 SPLASH_SCREEN_PATH = "images/danse_logo.png" 88 SPLASH_SCREEN_PATH = "images/danse_logo.png" 88 89 DEFAULT_STYLE = GUIFRAME.SINGLE_APPLICATION 89 90 SPLASH_SCREEN_WIDTH = 500 90 91 SPLASH_SCREEN_HEIGHT = 300 91 WELCOME_PANEL_ON 92 WELCOME_PANEL_ON = False 92 93 TUTORIAL_PATH = None 93 94 SS_MAX_DISPLAY_TIME = 1500 … … 125 126 126 127 def printEVT(message): 128 """ 129 :TODO - need method documentation 130 """ 127 131 if __EVT_DEBUG__: 128 132 print "%g: %s" % (time.clock(), message) 129 133 130 134 if __EVT_DEBUG_2_FILE__: 131 135 out = open(__EVT_DEBUG_FILENAME__, 'a') -
src/sas/guiframe/data_processor.py
rc85b0ae re54dbc3e 141 141 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnLeftClick) 142 142 self.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK, self.OnRightClick) 143 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.OnLeftDoubleClick)143 #self.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.OnLeftDoubleClick) 144 144 self.Bind(wx.grid.EVT_GRID_RANGE_SELECT, self.OnRangeSelect) 145 145 self.Bind(wx.grid.EVT_GRID_ROW_SIZE, self.OnRowSize) … … 187 187 if self.GetNumberCols() > 0: 188 188 self.default_col_width = self.GetColSize(0) 189 self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.on_left_click) 190 self.Bind(wx.grid.EVT_GRID_LABEL_RIGHT_CLICK, self.on_right_click) 191 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.on_selected_cell) 192 self.Bind(wx.grid.EVT_GRID_CMD_CELL_CHANGE, self.on_edit_cell) 193 self.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK, self.onContextMenu) 194 189 #self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.on_left_click) 190 #self.Bind(wx.grid.EVT_GRID_LABEL_RIGHT_CLICK, self.on_right_click) 191 #self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.on_selected_cell) 192 #self.Bind(wx.grid.EVT_GRID_CMD_CELL_CHANGE, self.on_edit_cell) 193 #self.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK, self.onContextMenu) 194 195 def OnLeftClick(self, event): 196 sheet.CSheet.OnLeftClick(self, event) 197 self.on_selected_cell(event) 198 195 199 def on_edit_cell(self, event): 196 200 """ … … 211 215 row, col = event.GetRow(), event.GetCol() 212 216 cell = (row, col) 213 event.Skip()214 217 if not flag and not flag_shift: 215 218 self.selected_cols = [] … … 273 276 if cell_row > 0 and cell_row < self.max_row_touse: 274 277 self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 278 event.Skip() 275 279 276 280 def on_left_click(self, event): … … 278 282 Catch the left click on label mouse event 279 283 """ 280 event.Skip()281 284 flag = event.CmdDown() or event.ControlDown() 282 285 … … 317 320 if not self.axis_label: 318 321 self.axis_label = " " 322 event.Skip() 319 323 320 324 def on_right_click(self, event): … … 1385 1389 wx.EVT_MENU(self, self.save_menu.GetId(), self.on_save_page) 1386 1390 1391 # To add the edit menu, call add_edit_menu() here. 1392 self.edit = None 1393 self.Bind(wx.EVT_MENU_OPEN, self.on_menu_open) 1394 1395 self.Bind(wx.EVT_CLOSE, self.on_close) 1396 1397 def add_edit_menu(self, menubar): 1387 1398 self.edit = wx.Menu() 1388 1399 … … 1414 1425 self.remove_menu = self.edit.Append(-1, 'Remove Column', hint) 1415 1426 wx.EVT_MENU(self, self.remove_menu.GetId(), self.on_remove_column) 1416 1417 self.Bind(wx.EVT_MENU_OPEN, self.on_menu_open)1418 1427 menubar.Append(self.edit, "&Edit") 1419 self.Bind(wx.EVT_CLOSE, self.on_close)1420 1428 1421 1429 def on_copy(self, event): -
src/sas/guiframe/documentation_window.py
re82a901 rc8d22ec 1 """ 2 documentation module provides a simple means to add help throughout the 3 application. It checks for the existence of html2 package needed to support 4 fully html panel which supports css. The class defined here takes a title for 5 the particular help panel, a pointer to the html documentation file of interest 6 within the documentation tree along with a 'command' string such as a page 7 anchor or a query string etc. The path to the doc directory is retrieved 8 automatically by the class itself. Thus with these three pieces of information 9 the class generates a panel with the appropriate title bar and help file 10 formatted according the style sheets called in the html file. Finally, if an 11 old version of Python is running and the html2 package is not available the 12 class brings up the default browser and passes the file:/// string to it. In 13 this case however the instruction portion is usually not passed for security 14 reasons. 15 """ 1 16 import os 2 17 import logging … … 5 20 import urllib 6 21 7 wx_supports_html2 = True 22 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 23 WX_SUPPORTS_HTML2 = True 8 24 try: 9 25 import wx.html2 as html 10 26 except: 11 wx_supports_html2 = False 27 WX_SUPPORTS_HTML2 = False 28 12 29 13 30 from gui_manager import get_app_dir … … 15 32 16 33 class DocumentationWindow(wx.Frame): 17 def __init__(self, parent, id, path, url_instruction, title, size=(850, 540)): 18 wx.Frame.__init__(self, parent, id, title, size=size) 34 """ 35 DocumentationWindow inherits from wx.Frame and provides a centralized 36 coherent framework for all help documentation. Help files must be html 37 files stored in an properly organized tree below the top 'doc' folder. In 38 order to display the appropriate help file from anywhere in the gui, the 39 code simply needs to know the location below the top level where the 40 help file resides along with the name of the help file. 41 called 42 (self, parent, dummy_id, path, url_instruction, title, size=(850, 540)) 19 43 20 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 44 :param path: path to html file beginning AFTER /doc/ and ending in the 45 file.html 46 :param url_instructions: anchor string or other query e.g. '#MyAnchor 47 :param title - text to place in the title bar of the help panel 48 """ 49 def __init__(self, parent, dummy_id, path, url_instruction, title, size=(850, 540)): 50 wx.Frame.__init__(self, parent, dummy_id, title, size=size) 51 21 52 if SPHINX_DOC_ENV in os.environ: 22 53 docs_path = os.path.join(os.environ[SPHINX_DOC_ENV]) … … 27 58 docs_path = os.path.join(get_app_dir(), "doc") 28 59 60 #note that filepath for mac OS, at least in bundle starts with a 61 #forward slash as /Application, while the PC string begins C:\ 62 #It seems that mac OS is happy with four slashes as in file:////App... 63 #Two slashes is not sufficient to indicate path from root. Thus for now 64 #we use "file:///" +... If the mac behavior changes may need to make the 65 #file:/// be another constant at the beginning that yields // for Mac 66 #and /// for PC. 67 #Note added June 21, 2015 PDB 29 68 file_path = os.path.join(docs_path, path) 30 url = "file:///" + urllib.quote(file_path, '\:')+ url_instruction69 url = "file:///" + urllib.quote(file_path, r'/\:')+ url_instruction 31 70 32 71 if not os.path.exists(file_path): 33 72 logging.error("Could not find Sphinx documentation at %s \ 34 73 -- has it been built?", file_path) 35 elif wx_supports_html2:74 elif WX_SUPPORTS_HTML2: 36 75 # Complete HTML/CSS support! 37 76 self.view = html.WebView.New(self) 38 77 self.view.LoadURL(url) 39 78 self.Show() 40 else: 79 else: 41 80 logging.error("No html2 support, popping up a web browser") 42 81 #For cases that do not build against current version dependency 43 # Wx 3.0 we provide a webbrowser call - this is particularly for 82 # Wx 3.0 we provide a webbrowser call - this is particularly for 44 83 #Red hat used at SNS for which Wx 3.0 is not available. This 45 #does not deal with issue of math in docs of course. 84 #does not deal with issue of math in docs of course. 46 85 webbrowser.open_new_tab(url) 47 86 48 87 def main(): 88 """ 89 main loop function if running alone for testing. 90 """ 49 91 app = wx.App() 50 92 DocumentationWindow(None, -1, "index.html", "", "Documentation",) -
src/sas/guiframe/gui_manager.py
r7801df8 r3c2011e 1296 1296 #replace or add a new menu for the current plugin 1297 1297 pos = self._menubar.FindMenu(str(self._applications_menu_name)) 1298 if pos == -1 and self._applications_menu_pos > 0: 1299 pos = self._applications_menu_pos 1298 1300 if pos != -1: 1299 1301 menu_list = self._current_perspective.populate_menu(self) 1300 1302 if menu_list: 1301 1303 for (menu, name) in menu_list: 1304 print "[%s]" % name 1302 1305 self._menubar.Replace(pos, menu, name) 1303 1306 self._applications_menu_name = name 1307 self._applications_menu_pos = pos 1304 1308 else: 1305 1309 self._menubar.Remove(pos) 1306 1310 self._applications_menu_name = None 1307 #get the position of the menu when it first added 1308 self._applications_menu_pos = pos 1311 self._applications_menu_pos = -1 1309 1312 else: 1310 1313 menu_list = self._current_perspective.populate_menu(self) … … 1316 1319 if help_pos == -1: 1317 1320 self._menubar.Append(menu, name) 1321 self._applications_menu_pos = -1 1318 1322 else: 1319 1323 self._menubar.Insert(help_pos-1, menu, name) 1324 self._applications_menu_pos = help_pos - 1 1320 1325 else: 1321 1326 self._menubar.Insert(self._applications_menu_pos, menu, name) -
src/sas/perspectives/fitting/media/fitting.rst
rb404a3de rd896039 17 17 Polarisation/Magnetic Scattering <mag_help> 18 18 19 Information on the SasView Optimisers - Local <optimizer.rst> 20 21 Information on the SasView Optimisers - Web <https://github.com/bumps/bumps/blob/master/doc/guide/optimizer.rst> 19 Information on the SasView Optimisers <optimizer.rst> 22 20
Note: See TracChangeset
for help on using the changeset viewer.