I’m interested in learning how to connect two or more windows together. I was looking at the Managing Windows chapter, in the introduction to Xojo book, and I worked the example in the chapter. In the example, two windows were created, but they were completely separate of one another. Is there a way to connect one window to another, by perhaps a Next button, and not have it pop out separately? Rather stay in the same frame as window 1? Any ideas?
[quote=192009:@Richard Summers]Jim has also offered another option - using a PagePanel.
Basic Steps here:
Drag a PagePanel into Window1.
Put the required controls into each separate panel (by clicking on the numbers at the bottom of the PagePanel control).
Put the following code into a button’s action event, in order to make the PagePanel change to the appropriate Panel:
// The code below causes the PagePanel to change to Panel 1
PagePanel1.value=1
or
// The code below causes the PagePanel to change to Panel 2
PagePanel1.value=2
Bear in mind that PagePanels are 0 based - meaning that the first Panel is number 0, (not number 1).
Hope this also helps.[/quote] @Richard Summers Thanks for your help! Question though. For step 2, any advice on what controls to add? Would this involve an Event or Method?
Basically, Window1 needs a way to link to your other panels (this could be via buttons, PopupMenu etc. etc.)
Then in each panel, you put whatever you want, as these are the pages of your software which display your information.
You can simply drag whatever controls you like, from the Library on the right hand side of the IDE, into your window (simple as that)
@Richard Summers
Thank you so much for your help. I sincerely appreciate your patience with me.
For some reason I’m missing something. I’ve been looking at it for the past couple of hours. Here’s what I’ve done. I’ve inserted a pagepanel into one window (call it Window1). I created two Container Controls with buttons, labels, etc. For page 0 of the pagepanel I inserted Container Control1. I then clicked the pagepanel to go to page 1. Page 1 of the pagepanel was identical to page 0 of the pagepanel. The same Container Control1 was present for page 1 of the pagepanel as it is for page 0 of the pagepanel. Then I thought, since I’m one page 1 now, I’ll remove the Container Control 1 (which is placed identically from page 0) and insert Container Control 2. When I click the pagepanel to return to page 0, now I only see Container Control 2.
My thoughts: I think I’m supposed to assign some kind of action for the pagepanel, so new pages are created as the page number increases (relative to the assigned number of pages).
I was looking at an example from one of the Xojo webinars. It has the same thing as me…two Container Controls and a pagepanel. The difference is, the example works. I downloaded it and tried to inspect the pagepanel but I don’t see any options. Here’s the link if you’re interested. Container Control example file
Thanks again for your help! I’m moving toward the direction I want to go.
You want to ensure that your containerControls are fully contained within the bounds of each panel. A visual cue is that when the containerControl is selected, the pagePanel boundaries will have a red highlight.
This red highlight also applies to any control that may contain a child control. Red indicates parent.
(Just noticed you’re using Windows. I’ve haven’t used the IDE there very much, but I imagine it’s the same)
After you click on the PagePanel in Window1, look at the inspector on the right hand side, and you will see an area saying “Appearance”. Click on the button there which says “Edit”. From there you can add additional panels.
Hopefully this example project will make it much easier for you to understand.
@Richard Summers Thank you so much for your example!
I finally got it!! I found my solution. I feel silly about it, because it was so simple. This was my problem. When I selected the pagepanel and placed it in the window, I was making the box smaller so it only surrounded the counter. I didn’t think to make it bigger, filling the window, thus including the rest of the text to make the pagepanel work. Ah, I feel so dumb, but happy at the same. Thanks Richard!
If this problem is now solved, you can click on the bottom right of the post , and this thread will then be displayed as answered, so that other members know it has been solved.