Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: BlueHazzard on September 25, 2013, 04:47:30 pm

Title: Add Script IO Window
Post by: BlueHazzard on September 25, 2013, 04:47:30 pm
Hi,
i'm planing to add a IO window for scripting purpose. The layout will be a simple wxTextCtrl, but editable from the squirrel code, so you can delete the content, or print a coloured text. Also i plan to add a Input handling, so you can call in squirrel a function like
Code
iowindow.GetString()
and the window will wait for a user input in the TextCtrl, like the normal cmd... This would allow to make easily interactive scripts with menus etc.

The questions are:
* Is there a interest to add such a feature to c::b?
if yes:
* I think the source of this window should be placed in scripts/binding or?
* Should it be a modal dialogue, or a (what i would prefer) window to dock it somewhere like the script-console?
* Should the script console be modified to satisfy this requirements (but i think the script-console has complete separate tasks)

greetings
Title: Re: Add Script IO Window
Post by: oBFusCATed on September 25, 2013, 07:18:51 pm
Have you tried the global function wxGetTextFromUser?
As far as I know it does the same thing.
Title: Re: Add Script IO Window
Post by: LETARTARE on September 25, 2013, 07:38:58 pm
http://wiki.codeblocks.org/index.php?title=Scripting_commands#Global_functions (http://wiki.codeblocks.org/index.php?title=Scripting_commands#Global_functions)
Title: Re: Add Script IO Window
Post by: BlueHazzard on September 25, 2013, 08:44:34 pm
Have you tried the global function wxGetTextFromUser?
As far as I know it does the same thing.
no, it asks the user for a input, with a dialog, but you can't make interactive menus (or at least not as neat as with a cmd window)

a quick and ditry example:
Code
1) Set Frequency
2) Set Fusebit
3) Set Programmer
Enter Menu Number: |
and also progress-bars like in wget etc...
it is a easy and quick way to make scripts more user-friendly and interactive.

greetings
Title: Re: Add Script IO Window
Post by: oBFusCATed on September 25, 2013, 09:00:01 pm
a quick and ditry example:
This would have been a good user interface in a console program, but not in a GUI one.
So, I don't think I like the idea of putting such function in the core...
A better option is to provide a way to make scriptable wx XRC dialogs.
Or start porting some parts of wx to squirrel.