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

View of /PyGUI/Catalogpanel.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Jul 31 15:54:29 2003 UTC (16 years, 5 months ago) by efrank
Branch: MAIN
CVS Tags: efrank-worksBeforeCatalogTree
Changes since 1.1: +16 -10 lines
1) change so that when an item is selected, the load does not start right away.  instead,
   we just rcord which thing was selected.
2) wire in the LOAD button.  the load button handler does the recoelem load refered
   to in 1)
3) stifle some printouts

from wxPython.wx import *
from FaST.BssFactory import BssFactory
from FaST.RecoElem import RecoElem
from RecoElempanel import RecoElemWindow

class CatalogWindow:
    def __init__(self, parent):
        self.parent = parent
        self.to_re = parent.re 
        self.selected = None       #remember last selected catalog entry
                                   #..is used when LOAD button is hit.
        button1= self.parent.OK_button
        EVT_BUTTON(self.parent, self.parent.loadbtn.GetId(),
                   self.onLoadBtnPress)

        return
        
    def InitLsCat(self):
        b=BssFactory()
        cpanel_list = b.getLsCat()
        
        for x in cpanel_list:
            self.parent.catalog_listbox.Append(x[0], x[1])
                      
        EVT_LISTBOX(self.parent, self.parent.catalog_listbox.GetId(), self.onLeftClick)
        return

    def onLeftClick(self,event):
        pt=self.parent.catalog_listbox.GetSelection()
        self.selected =int (self.parent.catalog_listbox.GetClientData(pt))
        return

        
    def onLoadBtnPress(self, event):
        wxBeginBusyCursor()
        b=BssFactory()
        top= b.getRecoElemById( self.selected )
        self.to_re.AddRecoElemTree(self.parent.rootId, top)
        wxEndBusyCursor()
        return
    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3