(self, cmdui)
| 82 | self.HookCommandUpdate(self.OnUpdatePosIndicator, win32ui.ID_INDICATOR_COLNUM) |
| 83 | |
| 84 | def OnUpdatePosIndicator(self, cmdui): |
| 85 | editControl = scriptutils.GetActiveEditControl() |
| 86 | value = " " * 5 |
| 87 | if editControl is not None: |
| 88 | try: |
| 89 | startChar, endChar = editControl.GetSel() |
| 90 | lineNo = editControl.LineFromChar(startChar) |
| 91 | colNo = endChar - editControl.LineIndex(lineNo) |
| 92 | |
| 93 | if cmdui.m_nID==win32ui.ID_INDICATOR_LINENUM: |
| 94 | value = "%0*d" % (5, lineNo + 1) |
| 95 | else: |
| 96 | value = "%0*d" % (3, colNo + 1) |
| 97 | except win32ui.error: |
| 98 | pass |
| 99 | cmdui.SetText(value) |
| 100 | cmdui.Enable() |
| 101 | |
| 102 | def PreCreateWindow(self, cc): |
| 103 | cc = self._obj_.PreCreateWindow(cc) |
nothing calls this directly
no test coverage detected