Author Topic: Add Script IO Window  (Read 12120 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Add Script IO Window
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Add Script IO Window
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Add Script IO Window
« Reply #3 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Add Script IO Window
« Reply #4 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]