Monday, April 7, 2008 Tip of the Day #3: GROUPINDEX property for Speed Buttons
Section: Form Controls (Speed Buttons) Supported Versions: . R:BASE 7.6 (Build 7.6.3.30404 or higher) for Windows . R:BASE C/S:I 7.6 (Build 7.6.3.30404 or higher) for Windows . R:BASE Turbo (Build 8.0.17.30404 or higher) for Windows Did you know that you can group all Speed Buttons to determine how the buttons behave when clicked? You can use the new GROUPINDEX property for Speed Buttons to allows all speed buttons to work together as a group. Syntax: PROPERTY <SpeedButtonComponentID> GROUPINDEX nnnn You will need to set GROUPINDEX to determine how the button behaves when clicked. -- Example: PROPERTY <SpeedButtonOFF> GROUPINDEX 1000 PROPERTY <SpeedButtonON> GROUPINDEX 1000 PROPERTY <SpeedButtonOFF> DOWN 'TRUE' PROPERTY <SpeedButtonON> DOWN 'FALSE' When GROUPINDEX is 0, the button behaves independently of all other buttons on the form. When the user clicks such a speed button, the button appears pressed (in its clicked state) and then returns to its normal up state when the user releases the mouse button. When GROUPINDEX is greater than 0, the button remains selected (in its down state) when clicked by the user. When the user clicks a selected button, it returns to the up state, unless Caption is False. Setting the GROUPINDEX property of a single speed button to a value greater than 0 causes the button to behave as a two-state button when Caption is True. Speed buttons with the same GROUPINDEX property value (other than 0), work together as a group. When the user clicks one of these buttons, it remains selected until the user clicks another speed button belonging to the same group. Speed buttons used in this way can present mutually exclusive choices to the user. The option DOWN specifies whether the button is selected (down) or unselected (up). Set DOWN to determine whether a speed button is selected. The DOWN property only applies if the GROUPINDEX property of the button is nonzero. When GROUPINDEX is greater than 0, set DOWN to TRUE to select a button. When the user clicks on a button in the unselected (up) state, the button is selected and DOWN is set to TRUE. When the user clicks on a button in the selected (down) state, if Caption is True, the button becomes unselected and DOWN is set to FALSE. At design time, specify which button in a group is the initially selected button by setting the Down property of the selected button to TRUE. Note: When GROUPINDEX is 0, buttons do not remain in the selected state when clicked. Examples: http://www.rupdates.com/sat2008/samples/UsingGROUPINDEX_01.jpg http://www.rupdates.com/sat2008/samples/UsingGROUPINDEX_02.jpg http://www.rupdates.com/sat2008/samples/UsingGROUPINDEX_03.jpg http://www.rupdates.com/sat2008/samples/UsingGROUPINDEX_04.jpg A sample application to demonstrate the use of new GROUPINDEX property is also available at: 2008 SAT Sample Applications: http://www.rupdates.com/SAT2008/ Folder: \UsingGroupIndexPropertyForSpeedButtons Database: GrpIndex Form: GroupIndexProperty Command File: UsingGroupIndexPropertyForSpeedButtons.dat Very Best R:egards, Razzak.

