Re: X-Basic - October 22, 2013
Posted by Skywise on October 27, 2013 at 19:29:14:

"Something valuable about Perl is the fact that it can send Windows information as if it had been entered using a keyboard and probably a mouse. And, it can also read key presses at several different levels within Windows. I believe it can even do that in such a way that Windows itself doesn't see the keystroke."

Of course, XBasic can read the keyboard, and programs can be made to react to key presses in any way you program it to. I've only written programs that respond while that program has focus. I've never done anything where it reacts while you are focused on another program, but to be honest, I don't see why not.
But I must say that reading keystrokes in XB is not like in previous BASICS - there is no INKEY$ command.

Can it send keystrokes to other programs? I honestly don't know. That you have a program that can do that implies to me that it's not impossible, just a matter of knowing how. My first guess is it has to do with accessing the right commands in the Windows API, and XBasic certainly can access the API as I've done it.

Since the API is what programs access to access Windows, and that XBasic can interact with the API, I'm going to guess it's likely possible to do those things. I've just never done it so don't know exactly how. Can't be too hard to figure out, though. Just gotta read the API docs. Fortunately that info is online at the microsoft developers network website: http://msdn.microsoft.com

If I get the chance I'll take a quick look around and see if I can get a better answer for you.

Could you give a detailed example of something you do like this so I can make sure I understand the problem?


"How is it with graphics? Does it have its own library."

Yes and yes.


"And do its graphics displays work well with Windows?"

Yes. Actually, it's the ONLY way it can display graphics - in a window. Or 100% full screen. There is no "dos mode".


"can you click on a button on the top right corner of the screen to get the display to expand to full screen"

There's multiple possibilities. One is to expand a window to full size within windows - still have taskbar, menus, etc.... The other is to drop out of windows and have true full screen graphics, like a game might.

XBasic can do both. But, it takes programming to make it react to those inputs. It won't do it by default.


"Gnuplot"

The graphics library in XBasic isn't as powerful as GNUplot, but all the graphics I've seen Roger produce, XB can do easily. More complex stuff can be done with programming. I've programmed simple rotatable orthographic 3D display plots - it's just not built in like GNUplot.

Doing simple graphics in XBasic isn't too hard. It takes minimal code to build a window and create a drawing 'grid' for it. Then it's just drawing commands not unlike in previous BASIC's.

Doing full windows interactive graphics and buttons and such is more complicated. That took me a while to get the hang of. But it's not XBasic's fault. It's because that's what's required to do GUI interfaces in a windowing operating system.

Fortunately, there is a program starting template that sets up the necessary minimum code. There's also a "gui toolkit" that allows simple WYSIWYG placement of buttons and other gui features.

To address a specific point, resizing the window. That's actually more complicated than you may realize. Clicking the resize button will resize the window, but then your program has to react to the size change and adjust itself accordingly. It just means you have to write your program to be dynamic and to track the window size. But I've done it.

And as I've mentioned before, I've even gone so far as to use OpenGL to create fast 2D and 3D graphics. I definitely don't recommend biting off that piece of cake until you've mastered other stuff first. I've yet to finish that project as it kind of overwhelmed me a bit. But I've been getting the yearning to tackle it again.

The power of XBasic is that if it's not built in, it can be made, or you can use a library. XB can access C libraries (with some limits that I've not encountered yet) to do what you need. I once used an image editing library to do some special graphics.

Brian


Follow Ups:
     ● Re: X-Basic - October 22, 2013 - EQF  20:58:51 - 10/27/2013  (101191)  (1)
        ● Re: X-Basic - October 22, 2013 - Skywise  00:56:32 - 10/28/2013  (101193)  (0)