[GRASS-dev] GUI console example 2

Here is a more developed version of the GUI console.

Integrating this diff in GRASS 6.5 (develbranch_6) will activate the current output window and make it an input console too. This also has command history and autocompletion for maps/data file entry.

History: press ctrl-up or ctrl-down arrows to move through the command history

Autocompletion: press ctrl-space when the cursor is positioned after an "=" (r.info map=^ for example). You'll get a list of maps/data elements. Use the arrow keys, mouse, or type the first few letters of a map name to scroll to the item you want. Press enter or click with a mouse to insert it.

Running commands: Place the cursor anywhere on a line with a command and press enter. The command will run. Non-interactive display commands (e.g., d.rast, d.grid, d.vect) will render in the display canvas and will be added to the layer tree for later manipulation. You can even position the cursor on commands echoed from using the menus, edit the command, press enter, and run the command again.

It does not yet incorporate Martin's GRASS command autocompletion, but these could be done as tooltips.

Michael

(attachments)

console_example2.diff (8.59 KB)

Michael Barton schrieb:

Here is a more developed version of the GUI console.

Integrating this diff in GRASS 6.5 (develbranch_6) will activate the
current output window and make it an input console too. This also has
command history and autocompletion for maps/data file entry.

[...]

It does not yet incorporate Martin's GRASS command autocompletion, but
these could be done as tooltips.

Will this be commited to SVN?

Hi,

2009/12/7 Michael Barton <michael.barton@asu.edu>:

Here is a more developed version of the GUI console.

I have checked you patch. I just think that it's not good idea to mix
log area with prompt. I would vote for improving GPrompt class. Log
area should remain read-only. Input and output should remain
separated.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

On Dec 7, 2009, at 6:44 AM, Martin Landa wrote:

Hi,

2009/12/7 Michael Barton <michael.barton@asu.edu>:

Here is a more developed version of the GUI console.

I have checked you patch. I just think that it's not good idea to mix
log area with prompt. I would vote for improving GPrompt class. Log
area should remain read-only. Input and output should remain
separated.

Martin

A while back I would have agreed with this. Now I'm not so sure. It is certainly not a problem to separate input and output, though I'd recommend looking at making the input box an STC too to take advantage of the autocomplete functions. It really eliminates a lot of coding and the current autocomplete doesn't seem to work on my Mac. On the other hand, I no longer see disadvantage to putting input and output into the same window, like a system terminal or python shell, and I can now see some advantages to doing so--or at least some handy features.

Michael