Changeset 53cf669 in sasview for sansguiframe/src/sans/guiframe/gui_manager.py
- Timestamp:
- Sep 4, 2011 6:12:25 PM (13 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:
- e85e2bc
- Parents:
- 37c36d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/gui_manager.py
r37c36d9 r53cf669 234 234 # List of plot panels 235 235 self.plot_panels = {} 236 # default Graph number fot the plotpanel caption 237 self.graph_num = 0 236 238 237 239 # Default locations … … 808 810 count += 1 809 811 windowname = p.window_name 810 caption =p.window_caption812 windowcaption = 'Graph'#p.window_caption 811 813 if count > 0: 812 814 windowname += str(count+1) 813 caption += (' '+str(count))815 #caption += (' '+str(count)) 814 816 p.window_name = windowname 817 818 # Append nummber 819 captions = self._get_plotpanel_captions() 820 while (1): 821 self.graph_num += 1 822 caption = windowcaption + '%s'% str(self.graph_num) 823 if caption not in captions: 824 break 825 815 826 p.window_caption = caption 816 827 … … 861 872 self._data_panel.cb_plotpanel.Append(str(caption), p) 862 873 return ID 863 874 875 def _get_plotpanel_captions(self): 876 """ 877 Get all the plotpanel cations 878 879 : return: list of captions 880 """ 881 captions = [] 882 for Id in self.plot_panels.keys(): 883 captions.append(self.plot_panels[Id].window_caption) 884 885 return captions 886 864 887 def _setup_menus(self): 865 888 """ … … 2361 2384 # wx.aui.AuiPaneInfo 2362 2385 pane_info = self.get_paneinfo(name) 2363 # New Caption2364 pane_info.Caption(new_caption)2365 2386 # update the data_panel.cb_plotpanel 2366 2387 if 'data_panel' in self.panels.keys(): … … 2368 2389 data_panel = self.panels["data_panel"] 2369 2390 if data_panel.cb_plotpanel is not None: 2391 # Check if any panel has the same caption 2392 has_newstring = data_panel.cb_plotpanel.FindString\ 2393 (str(new_caption)) 2394 caption = new_caption 2395 if has_newstring != wx.NOT_FOUND: 2396 captions = self._get_plotpanel_captions() 2397 # Append nummber 2398 inc = 1 2399 while (1): 2400 caption = new_caption + '_%s'% str(inc) 2401 if caption not in captions: 2402 break 2403 inc += 1 2404 # notify to users 2405 msg = "Found Same Title: Added '_%s'"% str(inc) 2406 wx.PostEvent(self, StatusEvent(status=msg)) 2407 # update data_panel cb 2370 2408 pos = data_panel.cb_plotpanel.FindString(str(old_caption)) 2371 2409 if pos != wx.NOT_FOUND: 2372 data_panel.cb_plotpanel.SetString(pos, new_caption)2373 data_panel.cb_plotpanel.SetStringSelection( new_caption)2410 data_panel.cb_plotpanel.SetString(pos, caption) 2411 data_panel.cb_plotpanel.SetStringSelection(caption) 2374 2412 # update window Show menu 2375 2413 if self._window_menu != None: … … 2377 2415 pos = self._window_menu.FindItem(old_caption) 2378 2416 if self._window_menu.GetLabel(pos) == str(old_caption): 2379 self._window_menu.SetLabel(pos, new_caption)2417 self._window_menu.SetLabel(pos, caption) 2380 2418 break 2419 # New Caption 2420 pane_info.Caption(caption) 2381 2421 # update aui manager 2382 2422 self._mgr.Update() 2423 return caption 2383 2424 2384 2425 def get_paneinfo(self, name): … … 2580 2621 self.panel_on_focus = panel 2581 2622 self.set_panel_on_focus(None) 2582 2623 2583 2624 def set_plot_unfocus(self): 2584 2625 """
Note: See TracChangeset
for help on using the changeset viewer.