//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : seldrag.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: Slect drag list // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // Project Object Structure // oSelectDrag is a zf_dbModalPanel // oOK_btn is a Button // oCancel_btn is a Button // oList is a List // Register all objects Register_Object oCancel_btn Register_Object oList Register_Object oOK_btn Register_Object oSelectDrag Use DFAllEnt.pkg Object oSelectDrag is a ModalPanel #IF (!@ >= 140) Set pbSizeToClientArea to False #ENDIF property integer invoking_object_id public 0 Set Label to "Select Drag/Drop Method" Set Size to 94 181 Set Location to 6 7 Object oList is a List Set Size to 70 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 'TD_DRAG_CONTROL' send Add_item 0 'TD_DRAG_FIELDS' send add_item 0 'TD_DRAG_CONTAINER_CONTROL' end_procedure End_Object // oList Object oOK_btn is a Button Set Label to "OK" Set Location to 7 119 set default_state to true Procedure onClick integer ho imax iItem 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 if '+' in sVal move ('(' + sVal + ')') to sVal set value of (invoking_object_id(self)) item 0 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 ' ' replace '(' in sval with '' replace ')' in sVal with '' 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 Procedure popup integer hFoc get focus to hFoc set invoking_object_id to hFoc send fill_list to (oList(self)) forward send popup End_Procedure End_Object // oSelectDrag