Forum > General

Best way to handle multiple screens displayed one at a time.

(1/1)

wpflum:
I'm back with Lazarus after almost a year from the last time I picked it up for a project that got canned.  What I'm trying to do is imitate an existing program that runs on a dumb terminal for sales entries.  The program starts out with a Header screen where you enter the Customer account info and then after a key press the next screen is displayed to enter item details.  After another key press you get a totals screen from where you can print off an invoice.  What I'm struggling with is the best/proper way to flip between these screens.  Right now I'm trying it using different forms for each screen and I can flip to another form but I'm not sure how I should handle the code end.  When I show the second form I don't seem to be accessing the unit associated with the form but still on the first forms unit.  What am I missing??  I did think briefly of starting out with a blank form and use code to recreating each screen, this way I'd just have one unit to deal with but I wasn't sure I wanted to deal with that so I tried the multiple form way.  I'm trying to keep it as much like the original screens as possible so I don't want to use tabbed windows.  Can someone point me in good direction.

Thanks

Bill   

typo:

--- Quote ---When I show the second form I don't seem to be accessing the unit associated with the form but still on the first forms unit.  What am I missing??
--- End quote ---

Why do you say so? What the actual problem you have?

wpflum:

--- Quote from: typo on August 26, 2010, 08:58:22 pm ---Why do you say so? What the actual problem you have?

--- End quote ---


I guess I'm missing something but when I show the 2nd form I thought the unit attached to it would then have control but it doesn't seem to so the only way I can get the form to stay up is to make it show as a modal but I don't want the calling form to get control back when 2nd form is closed.  Do I have to also call some kind of main procedure on the second unit to get the program flow over to it??   I figured I'm doing something the 'hard way' so I figured I'd ask before banging my head against the wall.

Bill

typo:
I do not think you're doing anything wrong. While one form is active, the corresponding unit is in control. Maybe you must BringToFront the second form or make it StayOnTop instead of using ShowModal.

wpflum:
I figured out a better way to do this using Tabs and turning off the tabs.  I'd seen this on a Delphi tutorial but couldn't find the property of the page to turn it off in Lazarus but I did find out that I could turn it off using code so now I have three non-tabbed Tab sheets that I can switch between with just a bit of code in one Unit, now to just add the rest of the program...........

Navigation

[0] Message Index

Go to full version