//AB/ Project Choose field //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Choose field" //AB/ Set ProjectFileName to "ChooseField.dg" //AB/ Set GenerateFileName to "NONAME" //AB/ Set Size to 356 236 // Project Object Structure // oChooseField is a ModalPanel // oFieldList is a List // oOK_btn is a Button // oCancel_btn is a Button // Register all objects Register_Object oCancel_btn Register_Object oChooseField Register_Object oFieldList Register_Object oOK_btn //AB-IgnoreStart Use Windows.pkg //AB-IgnoreEnd Object oChooseField is a ModalPanel Set Border_Style to Border_Thick Set Label to "Choose field" Set Location to 2 2 Set Size to 152 152 Set piMaxSize to 294 152 Set piMinSize to 152 152 //AB-DDOStart //AB-DDOEnd Object oFieldList is a List Set Size to 104 135 Set Location to 4 6 Set peAnchors to anAll //AB-StoreStart On_Key kEnter Send keyAction of oOK_btn Procedure DoFillList Integer iAntalFelter iItem iField iListItem iFieldtype Integer iOldState iStartField String sFieldname Get dynamic_update_state to iOldState Set dynamic_update_state to False Send cursor_wait of cursor_control Send Delete_data Set piChoosedField to 0 // Fill the list by sending Add_item Get pDataNumFields to iAntalFelter Get FirstFieldnumber to iStartField For iItem From iStartField to iAntalFelter Move iItem to iField Get String_value of aFilDef Item (iField * 4) to sFieldname Get integer_value of aFildef Item ((iField * 4) + 1) to iFieldType If (iFieldType <> DF_OVERLAP) Begin Send Add_Item Msg_None sFieldname Get item_count to iListItem Decrement iListItem Set aux_value Item iListItem to iField End Loop Send Sort_Items ascending Set dynamic_update_state to iOldState Send cursor_ready of cursor_control End_Procedure // DoFillList // Send DoFillList // message must be sent to fill the list //Procedure OnChange // Integer iCurrent // // Get Current_Item To iCurrent // item number of current item //End_Procedure // OnChange //AB-StoreEnd End_Object // oFieldList Object oOK_btn is a Button Set Label to "&OK" Set Location to 112 15 Set peAnchors to anBottomRight //AB-StoreStart Procedure OnClick Integer iItem iField String sField Get current_item of oFieldList to iItem Get value of oFieldList Item iItem to sField Get aux_value of oFieldList Item iItem to iField Set piChoosedField to iField Set pValgtFelt to sField Send Close_Panel End_Procedure // OnClick //AB-StoreEnd End_Object // oOK_btn Object oCancel_btn is a Button Set Label to "&Cancel" Set Location to 112 81 Set peAnchors to anBottomRight //AB-StoreStart Procedure OnClick Send Close_Panel End_Procedure // OnClick //AB-StoreEnd End_Object // oCancel_btn //AB-StoreStart On_Key kCancel Send close_panel Procedure Activate_group Set visible_state to False Forward Send Activate_group Set piChoosedField to -1 Set pValgtFelt to "" Send DoFillList of oFieldList Set visible_state to True End_Procedure //AB-StoreEnd End_Object // oChooseField //AB-StoreStart //AB-StoreEnd //AB/ End_Object // prj