OSDN Git Service

增加表情功能 master
authortanyuliang <tanyuliang2@Gmail.com>
Fri, 21 Aug 2015 03:52:33 +0000 (11:52 +0800)
committertanyuliang <tanyuliang2@Gmail.com>
Fri, 21 Aug 2015 03:52:33 +0000 (11:52 +0800)
LoginGui.py
Talk.py

index dc70b4f..13c48e2 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# encoding: utf-8
+# -*- coding: utf-8 -*- 
 import os
 import wx
 from wx.lib.pubsub import setupkwargs
diff --git a/Talk.py b/Talk.py
index 0fcb4da..e8d4021 100644 (file)
--- a/Talk.py
+++ b/Talk.py
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+#!/usr/bin/env python
+# -*- coding: utf-8 -*- 
 import wx
 import datetime
 import pymongo
@@ -17,6 +18,15 @@ class myapp(wx.Frame):
        except urllib2.HTTPError,e:
           print e.code
        self.Destroy()
+    def OnFace(self, event):
+        dlg = wx.SingleChoiceDialog(
+                self, "What's your favorite langauge?", 'The Caption',
+                ["£¼£¨£­¦ä£­£©£¾", "£¼£¨£¾£ß£¼)  £¾", "£¼£¨£þ¦á£þ£©£¾", "£¼£¨£þ¦á£þ£©£¯", "£¼£¨£À£þ¦á£þ£À£©£¾", "£¨£££þ¨\8c£þ£££©","£Ü£¨£þ¦á£þ£©£¯","£â£¨£þ¨\8c£þ£©£ä","¨t£¨£þ¨\8c£þ£©¨q","£¨£þ¦á£þ£©¨J","¡ð£¨£ª£þ¦á£þ£ª£©¡ð","¡â£¨£þ¨\8c£þ£©£¯","¡á£¨£þ¨\8c£þ£©£¯","¨r£¨¨s¡ó¨t£©¨q","¨q£¨¡ä¨\8c¨F£©¨q£¨¡ä¨\8c¨F£©¨q£¨¡ä¨\8c¨F£©¨s","£¨£þ¨\8c£þ£©¡«¡ö¡õ¡«£¨£þ¨\8c£þ£©","£¼£¨£þ¦á£þ£©£¾£¼£¨£þ¦á£þ£©£¾£¼£¨£þ¦á£þ£©£¾","£¨¨s¨F¡õ¡ä£©¨s¦à©Ø©¤©Ø ","¨q¡É¨r£¨£þ¨\8c£þ£©¨q¡É¨r","£¨¨p£þÃó£þ£©£½¡ð£££¨£þ£££©£³£þ£©","£¼£¨¨F¡õ¡ä£©£¾©¤©¤©¤£Ã¦Å£¨©Ð£ß©Ð£©£³ ","£¼( £þ¦ä£þ)¦à¦È¦à¦È¦à¦È¦à¦È¦à¡î£¨£¾¿Ú£¼£­£©","£½¡¡£½££","(#¨F¡ä)","£¨£þ c£þ£©y¨y¦Î ","(£þ(¹¤)£þ) ","( ¨\89___¨\89)y-¡« ","£¨¡«£þ¨\8c£þ¡«£©","¨q(©¤??©¤)¨r ¨z¨~","<(£þ3£þ)>","£­(>¿Ú£¼-)","<(¨F¨\8c¡ä)>","o(¨\93©n¨\93)o","¨r(£þ¨\8c£þ\")¨q ","¦×(._. )>","¨R¦Ø¨Q","O¿ÚO!","¦Ï-_-)£°)¡££°)","m(_ _)m","(¡Ñ£°¡Ñ) ","¡Ñ . ¡Ñ ","£­ £­|||| ","?~? ", "¡ò?¡ò£¿","(T_T)  ","(/¨F¢ó¡ä)/"], 
+                wx.CHOICEDLG_STYLE
+                )
+        if dlg.ShowModal() == wx.ID_OK: 
+            self.tinput.AppendText(dlg.GetStringSelection() )
+        dlg.Destroy()
     def __init__(self, parent, id,title,user_name,un,addcon):
         wx.Frame.__init__(self,parent,id,title,wx.DefaultPosition,wx.Size(400,300))
         global username
@@ -42,6 +52,14 @@ class myapp(wx.Frame):
             self.tshow.AppendText(_("User:")+now.strftime('%Y-%m-%d %H:%M:%S')+"\n")       
             self.tshow.SetDefaultStyle(wx.TextAttr("BLACK"))
             self.tshow.AppendText(addcon + "\n")
+        menuBar = wx.MenuBar()
+        menu = wx.Menu()
+        m_exit = menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Close window and exit program.")
+        m_face = menu.Append(wx.ID_NEW, "&Face", "Many Face here")
+        self.Bind(wx.EVT_MENU,self.OnClose, m_exit)
+        self.Bind(wx.EVT_MENU,self.OnFace, m_face)
+        menuBar.Append(menu, "&File")
+        self.SetMenuBar(menuBar)
         self.Bind(wx.EVT_CLOSE, self.OnClose)
         self.bt.Bind(wx.EVT_BUTTON,self.btaction)        
         thread.start_new_thread(self.receive, ())