WinButton Object Plugin

Description

The WinButton plugin object that allows you to include standard Windows-style buttons in your application. This allows you to present simple Windows buttons to your users that they are used to working with in many of their Windows applications. The button will even take on the Windows XP look according to the user's system settings on Windows XP.

Properties

Text

The text you want displayed on your button. For example, "Ok" or "Cancel".

Alignment

How you want to align the text (Left, Center, Right).

Type

The type of button you want this to be (Regular or Toggle).

Events

On Click

Fires when the WinButton is clicked.

On Focus

Fires when the WinButton gets page focus.

On Key

Fires when the WinButton has focus and a key is pressed.

Actions

WinButton.GetState
WinButton.GetText
WinButton.SetState
WinButton.SetText

number WinButton.GetState(string ObjectName)

Description:

Returns the current up/down state of a WinButton.

ObjectName:

(string) The name of the WinButton object.

Returns:

(number) The state of the WinButton:

0  (BTN_UP) - Button is up (normal).
1  (BTN_DOWN) - Button is down (pressed).

If an error occurs, -1 will be returned. You can also use Application.GetLastError to determine whether this action failed, and why.

Example:

-- Get the current state of WinButton1
nCurrentState = WinButton.GetState("WinButton1");
-- Check to see if any errors occurred calling the WinButton.GetState action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
 Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
-- Display a dialog if the button is up if nCurrentState == 0 then
 Dialog.Message("", "The WinButton is UP!!!! UP IT IS!!!");
end

string WinButton.GetText(string ObjectName)

Description:

Returns the text displayed on a WinButton.

ObjectName:

(string) The name of the WinButton object.

Returns:

(string) The text that is currently displayed on the WinButton object. If an error occurs, a blank string ("") will be returned. You can use Application.GetLastError to determine whether this action failed, and why.

Example:

-- Retrieve the current text from WinButton1
sWinButtonText = WinButton.GetText("WinButton1");
-- Check to see if any errors occurred calling the WinButton.GetState action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
 Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
-- Output the current winbutton text to the debug window Debug.Print("WinButtonText: " .. sWinButtonText .. "\r\n");

WinButton.SetState(string ObjectName, number State = BTN_UP)

Description:

Returns the up/down state of a WinButton.

ObjectName:

(string) The name of the WinButton object.

State:

(number) The state you want to set the WinButton to.

Returns:

Nothing. You can use Application.GetLastError() to determine whether this action failed, and why.

Example:

-- Set the state of WinButton1 to 'down'
WinButton.SetState("WinButton1", BTN_DOWN);
-- Check to see if any errors occurred calling the WinButton.SetState action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
 Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end

WinButton.SetText(string ObjectName, string Text)

Description:

Sets the text to be displayed on a WinButton object.

ObjectName:

(string) The name of the WinButton object.

Text:

(string) The text you want to display.

Returns:

Nothing. You can use Application.GetLastError() to determine whether this action failed, and why.

Example:

-- Set the text of WinButton1 to 'I am a button!!!'
WinButton.SetText("WinButton1", "I am a button!!!");
-- Check to see if any errors occurred calling the WinButton.SetText action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
 Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end

Error Codes

0  -(no error)
1100  -The specified object could not be found.

Change Log

1.0.2.0

1.0.1.0

1.0.0.1

1.0.0.0

Additional Information

Author:

Indigo Rose Corporation
support.indigorose.com

Copyright:

The WinButton Object Plugin is copyright © 2003-2006 Indigo Rose Software Design Corporation.

Website:

http://www.indigorose.com


Copyright © 2003-2006 Indigo Rose Software Design Corporation.
All Rights Reserved.