gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: jakarta-gump/python/gump view.py
Date Fri, 09 May 2003 06:40:06 GMT
nicolaken    2003/05/08 23:40:06

  Modified:    python/gump view.py
  Log:
  Add icons to trees. Something is wrong on module selection, dunno why...
  
  Revision  Changes    Path
  1.41      +26 -14    jakarta-gump/python/gump/view.py
  
  Index: view.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/view.py,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- view.py	8 May 2003 22:01:05 -0000	1.40
  +++ view.py	9 May 2003 06:40:05 -0000	1.41
  @@ -173,8 +173,6 @@
       #self.SetImageList(self.il, wxIMAGE_LIST_SMALL)
   
       # panes
  -    self.tree=wxTreeCtrl(self.mainsplit,-1)
  -    
       self.list=wxListCtrl(notebook,-1,style=wxLC_REPORT|wxNO_BORDER )
       self.dependencies=wxListCtrl(notebook,-1,style=wxLC_REPORT|wxNO_BORDER )
       self.prereqs=wxListCtrl(notebook,-1,style=wxLC_REPORT|wxNO_BORDER )
  @@ -184,15 +182,10 @@
   
       self.data=wxTextCtrl(split2,-1,style=wxTE_MULTILINE)
   
  -
       self.logview=GumpLogView(self.logsplitter)
  -    
  -    #self.logview=wxListCtrl(self.logsplitter,-1,style=wxLC_REPORT|wxNO_BORDER )
  -    #self.logview.InsertColumn(0, "Console")
  -    #self.logview.SetColumnWidth(0,self.frame.GetRect().GetWidth())    
  -    #                        wxFont(9, wx.wxMODERN, wx.wxNORMAL, wx.wxNORMAL)))
  -    
   
  +    self.tree=wxTreeCtrl(self.mainsplit,-1)
  +    
       # attach the panes to the frame
       self.logsplitter.SplitHorizontally(self.mainsplit, self.logview)
       self.mainsplit.SplitVertically(self.tree, split2)
  @@ -241,7 +234,20 @@
   
     # list all modules and their projects
     def load(self,files):
  +      
  +    #tree images
  +    treeil = wxImageList(16, 16)
  +    idx_workspace = treeil.Add(wxImage("gump/images/workspace.bmp").ConvertToBitmap())
  +    idx_module = treeil.Add(wxImage("gump/images/module.bmp").ConvertToBitmap())
  +    idx_module_ex = treeil.Add(wxImage("gump/images/module_ex.bmp").ConvertToBitmap())
   
  +    idx_project = treeil.Add(wxImage("gump/images/project.bmp").ConvertToBitmap())
  +    idx_project_ex = treeil.Add(wxImage("gump/images/project_ex.bmp").ConvertToBitmap())
  +    self.tree.AssignImageList(treeil)
  +    
       root = self.tree.AddRoot(files[0])
  +    self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_Normal)
  +    self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_Expanded)
  +    self.tree.SetItemImage(root, idx_workspace, wx.wxTreeItemIcon_SelectedExpanded)
       self.workspace = load(files[0])
       names=Module.list.keys()
       names.sort()
  @@ -249,10 +255,16 @@
         module=Module.list[name]
         parent=self.mItem[name]=self.tree.AppendItem(root,name)
         self.tree.SetPyData(parent,module)
  +      self.tree.SetItemImage(parent, idx_module ,    wx.wxTreeItemIcon_Normal)
  +      self.tree.SetItemImage(parent, idx_module_ex , wx.wxTreeItemIcon_Expanded)
  +      self.tree.SetItemImage(parent, idx_module_ex , wx.wxTreeItemIcon_Selected)
  +      self.tree.SetItemImage(parent, idx_module_ex,  wx.wxTreeItemIcon_SelectedExpanded)
         for project in module.project:
  -        self.pItem[project.name]=self.tree.AppendItem(parent,project.name)
  +        proj=self.pItem[project.name]=self.tree.AppendItem(parent,project.name)
           self.tree.SetPyData(self.pItem[project.name],project)
  -
  +        self.tree.SetItemImage(proj, idx_project ,    wx.wxTreeItemIcon_Normal)
  +        self.tree.SetItemImage(proj, idx_project_ex , wx.wxTreeItemIcon_Selected)
  +      
       self.tree.Expand(root)
   
     def OnKeyUp(self,event):
  
  
  

Mime
View raw message