00001 #!/usr/local/bin/python
00002 #
00003 # Copyright 2003
00004 # by
00005 # The Board of Trustees of the
00006 # Leland Stanford Junior University.
00007 # All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Argument GUI implementation module"
00012 __author__ = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__ = "11/20/2003"
00014 __version__ = "$Revision: 2.1 $"
00015 __credits__ = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import sys
00020 from qt import *
00021 from Argument import Argument
00022
00023
00024 class ArgumentImpl(Argument):
00025
00026 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00027 Argument.__init__(self,parent,name,modal,fl)
00028
00029 self.__label = 0
00030
00031 self.connect(self.OKButton,SIGNAL("clicked()"),self.OKButtonClicked)
00032 self.connect(self.CancelButton,SIGNAL("clicked()"),self.CancelButtonClicked)
00033
00034 def OKButtonClicked(self):
00035 self.__value = int(self.ArgumentList.text().latin1())
00036 self.close()
00037
00038 def getValue(self, caption):
00039 self.ArgLabel.setText(caption)
00040 self.show()
00041 self.exec_loop()
00042 return self.__value
00043
00044 def CancelButtonClicked(self):
00045 self.close()
00046
00047 if __name__ == "__main__":
00048 a = QApplication(sys.argv)
00049 QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00050 w = ArgumentImpl()
00051 a.setMainWidget(w)
00052 w.show()
00053 a.exec_loop()