GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
prompt.GPromptSTC Class Reference

Styled wxGUI prompt with autocomplete and calltips. More...

Inheritance diagram for prompt.GPromptSTC:
Collaboration diagram for prompt.GPromptSTC:

Public Member Functions

def __init__
 
def OnTextSelectionChanged
 Copy selected text to clipboard and skip event. More...
 
def OnItemChanged
 Change text in statusbar if the item selection in the auto-completion list is changed. More...
 
def OnItemSelected
 Item selected from the list. More...
 
def UpdateCmdHistory
 Update command history. More...
 
def EntityToComplete
 Determines which part of command (flags, parameters) should be completed at current cursor position. More...
 
def GetWordLeft
 Get word left from current cursor position. More...
 
def ShowList
 Show sorted auto-completion list if it is not empty. More...
 
def OnKeyPressed
 Key pressed capture special treatment for tabulator to show help. More...
 
def OnChar
 Key char capture for autocompletion, calltips, and command history. More...
 
def ShowStatusText
 Sets statusbar text, if it's too long, it is cut off. More...
 
def GetTextLeft
 Returns all text left of the caret. More...
 
def OnDestroy
 The clipboard contents can be preserved after the app has exited. More...
 
def OnCmdErase
 Erase command prompt. More...
 
- Public Member Functions inherited from prompt.GPrompt
def __init__
 
def GetCommandDesc
 Get description for given command. More...
 
def GetCommandItems
 Get list of available commands. More...
 
def OnUpdateStatusBar
 Update Layer Manager status bar. More...
 
def GetPanel
 Get main widget panel. More...
 
def GetInput
 Get main prompt widget. More...
 
def SetFilter
 Set filter. More...
 
def GetCommands
 Get list of launched commands. More...
 
def ClearCommands
 Clear list of commands. More...
 

Data Fields

 cmdDesc
 
 cmdindex
 
 autoCompList
 
 toComplete
 
- Data Fields inherited from prompt.GPrompt
 parent
 
 panel
 
 standAlone
 
 moduleDesc
 
 moduleList
 
 mapList
 
 mapsetList
 
 autoCompList
 
 autoCompFilter
 
 cmdDesc
 
 cmdbuffer
 
 cmdindex
 
 commands
 
 dataList
 

Detailed Description

Styled wxGUI prompt with autocomplete and calltips.

Definition at line 713 of file prompt.py.

Constructor & Destructor Documentation

Member Function Documentation

def prompt.GPromptSTC.EntityToComplete (   self)

Determines which part of command (flags, parameters) should be completed at current cursor position.

Definition at line 857 of file prompt.py.

References prompt.GPromptSTC.GetTextLeft(), prompt.GPromptSTC.GetWordLeft(), and utils.split().

def prompt.GPromptSTC.GetTextLeft (   self)
def prompt.GPromptSTC.GetWordLeft (   self,
  withDelimiter = False,
  ignoredDelimiter = None 
)

Get word left from current cursor position.

The beginning of the word is given by space or chars: .,-=

Parameters
withDelimiterreturns the word with the initial delimeter
ignoredDelimiterfinds the word ignoring certain delimeter

Definition at line 912 of file prompt.py.

References prompt.GPromptSTC.GetTextLeft(), min, and main.set.

Referenced by prompt.GPromptSTC.EntityToComplete(), and prompt.GPromptSTC.OnItemSelected().

def prompt.GPromptSTC.OnChar (   self,
  event 
)

Key char capture for autocompletion, calltips, and command history.

Todo:
event.ControlDown() for manual autocomplete

Definition at line 996 of file prompt.py.

Referenced by prompt.GPromptSTC.__init__().

def prompt.GPromptSTC.OnCmdErase (   self,
  event 
)

Erase command prompt.

Definition at line 1174 of file prompt.py.

Referenced by prompt.GPrompt.GetCommandItems(), and prompt.GPromptSTC.OnItemSelected().

def prompt.GPromptSTC.OnDestroy (   self,
  event 
)

The clipboard contents can be preserved after the app has exited.

Definition at line 1168 of file prompt.py.

Referenced by prompt.GPromptSTC.__init__().

def prompt.GPromptSTC.OnItemChanged (   self,
  event 
)

Change text in statusbar if the item selection in the auto-completion list is changed.

Definition at line 767 of file prompt.py.

References prompt.GPrompt.autoCompList, prompt.GPrompt.moduleDesc, prompt.GPromptSTC.ShowStatusText(), and prompt.GPromptSTC.toComplete.

Referenced by prompt.GPromptSTC.__init__().

def prompt.GPromptSTC.OnItemSelected (   self,
  event 
)
def prompt.GPromptSTC.OnKeyPressed (   self,
  event 
)

Key pressed capture special treatment for tabulator to show help.

Definition at line 939 of file prompt.py.

References prompt.GPrompt._runCmd(), prompt.GPrompt.cmdbuffer, prompt.GPrompt.cmdindex, gcmd.GetRealCmd(), prompt.GPromptSTC.GetTextLeft(), and prompt.GPromptSTC.ShowStatusText().

Referenced by prompt.GPromptSTC.__init__().

def prompt.GPromptSTC.OnTextSelectionChanged (   self,
  event 
)

Copy selected text to clipboard and skip event.

The same function is in GMStc class (goutput.py).

Definition at line 760 of file prompt.py.

def prompt.GPromptSTC.ShowList (   self)

Show sorted auto-completion list if it is not empty.

Definition at line 933 of file prompt.py.

References prompt.GPrompt.autoCompList.

def prompt.GPromptSTC.ShowStatusText (   self,
  text 
)

Sets statusbar text, if it's too long, it is cut off.

Definition at line 1150 of file prompt.py.

Referenced by prompt.GPromptSTC.OnItemChanged(), and prompt.GPromptSTC.OnKeyPressed().

def prompt.GPromptSTC.UpdateCmdHistory (   self,
  cmd 
)

Update command history.

Parameters
cmdcommand given as a list

Definition at line 844 of file prompt.py.

References prompt.GPrompt.cmdbuffer.

Referenced by prompt.GPrompt.GetCommandItems(), and prompt.GPromptSTC.OnItemSelected().

Field Documentation

prompt.GPromptSTC.autoCompList

Definition at line 1005 of file prompt.py.

prompt.GPromptSTC.cmdDesc

Definition at line 840 of file prompt.py.

prompt.GPromptSTC.cmdindex

Definition at line 855 of file prompt.py.

prompt.GPromptSTC.toComplete

Definition at line 1009 of file prompt.py.

Referenced by prompt.GPromptSTC.OnItemChanged().


The documentation for this class was generated from the following file: