Ciao avevo un problemin con uno script di drag & drop molto semplice
in pratica nella SUB GetTarget mi servirebbe di prendere le coordinate interne al contenitore del drop attraverso un target per droppare gli item tutti nello stesso posto scelto
sulla guida di easy uo l'unica soluzione che ho trovato è mettere le coordinate a mano
grazie x le risposte
Zio Fex
codice:
; Script Sposta_Item by Fex gosub SelectContainerDrag gosub SelectItem gosub SelectContainerDrop gosub GetTarget mainloop: gosub spostaitem goto mainloop SUB GetTarget NAMESPACE push NAMESPACE local GetTarget set %xposition 40 set %yposition 70 RETURN #result SUB SelectItem NAMESPACE push NAMESPACE local SelectItem SET #LTARGETID N/A DISPLAY OK Please select the item type you want to drag. SET #TARGCURS 1 _SelectItem_ReCheckClick: IF #TARGCURS = 1 GOTO _SelectItem_ReCheckClick FINDITEM #LTARGETID SET %item #FINDTYPE SET #RESULT %item RETURN #RESULT SUB SelectContainerDrag NAMESPACE push NAMESPACE local CavsSelectContainer SET !containertypes CKF_LKF_ZJF_JIF_HIF_KIF_IIF_CUD_HKF_VMF_ +BUD_WMF_TMF_UMF_KKF_ZTD_ABG_CTD_AUD_SPF_ +JKF_OKF_OVH_KUD_JIF_HIF_IIF_KIF_KIR_JIR_DYM_ SET #LTARGETID N/A DISPLAY OK Please select your drag container. SET #TARGCURS 1 SelectContainerDrag_ReCheckClick: IF #TARGCURS = 1 GOTO SelectContainerDrag_ReCheckClick FINDITEM #LTARGETID IF #FINDTYPE notin !containertypes { DISPLAY YESNO This is not a valid container. $ +Would you like to re-target your container? IF #DISPRES = YES { SET #TARGCURS = 1 GOTO SelectContainerDrag_ReCheckClick } IF #DISPRES = NO { SET #RESULT #FALSE GOTO SelectContainerDrag_Done } } SET %container_risorse #FINDID SET #RESULT %container_risorse SET #LOBJECTID %container_risorse WAIT 10 EVENT macro 17 0 WAIT 10 SelectContainerDrag_Done NAMESPACE pop RETURN #RESULT SUB SelectContainerDrop NAMESPACE push NAMESPACE local CavsSelectContainer SET !containertypes CKF_LKF_ZJF_JIF_HIF_KIF_IIF_CUD_HKF_VMF_ +BUD_WMF_TMF_UMF_KKF_ZTD_ABG_CTD_AUD_SPF_ +JKF_OKF_OVH_KUD_JIF_HIF_IIF_KIF_KIR_JIR_DYM_ SET #LTARGETID N/A DISPLAY OK Please select your drop container. SET #TARGCURS 1 SelectContainerDrop_ReCheckClick: IF #TARGCURS = 1 GOTO SelectContainerDrop_ReCheckClick FINDITEM #LTARGETID IF #FINDTYPE notin !containertypes { DISPLAY YESNO This is not a valid container. $ +Would you like to re-target your container? IF #DISPRES = YES { SET #TARGCURS = 1 GOTO SelectContainerDrop_ReCheckClick } IF #DISPRES = NO { SET #RESULT #FALSE GOTO SelectContainerDrop_Done } } SET %container_drop #FINDID SET #RESULT %container_drop SET #LOBJECTID %container_drop WAIT 10 EVENT macro 17 0 WAIT 10 SelectContainerDrop_Done NAMESPACE pop RETURN #RESULT SUB spostaitem _spostaitem_ReSearch: FINDITEM %item C_ , %container_risorse IF #FINDKIND <> -1 { EXEVENT Drag #FINDID #FINDSTACK WAIT 10 EXEVENT Dropc %container_drop %xposition %yposition WAIT 10 SET #RESULT #TRUE GOTO _spostaitem_ReSearch } IF #FINDKIND = - 1 { DISPLAY OK Hai finito di spostare gli oggetti halt } goto mainloop RETURN
sulla guida di easy uo l'unica soluzione che ho trovato è mettere le coordinate a mano
grazie x le risposte
Zio Fex
Commenta