def setupkb(self):
#define keys
redokey=key(title='redo',action=self.redoaction)
undokey=key(title='undo',subkeys=[redokey], action=self.undoaction)
hidekey=key(title='hide',action=self.hideaction)
keymap=[key('\t',title='TAB'),key('_'),key('#',['@']),key('<',['<=']),key('>',['>=']),
key('{'),key('}'),key('['),key(']'),key("'",['"']),key('('),key(')'),
key(':',[';']), undokey]+[key(str(n)) for n in range(1,9)]+[key('0'),key('+',['%']),key('-'),key('/',['\\n','\\t','\\','/']),key('*'),key('=',['!=']), hidekey]
#customkb component
customkb=FlowContainer(frame=(0,self.height-100,self.width,100),flex='')
customkb.name='customkb'
self.add_subview(customkb)
minimizedkb=ui.Button(frame=(0,self.height-15,self.width,15),flex='',bg_color=(.7, .7, .7))
minimizedkb.action=self.showaction
minimizedkb.title=u'\u2550'*10
minimizedkb.name='minimizedkb'
self.add_subview(minimizedkb)
customkb.bring_to_front()
customkb.hidden=True
for k in keymap:
customkb.add_subview(k.makeButton())
customkb.flex='WT'
customkb.y=self.height-customkb.height
#contentframe
content=ui.View(frame=(0,0,self.width,self.height-15))
content.name='content'
self.add_subview(content)
content.send_to_back()
content.border_color=(0,0,1)
content.border_width=3
self.content=content
评论列表
文章目录