/* ----------------------------------------------------------------------------- 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 -> [ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxalign ctrlyalign ctrldistance ctrllevel ctrlctransparent ctrlinit] in let ftoi getEdCtrlFloatValue ctrlposx -> posx in let ftoi getEdCtrlFloatValue ctrlposy -> posy in let ftoi getEdCtrlFloatValue ctrlwidth -> width in let ftoi getEdCtrlFloatValue ctrlheight -> height in let getEdCtrlCheckState ctrlxpercent -> xpercent in let getEdCtrlCheckState ctrlypercent -> ypercent in let getEdCtrlCheckState ctrlwpercent -> wpercent in let getEdCtrlCheckState ctrlhpercent -> hpercent in let getSelectedEdCtrlSelectPos ctrlxalign -> xalign in let getSelectedEdCtrlSelectPos ctrlyalign -> yalign in let getEdCtrlFloatValue ctrldistance -> distance in let getEdCtrlFloatValue ctrllevel -> level in let getEdCtrlCheckState ctrlctransparent -> transparent in let getEdCtrlCheckState ctrlinit -> init in ["posx" itoa posx]:: ["posy" itoa posy]:: ["width" itoa width]:: ["height" itoa height]:: ["xpercent" itoa xpercent]:: ["ypercent" itoa ypercent]:: ["wpercent" itoa wpercent]:: ["hpercent" itoa hpercent]:: ["xalign" itoa xalign]:: ["yalign" itoa yalign]:: ["transparent" itoa transparent]:: ["distance" ftoa distance]:: ["level" ftoa level]:: ["init" itoa init]:: 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) 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 iTypeCamera objname mkfun3 @cbSelectObj [inst winstr viewstr ctrlobjname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [430 210] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let atoi (getPluginInstanceParam inst "xpercent") -> xpercent in let if xpercent == nil then 0 else xpercent -> xpercent in let atoi (getPluginInstanceParam inst "xalign") -> xalign in let if xalign == nil then 0 else xalign -> xalign in let atoi (getPluginInstanceParam inst "posx") -> posx in let if posx == nil then 0 else posx -> posx in let atoi (getPluginInstanceParam inst "ypercent") -> ypercent in let if ypercent == nil then 0 else ypercent -> ypercent in let atoi (getPluginInstanceParam inst "yalign") -> yalign in let if yalign == nil then 0 else yalign -> yalign in let atoi (getPluginInstanceParam inst "posy") -> posy in let if posy == nil then 0 else posy -> posy in let atoi (getPluginInstanceParam inst "wpercent") -> wpercent in let if wpercent == nil then 0 else wpercent -> wpercent in let atoi (getPluginInstanceParam inst "width") -> width in let if width == nil then 320 else width -> width in let atoi (getPluginInstanceParam inst "hpercent") -> hpercent in let if hpercent == nil then 0 else hpercent -> hpercent in let atoi (getPluginInstanceParam inst "height") -> height in let if height == nil then 200 else height -> height in let atof (getPluginInstanceParam inst "distance") -> distance in let if distance == nil then 10.0 else distance -> distance in let atof (getPluginInstanceParam inst "level") -> level in let if level == nil then 2.0 else level -> level in let atoi (getPluginInstanceParam inst "transparent") -> transparent in let if transparent == nil then 1 else transparent -> transparent in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in let crEdCtrlLabel winstr 10 (ypos + 2) 160 20 (loc "OS3DMINIMAP_0009") nil -> labelx in let crEdCtrlFloat winstr 180 ypos 100 20 itof posx (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlposx in let crEdCtrlCheck winstr 290 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlxpercent in let crEdCtrlSelect winstr 335 ypos 95 120 EDWIN_RESIZE_MW -> ctrlxalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMINIMAP_0010") nil -> labely in let crEdCtrlFloat winstr 180 ypos 100 20 itof posy (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlposy in let crEdCtrlCheck winstr 290 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlypercent in let crEdCtrlSelect winstr 335 ypos 95 120 EDWIN_RESIZE_MW -> ctrlyalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMINIMAP_0014") nil -> labelw in let crEdCtrlFloat winstr 180 ypos 100 20 itof width 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwidth in let crEdCtrlCheck winstr 290 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlwpercent in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMINIMAP_0007") nil -> labelh in let crEdCtrlFloat winstr 180 ypos 100 20 itof height 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlheight in let crEdCtrlCheck winstr 290 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlhpercent in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMINIMAP_0002") nil -> labeld in let crEdCtrlFloat winstr 180 ypos 100 20 distance 0.0 10000.0 0.1 5 nil EDWIN_RESIZE_MW -> ctrldistance in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMINIMAP_0003") nil -> labeld in let crEdCtrlFloat winstr 180 ypos 100 20 level 0.0 10000.0 0.1 5 nil EDWIN_RESIZE_MW -> ctrllevel in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMINIMAP_0013") EDWIN_RESIZE_MW -> ctrlctransparent in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMINIMAP_0005") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrlxalign (loc "OS3DMINIMAP_0008")::(loc "OS3DMINIMAP_0004")::(loc "OS3DMINIMAP_0011")::nil; fillEdCtrlSelect ctrlyalign (loc "OS3DMINIMAP_0012")::(loc "OS3DMINIMAP_0004")::(loc "OS3DMINIMAP_0001")::nil; selectEdCtrlSelectByPos ctrlxalign xalign; selectEdCtrlSelectByPos ctrlyalign yalign; setEdCtrlCheckState ctrlctransparent transparent; setEdCtrlCheckState ctrlinit init; setEdCtrlCheckState ctrlxpercent xpercent; setEdCtrlCheckState ctrlypercent ypercent; setEdCtrlCheckState ctrlwpercent wpercent; setEdCtrlCheckState ctrlhpercent hpercent; [mkfun1 @cbCloseEdit [ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxalign ctrlyalign ctrldistance ctrllevel ctrlctransparent ctrlinit] nil]; ); );;