From: Lubos P. <lub...@gm...> - 2011-05-31 13:51:42
|
Hmm. EditPad has another problem: Although event_caret is fired, getGUIThreadInfo returns (0,0,0,0) for rcCaret. Totally confused! Dňa 31.5.2011 18:27, Lubos Pintes wrote / napísal(a): > Hmm I am totally lost now. I don't see why this behaves like you > described. So I try to debug it myself. > And concerning braille, unfortunately I am unable to debug braille > problems, sorry! > Dňa 31.5.2011 15:00, Gianluca Casalino wrote / napísal(a): >> Hi, >> I am trying to let work EditPad lite with NVDA. >> I assigned the "DisplayModelEditableText" class and I have rewriten >> the _getCaretOffset as follows: >> >> class TEditPadTextInfo(EditableTextDisplayModelTextInfo): >> def _getCaretOffset(self): >> caretRect = winUser.getGUIThreadInfo(self.obj.windowThreadID).rcCaret >> objLocation=self.obj.location >> >> objRect=RECT(objLocation[0],objLocation[1],objLocation[0]+objLocation[2],objLocation[1]+objLocation[3]) >> >> tempPoint = winUser.POINT() >> tempPoint.x=caretRect.left >> tempPoint.y=caretRect.top >> winUser.user32.ClientToScreen(self.obj.windowHandle, byref(tempPoint)) >> caretRect.left=max(objRect.left,tempPoint.x) >> caretRect.top=max(objRect.top,tempPoint.y) >> tempPoint.x=caretRect.right >> tempPoint.y=caretRect.bottom >> winUser.user32.ClientToScreen(self.obj.windowHandle, byref(tempPoint)) >> caretRect.right=min(objRect.right,tempPoint.x) >> caretRect.bottom=min(objRect.bottom,tempPoint.y) >> caretRect.left += 8 >> >> for charOffset, (charLeft, charTop, charRight, charBottom) in >> enumerate(self._textAndRects[1]): >> if caretRect.left>=charLeft and caretRect.right<=charRight and >> ((caretRect.top<=charTop and caretRect.bottom>=charBottom) or >> (caretRect.top>=charTop and caretRect.bottom<=charBottom)): >> # speech.speakMessage("Cursore: %d,%d. carattere: >> %d,%d"%(caretRect.top,caretRect.bottom,charTop,charBottom)) >> return charOffset-1 if charOffset> 0 else 0 >> raise RuntimeError >> >> The strange behaviour is that if I do not put return offset-1 NVDA >> does not speak chars but only say line and say All rok. >> If I put that line, it Works but braille text and spoken text are not >> syncrhonized and sometimes it jumps something. >> Where have I to investigate? >> Gianluca >> >> _______________________________________________ >> NVDA-dev mailing list >> NVD...@li... >> http://lists.nvaccess.org/listinfo/nvda-dev >> > |