//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : selgent.dg // $ProjectName : The Hammer 2.0 // $Authors : Wil van Antwerpen, Michael Kurz, Sergey V. Natarov, Bernhard Ponemayr // $Created : 01.25.2014 01:08 // $Type : LGPL // // Contents: Select Generate Type // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // Project Object Structure // oSelectDataType is a ModalPanel // oList is a List // oOK_btn is a Button // oCancel_btn is a Button // Register all objects Register_Object oCancel_btn Register_Object oList Register_Object oOK_btn Register_Object oSelectDataType Use DFAllEnt.pkg Object oSelectGenerateType is a ModalPanel #IF (!@ >= 140) Set pbSizeToClientArea to False #ENDIF property integer invoking_object_id public 0 Set Label to "Select Generate Type" Set Size to 125 181 Set Location to 6 7 Object oList is a List Set Size to 100 104 Set Location to 5 9 set select_mode to multi_select On_Key kCancel Send Close_Panel Procedure fill_list send delete_data send Add_item 0 'No_Visible' send add_item 0 'No_Generate' send add_item 0 'Always_Generate' send add_item 0 'No_Execute' send add_item 0 'Item' end_procedure End_Object // oList Object oOK_btn is a Button Set Label to "OK" Set Default_State to TRUE Set Location to 7 119 Procedure onClick integer ho imax iItem hoInv string sVal get oList to ho move (item_count(ho)-1) to imax For iItem From 0 to iMax if (select_state(ho, iItem)) Begin if sVal ne '' append sVal ' ' append sVal (value(ho, iItem)) End Loop get invoking_object_id to hoInv set value of hoInv item (current_item(hoInv)) to sVal send close_panel End_Procedure End_Object // oOK_btn Object oCancel_btn is a Button Set Label to "Cancel" Set Location to 25 119 Procedure onclick send close_panel End_Procedure End_Object // oCancel_btn Procedure popup integer hFoc iItem ho string sVal get focus to hFoc set invoking_object_id to hFoc get value of hFoc item (current_item(hFoc)) to sVal get oList to ho send fill_list to ho append sval ' ' repeat get item_matching of ho (left(sVal,(pos(' ',sVal)-1))) to iItem if iItem ne -1 begin set current_item of ho to iItem set select_state of ho item iItem to true end mid sVal to sVal (Length(sVal)-pos(' ', sVal)) (pos(' ',sVal)+1) until sval eq '' forward send popup End_Procedure End_Object // oSelectDataType