101
106
def _expandToLineAtCaret(self):
102
sel=self.obj.WinwordSelectionObject
105
app.ScreenUpdating=False
106
self._rangeObj.select()
108
self._rangeObj=sel.range
110
app.ScreenUpdating=True
107
lineStart=ctypes.c_int()
108
lineEnd=ctypes.c_int()
109
res=NVDAHelper.localLib.nvdaInProcUtils_winword_expandToLine(self.obj.appModule.helperLocalBindingHandle,self.obj.windowHandle,self._rangeObj.start,ctypes.byref(lineStart),ctypes.byref(lineEnd))
111
raise ctypes.WinError(res)
112
self._rangeObj.setRange(lineStart.value,lineEnd.value)
112
114
def _getFormatFieldAtRange(self,range,formatConfig):
113
115
formatField=textInfos.FormatField()
115
117
paraFormatObj=None
118
listString=range.ListFormat.ListString
119
if listString and range.Paragraphs[1].range.start==range.start:
120
formatField['line-prefix']=listString
116
121
if formatConfig["reportSpellingErrors"] and range.spellingErrors.count>0:
117
122
formatField["invalid-spelling"]=True
118
123
if formatConfig["reportLineNumber"]:
349
365
self._WinwordSelectionObject=windowObject.selection
350
366
return self._WinwordSelectionObject
352
def script_nextRow(self,keyPress):
368
def script_tab(self,gesture):
370
info=self.makeTextInfo(textInfos.POSITION_CARET)
371
if info._rangeObj.tables.count>0:
372
info.expand(textInfos.UNIT_LINE)
373
speech.speakTextInfo(info,reason=speech.REASON_CARET)
375
def script_nextRow(self,gesture):
353
376
info=self.makeTextInfo("caret")
354
377
if not info._rangeObj.Information(wdWithInTable):
355
378
speech.speakMessage(_("not in table"))
356
380
if info._moveInTable(0,1):
357
381
info.updateCaret()
358
382
info.expand(textInfos.UNIT_CELL)
359
383
speech.speakTextInfo(info,reason=speech.REASON_CARET)
361
speech.speakMessage("edge of table")
385
speech.speakMessage(_("edge of table"))
363
def script_previousRow(self,keyPress):
387
def script_previousRow(self,gesture):
364
388
info=self.makeTextInfo("caret")
365
389
if not info._rangeObj.Information(wdWithInTable):
366
390
speech.speakMessage(_("not in table"))
367
392
if info._moveInTable(0,-1):
368
393
info.updateCaret()
369
394
info.expand(textInfos.UNIT_CELL)
370
395
speech.speakTextInfo(info,reason=speech.REASON_CARET)
372
speech.speakMessage("edge of table")
397
speech.speakMessage(_("edge of table"))
374
def script_nextColumn(self,keyPress):
399
def script_nextColumn(self,gesture):
375
400
info=self.makeTextInfo("caret")
376
401
if not info._rangeObj.Information(wdWithInTable):
377
402
speech.speakMessage(_("not in table"))
378
404
if info._moveInTable(1,0):
379
405
info.updateCaret()
380
406
info.expand(textInfos.UNIT_CELL)
381
407
speech.speakTextInfo(info,reason=speech.REASON_CARET)
383
speech.speakMessage("edge of table")
409
speech.speakMessage(_("edge of table"))
385
def script_previousColumn(self,keyPress):
411
def script_previousColumn(self,gesture):
386
412
info=self.makeTextInfo("caret")
387
413
if not info._rangeObj.Information(wdWithInTable):
388
414
speech.speakMessage(_("not in table"))
389
416
if info._moveInTable(-1,0):
390
417
info.updateCaret()
391
418
info.expand(textInfos.UNIT_CELL)
392
419
speech.speakTextInfo(info,reason=speech.REASON_CARET)
394
speech.speakMessage("edge of table")
396
[WordDocument.bindKey(keyName,scriptName) for keyName,scriptName in [
397
("control+alt+extendedUp","previousRow"),
398
("control+alt+extendedDown","nextRow"),
399
("control+alt+extendedLeft","previousColumn"),
400
("control+alt+extendedRight","nextColumn"),
401
("Control+ExtendedPrior","caret_moveByLine"),
402
("Control+ExtendedNext","caret_moveByLine"),
421
speech.speakMessage(_("edge of table"))
425
"kb:shift+tab": "tab",
426
"kb:control+alt+upArrow": "previousRow",
427
"kb:control+alt+downArrow": "nextRow",
428
"kb:control+alt+leftArrow": "previousColumn",
429
"kb:control+alt+rightArrow": "nextColumn",
430
"kb:control+pageUp": "caret_moveByLine",
431
"kb:control+pageDown": "caret_moveByLine",