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

Summary
A simple button control directly representing a BUTTON element but exposing all methods of the base Control classes. The button control handles themed hover states automatically. By sub classing the label control class the button provides significant extra functionality above the normal element such as anchoring and dragging. Text can be set or retrieved via the SetText and GetText elements of the Label base class.

Example
var buttonExample;

// Create Button
buttonExample = System.CreateObject("System.Controls.Button");
buttonExample.Initialize();
buttonExample.Move(0, 0);
buttonExample.Resize(128, 24);
buttonExample.SetText("My Button");
Methods
Initialize SetHoverClass GetHoverClass SetImageUrl

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 buttonExample;

// Create Button
buttonExample = System.CreateObject("System.Controls.Button");
buttonExample.Initialize();
SetHoverClass (sClass)

Summary
The SetHoverClass method changes the CSS class used when the user hovers over the button. To set the class when not hovered use the SetClass method of the base control class. The button class automatically handles the changing of hover and non-hover classes by attaching to control events.

Parameters
Parameter Description
sClass The css class to be used when the user hovers over the button.

Return Value
This method does not return a value.

Example
var buttonExample;

// Create Button
buttonExample = System.CreateObject("System.Controls.Button");
buttonExample.Initialize();

// Change hover class
buttonExample.SetHoverClass("MyButtonCssClass");
GetHoverClass ()

Summary
The GetHoverClass method returns the Css class currently set to activate when the user hovers over the button. To get the class when not hovered use the GetClass method of the base control class. The button class automatically handles the changing of hover and non-hover classes by attaching to control events.

Parameters
This method has no parameters.

Return Value
The current css class set to be used when the user hovers over the button.

Example
var buttonExample;

// Create Button
buttonExample = System.CreateObject("System.Controls.Button");
buttonExample.Initialize();

// Show hover class
System.MessageBox("My Button", buttonExample.GetHoverClass());
SetImageUrl (sImageUrl)

Summary
The SetImageUrl method changes the background-image css style of the button instance. This is mainly used for toolbar buttons to reduce the number of css classes required in a Cheiron theme.

Parameters
Parameter Description
sImageUrl The url of the image to apply to the button's background.

Return Value
This method does not return a value.

Example
var buttonExample;

// Create Button
buttonExample = System.CreateObject("System.Controls.Button");
buttonExample.Initialize();

// Change image
buttonExample.SetImageUrl("/Images/MyImage.png");
 
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 the e-commerce platform built for flexibility