Package appModules :: Module calc
[hide private]
[frames] | no frames]

Source Code for Module appModules.calc

 1  import appModuleHandler 
 2  import NVDAObjects.IAccessible 
 3  import speech 
 4   
5 -class AppModule(appModuleHandler.AppModule):
6
7 - def chooseNVDAObjectOverlayClasses(self, obj, clsList):
8 windowClassName=obj.windowClassName 9 windowControlID=obj.windowControlID 10 if ((windowClassName=="Edit" and windowControlID==403) 11 or (windowClassName=="Static" and windowControlID==150) 12 ): 13 clsList.insert(0, Display)
14
15 -class Display(NVDAObjects.IAccessible.IAccessible):
16 17 shouldAllowIAccessibleFocusEvent=True 18 19 calcCommandChars=['!','=','@','#'] 20 21 calcCommandGestures=( 22 "kb:back","kb:escape","kb:enter","kb:numpadEnter", 23 "kb:f2","kb:f3","kb:f4","kb:f5","kb:f6","kb:f7","kb:f8","kb:f9", 24 "kb:l","kb:n","kb:o","kb:p","kb:r","kb:s","kb:t", 25 ) 26
27 - def _get_name(self):
28 name=super(Display,self).name 29 if not name: 30 name=_("Display") 31 return name
32
33 - def event_typedCharacter(self,ch):
34 super(Display,self).event_typedCharacter(ch) 35 if ch in self.calcCommandChars: 36 speech.speakObjectProperties(self,value=True)
37
38 - def script_executeAndRead(self,gesture):
39 gesture.send() 40 speech.speakObjectProperties(self,value=True)
41
42 - def initOverlayClass(self):
43 for g in Display.calcCommandGestures: 44 self.bindGesture(g,"executeAndRead")
45