Class: SpinForm

Properties  Events  Methods    Index of Classes

Adds a spin button to a Form

Hierarchy

cObject
---cUIObject
------DfBaseObject
---------DfBaseWindow
------------DfBaseUIWindow
---------------DfBaseControl
------------------DfBaseList
---------------------DfBaseForm
------------------------Form
---------------------------SpinForm

Library: Windows Application Class Library

Package: Dfspnfrm.pkg

Mixins: SpinForm_Mixin

Description

SpinForm is used to add a spin button to a Form. Its purpose is to provide a form that users can edit, that displays an integer that can be "spun" through a range. The value can be manually changed by users in the form and the spin buttons will pick up the modified value, and resume spinning from that value.

The dbSpinForm class is a data-aware class similar to the SpinForm class.

Sample

Use DfSpnFrm.pkg
:
Object oSpinForm1 is a SpinForm
    set Location to 10 70
    set Size to 13 40
    set Label to "Spin 0-100:"
    Set Maximum_Position to 100
    Set Minimum_Position to 0
    Set Wrap_State to True
End_Object
 
Object oSpinForm2 is a SpinForm
    set Location to 25 90
    set Size to 13 70
    Set Value 0 to 'Open'
    Set Minimum_Position to 0
    Set Maximum_Position to 2
    Set Wrap_State to True
 
    Procedure Set Spin_Value integer iItem
        If (iItem = 0) ;
            Set Value to "Open"
        Else if (iItem = 1) ;
           Set Value to "Closed"
        Else if (iItem = 2) ;
            Set Value to "Cancelled"
    End_Procedure
 
    Function Spin_Value returns integer
        string sVal
        integer iRetVal

        Get Value to sVal
        If (sVal = "Open") ;
             Move 0 to iRetVal
        Else if (sVal = "Closed") ;
            Move 1 to iRetVal
        Else if (sVal = "Cancelled") ;
            Move 2 to iRetVal
        Function_Return iRetVal
    End_Function
End_Object


Syntax

Use DFSpnFrm
:
Object object_name is a SpinForm
    Set Size to height width
    Set Location to row column
    Set Value 0 to value
 
    Set Minimum_Position To MinValue
    Set Maximum_Position To MaxValue
    Set Wrap_State to To true|false
 
    Set Label to text
    Set Label_Justification_Mode to mode
    Set Label_Row_Offset to Num
    Set Label_Col_Offset to Num
 
    Set Form_DataType 0 to mode
    Set Form_Margin 0 to mode
    Set Form_Mask 0 to maskstring
    Set Numeric_Mask 0 to leftDigits rightDigits {template}
    Set Currency_Mask 0 to leftDigits rightDigits {template}
 
    Set Enabled_State to true|false
    Set Status_Help to text
 
    Procedure onChange
        :
    End_Procedure
 
    Procedure onSetFocus
        :
    End_Procedure
 
    Procedure onKillFocus
        :
    End_Procedure
 
End_Object


Note

You program the component as though it were a Form, but can set additional properties to define the behavior of the spin button. The behavior of the Form is not modified in any way by the addition of the spin button.

The spin button will appear as an integrated part of your form-it appears inside the form and is right-justified.

SpinButtons are capable of a maximum range of 32K, within the range ±32K. Both numbers and dates are automatically supported with this object. When used as a date, the ±32K range is relative to today's date. String values may also be supported, but will require the augmentation of the get and set Spin_Value messages to make this conversion.