=== modified file 'source/appModules/miranda32.py' --- source/appModules/miranda32.py 2010-02-03 21:06:17 +0000 +++ source/appModules/miranda32.py 2010-02-07 18:18:53 +0000 @@ -4,6 +4,8 @@ #This file is covered by the GNU General Public License. #See the file COPYING for more details. +import ui +import globalVars from ctypes import * from ctypes.wintypes import * import winKernel @@ -71,9 +73,12 @@ #other constants ANSILOGS=(1001,1006) +MESSAGEVIEWERS=(1001,1005,5005) class AppModule(_default.AppModule): - + lastTextLengths={} + lastMessages=[] + MessageHistoryLength=3 def event_NVDAObject_init(self,obj): if obj.windowClassName=="CListControl": obj.__class__=mirandaIMContactList @@ -87,6 +92,15 @@ obj.role=controlTypes.ROLE_COLORCHOOSER elif obj.IAccessibleRole==oleacc.ROLE_SYSTEM_PROPERTYPAGE: obj.__class__=MPropertyPage + elif obj.windowControlID in MESSAGEVIEWERS and obj.IAccessibleRole == oleacc.ROLE_SYSTEM_SCROLLBAR: + self.overlayCustomNVDAObjectClass(obj,MirandaMessageViewerScrollbar,outerMost=True) + + def script_readMessage(self,keyPress): + num=int(keyPress[-1][-1]) + if len(self.lastMessages)>num-1: + ui.message(self.lastMessages[num-1]) + else: + ui.message(_("No message yet")) class mirandaIMContactList(IAccessible): @@ -163,6 +177,21 @@ break return name + +class MirandaMessageViewerScrollbar(IAccessible): + def event_valueChange(self): + curTextLength=len(self.windowText) + if self.windowHandle not in self.appModule.lastTextLengths: + self.appModule.lastTextLengths[self.windowHandle]=curTextLength + elif self.appModule.lastTextLengths[self.windowHandle]