Main Menu: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:
<code>
<code>
{| style="width:100%" border="1"
{| style="width:100%" border="1"
! Variable || Type
! Variable || Type || How the Control gets added
|-
|-
| pnlContent || System.Windows.Forms.Panel
| pnlContent || System.Windows.Forms.Panel || Hard-coded
|-
|-
| --> pnlTaskArea || System.Windows.Forms.Panel
| --> pnlTaskArea || System.Windows.Forms.Panel || Hard-coded
|-
|-
| ----> pnlTop || System.Windows.Forms.Panel
| ----> pnlTop || System.Windows.Forms.Panel || Hard-coded
|-
|-
| ----> dsbContent || TDashboard {derives from System.Windows.Forms.Panel}
| ------> TopPanel || TPnlGradient {derives from System.Windows.Forms.Panel} || Dynamically
|-
|-
| --> lstFolders || TLstFolderNavigation {derives from System.Windows.Forms.Panel}
| --------> FBreadcrumbTrailPanel || System.Windows.Forms.Panel || Dynamically
|-
|-
| ----> pnlMoreButtons || TPnlGradient
| ----------> BreadcrumbTrailModulePanel || System.Windows.Forms.Panel || Dynamically
|-
|-
| ----> sptNavigation || System.Windows.Forms.SplitContainer
| ------------> FBreadcrumbTrailModuleLabel || System.Windows.Forms.Label || Dynamically
|-
|-
| ------> Panel1 || System.Windows.Forms.SplitterPanel
| ----------> FBreadcrumbTrailDetailLabel || System.Windows.Forms.Label || Dynamically
|-
|-
| --------> pnl ''+ Folder Name'' [1..n] || TPnlModuleNavigation {derives from System.Windows.Forms.Panel}
| ----> dsbContent || TDashboard {derives from System.Windows.Forms.Panel} || Hard-coded
|-
|-
| ------------> FCollapsibleNavigation || TPnlCollapsible {derives from System.Windows.Forms.UserControl}
| --> lstFolders || TLstFolderNavigation {derives from System.Windows.Forms.Panel} || Hard-coded
|-
|-
| --------------> FTaskListInstance  '''''OR''''' || TTaskList {derives from System.Windows.Forms.UserControl}
| ----> pnlMoreButtons || TPnlGradient {derives from System.Windows.Forms.Panel} || Hard-coded
|-
|-
| --------------> FPnlCollapsibleHoster || TPnlCollapsibleHoster {derives from System.Windows.Forms.UserControl}
| ----> sptNavigation || System.Windows.Forms.SplitContainer || Hard-coded
|-
|-
| ------------> FCurrentTaskList || TLstTasks {derives from System.Windows.Forms.UserControl}
| ------> Panel1 || System.Windows.Forms.SplitterPanel || Hard-coded
|-
|-
| --------------> TaskGroup [1..n] || TUcoTaskGroup {derives from System.Windows.Forms.UserControl}
| --------> pnl ''+ Folder Name'' [1..n] || TPnlModuleNavigation {derives from System.Windows.Forms.Panel} || Dynamically
|-
|-
| ----------------> flpTaskGroup || System.Windows.Forms.FlowLayoutPanel
| ------------> FCollapsibleNavigation || TPnlCollapsible {derives from System.Windows.Forms.UserControl} || Dynamically
|-
|-
| ------------------> SingleTask [1..n] || TUcoSingleTask {derives from System.Windows.Forms.UserControl}
| --------------> FTaskListInstance  '''''OR''''' || TTaskList {derives from System.Windows.Forms.UserControl} || Dynamically
|-
|-
| ------> Panel2 || System.Windows.Forms.SplitterPanel
| --------------> FPnlCollapsibleHoster || TPnlCollapsibleHoster {derives from System.Windows.Forms.UserControl} || Dynamically
|-
|-
| --------> rbt ''+ Module Name'' [1..n] || TRbtNavigationButton {derives from Owf.Controls.A1Panel}
| -----------------> CollPanel [1..n] || TPnlCollapsible {derives from System.Windows.Forms.UserControl} || Dynamically
|-
| ------------> FCurrentTaskList || TLstTasks {derives from System.Windows.Forms.UserControl} || Dynamically
|-
| --------------> TaskGroup [1..n] || TUcoTaskGroup {derives from System.Windows.Forms.UserControl} || Dynamically
|-
| ----------------> flpTaskGroup || System.Windows.Forms.FlowLayoutPanel || Hard-coded
|-
| ------------------> SingleTask [1..n] || TUcoSingleTask {derives from System.Windows.Forms.UserControl} || Dynamically
|-
| ------> Panel2 || System.Windows.Forms.SplitterPanel || Hard-coded
|-
| --------> rbt ''+ Module Name'' [1..n] || TRbtNavigationButton {derives from Owf.Controls.A1Panel} || Dynamically
|}
|}
</code>
</code>
Line 61: Line 73:


