Use Windows.pkg Use dfCmbFrm.pkg Use Structs\tsColumnProperties.pkg Enum_List Define COLUMNPROPS_CANCEL Define COLUMNPROPS_OK Define COLUMNPROPS_NEW Define COLUMNPROPS_DELETE End_Enum_List Object oColumnProps is a ModalPanel Property Integer piSelectedFunction Set Label to "Column properties" Set Location to 2 2 Set Size to 114 274 Object oName is a Form Set Label to "Name:" Set Size to 13 85 Set Location to 5 70 End_Object 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 Procedure Combo_Fill_List 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 Procedure OnChange String sValue Get Value to sValue 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 End_Object Object oLength is a Form Set Label to "Length:" Set Size to 13 56 Set Location to 41 70 End_Object Object oPrecision is a Form Set Label to "Precision:" Set Size to 13 56 Set Location to 58 70 End_Object Object oOffset is a Form Set Label to "Offset:" Set Size to 13 56 Set Location to 76 70 End_Object 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 End_Object 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 End_Object Object oDelete is a Button Set Label to "Delete column" Set Size to 14 63 Set Location to 97 71 Procedure OnClick Integer iAnswer Get YesNo_Box ("This will delete the current column!\n\nAre you sure?") "WARNING!" MB_DEFBUTTON2 to iAnswer If (iAnswer <> MBR_YES) Procedure_Return Set piSelectedFunction to COLUMNPROPS_DELETE Send Close_Panel End_Procedure End_Object Object oNew is a Button Set Label to "As new column" Set Size to 14 63 Set Location to 97 4 Procedure OnClick Set piSelectedFunction to COLUMNPROPS_NEW Send Close_Panel End_Procedure End_Object Function EditColumnProperties tsColumnProperties ByRef lsProps Returns Integer Integer iEditMode String sType Set piSelectedFunction to COLUMNPROPS_CANCEL Set Value of oName to lsProps.sName Get FieldTypeDescription lsProps.iType to sType Set Value of oType to sType Set Value of oLength to lsProps.iLength Set Value of oPrecision to lsProps.iPrecision Set Value of oOffset to lsProps.iOffset Set Label to (SFormat("Column properties for %1", lsProps.sName)) Send Popup Get piSelectedFunction to iEditMode If (iEditMode <> COLUMNPROPS_CANCEL) Begin Get Value of oName to lsProps.sName Move (Trim(lsProps.sName)) to lsProps.sName Get Value of oType to sType Get FieldType sType to lsProps.iType Get Value of oLength to lsProps.iLength Get Value of oPrecision to lsProps.iPrecision Get Value of oOffset to lsProps.iOffset End Function_Return iEditMode End_Function End_Object