~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to source/NVDAObjects/window/winConsole.py

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#NVDAObjects/WinConsole.py
2
2
#A part of NonVisual Desktop Access (NVDA)
3
 
#Copyright (C) 2006-2007 NVDA Contributors <http://www.nvda-project.org/>
4
3
#This file is covered by the GNU General Public License.
5
4
#See the file COPYING for more details.
 
5
#Copyright (C) 2007-2010 Michael Curran <mick@kulgan.net>, James Teh <jamie@jantrid.net>
6
6
 
7
 
from keyUtils import sendKey, key
8
7
import winConsoleHandler
9
8
from . import Window
10
 
from ..behaviors import EditableTextWithoutAutoSelectDetection
11
 
import controlTypes
 
9
from ..behaviors import Terminal, EditableTextWithoutAutoSelectDetection
 
10
import api
12
11
 
13
 
class WinConsole(EditableTextWithoutAutoSelectDetection, Window):
 
12
class WinConsole(Terminal, EditableTextWithoutAutoSelectDetection, Window):
 
13
        STABILIZE_DELAY = 0.03
14
14
 
15
15
        def _get_TextInfo(self):
16
16
                consoleObject=winConsoleHandler.consoleObject
18
18
                        return winConsoleHandler.WinConsoleTextInfo
19
19
                return super(WinConsole,self).TextInfo
20
20
 
21
 
        def _get_role(self):
22
 
                return controlTypes.ROLE_TERMINAL
23
 
 
24
21
        def event_becomeNavigatorObject(self):
25
22
                if winConsoleHandler.consoleObject is not self:
26
23
                        if winConsoleHandler.consoleObject:
27
24
                                winConsoleHandler.disconnectConsole()
28
25
                        winConsoleHandler.connectConsole(self)
 
26
                        if self == api.getFocusObject():
 
27
                                # The user is returning to the focus object with object navigation.
 
28
                                # The focused console should always be monitored if possible.
 
29
                                self.startMonitoring()
29
30
                super(WinConsole,self).event_becomeNavigatorObject()
30
31
 
31
32
        def event_gainFocus(self):
36
37
                super(WinConsole, self).event_gainFocus()
37
38
 
38
39
        def event_loseFocus(self):
 
40
                super(WinConsole, self).event_loseFocus()
39
41
                if winConsoleHandler.consoleObject is self:
40
42
                        winConsoleHandler.disconnectConsole()
41
43
 
42
44
        def event_nameChange(self):
43
45
                pass
 
46
 
 
47
        def _getTextLines(self):
 
48
                return winConsoleHandler.getConsoleVisibleLines()