|
## include header files
import win32api, win32con, win32gui
import win32ui
import win32con
import string
from ctypes import *
from BrandNewUI import *
class Dictionaray:
search_keyword = ''
url = ''
state = 'google'
def Search(self):
if self.state == 'wiki':
self.url = "http://mobile.wikipedia.org/transcode.php?go=%s" % self.search_keyword
pass
if self.state == 'google':
self.url = "http://www.google.com/dictionary?langpair=en|en&q=%s&hl=ko&aq=f" % self.search_keyword
pass
DictionarySkin.SendSkinMessage("webpage","url",self.url)
pass
Dic = Dictionaray()
def SkinWndProc(str):
operator = string.split(str.value,"/")
print str
if operator[0] == "btn_wiki" and operator[1] == "btnup":
Dic.state = 'wiki'
print operator[2]
Dic.Search()
pass
if operator[0] == "btn_google" and operator[1] == "btnup":
Dic.state = 'google'
Dic.Search()
pass
if operator[0] == "btn_close":
DictionarySkin.SendSkinMessage("wndmgr","cls","WebDic")
DictionarySkin.FinalSkin()
EndPumpMessage()
pass
if operator[1] == "input":
print operator[2]
Dic.search_keyword = operator[2]
Dic.Search()
pass
pass
DictionarySkin = CBrandNewUI(".\BrandNewUI.dll",".\DicSkin\Skin.xml")
DictionarySkin.LoadModule()
DictionarySkin.InitSkin()
DictionarySkin.SetAppHwnd()
DictionarySkin.GetSkinMessage()
DictionarySkin.SendSkinMessage("wndmgr","opn","webdic")
DictionarySkin.SetSkinProc(SkinWndProc)
StartPumpMessage()
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.