Ejemplo n.º 1
0
def Button_14_onCommand(className,widgetName):
  OpType = Fun.GetUIData(className,'Label_2','OpType')
  Count = Fun.GetUIData(className,'Label_2','Count')
  MidCount = Fun.GetUIData(className,'Label_2','MidCount')
  if OpType == 1:
    Count = MidCount  + Count
  elif OpType == 2:
    Count = MidCount  - Count
  elif OpType == 3:
    Count = MidCount  * Count
  elif OpType == 4:
    Count = MidCount / Count
  Fun.SetUIData(className,'Label_2','Count',Count)
Ejemplo n.º 2
0
def Button_4_onCommand(className, widgetName):
    StockCode = Fun.GetUIText(className, "Entry_3")
    StockInfo = StockMonitor.getStockInfo(StockCode)
    StockCode = StockInfo[u'code']
    StockName = StockInfo[u'name']
    StockTime = StockInfo[u'time']
    StockPrice = StockInfo[u'price']
    MaxPrice = Fun.GetUIText(className, "Entry_10")
    MinPrice = Fun.GetUIText(className, "Entry_12")
    TreeView13 = Fun.GetUIEle(className, "TreeView_13")
    TreeView13.insert('',
                      'end',
                      values=(StockCode[0], StockName[0], StockTime[0],
                              StockPrice[0], MinPrice, MaxPrice))
    StockArray = Fun.GetUIData(className, "TreeView_13", "StockArray")
    StockArray.append([StockCode[0], MaxPrice, MinPrice])
Ejemplo n.º 3
0
def Button_6_onCommand(className, widgetName):
    global StockMonitorInst
    BtnText = Fun.GetUIText(className, widgetName)
    if BtnText == "启动监控":
        if StockMonitorInst == None:
            StockMonitorInst = StockMonitor.StockMonitor()
        StockArray = Fun.GetUIData(className, "TreeView_13", "StockArray")
        for stockcode in StockArray:
            StockMonitorInst.addStock(stockcode[0], stockcode[1], stockcode[2])
        TreeView = Fun.GetUIEle(className, "TreeView_13")
        PhoneNumber = Fun.GetUIText(className, "Entry_17")
        StockMonitorInst.SetMonitorInfo(TreeView, PhoneNumber)
        StockMonitorInst.StartMonitoring()
        Fun.SetUIText(className, widgetName, "停止监控")
    else:
        StockMonitorInst.StopMonitoring()
        Fun.SetUIText(className, widgetName, "启动监控")
Ejemplo n.º 4
0
def Button_12_onCommand(className,widgetName):
  Count = Fun.GetUIData(className,'Label_2','Count')
  Count = Count * 10.0
  Fun.SetUIData(className,'Label_2','Count',Count)
Ejemplo n.º 5
0
def Button_18_onCommand(className,widgetName):
  MidCount = Fun.GetUIData(className,'Label_2','Count')
  Fun.SetUIData(className,'Label_2','OpType',4)
  Fun.SetUIData(className,'Label_2','MidCount',MidCount)
  Fun.SetUIData(className,'Label_2','Count',0.0)
Ejemplo n.º 6
0
def Button_5_onCommand(className, widgetName):
    MySocket = Fun.GetUIEle(className, 'MySocket_9')
    IPAddr = Fun.GetUIData(className, 'Entry_2', 'IPAddr')
    PORT = Fun.GetUIData(className, 'Entry_4', 'Port')
    MySocket.createServer(IPAddr, PORT)
Ejemplo n.º 7
0
def Button_8_onCommand(className, widgetName):
    MySocket = Fun.GetUIEle(className, 'MySocket_11')
    IPAddr = Fun.GetUIData(className, 'Entry_3', 'IPAddr')
    PORT = Fun.GetUIData(className, 'Entry_5', 'Port')
    MySocket.connServer(IPAddr, PORT)