/* ----------------------------------------------------------------------------- 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 cbDesttroyEdit()= 0;; fun cbCloseEdit(p)= let p -> [ctrlobjname ctrlenable ctrlfpsbased ctrlrotx ctrlroty ctrlrotz] in let getEdCtrlTextLineValue ctrlobjname -> objname in let getEdCtrlCheckState ctrlenable -> enable in let getEdCtrlCheckState ctrlfpsbased -> fpsbased in let getEdCtrlFloatValue ctrlrotx -> rotx in let getEdCtrlFloatValue ctrlroty -> roty in let getEdCtrlFloatValue ctrlrotz -> rotz in ["object" objname]:: ["enable" itoa enable]:: ["fpsbased" itoa fpsbased]:: ["rotx" ftoa rotx]:: ["roty" ftoa roty]:: ["rotz" ftoa rotz]:: nil;; fun cbSelectObj(val, type, p)= let p -> [inst winstr viewstr ctrlobjname] in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) val -> obj in if (obj != nil) || (!strcmpi "Current camera" val) || (!strcmpi "Current camera shell" val) then ( setEdCtrlTextLineValue ctrlobjname val; ) else nil; 0;; fun cbCloseRes(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbBtnPickObj(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlobjname objname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeGroup|iTypeNode|iTypeLight|iTypeCamera|iTypeEntity|iTypeParticle|iTypeBone objname mkfun3 @cbSelectObj [inst winstr viewstr ctrlobjname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [420 160] -> [iw ih] in ( setEdWindowSize winstr iw ih; let (getPluginInstanceParam inst "object") -> objname in let atof (getPluginInstanceParam inst "rotx") -> rotx in let atof (getPluginInstanceParam inst "roty") -> roty in let atof (getPluginInstanceParam inst "rotz") -> rotz in let if rotx == nil then 0.0 else rotx -> rotx in let if roty == nil then 0.0 else roty -> roty in let if rotz == nil then 0.0 else rotz -> rotz in let atoi (getPluginInstanceParam inst "fpsbased") -> fpsbased in let if fpsbased == nil then 0 else fpsbased -> fpsbased in let atoi (getPluginInstanceParam inst "enable") -> enable in let if enable == nil then 0 else enable -> enable in let crEdCtrlLabel winstr 10 12 160 20 (loc "OS3DROTATE_0005") nil -> labelobj in let crEdCtrlTextLine winstr 180 10 140 20 objname nil EDWIN_RESIZE_MW -> ctrlobjname in let crEdCtrlButton winstr 325 10 55 20 "..." nil -> pickbtn in let crEdCtrlButton winstr 385 10 35 20 "X" nil -> refreshobjname in let crEdCtrlLabel winstr 10 37 160 20 (loc "OS3DROTATE_0006") nil -> labelposx in let crEdCtrlFloat winstr 180 35 100 20 rotx (-.360.0) 360.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlrotx in let crEdCtrlLabel winstr 10 62 160 20 (loc "OS3DROTATE_0007") nil -> labelposy in let crEdCtrlFloat winstr 180 60 100 20 roty (-.360.0) 360.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlroty in let crEdCtrlLabel winstr 10 87 160 20 (loc "OS3DROTATE_0008") nil -> labelposz in let crEdCtrlFloat winstr 180 85 100 20 rotz (-.360.0) 360.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlrotz in let crEdCtrlCheck winstr 10 110 280 20 (loc "OS3DROTATE_0004") EDWIN_RESIZE_MW -> ctrlfpsbased in let crEdCtrlCheck winstr 10 135 280 20 (loc "OS3DROTATE_0003") EDWIN_RESIZE_MW -> ctrlenable in ( setEdCtrlCheckState ctrlfpsbased fpsbased; setEdCtrlCheckState ctrlenable enable; setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlobjname objname]; setEdCtrlTextLineEnable ctrlobjname 0; setEdCtrlButtonCb refreshobjname mkfun2 @cbRefreshBtn [ctrlobjname]; [mkfun1 @cbCloseEdit [ctrlobjname ctrlenable ctrlfpsbased ctrlrotx ctrlroty ctrlrotz] @cbDesttroyEdit]; ); );;