Hello,
I have the following code snippet:
console = wx.TextControl(parent, -1, style = wx.TE_PROCESS_ENTER|wx.TE_MULTILINE)
console.Bind(wx.EVT_TEXT_ENTER, self.ConsoleEvents)
console.Bind(wx.EVT_KEY_DOWN, self.ConsoleEvents) #To handle the Enter key
console.AutoComplete((Draw, Move, Rotate, Zoom))
def ConsoleEvents(self)
if e.GetKeyCode() == 44 #Comma
console.AutoComplete((Rectangle, Circle, triangle))
elif
…
…
I would like to enter commands which is a set of arguments. While I enter the arguments, each argument comes from a predefined set of items. So I would like to call AutoComplete(items) before each argument selection.
For example, I have a tree of depth two to simplify the problem.
Commands(
(Draw, [Rectangle, Circle, Triangle]),
(Move, [AlongX, AlongY, Both]),
(Rotate, [CW, CCW]),
(Zoom, [In, Out, Fit]),
etc
)
I would like to choose my first argument from (Draw, Move, Rotate, Zoom, etc). So, initially I call console.AutoComplete((Draw, Move, Rotate, Zoom))
If I choose Move as my first argument, I would like to call console.AutoComplete( (AlongX, AlongY, Both)). This can go deeper depending on the command.
The above code only helps me selecting the first argument. But I don’t know how and where to call the next AutoComplete(…). BTW, I want to separate the arguments with a delimeter, e.g comma.
If there is an example that would help me too.
Thanks
Kotesh