/* ----------------------------------------------------------------------------- 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 cbDestroyEdit()= 0;; fun cbCloseEdit(p)= let p -> [ctrlobjname ctrlmsize ctrlenable ctrltrack] in let getEdCtrlTextLineValue ctrlobjname -> objname in let getEdCtrlFloatValue ctrlmsize -> msize in let getEdCtrlCheckState ctrlenable -> enable in let getEdCtrlCheckState ctrltrack -> track in ["object" objname]:: ["msize" ftoa msize]:: ["enable" itoa enable]:: ["track" itoa track]:: 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 iTypeEntity|iTypeNode|iTypeLight|iTypeCamera|iTypeParticle|iTypeBone|iTypeCubeMap objname mkfun3 @cbSelectObj [inst winstr viewstr ctrlobjname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbRefreshBtnFile(pickbtn, p)= let p -> [inst winstr ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [430 165] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "object") -> objname in let atof (getPluginInstanceParam inst "msize") -> msize in let if (msize == nil) then 0.08 else msize -> msize in let atoi (getPluginInstanceParam inst "enable") -> enable in let if enable == nil then 1 else enable -> enable in let atoi (getPluginInstanceParam inst "track") -> track in let if track == nil then 1 else track -> track in let crEdFrameWindow _channel ewinstr 0 0 iw 55 EDWIN_RESIZE_MW nil (loc "OS3DARFACETRACKER_0005") (loc "OS3DARFACETRACKER_0007") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 35 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DARFACETRACKER_0006") nil -> labelmsize in let crEdCtrlFloat winstr 180 ypos 100 20 msize 0.0 1000000.0 0.01 3 nil EDWIN_RESIZE_MW -> ctrlmsize in let crEdCtrlLabel winstr 285 (ypos + 2) 140 20 (loc "OS3DARFACETRACKER_0010") nil -> labelmsize2 in let crEdFrameWindow _channel ewinstr 0 0 iw 110 EDWIN_RESIZE_MW nil (loc "OS3DARFACETRACKER_0009") (loc "OS3DARFACETRACKER_0007") -> 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 "OS3DARFACETRACKER_0008") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 140 20 objname nil EDWIN_RESIZE_MW -> ctrlobjname in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshbtn in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DARFACETRACKER_0004") EDWIN_RESIZE_MW -> ctrlenable in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DARFACETRACKER_0003") EDWIN_RESIZE_MW -> ctrltrack in ( setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlobjname objname]; setEdCtrlTextLineEnable ctrlobjname 0; setEdCtrlButtonCb refreshbtn mkfun2 @cbRefreshBtnFile [inst winstr ctrlobjname]; setEdCtrlCheckState ctrlenable enable; setEdCtrlCheckState ctrltrack track; [(mkfun1 @cbCloseEdit [ctrlobjname ctrlmsize ctrlenable ctrltrack]) @cbDestroyEdit]; ); );;