Friday, February 13, 2015

FlexPanelTabSheet



FlexPanelTabSheet class
It represents a container that contains multiple panels that share the same space on the screen.
Remarks
The FlexPanelTabSheet is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A FlexPanelTabSheet consists of at least two FlexPanel objects that share the same screen space. Only one FlexPanel in a FlexPanelTabSheet is visible at a time. When a user select the tab of a FlexPanel, the contents of that FlexPanel become visible and the contents of the other FlexPanel obejcts are hidden.

§   Drag a FlexPanel object into another FlexPanel object to form a new FlexPanelTabSheet sheet.
§   Drag a page out of the sheet by dragging the tab.
§   Drag a FlexPanel into a sheet to make it one page of the sheet.
§   Drag a FlexPanelTabSheet object and dock it at any place during run time.
§   Can hide a FlexPanelTabSheet object by click at its “Pin” button.
§   The visibility of a FlexPanelTabSheet object can also be turned on/off.
Examples
The following example shows how to create a FlexPanelTabSheet 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 panel tabsheet
FlexPanelTabSheet sheet = new FlexPanelTabSheet();
// 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 FlexPanelTabSheet()
Remarks
Initialize a new instance of FlexPanelTabSheet
§  Members
1)  public override bool AutoHide { get; set; }
Remarks
If it is true, then the sheet will be pinned to a border of the MDI Frame. This field will be ignored, if the sheet is not docked.
2)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of the sheet including its non-client elements, in pixels, relative to its parent.
3)  public virtual Rect BoundsAtMDIFrame { get; }
Remarks
Retrieve both the size and the location of the sheet including its non-client elements, in pixels, relative to MDI frame.
4)  public UIElement Content { get; set; }
Remarks
Gets or sets the content of the sheet.
5)  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,
§   NONE:             
The control is not docked.
§   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.
6)  public virtual 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 one of the following conditions is true,
a)  The Dock attribute of the sheet is FLEX_DOCKING_ALIGN .LEFT or FLEX_DOCKING_ALIGN .RIGHT.
b)  The sheet is one page of a VirtualPanelSheet, and the Dock attribute of the sheet is FLEX_DOCKING_ALIGN .TOP or FLEX_DOCKING_ALIGN .BOTTOM.
7)  public override ImageSource Icon { get; set; }
Remarks
Gets or sets the icon of the sheet. If this field is not set, then it will use the icon of the active page.
8)  public 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.
9)  public FlexMenu MainMenu { get; set; }               
Remarks
Set the menu of this sheet. If it is set to null, the menu will be removed from the sheet.
10)public FlexRibbonMenu MainRibbonMenu { get; set; }               
Remarks
Set the ribbon menu of this sheet. If it is set to null, the ribbon menu will be removed from the sheet.
11)public override bool NoAnimate { get; set; }
Remarks
Gets or sets the animation ability of the sheet.
12)public override bool PageOfVirtualSheet { get; }
Remarks
True, if this sheet is one page of a VirtualPanelSheet.
13)public FLEX_PANELSTYLE PanelStyle { get; }
Remarks
Retrieve the style of the sheet; it must be   FLEX_PANEL_TABSHEET.         
14)public virtual int SelectedIndex { get; set }
Remarks
Gets or sets the index of the currently selected tab page.
15)public virtual FlexPanel SelectedTab { get; }
Remarks
Retrieve the selected page.
16)public int TabCount { get; }
Remarks
Retrieve the number of pages. 
17)public FlexCollection<FlexPanel> TabPages { get; }
Remarks
Retrieve all pages. 
18)public override string Title { get; set; }
Remarks
Gets or sets the caption of the sheet. If this field is not set, then it will use the caption of the active page.
19)public virtual 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 one of the following conditions is true,
a)  The Dock attribute of the sheet is FLEX_DOCKING_ALIGN .TOP or FLEX_DOCKING_ALIGN .BOTTOM.
b)  The sheet is one page of a VirtualPanelSheet, and the Dock attribute of the sheet is FLEX_DOCKING_ALIGN .LEFT or FLEX_DOCKING_ALIGN .RIGHT.
§  Methods
1)  public void AddPage(
FlexPanel panel,
bool bUsingFirstChildInfo)
Parameters
panel
Type: FlexPanel
The FlexPanel is going to be added into the sheet. 
bUsingFirstChildInfo
Type: bool
If the panel is the first and the only page of the sheet at this time, and bUsingFirstChildInfo is true, the sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the sheet already has other pages, then this parameter will be ignored. 
Remarks
Add a FlexPanel object into the sheet, and append the page at the bottom.
2)  public virtual void Close()
Remarks
This make the FlexPanelTabSheet object invisible. 
3)  public void ClosePage(
int nIndex)
Parameters
nIndex
Type: int
The page index of the page which is going to be close.
Remarks
Close a page.
4)  public void EnsureVisible()                 
Remarks
Move the sheet into view area if it is outside the view area.
5)  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.
6)  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.
7)  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.
8)  public FlexPanel[] GetTabPages()
Remarks
Retrieve all pages of the sheet.
9)  public virtual bool HitTest(
Point ptMousePosAtMDIFrame)                 
Parameters
ptMousePosAtMDIFrame
Type: Point
A location which is in MDI Frame coordinate. 
Remarks
Test whether the point, ptMousePosAtMDIFrame, which is in MDI Frame coordinate, is inside this sheet includes the non-client area.
10)public void InsertPage(
int nIndex,
FlexPanel panel,
bool bUsingFirstChildInfo)
Parameters
nIndex
Type: int
The specific position where the FlexPanel is going to be inserted into the sheet. 
panel
Type: FlexPanel
The FlexPanel is going to be added into the sheet.
bUsingFirstChildInfo
Type: bool
If the panel is the first and the only page of the sheet at the time, and bUsingFirstChildInfo is true, the sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the sheet already has other pages, then this parameter will be ignored. 
Remarks
Insert a FlexPanel object into the sheet at a specific position.
11)public void RemovePage(
FlexPanel panel)
Parameters
panel
Type: FlexPanel
The page will be removed from the sheet.
Remarks
Remove panel from the sheet.
12)public virtual void RemoveToolBar(
FlexToolBar toolbar)                 
Parameters
toolbar
Type: FlexToolBar
The toolbar is going to be removed from this sheet. 
Remarks
This removes a toolbar from this sheet. 
13)public void SetLocation(
Point ptLoc)
Parameters
ptLoc
Type: Point
A location which is relative its parent coordinates. 
Remarks
Set the location of the sheet, in pixels, relative to its parent. When the sheet is docked, this method will be invalid.
14)public void SetLocationAtMDIFrame(
Point ptMousePosAtMDIFrame)                 
Parameters
ptMousePosAtMDIFrame
Type: Point
A location which is relative to MDI Frame coordinates. 
Remarks
Set the location of the sheet, in pixels, relative to MDI Frame. When the sheet is docked, this method will be invalid.
15)public override bool ShowPanel()              
Remarks
This make the FlexPanelTabSheet object visible. 
16)  public override bool ShowPanel(
bool bShowImmediately)  
Parameters
ptLoc
Type: bool
If true, the FlexPanelTabSheet object will become visible immediately; otherwise, it will depend on its settings.             
Remarks
This forces the FlexPanel object visible immediately if bShowImmediately is true; otherwise, it will depend on its settings.
17)public void SwitchPages(
FlexPanel panel1,
FlexPanel panel2)
Parameters
panel1
Type: FlexPanel
The first page whose position will be changed.
panel2
Type: FlexPanel
The second page whose position will be changed.
Remarks
Switch panel1 ‘s position with panel2 ‘s position.
18)public virtual void UpdateSize()                 
Remarks
When width or height of a sheet is changed, this method needs to be called to performing the change.
§  Events
1)     public event AutoHideChangedEventHandler AutoHideChangedEvent              
Remarks
This event is fired when AutoHide is changed.   
2)     public event ContentChangedEventhandler ContentChanged              
Remarks
This event is fired when the content is changed. 
3)     public event SelectedIndexChangedEventhandler SelectedIndexChanged              
Remarks
This event is fired when the active page is changed.  


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

No comments:

Post a Comment