Advanced JavaScript Library
 
 
 
System.Controls.ControlStrip
Home > Documentation > 3.0 Controls > System.Controls.ControlStrip
Developed by Exbos Limited.

Summary
An control strip alows controls to be grouped together and automatically arranged along a strip in either vertical or horizontal format. The class contains helper functions for quickly creating tool bars. The following layout modes are supported by the control: LAYOUT_VERTICAL (0) LAYOUT_HORIZONTAL (1) LAYOUT_SPRING_VERTICAL (2) LAYOUT_SPRING_HORIZONTAL (3) LAYOUT_FIT_VERTICAL (4) LAYOUT_FIT_HORIZONTAL (5)

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set layout mode
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetLayout(controlStripExample.LAYOUT_HORIZONTAL);

// Add some buttons
controlStripExample.AddToolBarButton("New", "%THEME%/Images/New.png");
Methods
Initialize GetLayout SetLayout GetPadding SetPadding ArrangeLayout AddToolBarButton AddToolBarTextButton AddToolBarSeperator SuspendLayout ResumeLayout

Events
This class has no events.


Initialize ()

Summary
The Initialize method is supported by all controls that inherit from the System.Controls.Control class. The method performs the actual creation of the control and the attachment to the document object model. The call is often overridden by its child classes to perform any additional object initialization that might be required.

Parameters
This method has no parameters.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();
GetLayout ()

Summary
Gets the current layout mode applied to the control.

Parameters
This method has no parameters.

Return Value
The current layout mode applied by the control.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Get layout mode
System.Messagebox("Default Layout Mode", controlStripExample.GetLayout();
SetLayout (layoutMode)

Summary
Sets the layout mode applied to the control and performs a rearrange.

Parameters
Parameter Description
layoutMode The layout mode to applied on the strip.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set layout mode
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetLayout(controlStripExample.LAYOUT_HORIZONTAL);
GetPadding ()

Summary
Gets the current padding applied around controls on the strip.

Parameters
This method has no parameters.

Return Value
The current padding in pixels applied by the control.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Get padding
System.Messagebox("Default Padding", controlStripExample.GetPadding();
SetPadding (iPadding)

Summary
Sets the padding applied to the control and performs a rearrange.

Parameters
Parameter Description
iPadding The padding applied to controls on the strip.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set padding
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetPadding(8);
ArrangeLayout ()

Summary
Forces a rearrange of the controls on the strip. This is normally done when a new control is added or an existing control is resized.

Parameters
This method has no parameters.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Force arrange
controlStripExample.ArrangeLayout();
AddToolBarButton (sText, sImageUrl, delgateAction, sClass, sHoverClass)

Summary
Provides a helper function to quickly add a button onto the control strip making it easy to create a standard look and feel toolbar.

Parameters
Parameter Description
sText The text displayed when the button is hovered.
sImageUrl The url of an image to display on the button.
delgateAction Optional function to call when the button is clicked.
sClass Optionally override the default css class for the button.
sHoverClass Optionally override the hover css class for the button.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set layout mode
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetLayout(controlStripExample.LAYOUT_HORIZONTAL);

// Add some buttons
controlStripExample.AddToolBarButton("New", "%THEME%/Images/New.png");
AddToolBarTextButton (sText, sImageUrl, delgateAction, sDescription, sClass, sHoverClass)

Summary
Provides a helper function to quickly add a button with adjacent text onto the control strip making it easy to create a standard look and feel toolbar with text and tooltips.

Parameters
Parameter Description
sText The text displayed when the button is hovered.
sImageUrl The url of an image to display on the button.
delgateAction Optional function to call when the button is clicked.
sDescription Optional description to display in the tooltip.
sClass Optionally override the default css class for the button.
sHoverClass Optionally override the hover css class for the button.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set layout mode
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetLayout(controlStripExample.LAYOUT_HORIZONTAL);

// Add some buttons
controlStripExample.AddToolBarTextButton("New", "%THEME%/Images/New.png", null, "My Description");
AddToolBarSeperator ()

Summary
Provides a helper function to quickly add a seperator between buttons onto the control strip making it easy to create a standard look and feel toolbar with divided sections.

Parameters
This method has no parameters.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Set layout mode
controlStripExample.Move(0, 0);
controlStripExample.Resize(512, 24);
controlStripExample.SetLayout(controlStripExample.LAYOUT_HORIZONTAL);

// Add buttons and a seperator
controlStripExample.AddToolBarButton("New", "%THEME%/Images/New.png");
controlStripExample.AddToolBarSeperator();
controlStripExample.AddToolBarButton("Cut", "%THEME%/Images/Cut.png");
SuspendLayout ()

Summary
Prevents the arrange layout event from being thrown when a resize occurs or a new control is added. This can be used to improve performance when adding a large number of controls.

Parameters
This method has no parameters.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Suspend layout
controlStripExample.SuspendLayout();

// Add controls

// Suspend layout
controlStripExample.ResumeLayout();
ResumeLayout ()

Summary
Causes the arrange layout event to resume being thrown when a resize occurs or a new control is added. This can be used to improve performance when adding a large number of controls.

Parameters
This method has no parameters.

Return Value
This method does not return a value.

Example
var controlStripExample;

// Create Command Strip
controlStripExample = System.CreateObject("System.Controls.ControlStrip");
controlStripExample.Initialize();

// Suspend layout
controlStripExample.SuspendLayout();

// Add controls

// Suspend layout
controlStripExample.ResumeLayout();
 
Shopping Basket
Your shopping basket is currently empty.
 
 
RSS Feed   Powered By Commerce Cloud
This site is powered by the Commerce Cloud Engine. Copyright (c) 2009 Exbos Limited. All Rights Reserved. SiteMap   Cookie Policy
Web site design and layout by Exbos Ltd. Copyright (c) 2010 Exbos Ltd. All Rights Reserved.
Commerce Cloud provides multiple e-commerce sites with full product support