Use Windows.pkg
Use dfCmbFrm.pkg

Object oColumnProps is a ModalPanel

    Enum_List
        Define COLUMNPROPS_CANCEL
        Define COLUMNPROPS_OK
        Define COLUMNPROPS_NEW
        Define COLUMNPROPS_DELETE
    End_Enum_List

    Property Integer piSelectedFunction
    Set Label to "Column properties"
    Set Location to 2 2
    // Visual DataFlex 14.0 Client Size Adjuster, modified May 7, 2008: 13:11:31
//    Set Size to 132 277
    Set Size to 114 274
    // Visual DataFlex 14.0 Client Size Adjuster, modified May 7, 2008: 13:11:31
//    Set piMinSize to 104 217




    Object oName is a Form
        Set Label to "Name:"
        Set Size to 13 85
        Set Location to 5 70
        Set Capslock_State to TRUE

        //OnChange is called on every changed character
        //Procedure OnChange
        //    String sValue
        //
        //    Get Value To sValue
        //End_Procedure // OnChange

    End_Object    // oName

    Object oType is a ComboForm
        Set Label to "Type:"
        Set Size to 13 85
        Set Location to 23 70
        Set Form_Border to 0
        Set Entry_State Item 0 to FALSE
        Set Combo_Sort_State to FALSE

        //Class is defined in dfCmbFrm.pkg

        //Combo_Fill_List is called when the list needs filling
        Procedure Combo_Fill_List
            // Fill the combo list with Send Combo_Add_Item
            Send Combo_Add_Item "ASCII"
            Send Combo_Add_Item "NUMERIC"
            Send Combo_Add_Item "DATE"
            Send Combo_Add_Item "OVERLAP"
            Send Combo_Add_Item "TEXT"
            Send Combo_Add_Item "BINARY"
        End_Procedure // Combo_Fill_List

        //OnChange is called on every changed character
        Procedure OnChange
            String sValue

            Get Value to sValue // the current selected item
            Set Enabled_state of oOffset to (sValue = "OVERLAP")
            Set Enabled_state of oPrecision to (sValue = "NUMERIC")
            Set Enabled_state of oLength to (sValue <> "DATE")

        End_Procedure // OnChange

        //Notification that the list has dropped down
        //Procedure OnDropDown
        //End_Procedure // OnDropDown

        //Notification that the list was closed
        //Procedure OnCloseUp
        //End_Procedure // OnCloseUp

    End_Object    // oType

    Object oLength is a Form
        Set Label to "Length:"
        Set Size to 13 56
        Set Location to 41 70
        Set Form_DataType to ascii_window

        //OnChange is called on every changed character
        //Procedure OnChange
        //    String sValue
        //
        //    Get Value To sValue
        //End_Procedure // OnChange



    End_Object    // oLength

    Object oPrecision is a Form
        Set Label to "Precision:"
        Set Size to 13 56
        Set Location to 58 70
        Set Form_DataType to ascii_window

        //OnChange is called on every changed character
        //Procedure OnChange
        //    String sValue
        //
        //    Get Value To sValue
        //End_Procedure // OnChange



    End_Object    // oPrecision

    Object oOffset is a Form
        Set Label to "Offset:"
        Set Size to 13 56
        Set Location to 76 70
        Set Form_DataType to ascii_window

        //OnChange is called on every changed character
        //Procedure OnChange
        //    String sValue
        //
        //    Get Value To sValue
        //End_Procedure // OnChange

    End_Object    // oOffset

    Object oOK_btn is a Button
        Set Label to "&OK"
        Set Size to 14 63
        Set Location to 97 138
        Set peAnchors to anBottomRight

        Procedure OnClick
            Set piSelectedFunction to COLUMNPROPS_OK
            Send Close_Panel
        End_Procedure // OnClick

    End_Object    // oOK_btn

    Object oCancel_btn is a Button
        Set Label to "&Cancel"
        Set Size to 14 63
        Set Location to 97 205
        Set peAnchors to anBottomRight

        Procedure OnClick
            Set piSelectedFunction to COLUMNPROPS_CANCEL
            Send Close_Panel
        End_Procedure // OnClick

    End_Object    // oCancel_btn

    Object oDelete is a Button
        Set Label to "Delete column"
        Set Size to 14 63
        Set Location to 97 71

        // fires when the button is clicked
        Procedure OnClick
            Integer iSvar
            Get yesno_box ("This will delete the current column!\n\nAre you sure?") "WARNING!" MB_DEFBUTTON2 to iSvar
            If (iSvar <> MBR_YES) Procedure_Return
            Set piSelectedFunction to COLUMNPROPS_DELETE
            Send Close_Panel
        End_Procedure // OnClick

    End_Object    // oDelete

    Object oNew is a Button
        Set Label to "As new column"
        Set Size to 14 63
        Set Location to 97 4

        // fires when the button is clicked
        Procedure OnClick
            Set piSelectedFunction to COLUMNPROPS_NEW
            Send Close_Panel
        End_Procedure // OnClick

    End_Object    // oNew



    Procedure Popup
        Set piSelectedFunction to COLUMNPROPS_CANCEL
        Forward Send Popup
    End_Procedure

End_Object    // oColumnProps