From: tanyuliang Date: Fri, 21 Aug 2015 03:52:33 +0000 (+0800) Subject: 增加表情功能 X-Git-Url: http://git.osdn.net/view?p=chatyl%2Fchatyl.git;a=commitdiff_plain;h=80d7a221ed8c08c529918b872a2a6b83618c4a73 增加表情功能 --- diff --git a/LoginGui.py b/LoginGui.py index dc70b4f..13c48e2 100644 --- a/LoginGui.py +++ b/LoginGui.py @@ -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 --- 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', + ["£¼£¨£­¦ä£­£©£¾", "£¼£¨£¾£ß£¼) £¾", "£¼£¨£þ¦á£þ£©£¾", "£¼£¨£þ¦á£þ£©£¯", "£¼£¨£À£þ¦á£þ£À£©£¾", "£¨£££þ¨Œ£þ£££©","£Ü£¨£þ¦á£þ£©£¯","£â£¨£þ¨Œ£þ£©£ä","¨t£¨£þ¨Œ£þ£©¨q","£¨£þ¦á£þ£©¨J","¡ð£¨£ª£þ¦á£þ£ª£©¡ð","¡â£¨£þ¨Œ£þ£©£¯","¡á£¨£þ¨Œ£þ£©£¯","¨r£¨¨s¡ó¨t£©¨q","¨q£¨¡ä¨Œ¨F£©¨q£¨¡ä¨Œ¨F£©¨q£¨¡ä¨Œ¨F£©¨s","£¨£þ¨Œ£þ£©¡«¡ö¡õ¡«£¨£þ¨Œ£þ£©","£¼£¨£þ¦á£þ£©£¾£¼£¨£þ¦á£þ£©£¾£¼£¨£þ¦á£þ£©£¾","£¨¨s¨F¡õ¡ä£©¨s¦à©Ø©¤©Ø ","¨q¡É¨r£¨£þ¨Œ£þ£©¨q¡É¨r","£¨¨p£þÃó£þ£©£½¡ð£££¨£þ£££©£³£þ£©","£¼£¨¨F¡õ¡ä£©£¾©¤©¤©¤£Ã¦Å£¨©Ð£ß©Ð£©£³ ","£¼( £þ¦ä£þ)¦à¦È¦à¦È¦à¦È¦à¦È¦à¡î£¨£¾¿Ú£¼£­£©","£½¡¡£½££","(#¨F¡ä)","£¨£þ c£þ£©y¨y¦Î ","(£þ(¹¤)£þ) ","( ¨‰___¨‰)y-¡« ","£¨¡«£þ¨Œ£þ¡«£©","¨q(©¤??©¤)¨r ¨z¨~","<(£þ3£þ)>","£­(>¿Ú£¼-)","<(¨F¨Œ¡ä)>","o(¨“©n¨“)o","¨r(£þ¨Œ£þ\")¨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, ())