call window to main screen?

Im not sure how to explain this, but here goes:

I want to create a “screen” as the main screen. when the app is opened, it displays the main screen (window 1). from there, you could call several other screens depending on which button was pressed. this window would appear in the screen overwriting the other window that first occupied the main screen.

For example:
App starts, a screen is created (blank window) then a window is called (main window) in this instance a window with a text box asking for a surname. once the surname is entered, the window is replaced with window 2 which displays a list of all surnames matching the query. once user selects a name, window 3 then overwrites the screen with details of the customer and so on.

All this time, no new windows should appear. I can do this with sheet windows, but it has that animation, i really just want to call a window to the screen.

How might I do this?

Cheers Andrew.

[quote=160223:@Andrew Willyan]Im not sure how to explain this, but here goes:

I want to create a “screen” as the main screen. when the app is opened, it displays the main screen (window 1). from there, you could call several other screens depending on which button was pressed. this window would appear in the screen overwriting the other window that first occupied the main screen.
[/quote]

Please do not use the word “screen” for a window. It is not at all the same thing. In Xojo, the word Screen designates a display. Usually one, but there may be several in a multi-display setting.

See http://documentation.xojo.com/index.php/screen

Your explanations show how confused you seem to be about what is a screen and a window. From what I can make of it, it seems you want to display an initial window (not a screen !) called Window1, then mainWindow, then Window2 with a choice of surnames, then window3 with details about that surname.

If what you want to do is having only one window at a time on the screen, you can close a window with window.close and open a new one with window.show. Set the windows left, top, width and height the same if you want the user to see the same window with different content.

Fair call.

I am a bit confused, I come from VFP.

In VFP, we create the screen. Then load the main form (window) we can then call a new form (window) into the main form (window).
This displays over the top of the main form (window). We size the form (window) to the same size as the main form (window). In essence we open a new window the same size as the main window, but don’t close the main window. the window is contained in the main window.

Is there something similar in xojo?

Side note. In VFP, if we do what you describe, there would be a flicker between the window closing and a new window opening. Is this not the case in xojo?

Also, because we don’t close the original window, we can get info from it, for example, in the new window (window 2), we can display data based on the entry from a textbox in window 1.

fro example, we might do a database search like:

in window 2:
display data into a listbox where surname = window1.surname.text

[quote=160233:@Andrew Willyan]In VFP, we create the screen. Then load the main form (window) we can then call a new form (window) into the main form (window).
This displays over the top of the main form (window). We size the form (window) to the same size as the main form (window). In essence we open a new window the same size as the main window, but don’t close the main window. the window is contained in the main window.[/quote]

It is important that you use the Xojo terminology, so we can communicate without errors.

What you describe can be achieved by displaying instances of Container Controls on a single window. A container control works pretty much like a window, where you can place controls, properties and methods, but you can put an instance of it on a window by simply dragging it over. The instance has access to all properties, methods and controls of the main window.

So to do what you described, you could have a Container control with a listbox or a PopupMenu containing the names, then another one with the details. Both are laid over the main window, and then you use ContainerControl.Visible = False or True to show them and hide them.

Alternatively, you can simply place the container control instance not needed out of the window area by for instance setting its left property a higher negative value than it’s width.

I believe this technique will spare you flickering that indeed multiple windows would create, especially on PC.

That would serve the purpose, so thank you, however:

I might have 20 different containers that could be called from the main window. In VFP, i can create a window for each of these instances and call them from within the main window. If I have 20 different containers within the main window, I believe it would get very messy and hard to design?

What I would really like to know, is if there is any way to call a window into the main window? For example. I can call a sheet window into the main window, which is exactly what I am after, but it has the animation where it comes down from the top of the window it is called from. Is there a way to turn off the animation or a window mode that will just appear with no animation?

Cheers

I would have thought that creating a window with the type Modal Dialog with Placement set to Parent Window would have done the trick, but it displays the window out of bounds from the parent window?

From what you describe, you might want a PagePanel. You could put each Container on one of its “pages” and move between them by changing the value, like changing the pages of a book.

[quote=160244:@Andrew Willyan]That would serve the purpose, so thank you, however:

I might have 20 different containers that could be called from the main window. In VFP, i can create a window for each of these instances and call them from within the main window. If I have 20 different containers within the main window, I believe it would get very messy and hard to design?

What I would really like to know, is if there is any way to call a window into the main window? For example. I can call a sheet window into the main window, which is exactly what I am after, but it has the animation where it comes down from the top of the window it is called from. Is there a way to turn off the animation or a window mode that will just appear with no animation?
[/quote]

If I may, you are trying to use Xojo like VFP, and it is like trying to speak a foreign language without making the effort to learn it. To get comfortable with Xojo, you will need to experiment it the way it is designed to work.

Sheet windows are not designed to replace windows.

Container controls are the way. If you have many, you can add them dynamically and remove them when not needed. You may want to watch http://youtu.be/wMhaX0ZCK5A in the Xojo webinars, and check http://documentation.xojo.com/index.php/ContainerControl.EmbedWithin to embed dynamically and ContainerControl.close.

Just try embedding a containercontrol in a window and close it, you will see how natural it can become. Probably rather close to what you were accustomed to in VFP.

Another control you may want to experiment with is the TabPanel : it will let you create and switch between virtual “pages”, each one being in fact a workspace where you can have controls attached, and instantly switch between them.

Thanks so much.

Tab panel doesn’t work for me as I don’t want the user to be able to select the panel displayed.

I am going to watch the video tonight, So long as I can call the panel by a name, e.g. customerpage rather than value = 1 then that will do nicely.

Will report back with how I find it.

Cheers.

I must have been tired when I posted. I meant PagePanel. Sorry.

And if you want to call the pages by name, you can create constants such as

const customerpage = 1

Then you do PagePanel1.Panelindex = customerpage.

It maybe easier than Container Control.

Try to experiment and see what works for you.

I just watched the video, thanks. I think I can do all I need now.
It is different, so harder to begin with, but I’m sure i will get used to it.
Cheers