Online Help
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.
The text you want displayed on your button. For example, "Ok" or "Cancel".
How you want to align the text (Left, Center, Right).
The type of button you want this to be (Regular or Toggle).
Fires when the WinButton is clicked.
Fires when the WinButton gets page focus.
Fires when the WinButton has focus and a key is pressed.
WinButton.GetState
WinButton.GetText
WinButton.SetState
WinButton.SetText
Returns the current up/down state of a WinButton.
(string) The name of the WinButton object.
(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.
-- 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
Returns the text displayed on a WinButton.
(string) The name of the WinButton object.
(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.
-- 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");
Returns the up/down state of a WinButton.
(string) The name of the WinButton object.
(number) The state you want to set the WinButton to.
Nothing. You can use Application.GetLastError() to determine whether this action failed, and why.
-- 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
Sets the text to be displayed on a WinButton object.
(string) The name of the WinButton object.
(string) The text you want to display.
Nothing. You can use Application.GetLastError() to determine whether this action failed, and why.
-- 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
0 | - | (no error) | |
---|---|---|---|
1100 | - | The specified object could not be found. |
Indigo Rose Corporation
support.indigorose.com
The WinButton Object Plugin is copyright © 2003-2006 Indigo Rose Software Design Corporation.
Copyright © 2003-2006 Indigo Rose Software Design Corporation.
All Rights Reserved.