Main Menu

From OpenPetra Wiki
Revision as of 13:58, 15 January 2013 by Christiankatict (talk | contribs)
Jump to navigation Jump to search

WORK IN PROGRESS

This page is now outdated as the new Menu Navigation has been merged to trunk for the Alpha 0.2.22-1 release (End of October 2012). The page therefore needs updating and should not be relied on until this has happened.

The page is in the process of getting updated (January 2013).

General

MainWindowNew-generated.cs is the Main Menu Form.

  • It gets displayed after a successful login.
  • Its purpose is to allow the user to 'drill down' the OpenPetra Module and Menu hierarchy and to launch Tasks once the user navigated to the place in the Menu hierarchy where the Task is found.
  • If the Main Menu Form is closed, the OpenPetra Client is closed.

The Main Menu Form content is highly dynamic. It is driven by content in the file \csharp\ICT\Petra\Definitions\UINavigation.yml - in other words, if the content of UINavigation.yml is changed, the content of the Main Menu Form gets changed (after an OpenPetra Client restart).


Control Hierarchy and Layout

Instantiation hierarchy of Controls hosted on the Main Menu Form:

Variable Type
pnlContent System.Windows.Forms.Panel
--> pnlTaskArea System.Windows.Forms.Panel
----> pnlTop System.Windows.Forms.Panel
----> dsbContent TDashboard {derives from System.Windows.Forms.Panel}
--> lstFolders TLstFolderNavigation {derives from System.Windows.Forms.Panel}
----> pnlMoreButtons TPnlGradient
----> sptNavigation System.Windows.Forms.SplitContainer
------> Panel1 System.Windows.Forms.SplitterPanel
--------> pnl + Folder Name [1..n] TPnlModuleNavigation {derives from System.Windows.Forms.Panel}
------------> FCollapsibleNavigation TPnlCollapsible {derives from System.Windows.Forms.UserControl}
--------------> FTaskListInstance OR TTaskList {derives from System.Windows.Forms.UserControl}
--------------> FPnlCollapsibleHoster TPnlCollapsibleHoster {derives from System.Windows.Forms.UserControl}
------------> FCurrentTaskList TLstTasks {derives from System.Windows.Forms.UserControl}
--------------> TaskGroup [1..n] TUcoTaskGroup {derives from System.Windows.Forms.UserControl}
----------------> flpTaskGroup System.Windows.Forms.FlowLayoutPanel
------------------> SingleTask [1..n] TUcoSingleTask {derives from System.Windows.Forms.UserControl}
------> Panel2 System.Windows.Forms.SplitterPanel
--------> rbt + Module Name [1..n] TRbtNavigationButton {derives from Owf.Controls.A1Panel}

Note: The instantiation path does not correlate with the nesting of Controls in each other! The nesting is described in the section 'Description/Purpose'.


Description/Purpose:

  • pnlContent: contains lstFolders and pnlTaskArea Controls.
    • The only other Controls on the Main Menu Form are mnuMain (the Menu) and stbMain (the Status Bar); pnlContent takes up the rest of the space of the Form (DockStyle.Fill).
    • pnlContent is not really seen on the Main Menu Form, although it is a Panel.
  • pnlTaskArea: Fills the entire Main Menu Form space that lies right of the lstFolders Control (DockStyle.Fill) and contains the pnlTop and dsbContent Controls.
    • pnlTaskArea is not really seen on the Main Menu Form, although it is a Panel.
  • pnlTop: Contains only a TPnlGradient Control, TopPanel, which is hosting Controls for the displaying of the 'Breadcrumb Trail'. (The Control hierarchy inside TopPanel is dynamically created in the Constructor of TBreadcrumbTrail.)
  • dsbContent: Fills the entire space that lies under the pnlTop Control (and right of the lstFolders Control). It is not really seen on the Main Menu Form, although it is a Panel.
    • Hosts several TLstTasks instances (as many as the user navigated to by navigating through the Sub-Modules) which get instantiated from within TPnlModuleNavigation. Only one instance is seen at a given time, though!
  • lstFolders: Is placed on the left side of the Main Menu Form (DockStyle.Left).
    • Displays
      • a dynamic list of one TPnlModuleNavigation per OpenPetra Module. TPnlModuleNavigation instances are shown above the list of the OpenPetra Modules (inside the SplitContainer's Splitter Panel #1 (sptNavigation.Panel1)). Once an instance of TPnlModuleNavigation got created and added to the Controls of sptNavigation.Panel1 it is re-used once the user switches to it again!
      • a dynamic list of OpenPetra Modules at the bottom (inside the SplitContainer's Splitter Panel #2 (sptNavigation.Panel2)). Each OpenPetra Module is represented by a TRbtNavigationButton (a custom-painted RadioButton).
    • Also holds a Panel that has currently no functionality (pnlMoreButtons). It is displayed below the SplitContainer.




  • TPnlModuleNavigation:
  • contains an instance of TPnlCollapsible (held in FCollapsibleNavigation) which is a 'Collapsible Panel' that has a heading (which shows the currently OpenPetra Module) and which can host either a TTaskList OR a TPnlCollapsibleHoster Control (TPnlCollapsible can host an arbitrary UserControl, too, but that is not discussed here as it isn't used in the Module Navigation).



  • contains several sub panels
    • each panel has a heading
    • a click on the heading collapses or extends the panel
    • several panels can be expanded at the same time (can be disabled by setting Property 'OnlyOneActiveTaskOnAllCollapsiblePanelsTaskLists' to true)


    • Contains several sub-panels that can be expanded and collapsed; these represent Sub-Module items.
    • Also displays LinkLabels inside each sub-panel that represent the Areas of the Sub-Module.
      • Example: 'Main' Sub-Module in Partner Module, which has the following Areas: 'Partners', 'Extracts', 'Reports' and 'Setup'.
    • Shows the corresponding TLstTasks Control in dsbContent when a LinkLabel got clicked.
  • TLstTasks instances manage Tasks within Task Groups and get instantiated by TPnlModuleNavigation; once an instance of TLstTasks got created and added to the Controls of dsbContent it is re-used once the user switches to it again!
    • FCurrentTaskList: Holds a reference to the currently displayed TLstTask (although there can be several TLstTasks per Sub-Module, only one is currently displayed).
  • TaskGroup: Groups several SingleTasks into groups.
    • Each Task Group features a heading and a dividing line.
    • Each Task Group contains a flpTaskGroup Control.
    • Example: 'New Partner' Group in Partner Module, Partners Sub-Module.
  • flpTaskGroup:
    • Responsible for the layout of SingleTasks in TaskGroups.
    • Example: Layout of the SinlgeTasks 'Add New Family', 'Add New Person' and 'Add New Organisation' in the 'New Partner' Group in the Partner Module, Partners Sub-Module.
  • SingleTask: A single Main Menu item that the user can click to perform a Task in OpenPetra.
    • Example: 'Add New Family' in 'New Partner' Group in Partner Module, Partners Sub-Module.


Main Menu Screen with the various sections highlighted and annotated

NOTE: The annotated screenshot is now outdated as the new Menu Navigation has been merged to trunk for the Alpha 0.2.22-1 release (End of October 2012). The screenshot therefore needs updating and should not be relied on until this has happened.