Search code examples
delphiuser-interfaceapplication-design

What design alternatives are there for nested page controls?


In our primary application, we have a form that will allow us to do cross tab analysis of data in four different ways. Presently, each analysis appears in its own page of a PageControl on the screen. Now, upper management would like us to add in a historical aspect to the form, which in other areas we would use a PageControl to do, but nesting two of them seems like a bad idea to display the periods and analyses tabs stacked on top of each other. Does anyone have any suggestions as to how we could re-work this to look decent and work well? Thanks.


Solution

  • IMHO, you can use frames for each analysis result page, then you can use either PageControl or TabSet or any other visual control for loading and showing the appropriate frame.

    Since frames are totally independent from the visual control you use to select proper period and analysis, you won't be restricted to tab-based controls; for example you can have a tabset for analysis selection, and a treeview for period selection.

    Frames have some additional benefits here too:

    • First of all, their code is kept in separate units and this will increase code readability.
    • Second, you can design a base frame and put all the controls and codes which all these 4 analysis share into that base frame, and in this way have a better code reuse.
    • Third, you can either drop each frame on your main form and make them load just like before, or you can define a container control (e.g a panel), and based on user's selection load one of the frames into the container control dynamically, so reduce initial load time of your application, and probably reduce the overall system resource consumption.