#appModules/teamtalk4classic.py #A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2010-2012 NV Access Limited #This file is covered by the GNU General Public License. #See the file COPYING for more details. import controlTypes import appModuleHandler from NVDAObjects.behaviors import ProgressBar from NVDAObjects.window import edit import ui class AppModule(appModuleHandler.AppModule): lastLength=0 def event_NVDAObject_init(self,obj): # The richedit control displaying incoming chat does not return correct _isWindowUnicode flag. if obj.windowClassName=="RichEdit20A": obj._isWindowUnicode=False if obj.windowControlID == 1002: obj.name = 'Output Volume' elif obj.windowControlID == 1342: obj.name = 'Input Volume' elif obj.windowControlID == 1001 and obj.role == controlTypes.ROLE_SLIDER: obj.name = 'Microphone Activation Level' def chooseNVDAObjectOverlayClasses(self, obj, clsList): # There is a VU meter progress bar in the main window which we don't want to get anounced as all the other progress bars. if obj.windowClassName=="msctls_progress32" and obj.name==u'VU': try: clsList.remove(ProgressBar) except ValueError: pass if obj.windowControlID == 1204 and obj.windowClassName == 'RichEdit20W': clsList.insert(0, ChatText) class ChatText(edit.Edit): def event_valueChange(self): text=self.windowText new_text = text[self.appModule.lastLength:] if new_text == "": #no new text was added this time return ui.message(new_text) self.appModule.lastLength =len(text)