Friday, February 13, 2015

VirtualPanelSheet



VirtualPanelSheet class
It represents a container that contains multiple panels/sheets that have the same docking style.
Remarks
The VirtualPanelSheet is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A VirtualPanelSheet consists of at least two FlexPanel / FlexPanelTabSheet objects that have the same docking style. The contents of all the FlexPanel / FlexPanelTabSheet objects in a VirtualPanelSheet are always visible at the same time.
User can drag page out of the virtual sheet by dragging the page. You can also drag a FlexPanel / FlexPanelTabSheet into a virtual sheet to make it one page of the sheet. 
Examples
The following example shows how to create a VirtualPanelSheet object. 
public partial class MyChildPanel1 : FlexPanel
{
// ***** //
public partial class MyChildPanel2 : FlexPanel
{
// ***** //
public partial class Window1 : LinsMDIWindow
{
public Window1()
{
InitializeComponent();

// Create a child panel.
MyChildPanel1 myChild1 = new MyChildPanel1();
// Show the panel.
MyChild1.ShowPanel();

// Create another child panel.
MyChildPanel2 myChild2 = new MyChildPanel2();
// Show the panel.
myChild2.ShowPanel();

// Create a virtual panel tabsheet        
VirtualPanelSheet sheet = new VirtualPanelSheet(FLEX_DOCKING_ALIGN.TOP);
// Add child panel 1 as one of its pages
sheet.AddPage( myChild1, false );
// Insert child panel 2 as the first page
sheet.InsertPage( 0, myChild2, false );
// Show the sheet
sheet.ShowPanel();
}
} 
§  Constructors
1)  public VirtualPanelSheet(FLEX_DOCKING_ALIGN nDock)
Parameters
nDock
Type: FLEX_DOCKING_ALIGN
The docking style of the virtual sheet. 
Remarks
Initialize a new instance of VirtualPanelSheet
§  Members
1)  public override Rect Bounds { get; }
Remarks
Retrieve both the size and the location of the sheet, in pixels, relative to its parent.
2)  public override Rect BoundsAtMDIFrame { get; }
Remarks
Retrieve both the size and the location of the sheet, in pixels, relative to MDI frame.
3)  public virtual FLEX_DOCKING_ALIGN Dock { get; set; }
Remarks
Gets or sets which border of the main frame is to be docked to and determines how a control is resized with its parent. It can be one of the following values,
§   TOP:                
The control's top edge is docked to the top of its containing control.
§   BOTTOM:         
The control's bottom edge is docked to the bottom of its containing control.
§   LEFT:              
The control's left edge is docked to the left edge of its containing control.
§   RIGHT:             
The control's right edge is docked to the right edge of its containing control. 
4)  public override double Height { get; set; }
Remarks
Gets or sets the height of the sheet. UpdateSize() needs to be called for performing the size change.  This field will be ignored, if the Dock attribute of the sheet is FLEX_DOCKING_ALIGN .LEFT or FLEX_DOCKING_ALIGN .RIGHT.
5)  public override long ID { get; set; }               
Remarks
A unique number which is larger than FlexConstants.m_nUserDefinedControlStartID (10,000,000) will be automatically generated and assigned to it. If the sheet has at least two pages, then it will never been destroyed, and its layout will be persistent. You can always use LinsUIWPFDockingManager.GetPanelFromAllPlacesByID() to retrieve its instance, once it is created.
6)  public int PagesCount { get; }
Remarks
Retrieve the number of pages. 
7)  public FLEX_PANELSTYLE PanelStyle { get; }
Remarks
Retrieve the style of the sheet; it must be   FLEX_PANEL_VIRTUALSHEET.         
8)  public override double Width { get; set; }
Remarks
Gets or sets the width of the sheet. UpdateSize() needs to be called for performing the size change.  This field will be ignored, if the Dock attribute of the sheet is FLEX_DOCKING_ALIGN .TOP or FLEX_DOCKING_ALIGN .BOTTOM.
§  Methods
1)  public override void AddPage(
FlexPanel panel,
bool bUsingFirstChildInfo)
Parameters
panel
Type: FlexPanel
The FlexPanel is going to be added into the virtual sheet. 
bUsingFirstChildInfo
Type: bool
If the panel is the first and the only page of the virtual sheet at the time, and bUsingFirstChildInfo is true, the virtual sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the virtual sheet already has other pages, then this parameter will be ignored. 
Remarks
Add a FlexPanel object into the virtual sheet, and append the page at the bottom of the page list.
2)  public virtual void Close()
Remarks
This method is invalid for a VirtualPanelSheet object. 
3)  public FlexPanel GetPage (
int nIndex)
Parameters
nIndex
Type: int
The page index.
Remarks
Retrieve the page by its specific position. It will return null, if the index exceeds the range.
4)  public int GetPageIndex(
FlexPanel panel)
Parameters
panel
Type: FlexPanel
A page of the sheet.
Remarks
Retrieve the page index of the page panel. It will return -1, if it is no one of the pages of the sheet.
5)  public int GetPageIndex(
long nPageID)
Parameters
nPageID
Type: long
The page id.
Remarks
Retrieve the page index of a page by its ID. It will return -1, if it is no one of the pages of the sheet.
6)  public FlexPanel[] GetPages()
Remarks
Retrieve all pages of the sheet.
7)  public virtual void InsertPage(
int nIndex,
FlexPanel panel,
bool bUsingFirstChildInfo)
Parameters
nIndex
Type: int
The page index of the FlexPanel is going to be inserted into the virtual sheet. 
panel
Type: FlexPanel
The FlexPanel is going to be added into the virtual sheet. 
bUsingFirstChildInfo
Type: bool
If the panel is the first and the only page of the virtual sheet at the time, and bUsingFirstChildInfo is true, the virtual sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the virtual sheet already has other pages, then this parameter will be ignored. 
Remarks
Insert a FlexPanel object into the virtual sheet at a specific position.
8)  public void RemovePage(
FlexPanel panel)
Parameters
panel
Type: FlexPanel
The FlexPanel is going to be removed from the virtual sheet. 
Remarks
Remove a FlexPanel object from the virtual sheet.
9)  public override bool ShowPanel()              
Remarks
This make the VirualPanelSheet object visible depending on its settings.  
10)public virtual bool ShowPanel(
bool bShowImmediately)  
Parameters
ptLoc
Type: bool
If true, the VirualPanelSheet object will become visible immediately; otherwise, it will depend on its settings.             
Remarks
This forces the VirualPanelSheet object visible immediately if bShowImmediately is true; otherwise, it will depend on its settings.
11)public virtual void UpdateSize()                 
Remarks
When width or height of a sheet is changed, this method needs to be called to perform the change.

Demo


References:
Create a Panel,
Features,
FlexPanel,
FlexPanelTabSheet,
How To,
Index,
Instruction,
LinsUIWPFDockingManager,
LinsUIWPFUtil

No comments:

Post a Comment