QB64.org Forum
QB64 Team Software => InForm Discussion => Topic started by: Mad Axeman on December 15, 2021, 11:50:32 am
-
Let's say you have created your screen, it's done it's bit and then you need another new screen with completely different inputs. Is that possible?
-
Easily doable.
FirstScreen = _NEWIMAGE(640,480,32)
SecondScreen = _NEWIMAGE(640, 480, 32)
'Do stuff on first screen
SCREEN FirstScreen
CLS, _RGB32(0, 0, 255)
SLEEP
'Phew! I did a lot and now I'm done.
'Go to second screen
SCREEN SecondScreen
-
That's fine in plain QB64 but would it work the same with Inform? I haven't played around with it yet but looking at the video about creating a simple word search prog then I can't see how you would design the two screens in Inform and then integrate them into 1 QB64 prog??
-
I think, it is none problem, if you use more screens as virtual screens as in this example. For writing points (and text) to this virtual screens use _DEST, for reading colors using POINT from this screen use _SOURCE. This screens does not have to be visible and you can making with them as with normal images.
_Dest 0 ' 0 is always visible SCREEN
_PutImage (0, 0), Screen1
, 0 'place first screen as image to visible screen _PutImage (1980 / 2, 0), Screen2
, 0 'place second screen as imge to visible screen
-
I rather think that @Mad Axeman is correct here. In Inform, you can only have the one screen open. Everything has to be done in the one Inform window. The Master (@FellippeHeitor) will need to give the Intellignt Answer.
-
The way to have a different set of controls in the same app is to keep different sets in different containers, like a frame. Create your "sub dialog" inside a frame, then hide it from view (either by placing its .Left and .Top properties outside the form's boundaries or by setting it to .Hidden = True).
-
Yes, I have done this a few times in InForm projects and it works very well.
-
I'm not sure what you mean. Any chance you could give a simple demo of how to do this? If it helps, what I want to do is have an input screen with various input boxes and drop downs plus wait for input from a barcode scanner. If it gets the input from the screen prompts it keeps what is on the screen, adds 'Loading', does it's stuff then prints 'Completed'
If a scanner input is registered then is jumps to the screen for section 'B' where it reads the data from that barcode and displays it on a the new screen.
-
If it is any use, please see my Gravitational Simulation program
https://www.qb64.org/forum/index.php?topic=581.msg4319#msg4319 (https://www.qb64.org/forum/index.php?topic=581.msg4319#msg4319)
This is an Inform project where controls are brought in and out of the Inform window (just as, say, images would be loaded/unloaded). Line 628 onwards deals with how the Controls are handled.
If you run the program and click on the Options in the Simulation Type frame, you will see Controls removed/loaded as necessary. It is a restriction in Inform that you can only use the one window created with the UIEditor, and you have to load/unload Controls as necessary within that window. Use the Top/Left/Hidden/Disabled Control parameters as necessary.
I think that the UIEditor does not like Controls on top of each other / overlapping. So, as a tip place your controls so that this does not occur at design and move them into position as required at run. I also make sure that Controls don't overlap at runtime.
Hope that helps.
-
Thanks Qwerkey. I'll take a look. No doubt I'll have questions :-)