Changeset 09f2328 in sasview for src/sas/sasgui
- Timestamp:
- Mar 3, 2017 5:03:24 PM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 39f0bf4, 05d167e, 082239e, d0764bf, c08756f, 7e98655
- Parents:
- 951701c (diff), a45a298 (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. - git-author:
- Paul Kienzle <pkienzle@…> (03/03/17 17:03:24)
- git-committer:
- GitHub <noreply@…> (03/03/17 17:03:24)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/data_panel.py
rc8e1996 ra45a298 66 66 IS_MAC = True 67 67 68 STYLE_FLAG = wx.RAISED_BORDER | CT.TR_HAS_BUTTONS | CT.TR_HIDE_ROOT |\69 wx.WANTS_CHARS | CT.TR_HAS_VARIABLE_ROW_HEIGHT 68 STYLE_FLAG = (wx.RAISED_BORDER | CT.TR_HAS_BUTTONS | 69 wx.WANTS_CHARS | CT.TR_HAS_VARIABLE_ROW_HEIGHT) 70 70 71 71 … … 74 74 Check list control to be used for Data Panel 75 75 """ 76 def __init__(self, parent, *args, **kwds):76 def __init__(self, parent, root, *args, **kwds): 77 77 # agwstyle is introduced in wx.2.8.11 but is not working for mac 78 78 if IS_MAC and wx_version < 812: … … 97 97 del kwds['style'] 98 98 CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 99 self.root = self.AddRoot( "Available Data")99 self.root = self.AddRoot(root) 100 100 101 101 def OnCompareItems(self, item1, item2): … … 520 520 Add a listcrtl in the panel 521 521 """ 522 tree_ctrl_label = wx.StaticText(self, -1, "Data") 523 tree_ctrl_label.SetForegroundColour('blue') 524 self.tree_ctrl = DataTreeCtrl(parent=self, style=wx.SUNKEN_BORDER) 522 # Add splitter 523 w, h = self.parent.GetSize() 524 splitter = wx.SplitterWindow(self) 525 splitter.SetMinimumPaneSize(50) 526 splitter.SetSashGravity(1.0) 527 528 file_sizer = wx.BoxSizer(wx.VERTICAL) 529 file_sizer.SetMinSize(wx.Size(w/13, h*2/5)) 530 theory_sizer = wx.BoxSizer(wx.VERTICAL) 531 theory_sizer.SetMinSize(wx.Size(w/13, h*2/5)) 532 533 self.tree_ctrl = DataTreeCtrl(parent=splitter, 534 style=wx.SUNKEN_BORDER, 535 root="Available Data") 536 525 537 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_CHECKING, self.on_check_item) 526 538 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_MENU, self.on_right_click_data) … … 557 569 wx.EVT_MENU(self, self.editmask_id, self.on_edit_data) 558 570 559 tree_ctrl_theory_label = wx.StaticText(self, -1, "Theory") 560 tree_ctrl_theory_label.SetForegroundColour('blue') 561 self.tree_ctrl_theory = DataTreeCtrl(parent=self, 562 style=wx.SUNKEN_BORDER) 571 self.tree_ctrl_theory = DataTreeCtrl(parent=splitter, 572 style=wx.SUNKEN_BORDER, 573 root="Available Theory") 563 574 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_CHECKING, 564 575 self.on_check_item) 565 576 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_MENU, 566 577 self.on_right_click_theory) 567 self.sizer1.Add(tree_ctrl_label, 0, wx.LEFT, 10) 568 self.sizer1.Add(self.tree_ctrl, 1, wx.EXPAND | wx.ALL, 10) 569 self.sizer1.Add(tree_ctrl_theory_label, 0, wx.LEFT, 10) 570 self.sizer1.Add(self.tree_ctrl_theory, 1, wx.EXPAND | wx.ALL, 10) 578 splitter.SplitHorizontally(self.tree_ctrl, self.tree_ctrl_theory) 579 self.sizer1.Add(splitter, 1, wx.EXPAND | wx.ALL, 10) 571 580 572 581 def on_right_click_theory(self, event): … … 722 731 if self.tree_ctrl.root: 723 732 self.tree_ctrl.SortChildren(self.tree_ctrl.root) 733 # Expand root if # of data sets > 0 734 if self.tree_ctrl.GetCount() > 0: 735 self.tree_ctrl.root.Expand() 724 736 self.enable_remove() 725 737 self.enable_import() … … 760 772 state_id=state_id, 761 773 theory_list=theory_list) 774 if self.tree_ctrl_theory.GetCount() > 0: 775 self.tree_ctrl_theory.root.Expand() 762 776 763 777 def append_theory_helper(self, tree, root, state_id, theory_list):
Note: See TracChangeset
for help on using the changeset viewer.