Friday, February 13, 2015

FlexPanel




FlexPanel class
It is a customized dockable Panel object. The user can drag a FlexPanel object and dock it at any place. Can also drag a FlexPanel object into a sheet and make it becomes one of the pages of the sheet. You can also hide a FlexPanel object by click at its “Pin” button. The visibility of a FlexPanel object can be turned on/off.
Examples
The following example shows how to create a FlexPanel object. 
public partial class MyChildPanel : FlexPanel
{
// ***** //
public partial class Window1 : LinsMDIWindow
{
public Window1()
{
InitializeComponent();

// Create a child panel.
MyChildPanel myChild = new MyChildPanel();
// Show the panel.
MyChild.ShowPanel();
}
} 

§  Constructors
1)  public FlexPanel()
Remarks
Initialize a new instance of FlexPanel
§  Members
1)  public virtual bool AutoHide { get; set; }
Remarks
If it is false, then the panel will be pinned to a border of the MDI Frame. This field will be ignored, if the panel is not docked.
2)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of the panel 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 panel 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 panel.
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 panel. 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 panel is FLEX_DOCKING_ALIGN .LEFT or FLEX_DOCKING_ALIGN .RIGHT.
b)  The panel is one page of a FlexPanelTabSheet.
c)  The panel is one page of a VirtualPanelSheet, and the Dock attribute of the panel is FLEX_DOCKING_ALIGN .TOP or FLEX_DOCKING_ALIGN .BOTTOM.
7)  public virtual ImageSource Icon { get; set; }
Remarks
Gets or sets the icon of the panel.
8)  public virtual long ID { get; set; }               
Remarks
Every FlexPanel object should have a unique ID. If the user does not assign a number to the ID, a unique number which is larger than FlexConstants.m_nUserDefinedControlStartID (10,000,000) will be automatically generated and assigned to it. If the ID is between FlexConstants.m_nUserDefinedControlStartID (1000) and FlexConstants.m_nUserDefinedControlStartID (10,000,000), then once the panel is created, 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 panel. If it is set to null, the menu will be removed from the panel.
10)public FlexRibbonMenu MainRibbonMenu { get; set; }               
Remarks
Set the ribbon menu of this panel. If it is set to null, the ribbon menu will be removed from the panel.
11)public virtual bool NoAnimate { get; set; }
Remarks
Gets or sets the animation ability of the panel.
12)public virtual bool PageOfVirtualSheet { get; }
Remarks
True, if this panel is one page of a VirtualPanelSheet.
13)public FLEX_PANELSTYLE PanelStyle { get; }
Remarks
Retrieve the style of the panel; it can be one of the following values
§   FLEX_PANEL_REGULAR:             
The panel is a normal panel.
§   FLEX_PANEL_TABPAGE:         
The panel is one page of a FlexPanelTabSheet sheet.
14)public virtual string Title { get; set; }
Remarks
Gets or sets the caption of the panel.
15)public virtual double Width { get; set; }
Remarks
Gets or sets the width of the panel. 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 panel is FLEX_DOCKING_ALIGN .TOP or FLEX_DOCKING_ALIGN .BOTTOM.
b)   The panel is one page of a FlexPanelTabSheet.
c)   The panel is one page of a VirtualPanelSheet, and the Dock attribute of the panel is FLEX_DOCKING_ALIGN .LEFT or FLEX_DOCKING_ALIGN .RIGHT.
§  Methods
1)  public virtual void Close()
Remarks
This closes the panel. If this panel is non-persistent (ID is larger than 10,000,000), the panel will be destroyed. 
2)  public void EnsureVisible()                 
Remarks
Move the panel into view area if it is outside the view area.
3)  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 panel includes the non-client area.
4)  public virtual void RemoveToolBar(
FlexToolBar toolbar)                 
Parameters
toolbar
Type: FlexToolBar
The toolbar is going to be removed from this panel. 
Remarks
This removes a toolbar from this panel. 
5)  public void SetLocation(
Point ptLoc)
Parameters
ptLoc
Type: Point
A location which is relative its parent coordinates. 
Remarks
Set the location of the panel, in pixels, relative to its parent. When the panel is docked or is a page of a sheet, this method will be invalid.
6)  public void SetLocationAtMDIFrame(
Point ptMousePosAtMDIFrame)                 
Parameters
ptMousePosAtMDIFrame
Type: Point
A location which is relative to MDI Frame coordinates. 
Remarks
Set the location of the panel, in pixels, relative to MDI Frame. When the panel is docked or is a page of a sheet, this method will be invalid.
7)  public virtual bool ShowPanel()              
Remarks
This makes the FlexPanel object visible depending on its settings. 
8)  public virtual bool ShowPanel(
bool bShowImmediately)  
Parameters
ptLoc
Type: bool
If true, the FlexPanel 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.
9)  public virtual void UpdateSize()                 
Remarks
When width or height of a panel is changed, this method needs to be called to perform 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. 

No comments:

Post a Comment