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

Source Code for Module appModules.totalcmd

 1  #appModules/totalcmd.py 
 2  #A part of NonVisual Desktop Access (NVDA) 
 3  #Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/> 
 4  #This file is covered by the GNU General Public License. 
 5  #See the file COPYING for more details. 
 6   
 7  import appModuleHandler 
 8  from NVDAObjects.IAccessible import IAccessible 
 9  import speech 
10  import controlTypes 
11   
12  oldActivePannel=0 
13   
14 -class AppModule(appModuleHandler.AppModule):
15
16 - def chooseNVDAObjectOverlayClasses(self, obj, clsList):
17 if obj.windowClassName in ("TMyListBox", "TMyListBox.UnicodeClass"): 18 clsList.insert(0, TCList)
19
20 -class TCList(IAccessible):
21
22 - def event_gainFocus(self):
23 global oldActivePannel 24 if oldActivePannel !=self.windowControlID: 25 oldActivePannel=self.windowControlID 26 obj=self 27 while obj and obj.parent and obj.parent.windowClassName!="TTOTAL_CMD": 28 obj=obj.parent 29 counter=0 30 while obj and obj.previous and obj.windowClassName!="TPanel": 31 obj=obj.previous 32 if obj.windowClassName!="TDrivePanel": 33 counter+=1 34 if counter==2: 35 speech.speakMessage(_("left")) 36 else: 37 speech.speakMessage(_("right")) 38 super(TCList,self).event_gainFocus()
39
40 - def reportFocus(self):
41 if self.name: 42 speakList=[] 43 if controlTypes.STATE_SELECTED in self.states: 44 speakList.append(controlTypes.speechStateLabels[controlTypes.STATE_SELECTED]) 45 speakList.append(self.name.split("\\")[-1]) 46 speech.speakMessage(" ".join(speakList)) 47 else: 48 super(TCList,self).reportFocus()
49