Showing posts with label TDI. Show all posts
Showing posts with label TDI. Show all posts

Sunday, January 2, 2011

VirualPanelSheet class of LinsUI Layout Manager 2.1

It represents a container that contains multiple panels/sheets that have the same docking style.
Remarks
The VirualPanelSheet is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A VirualPanelSheet consists of at least two FlexPanel / FlexPanelTabSheet objects that have the same docking style. The contents of all the FlexPanel / FlexPanelTabSheet objects in a VirualPanelSheet 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 VirualPanelSheet object.

public class MyPanel1: FlexPanel
{
    // ***** //
}

public class MyPanel2: FlexPanel
{
    // ***** //
}

public class MDIForm : FlexMDIForm
{
    // ***** //
}

public MDIForm ()
{
SuspendLayout();
InitializeComponent();

// Create a panel.
MyPanel1 myPanel1 = new MyPanel1();
// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and
// FlexConstants.m_nUserDefinedControlEndID
myPanel1.ID = FlexConstants.m_nUserDefinedControlStartID + 1;
// Show the panel.
myPanel1.ShowPanel();

// Create another panel.
MyPanel2 myPanel2 = new MyPanel2();
// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and
// FlexConstants.m_nUserDefinedControlEndID
myPanel2.ID = FlexConstants.m_nUserDefinedControlStartID + 2;
// Show the panel.
myPanel2.ShowPanel();

// Create a panel virtual sheet
VirtualPanelSheet sheet = new VirtualPanelSheet();
//Assign the dock style to RIGHT
sheet.FlexDock = FLEX_DOCKING_ALIGN.BOTTOM;
sheet.Size = new Size(400, 400);
// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and
// FlexConstants.m_nUserDefinedControlEndID
sheet.ID = FlexConstants.m_nUserDefinedControlStartID + 3;
// Add panel 1 as one of its pages
sheet.AddPage( myPanel1, false );
// Insert panel 2 as the first page
sheet.InsertPage( 0, myPanel2, false );
//Show the sheet
sheet.ShowPanel();

ResumeLayout(false);
PerformLayout();
}

§      Members
1)  public long ID { get; set; }               
Remarks
Every VirualPanelSheet object should have a unique ID. If its value is between FlexConstants.m_nUserDefinedControlStartID and FlexConstants.m_nUserDefinedControlStartID, then its layout will be persistent; otherwise, its layout will not be saved.

2)  public virtual FLEX_DOCKING_ALIGN FlexDock { get; set; }
Remarks
Gets or sets which control borders are docked to its parent control 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.

§      Methods
1)  public void ShowPanel()              
Remarks
This make the VirualPanelSheet object visible.

2)  public virtual void HidePanel()
Remarks
This make the VirualPanelSheet object invisible.

3)  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 page of the sheet, 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.

4)  public 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 sheet.

panel
Type: FlexPanel
The FlexPanel is going to be added into the sheet.

bUsingFirstChildInfo
Type: bool
If the panel is the first page of the sheet, 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.


Download Free Trial,

TSITEM_TYPEID enumeration of LinsUI Layout Manager 2.1

Specifies what kind of toolstripitem the command is associated to.
§         BUTTON
§         COMBOBOX
§         DROPDOWNBUTTON
§         LABEL
§         MENUITEM
§         PROGRESSBAR
§         SEPARATOR
§         SPLITBUTTON
§         STATUSLABEL
§         TEXTBOX

ToolTipAttribute class of LinsUI Layout Manager 2.1

Specifies the tooltip for the command.
Examples
using LinsUI;