Description/Purpose:
Description/Purpose:
* pnlContent: contains lstFolders and pnlTaskArea Controls.  
* '''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).
** 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.
** 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''': 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.
** 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.)
* '''pnlTop''': Is placed above the dsbContent Control and right of the lstFolders Control (DockStyle.Top).
* 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 only a TPnlGradient Control, TopPanel, which itself is hosting Controls for the displaying of the 'Breadcrumb Trail'.  
** 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!
** TopPanel is dynamically created as the WinForm Generator does not support TPnlGradient Controls. Therefore the Control hierarchy inside TopPanel (four Controls in total) is dynamically created as well (in the Constructor of TBreadcrumbTrail).
* lstFolders: Is placed on the left side of the Main Menu Form (DockStyle.Left).
* '''dsbContent''' (TDashboard Control): Fills the entire space (DockStyle.Fill) that lies under the pnlTop Control (and right of the lstFolders Control).  
** Displays
** Hosts 1..n TLstTasks instances (as many as the user has navigated to by navigating through the Sub-Modules) which get instantiated from within TPnlModuleNavigation.  
*** 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!
** Only one TLstTasks instance is seen at a given time!
*** 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).  
** dsbContent is not really seen on the Main Menu Form, although it is a Panel.
** Also holds a Panel that has currently no functionality (pnlMoreButtons). It is displayed below the SplitContainer.
* '''lstFolders''' (TLstFolderNavigation Control): Is placed on the left side of the Main Menu Form (DockStyle.Left) and therefore to the left of the dsbContent Control.
 
** Hosts a SplitContainer which hosts...
 
*** 1..n TPnlModuleNavigation Controls, one per OpenPetra Module.  
 
