/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun cbCloseEdit(p)= let p -> [ctrlanimname1 ctrlanimname2 ctrlspeed] in let getEdCtrlTextLineValue ctrlanimname1 -> animname1 in let getEdCtrlTextLineValue ctrlanimname2 -> animname2 in let getEdCtrlFloatValue ctrlspeed -> speed in ["anim1" animname1]:: ["anim2" animname2]:: ["speed" ftoa speed]:: nil;; fun cbSelectObj(val, type, p)= let p -> [inst winstr viewstr ctrlanimname] in let V3DgetDefaultSession viewstr -> sessionstr in let V3DgetAnimationByName sessionstr val -> anim in if anim == nil then nil else ( setEdCtrlTextLineValue ctrlanimname val; ); 0;; fun cbCloseRes(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbBtnPickObj(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlanimname animname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeAnim animname mkfun3 @cbSelectObj [inst winstr viewstr ctrlanimname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let getPluginInstanceUserEvents inst -> levent in let [420 125] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "anim1") -> animname1 in let (getPluginInstanceParam inst "anim2") -> animname2 in let atof (getPluginInstanceParam inst "speed") -> speed in let if speed == nil then 1.0 else speed -> speed in let crEdFrameWindow _channel ewinstr 0 0 iw 115 EDWIN_RESIZE_MW nil (loc "OS3DANIMATIONTRANSITION_0001") (loc "OS3DANIMATIONTRANSITION_0003") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 85 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DANIMATIONTRANSITION_0002") nil -> labelobj1 in let crEdCtrlTextLine winstr 180 ypos 140 20 animname1 nil EDWIN_RESIZE_MW -> ctrlanimname1 in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn1 in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshanimname1 in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DANIMATIONTRANSITION_0004") nil -> labelobj2 in let crEdCtrlTextLine winstr 180 ypos 140 20 animname2 nil EDWIN_RESIZE_MW -> ctrlanimname2 in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn2 in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshanimname2 in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 160 20 (loc "OS3DANIMATIONTRANSITION_0005") nil -> labelspeed in let crEdCtrlFloat winstr 180 ypos 100 20 speed 0.0 1000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlspeed in ( setEdCtrlButtonCb pickbtn1 mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlanimname1 animname1]; setEdCtrlButtonCb pickbtn2 mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlanimname2 animname2]; setEdCtrlTextLineEnable ctrlanimname1 0; setEdCtrlTextLineEnable ctrlanimname2 0; setEdCtrlButtonCb refreshanimname1 mkfun2 @cbRefreshBtn [ctrlanimname1]; setEdCtrlButtonCb refreshanimname2 mkfun2 @cbRefreshBtn [ctrlanimname2]; [mkfun1 @cbCloseEdit [ctrlanimname1 ctrlanimname2 ctrlspeed] nil]; ); );;