Console Gadgets?

BlitzMax Forums/MaxGUI Module/Console Gadgets?

Blueapples(Posted 2007) [#1]
Is anyone aware of a MaxGUI console gadget or have one somewhere? I would like to embed a command line like tool into a GUI program I am working on.


computercoder(Posted 2007) [#2]
I haven't seen anything like this. I agree this would be a useful gadget to have.


Blueapples(Posted 2007) [#3]
I just realized that the IDE has some of this functionality... Input$() is handled in the same control that output is shown in. I'm going to poke around in there and see if I can extract that into a separate module.

Has anyone worked with that part of the IDE source?


computercoder(Posted 2007) [#4]
I took a look at the IDE code. Its rather slick how they did stuff in there. I noticed the main part I found it the TOutputPanel class. There are parts that are wrapped around this, but it appears everything is eventually done here. My guess is in order to get a console, it'd need to be created using a TextArea gadget and parse out the console itself. My understanding while looking at it was you can call out to the command line, but it doesn't exactly trap the real console activity? It does capture some things, but at this point I'm not entirely clear of what it all does. I'd need to dig a while more into it. (As its stands, I spent maybe 10 minutes looking into it.)


Blueapples(Posted 2007) [#5]
Here's something really basic that I just threw together. It only runs on Windows, I would get versions of this working for Mac and Linux if I had the time...or a Mac.

Edit: Fixed a couple issues grabbing the command line, removed the test output.

Edit 2: Added a Mac to my development environment, realized that I can use built-in MaxGUI commands to do the same thing I was doing with a Windows message (EM_GETSEL), so this should run anywhere now. I still need to test on the Mac though.

Not sure if this bug showed up with this change or not, but I was getting an extraneous newline when re-running a command from the history (move the cursor up to a command you entered before and hit enter: it's executed again). Fixed that.

Probably no one cares about this bit of code but it's very useful to me. The stuff I'm building around this will be more interesting once it's done.