- Timestamp:
- Mar 23, 2011 5:27:21 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:
- dfd3577
- Parents:
- be56c8c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_panel.py
rbe56c8c r91bdf87 23 23 #PANEL_HEIGHT = 560 24 24 PANEL_HEIGHT = 800 25 STYLE_FLAG = wx.SUNKEN_BORDER|CT.TR_HAS_BUTTONS| CT.TR_HIDE_ROOT|\ 26 wx.WANTS_CHARS|CT.TR_HAS_VARIABLE_ROW_HEIGHT 27 28 25 29 class DataTreeCtrl(CT.CustomTreeCtrl): 26 30 """ … … 29 33 def __init__(self, parent,*args, **kwds): 30 34 #agwstyle is introduced in wx.2.8.11 31 kwds['agwStyle']= wx.SUNKEN_BORDER|CT.TR_HAS_BUTTONS| CT.TR_HIDE_ROOT| \ 32 wx.WANTS_CHARS|CT.TR_HAS_VARIABLE_ROW_HEIGHT 35 try: 36 kwds['agwStyle'] = STYLE_FLAG 37 except: 38 try: 39 kwds['style'] = STYLE_FLAG 40 except: 41 raise 42 33 43 CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 34 44 self.root = self.AddRoot("Available Data") … … 283 293 (self.rb_batch_mode,0, wx.ALL,5)]) 284 294 285 def layout_data_list(self):295 def old_layout_data_list(self): 286 296 """ 287 297 Add a listcrtl in the panel … … 293 303 "THEORIES", ct_type=0) 294 304 295 def new_layout_data_list(self):305 def layout_data_list(self): 296 306 """ 297 307 Add a listcrtl in the panel … … 403 413 process.__str__()) 404 414 self.append_theory(state_id, theory_list) 405 415 406 416 407 def append_theory(self, state_id, theory_list):417 def old_append_theory(self, state_id, theory_list): 408 418 """ 409 419 append theory object under data from a state of id = state_id … … 422 432 state_id=state_id, 423 433 theory_list=theory_list) 424 def new_append_theory(self, state_id, theory_list):434 def append_theory(self, state_id, theory_list): 425 435 """ 426 436 append theory object under data from a state of id = state_id … … 431 441 if state_id not in self.list_cb_data.keys(): 432 442 root = self.tree_ctrl_theory.root 443 tree = self.tree_ctrl_theory 433 444 else: 434 445 item = self.list_cb_data[state_id] 435 446 data_c, _, _, _, _, _ = item 436 447 root = data_c 448 tree = self.tree_ctrl 437 449 if root is not None: 438 self.append_theory_helper( root=root,450 self.append_theory_helper(tree=tree, root=root, 439 451 state_id=state_id, 440 452 theory_list=theory_list) 441 453 442 454 443 def append_theory_helper(self, root, state_id, theory_list):455 def append_theory_helper(self, tree, root, state_id, theory_list): 444 456 """ 445 457 """ … … 464 476 if theory_id not in theory_list_ctrl: 465 477 #add new theory 466 t_child = self.tree_ctrl.AppendItem(root,478 t_child = tree.AppendItem(root, 467 479 name, ct_type=1, data=temp) 468 t_i_c = self.tree_ctrl.AppendItem(t_child, 'Info')469 i_c_c = self.tree_ctrl.AppendItem(t_i_c,480 t_i_c = tree.AppendItem(t_child, 'Info') 481 i_c_c = tree.AppendItem(t_i_c, 470 482 'Type: %s' % theory_class) 471 t_p_c = self.tree_ctrl.AppendItem(t_i_c, 'Process')483 t_p_c = tree.AppendItem(t_i_c, 'Process') 472 484 473 485 for process in theory_data.process: 474 i_t_c = self.tree_ctrl.AppendItem(t_p_c,486 i_t_c = tree.AppendItem(t_p_c, 475 487 process.__str__()) 476 488 theory_list_ctrl[theory_id] = [t_child, … … 480 492 #replace theory 481 493 t_child, i_c_c, t_p_c = theory_list_ctrl[theory_id] 482 self.tree_ctrl.SetItemText(t_child, name)483 self.tree_ctrl.SetItemPyData(t_child, temp)484 self.tree_ctrl.SetItemText(i_c_c, 'Type: %s' % theory_class)485 self.tree_ctrl.DeleteChildren(t_p_c)494 tree.SetItemText(t_child, name) 495 tree.SetItemPyData(t_child, temp) 496 tree.SetItemText(i_c_c, 'Type: %s' % theory_class) 497 tree.DeleteChildren(t_p_c) 486 498 for process in theory_data.process: 487 i_t_c = self.tree_ctrl.AppendItem(t_p_c,499 i_t_c = tree.AppendItem(t_p_c, 488 500 process.__str__()) 489 501 … … 500 512 # name = theory_state.model.name 501 513 temp = (theory_id, theory_class, state_id) 502 t_child = self.tree_ctrl.AppendItem(root,514 t_child = tree.AppendItem(root, 503 515 name, ct_type=1, 504 516 data=(theory_data.id, theory_class, state_id)) 505 t_i_c = self.tree_ctrl.AppendItem(t_child, 'Info')506 i_c_c = self.tree_ctrl.AppendItem(t_i_c,517 t_i_c = tree.AppendItem(t_child, 'Info') 518 i_c_c = tree.AppendItem(t_i_c, 507 519 'Type: %s' % theory_class) 508 t_p_c = self.tree_ctrl.AppendItem(t_i_c, 'Process')520 t_p_c = tree.AppendItem(t_i_c, 'Process') 509 521 510 522 for process in theory_data.process: 511 i_t_c = self.tree_ctrl.AppendItem(t_p_c,523 i_t_c = tree.AppendItem(t_p_c, 512 524 process.__str__()) 513 525 … … 515 527 #self.list_cb_theory[data_id] = theory_list_ctrl 516 528 self.list_cb_theory[state_id] = theory_list_ctrl 529 517 530 518 531
Note: See TracChangeset
for help on using the changeset viewer.