[Bio] / PyGUI / Catalogpanel.py Repository:
ViewVC logotype

Diff of /PyGUI/Catalogpanel.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19, Thu Nov 13 21:41:08 2003 UTC revision 1.24, Fri Mar 26 17:12:46 2004 UTC
# Line 4  Line 4 
4  from FaST.SeedDataFactory import SeedDataFactory  from FaST.SeedDataFactory import SeedDataFactory
5  from FaST.SeedDataFactory import SeedOrganism  from FaST.SeedDataFactory import SeedOrganism
6  from FaST.RecoElem import RecoElem  from FaST.RecoElem import RecoElem
7  from RecoElempanel import RecoElemWindow  from RecoElempanel           import RecoElempanel
8    from CatalogServices.Catalog import Catalog
9    
10    
11    class Catalogpanel:
 class CatalogWindow:  
12  #    def __init__(self, parent):  #    def __init__(self, parent):
13  #    def initCatEvents(self ):  #    def initCatEvents(self ):
14  #    def initCatData( self ):  #    def initCatData( self ):
# Line 50  Line 50 
50      #------------------------------------------------------------------------      #------------------------------------------------------------------------
51      def initCatEvents(self ):      def initCatEvents(self ):
52      #------------------------------------------------------------------------      #------------------------------------------------------------------------
53          button1= self.parent.OK_button  
         EVT_BUTTON(self.parent, self.parent.loadbtn.GetId(),  
                    self.onLoadBtnPress)  
54          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,
55                               self.parent.catalog_treeId,                               self.parent.catalog_treeId,
56                               self.onLeftClick)                               self.onLeftClick)
# Line 63  Line 61 
61          EVT_RIGHT_DOWN(self.parent.catalog_tree, self.onRightClickCatalogTree)          EVT_RIGHT_DOWN(self.parent.catalog_tree, self.onRightClickCatalogTree)
62    
63    
64          # doesn't work...          EVT_LEFT_DCLICK (self.parent.catalog_tree, self.onLeftDClick)
         # EVT_LEFT_DCLICK (self.parent.catalog_tree, self.onLeftDClick)  
65    
66          return          return
67    
# Line 103  Line 100 
100      def loadBssCatalog(self, bssItemId):      def loadBssCatalog(self, bssItemId):
101      #------------------------------------------------------------------------      #------------------------------------------------------------------------
102          b=BssFactory()          b=BssFactory()
103            Catalog.instance().addDataFactory( b )
104          for catEntryTuple in b.getLsCat():          for catEntryTuple in b.getLsCat():
105              id=self.parent.catalog_tree.AppendItem(bssItemId, catEntryTuple[0])              id=self.parent.catalog_tree.AppendItem(bssItemId, catEntryTuple[0])
106              self.parent.catalog_tree.SetPyData(id, (self.bssLoader, catEntryTuple) )              self.parent.catalog_tree.SetPyData(id, (self.bssLoader, catEntryTuple) )
# Line 113  Line 111 
111      def loadWitCatalog(self, witItemId):      def loadWitCatalog(self, witItemId):
112      #------------------------------------------------------------------------      #------------------------------------------------------------------------
113          w=WitFactory()          w=WitFactory()
114            Catalog.instance().addDataFactory( w )
115          pwyItemId=self.parent.catalog_tree.AppendItem(witItemId, "Pathways" )          pwyItemId=self.parent.catalog_tree.AppendItem(witItemId, "Pathways" )
116    
117          pwyList = w.listPathways( )          pwyList = w.listPathways( )
# Line 142  Line 140 
140    
141          # add it to the list in the catalog          # add it to the list in the catalog
142          try:          try:
143              self.parent.factoryMgr.addFactory( seedServer, seedFactory )              Catalog.instance().addDataFactory( seedFactory )
144          except:          except:
145              self.parent.error("loadSeedCatalog: %s already in foundry list." % seedServer)              self.parent.error("loadSeedCatalog: %s already in foundry list." % seedServer)
146              wxEndBusyCursor()              wxEndBusyCursor()
# Line 218  Line 216 
216    
217          return          return
218    
     #------------------------------------------------------------------------  
     def onLeftDClick(self,treeEvent):  
     #------------------------------------------------------------------------  
         self.onLoadBtnPress(treeEvent)  
   
         pt = treeEvent.GetPosition()  
         item = self.parent.tree_ctr.HitTest(pt)  
         print item  
         catEntryTuple = self.parent.tree_ctr.GetPyData(item)  
         apply(catEntryTuple[0], catEntryTuple[1])  
         return  
   
         pt = treeEvent.GetPosition()  
   
         item = self.parent.tree_ctr.HitTest(pt)  
   
         print item  
         catEntryTuple = self.parent.tree_ctr.GetPyData(item)  
         #print catEntryTuple, "catEntryTuple"  
         #self.selected = catEntryTuple  
   
         #catEntryTuple = self.selected  
         #apply(catEntryTuple[0], [catEntryTuple[1]])  
   
         return  
   
219    
220      #------------------------------------------------------------------------      #------------------------------------------------------------------------
221      def onLoadBtnPress(self, event):      def onLeftDClick(self, event):
222      #------------------------------------------------------------------------      #------------------------------------------------------------------------
223          if ( self.selected == None ):          if ( self.selected == None ):
224              print "No selection in onLoadBtnPress"              print "No selection in onLoadBtnPress"

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.24

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3