public static class LinsResource
{
[CommandGroupNameAttribute("Shapes and Pictures"), // The Category name
 // Command name
 CommandNameAttribute("Color"),
 // Tell the application, it is a combobox 
 CommandTypeAttribute(TSITEM_TYPEID.COMBOBOX),  
 // Tooltip for the combobox  
 ToolTipAttribute("Select a color for a shape")]
public const long m_nColorID =  FlexConstants.m_nUserDefinedControlStartID + 1;

LinsResource class of LinsUI Layout Manager 2.1

If users want to assign unique identifiers for commands, then they should define this class. Also users can define all attributes for commands inside this class.
Examples
using LinsUI;

public static class LinsResource
{
[CommandGroupNameAttribute("Shapes and Pictures"), // The Category name
 // Command name
 CommandNameAttribute("Color"),
 // The Button Icon
 CommandImageAttribute("ColorFill.ico"),
 // Button display style                                      
 CommandAppearanceAttribute(ToolStripItemDisplayStyle.ImageAndText),
 // The Text and Icon relation
 CommandImageAndTextRelationAttribute(TextImageRelation.TextBeforeImage),
 // Tell the application, it is a combobox 
 CommandTypeAttribute(TSITEM_TYPEID.COMBOBOX),  
 // Tooltip for the combobox  
 ToolTipAttribute("Select a color"),   
 // The rich text file format help file, it will be open when user click at the 
 // Help button on the tooltip         
 CommandHelpFileAttribute("ColorHelp.rtf")]              
public const long m_nColorID =  FlexConstants.m_nUserDefinedControlStartID + 1;


[CommandGroupNameAttribute("Main"),                 // The Category name
 // Tell the application, it is a menu item
 CommandTypeAttribute(TSITEM_TYPEID.MENUITEM),  
 // Tooltip for the menu item  
 ToolTipAttribute("Save layout"),
 // The detail description                  
 DetailDescriptionAttribute("Save Layout.")]       
public const long m_nSaveLayoutID = FlexConstants.m_nUserDefinedControlStartID + 2;

[CommandGroupNameAttribute("Main"),                 // The Category name
 // The Menu item Icon
 CommandImageAttribute("import2.ico"),  
 // Menu item display style          
 CommandAppearanceAttribute(ToolStripItemDisplayStyle.ImageAndText),  
 // The Text and Icon relation
 CommandImageAndTextRelationAttribute(TextImageRelation.TextBeforeImage),
 // Tell the application, it is a menu item 
 CommandTypeAttribute(TSITEM_TYPEID.MENUITEM),     
 // Tooltip for the menu item
 ToolTipAttribute("Import layout"),      
 // The detail description        
 DetailDescriptionAttribute("Import Layout.")]     
public const long m_nImportLayoutID = FlexConstants.m_nUserDefinedControlStartID + 3;


[CommandGroupNameAttribute("Shapes"),               // The Category name
 // Tell the application, it is a menu item
 CommandTypeAttribute(TSITEM_TYPEID.MENUITEM),   
 // Tooltip for the menu item 
 ToolTipAttribute("Selecte a shape"),          
 // The detail description   
 DetailDescriptionAttribute("Select a shape.")]    
public const long m_nShapesDropDownID = FlexConstants.m_nUserDefinedControlStartID + 4;

[CommandGroupNameAttribute("Colors"),               // The Category name
 // Tell the application, it is a dropdown button
 CommandTypeAttribute(TSITEM_TYPEID.DROPDOWNBUTTON),  
 // Tooltip for the menu item  
 ToolTipAttribute("Select a color"),   
 // The detail description           
 DetailDescriptionAttribute("Select a color.")]    
public const long m_nColorsDropDownID = FlexConstants.m_nUserDefinedControlStartID + 5;

LinsListBox class of LinsUI Layout Manager 2.1

It is a customized ListBox object; it owns all ListBox features. This listbox allow users to associate an icon or image with any listed item.
Examples
The following example shows how to create a LinsListBox object.

// lsImageList is an extend reference
ImageList lsImageList;

// Create a listbox object
LinsListBox listbox = new LinsListBox();
// Set the listbox’s image list to an existed image list
listbox.ImageList = lsImageList;

listbox.Items.Clear();

// Create a list item
LinsListItem item1 = new LinsListItem();
Item1.ID = 1;
// item text
Item1.Text = “Red”;
// the icon associated with this item will be the first image in lsImageList                  
Item1.ImageIndex = 0;                    
listbox.Items.Add( item1 );
           
// Create second list item
LinsListItem item2 = new LinsListItem();
Item2.ID = 2;
// item text
Item2.Text = “Gold”;   
// the icon associated with this item will be the second image in lsImageList            
Item2.ImageIndex = 1;                    
listbox.Items.Add( item1 );

//set the first one as default selected
listbox.SelectedIndex = 0;

§      Members
1)  public bool ShowIcon { get; set; }               
Remarks
Get or set the flag which controls whether to show the icon for each item.

§      Methods
1)  public void UpdateImage(
int nImageIndex,
ref Image newImage )             
Parameters
nImageIndex
Type: int
The index of the image which is going to be replaced.