**** TPnlModuleNavigation instances are shown above the TRbtNavigationButton Constrols (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!
 
*** 1..n TRbtNavigationButton Controls, each representing an OpenPetra Module. These are shown below the TPnlModuleNavigation instances (inside the SplitContainer's Splitter Panel #2 (sptNavigation.Panel2)).  
 
** Also hosts a Panel that has currently no functionality (pnlMoreButtons). It is displayed below the SplitContainer.
 
* '''TPnlModuleNavigation''' Controls:  
* TPnlModuleNavigation:  
** contain a single instance of a TPnlCollapsible Control (FCollapsibleNavigation) which collapses in horizontal direction and on doing so reduces the width of the lstFolders Control to a fraction of it's usual width, making more space available for the pnlTaskArea Control.
* 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).
*** the heading of the TPnlCollapsible Control shows the current OpenPetra Module
 
*** only one TPnlModuleNavigation instance is seen at a given time!
 
** also hold a reference to the ''currently displayed'' TLstTasks Control in FCurrentTaskList
 
*** although there can be 1..n TLstTasks Controls per Sub-Module, only one is currently displayed
 
* '''TPnlCollapsible''' Controls are 'Collapsible Panels'
 
** have has a heading
* contains several sub panels
** can host either  
** each panel has a heading
*** a TTaskList Control ''OR''
** a click on the heading collapses or extends the panel
*** a TPnlCollapsibleHoster Control  
** several panels can be expanded at the same time (can be disabled by setting Property 'OnlyOneActiveTaskOnAllCollapsiblePanelsTaskLists' to true)
*** (TPnlCollapsible can host an arbitrary UserControl, too, but that is not discussed here as it isn't used in the Module Navigation).
 
** which one it hosts when: see description for Control 'TPnlCollapsibleHoster'.
 
** can be collapsed/expanded in either horizontal or vertical direction
 
*** collapsing/expanding is triggered by either clicking the 'collapse/expand button' or the heading
** Contains several sub-panels that can be expanded and collapsed; these represent Sub-Module items.
* '''TTaskList''' Controls contain 1..n 'Tasks' which are represented by LinkLabels
** Also displays LinkLabels inside each sub-panel that represent the Areas of the Sub-Module.
** The 'Tasks' represent the individual Sub-Modules of OpenPetra
*** Example: 'Main' Sub-Module in Partner Module, which has the following Areas: 'Partners', 'Extracts', 'Reports' and 'Setup'.
** Once a 'Task' is clicked the TTaskList's 'ItemActivation' Event is fired. That causes the OnItemActivation Method of TPnlModuleNavigation to run, which in turn runs the Method 'LinkClicked', which creates or retrieves the associated TLstTasks Control, stores it in FCurrentTaskList and runs the code 'FDashboard.ShowTaskList(FCurrentTaskList);' which shows that TLstTasks Control to the user in the dsbContent Control.
 
* '''TLstTasks''' Controls manage and display SingleTasks within TaskGroups in the dsbContent Control.
** Shows the corresponding TLstTasks Control in dsbContent when a LinkLabel got clicked.
** although there can be 1..n TLstTasks Controls per Sub-Module, only one is currently displayed!
* 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!
* '''TPnlCollapsibleHoster''' Controls contains 1..n TPnlCollapsible Controls
** FCurrentTaskList: Holds a reference to the ''currently displayed'' TLstTask (although there can be several TLstTasks per Sub-Module, only one is currently displayed).
** several TPnlCollapsible Controls can be expanded at the same time (can be disabled by setting Property 'OnlyOneActiveTaskOnAllCollapsiblePanelsTaskLists' to true)
 
** TPnlCollapsibleHoster Controls are only needed for Sub-Modules that either
* TaskGroup: Groups several SingleTasks into groups.  
*** have many Tasks and the Tasks should therefore get grouped into 1..n TPnlCollapsible Controls (System Manager Module);
*** for the Finance and Financial Development Modules ''in case'' the OpenPetra Site has got more than one Ledger.  
**** If this is so then a 'Select Ledger' TPnlCollapsible Controls is dynamically added, listing all available Ledgers as Tasks, and the Sub-Modules of the Finance Module are put in a dynamically added 'Finance' TPnlCollapsible Control.
* '''TaskGroup''' (TUcoTaskGroup Control): Groups several SingleTasks into groups.  
** Each Task Group features a heading and a dividing line.
** Each Task Group features a heading and a dividing line.
** Each Task Group contains a flpTaskGroup Control.
** Each Task Group contains a flpTaskGroup Control.
** Example: 'New Partner' Group in Partner Module, Partners Sub-Module.
** Example: 'New Partner' Group in Partner Module, Partners Sub-Module.
* flpTaskGroup:  
* '''flpTaskGroup''' (FlowLayoutPanel Control): Responsible for the layout of SingleTasks in TaskGroups.
** 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.
** 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.
* '''SingleTask''' (TUcoSingleTask Control): 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.
** Example: 'Add New Family' in 'New Partner' Group in Partner Module, Partners Sub-Module.



Revision as of 17:06, 15 Ocak 2013

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 How the Control gets added
pnlContent System.Windows.Forms.Panel Hard-coded
--> pnlTaskArea System.Windows.Forms.Panel Hard-coded
----> pnlTop System.Windows.Forms.Panel Hard-coded
------> TopPanel TPnlGradient {derives from System.Windows.Forms.Panel} Dynamically
--------> FBreadcrumbTrailPanel System.Windows.Forms.Panel Dynamically
----------> BreadcrumbTrailModulePanel System.Windows.Forms.Panel Dynamically
------------> FBreadcrumbTrailModuleLabel System.Windows.Forms.Label Dynamically
----------> FBreadcrumbTrailDetailLabel System.Windows.Forms.Label Dynamically
----> dsbContent TDashboard {derives from System.Windows.Forms.Panel} Hard-coded
--> lstFolders TLstFolderNavigation {derives from System.Windows.Forms.Panel} Hard-coded
----> pnlMoreButtons TPnlGradient {derives from System.Windows.Forms.Panel} Hard-coded
----> sptNavigation System.Windows.Forms.SplitContainer Hard-coded
------> Panel1 System.Windows.Forms.SplitterPanel Hard-coded
--------> pnl + Folder Name [1..n] TPnlModuleNavigation {derives from System.Windows.Forms.Panel} Dynamically
------------> FCollapsibleNavigation TPnlCollapsible {derives from System.Windows.Forms.UserControl} Dynamically
--------------> FTaskListInstance OR TTaskList {derives from System.Windows.Forms.UserControl} Dynamically
--------------> FPnlCollapsibleHoster TPnlCollapsibleHoster {derives from System.Windows.Forms.UserControl} Dynamically
-----------------> CollPanel [1..n] TPnlCollapsible {derives from System.Windows.Forms.UserControl} Dynamically
------------> FCurrentTaskList TLstTasks {derives from System.Windows.Forms.UserControl} Dynamically
--------------> TaskGroup [1..n] TUcoTaskGroup {derives from System.Windows.Forms.UserControl} Dynamically
----------------> flpTaskGroup System.Windows.Forms.FlowLayoutPanel Hard-coded
------------------> SingleTask [1..n] TUcoSingleTask {derives from System.Windows.Forms.UserControl} Dynamically
------> Panel2 System.Windows.Forms.SplitterPanel Hard-coded
--------> rbt + Module Name [1..n] TRbtNavigationButton {derives from Owf.Controls.A1Panel} Dynamically

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: Is placed above the dsbContent Control and right of the lstFolders Control (DockStyle.Top).
    • Hosts only a TPnlGradient Control, TopPanel, which itself is hosting Controls for the displaying of the 'Breadcrumb Trail'.
    • TopPanel is dynamically created as the WinForm Generator does not support TPnlGradient Controls. Therefore the Control hierarchy inside TopPanel (four Controls in total) is dynamically created as well (in the Constructor of TBreadcrumbTrail).
  • dsbContent (TDashboard Control): Fills the entire space (DockStyle.Fill) that lies under the pnlTop Control (and right of the lstFolders Control).
    • Hosts 1..n TLstTasks instances (as many as the user has navigated to by navigating through the Sub-Modules) which get instantiated from within TPnlModuleNavigation.
    • Only one TLstTasks instance is seen at a given time!
    • dsbContent is not really seen on the Main Menu Form, although it is a Panel.
  • lstFolders (TLstFolderNavigation Control): Is placed on the left side of the Main Menu Form (DockStyle.Left) and therefore to the left of the dsbContent Control.
    • Hosts a SplitContainer which hosts...
      • 1..n TPnlModuleNavigation Controls, one per OpenPetra Module.
        • TPnlModuleNavigation instances are shown above the TRbtNavigationButton Constrols (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!
      • 1..n TRbtNavigationButton Controls, each representing an OpenPetra Module. These are shown below the TPnlModuleNavigation instances (inside the SplitContainer's Splitter Panel #2 (sptNavigation.Panel2)).
    • Also hosts a Panel that has currently no functionality (pnlMoreButtons). It is displayed below the SplitContainer.
  • TPnlModuleNavigation Controls:
    • contain a single instance of a TPnlCollapsible Control (FCollapsibleNavigation) which collapses in horizontal direction and on doing so reduces the width of the lstFolders Control to a fraction of it's usual width, making more space available for the pnlTaskArea Control.
      • the heading of the TPnlCollapsible Control shows the current OpenPetra Module
      • only one TPnlModuleNavigation instance is seen at a given time!
    • also hold a reference to the currently displayed TLstTasks Control in FCurrentTaskList
      • although there can be 1..n TLstTasks Controls per Sub-Module, only one is currently displayed
  • TPnlCollapsible Controls are 'Collapsible Panels'
    • have has a heading
    • can host either
      • a TTaskList Control 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).
    • which one it hosts when: see description for Control 'TPnlCollapsibleHoster'.
    • can be collapsed/expanded in either horizontal or vertical direction
      • collapsing/expanding is triggered by either clicking the 'collapse/expand button' or the heading
  • TTaskList Controls contain 1..n 'Tasks' which are represented by LinkLabels
    • The 'Tasks' represent the individual Sub-Modules of OpenPetra
    • Once a 'Task' is clicked the TTaskList's 'ItemActivation' Event is fired. That causes the OnItemActivation Method of TPnlModuleNavigation to run, which in turn runs the Method 'LinkClicked', which creates or retrieves the associated TLstTasks Control, stores it in FCurrentTaskList and runs the code 'FDashboard.ShowTaskList(FCurrentTaskList);' which shows that TLstTasks Control to the user in the dsbContent Control.
  • TLstTasks Controls manage and display SingleTasks within TaskGroups in the dsbContent Control.
    • although there can be 1..n TLstTasks Controls per Sub-Module, only one is currently displayed!
  • TPnlCollapsibleHoster Controls contains 1..n TPnlCollapsible Controls
    • several TPnlCollapsible Controls can be expanded at the same time (can be disabled by setting Property 'OnlyOneActiveTaskOnAllCollapsiblePanelsTaskLists' to true)
    • TPnlCollapsibleHoster Controls are only needed for Sub-Modules that either
      • have many Tasks and the Tasks should therefore get grouped into 1..n TPnlCollapsible Controls (System Manager Module);
      • for the Finance and Financial Development Modules in case the OpenPetra Site has got more than one Ledger.
        • If this is so then a 'Select Ledger' TPnlCollapsible Controls is dynamically added, listing all available Ledgers as Tasks, and the Sub-Modules of the Finance Module are put in a dynamically added 'Finance' TPnlCollapsible Control.
  • TaskGroup (TUcoTaskGroup Control): 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 (FlowLayoutPanel Control): 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 (TUcoSingleTask Control): 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.