I’m, new to Xojo and programming in general so please be gentle with me
I am trying to convert a set of specific business calculators from Excel to a Xojo desktop app (Windows) and I am having difficulty with the UI.
I have a window which is split in two vertically. On the left hand side is a menu consisting of three choices (one for each of the three calculators offered). On the right hand side is the specific calculator. The idea is that you click on a menu item on the left side, and the appropriate calculator appears on the right side. Easy as pie, or so I thought.
I am using a PagePanel on the right hand side, with each of the three pages I have set up (0, 1 & 2) offering one of the three different calculators. The left hand side, which I will use as a menu, is just a blank part of the window, and will hold links to the three choices, one for each of the three calculators.
I can create buttons, labels etc for the proposed menu and add them to the left hand part of the window. I can also add the PagePanel1.value = 0 command as a MouseDown or MouseUp event in the first of the options to link to Page 0 of the PagePanel, and sure enough when it is clicked on the PagePanel displays the contents of page 0. Likewise I can do the same for the second and third pages. All good so far.
Then I thought about creating a container so that I could keep the menu separate from the rest of the controls, making things more manageable and allowing me to reuse the menu in other projects (and only worry about changing the names etc), but it is here where I have come to a sticking point.
So I create the container, add my buttons, labels or whatever and add the code as before, and add it to the main window. On compiling the debugger tells me with regards to PagePanel1, “this item does not exist”. The same setup (button, code etc) works perfectly outside the container, but if I add the controls to the container, it freaks out.
Can anyone out out where I am going wrong please?
Incidentally, it didn’t take me too long to actually program the calculators themselves, and I honestly though that would be the hard part! Although the If, Else, EndIf statement did not work the way I expected it to with the last Else statement needing to be an ElseIf before the compiler stopped complaining (didn’t make sense to me at the time either!)
Thanks in advance for your help.