newImage
Type: Image
The new image.

Remarks
Replace the image with newImage.

2)  public void ResetImageList()               
Remarks
Clear the image list.

3)  public void SetImageList(
ref ImageList lsImageList )              
Remarks
Set the image list that contains the image displayed on this listbox. If user uses this call to set the image list, then user should free the resource allocated in lsImageList themself

4)  public ImageList GetImageList()            
Remarks
Get the image list that contains the image displayed on this listbox.

5)  public int AddImage(
Icon icon)             
Parameters
icon
Type: Icon
The icon which is going to be added into the image list.

Return
It returns the index of icon.

Remarks
Add icon into the image list that contains the image displayed on this listbox. It returns the index of icon.

6)  public int AddImage(
Image image)                 
Parameters
image
Type: Image
The image which is going to be added into the image list.

Return
It returns the index of image.

Remarks
Add image into the image list that contains the image displayed on this listbox. It returns the index of image.

7)  public virtual void SelecteThisOneOnly(
int nIndex)                 
Parameters
nIndex
Type: int
The index of the item which will be the only selected item.

Remarks
Make sure that the nIndex item is the only one selected.


Download Free Trial,

LinsFontComboBox class of LinsUI Layout Manager 2.1

It is a customized ComboBox object; it owns all ComboBox features. This combobox will automatically load all the FontFamily members into the list.
Examples

§      Methods
1)  public void SetSelection(
object fontname )            
Parameters
fontname
Type: object
The font which will be selected.

Remarks
Set the fontname as the selected item.

LinsColorComboBox class of LinsUI Layout Manager 2.1

It is a customized ComboBox object; it owns all ComboBox features. This combobox will automatically load all the KnownColor into the list.
Examples

§      Members
1)  public KnownColor SelectedColor { get; }               
Remarks
Get the selected known color.

§      Methods
1)  public void SetSelection(
KnownColor color )                 
Parameters
color
Type: KnownColor
The color which will be selected.

Remarks
Set the color as the selected item.

LinsCheckedListBox class of LinsUI Layout Manager 2.1

It is a customized ListBox object with a check box beside the selected item; it owns all ListBox features.
Examples
The following example shows how to create a LinsCheckedListBox object.

// lsImageList is an extend reference
ImageList lsImageList;

// Create a listbox object
LinsCheckedListBox listbox = new LinsCheckedListBox();
// Set the listbox’s image list to an existed image list
listbox.ImageList = lsImageList;

listbox.Items.Clear();

// Create a list item
LinsCheckedListItem item1 = new LinsCheckedListItem();
// This item is checked
Item1.CheckState = CheckState.Checked;   
Item1.ID = 1;
// item text
Item1.Text = “Red”;
// the icon associated with this item will be the first image in lsImageList                  
Item1.ImageIndex = 0;                    
listbox.Items.Add( item1 );
           
// Create second list item
LinsCheckedListItem item2 = new LinsCheckedListItem();
// This item is unchecked
Item2.CheckState = CheckState.Unchecked; 
Item2.ID = 2;
// item text
Item2.Text = “Gold”;                     
// the icon associated with this item will be the second image in lsImageList
Item2.ImageIndex = 1;                    
listbox.Items.Add( item1 );

//set the first one as default selected
listbox.SelectedIndex = 0;

§      Members
1)  public ImageList ImageList { get; set; }               
Remarks
Get or set the image list that contains the image displayed on this listbox.

§      Methods
1)  public virtual int InsertBySort(
ref LinsCheckedListItem item )            
Parameters
item
Type: LinsCheckedListItem
The item which is going to be inserted into the listbox.

Return
It returns the index of item.

Remarks
Insert item into the listbox. It will be sorted automatically.

2)  public void Select(
int nStartIndex,
int nEndIndex )
Parameters
nStartIndex
Type: int
The start index of the items which will be selected.

nEndIndex
Type: int
The end index of the items which will be selected.

Remarks
Select all items between nStartIndex and nEndIndex.