Changeset 2459

Show
Ignore:
Timestamp:
10/27/08 12:34:27 (2 months ago)
Author:
bzr
Message:

As Excel's formular bar is inaccesslble to NVDA, provide an NVDA specific dialog which allows the user to edit the cell's content. This dialog appears when the user presses f2 on a cell. Note that moving to a cell and typing with out pressing f2 is still inaccessible. The dialog idea came from the Thunder screen reader, but is only a temporary solution until NVDA has display hooks that can track text in the formular bar. Also it should be noted that if the user wishes to type a line feed (new line) as part of the cell's content, like in the formula bar, alt+enter can be pressed. Otherwize Enter will activate the OK Button.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property bzr:revision-info
      •  

        old new  
        1 timestamp: 2008-10-26 18:39:54.019000053 +0100 
        2 committer: Peter Vágner <peter.v@datagate.sk> 
         1timestamp: 2008-10-27 23:32:27.858000040 +1100 
         2committer: Michael Curran <mick@kulgan.net> 
        33properties:  
        44        branch-nick: main 
    • Property bzr:revision-id:v3-list-QlpoOTFBWSZTWbrL2vUAAB1VgAAQABCAQDrrnqAgAFCgaaGRkxBoTIJ6mmaNRwhndFAoNhZjh_YY4a01fOg1ulgNNC2UrzPdXXEnDpX8XckU4UJC6y9r1A..
      •  

        old new  
        2282282256 peter.v@datagate.sk-20081025172633-327bshns3h24b81f 
        2292292257 peter.v@datagate.sk-20081026173954-w9wtbrgppg3yfdrn 
         2302258 mick@kulgan.net-20081027123227-mrqm4dcrbo23amk0 
    • Property bzr:file-ids
      •  

        old new  
        1 source/locale/ru/LC_MESSAGES/nvda.po    1045@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Flocale%2Fru%2FLC_MESSAGES%2Fnvda.po 
         1source/NVDAObjects/IAccessible/excel.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2Fexcel.py 
         2user_docs/whats%20new.txt       559@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:user_docs%2Fwhats%20new.txt 
  • trunk/source/NVDAObjects/IAccessible/excel.py

    r2306 r2459  
    1111import win32com.client 
    1212import comtypes.automation 
     13import wx 
     14import gui 
     15import gui.scriptUI 
    1316import IAccessibleHandler 
    1417import controlTypes 
     
    1922 
    2023re_dollaredAddress=re.compile(r"^\$?([a-zA-Z]+)\$?([0-9]+)") 
     24 
     25class CellEditDialog(gui.scriptUI.ModalDialog): 
     26 
     27        def __init__(self,message,title,default,callback): 
     28                super(CellEditDialog,self).__init__(callback) 
     29                self._title=title 
     30                self._message=message 
     31                self._default=default 
     32 
     33        def onCellTextChar(self,evt): 
     34                if evt.GetKeyCode() == wx.WXK_RETURN: 
     35                        if evt.AltDown(): 
     36                                i=self._cellText.GetInsertionPoint() 
     37                                self._cellText.Replace(i,i,"\n") 
     38                        else: 
     39                                self.dialog.AddPendingEvent(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, wx.ID_OK)) 
     40                        return 
     41                evt.Skip(True) 
     42 
     43        def makeDialog(self): 
     44                d=wx.Dialog(gui.mainFrame, wx.ID_ANY, title=self._title) 
     45                mainSizer = wx.BoxSizer(wx.VERTICAL) 
     46                mainSizer.Add(wx.StaticText(d,wx.ID_ANY, label=self._message)) 
     47                self._cellText=wx.TextCtrl(d, wx.ID_ANY, size=(300, 200), style=wx.TE_RICH|wx.TE_MULTILINE|wx.TE_PROCESS_ENTER) 
     48                self._cellText.Bind(wx.EVT_KEY_DOWN, self.onCellTextChar) 
     49                self._cellText.SetValue(self._default) 
     50                mainSizer.Add(self._cellText) 
     51                mainSizer.Add(d.CreateButtonSizer(wx.OK|wx.CANCEL)) 
     52                d.SetSizer(mainSizer) 
     53                self._cellText.SetFocus() 
     54                return d 
     55 
     56        def getResponse(self,response): 
     57                if response!=wx.ID_CANCEL: 
     58                        return self._cellText.GetValue() 
     59                return self._default 
    2160 
    2261class ExcelGrid(IAccessible): 
     
    96135        script_moveByCell.__doc__=_("Moves to a cell and speaks its coordinates and content") 
    97136 
     137        def script_editCell(self,keyPress): 
     138                cell=self.getSelectedRange().Item(1) 
     139                formulaDialog=CellEditDialog(_("Cell content:"),_("NVDA Excel Cell Editor"),cell.formula,lambda text: setattr(cell,'formula',text)) 
     140                formulaDialog.run() 
     141 
    98142        def text_reportPresentation(self,offset): 
    99143                """Reports the current font name, font size, font attributes of the active cell""" 
     
    134178        ("Shift+Control+ExtendedHome","moveByCell"), 
    135179        ("Shift+Control+ExtendedEnd","moveByCell"), 
     180        ("f2","editCell"), 
    136181]] 
  • trunk/user_docs/whats new.txt

    r2436 r2459  
    22 
    33Changes since 0.6 P2: 
     4*New: As Excel's formula bar is inaccessible to NVDA, provide an NVDA specific dialog box for editing, when the user presses f2 on a cell.  
    45* change: If the audio output device is set to use the Windows default device (Microsoft Sound Mapper), NVDA will now switch to the new default device for eSpeak and tones when the default device changes. For example, NVDA will switch to a USB audio device if it automatically becomes the default device when it is connected. 
    56* fix: The last chunk of audio is no longer cut off when using NVDA with eSpeak on a remote desktop server.