/* ----------------------------------------------------------------------------- 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 ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxalign ctrlyalign /*ctrlkeyboard ctrlmouse*/ ctrlbg ctrlcompositor ctrlccolor ctrlcdepth ctrlisbuffer ctrlscreenindex ctrlinit] in let getEdCtrlTextLineValue ctrlobjname -> objname 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 getEdCtrlColorButtonColor ctrlbg -> bgcolor in let getSelectedEdCtrlSelect ctrlcompositor -> compositor in //let getEdCtrlCheckState ctrlkeyboard -> enablekeyboard in //let getEdCtrlCheckState ctrlmouse -> enablemouse in let getEdCtrlCheckState ctrlccolor -> ccolor in let getEdCtrlCheckState ctrlcdepth -> cdepth in let getEdCtrlCheckState ctrlisbuffer -> isbuffer in let ftoi getEdCtrlFloatValue ctrlscreenindex -> screenindex in let getEdCtrlCheckState ctrlinit -> init in ["camera" objname]:: ["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]:: ["bgcolor" itoa bgcolor]:: ["compositor" (if !strcmp compositor "none" then nil else compositor)]:: //["enablekeyboard" itoa enablekeyboard]:: //["enablemouse" itoa enablemouse]:: ["ccolor" itoa ccolor]:: ["cdepth" itoa cdepth]:: ["isbuffer" itoa isbuffer]:: ["screenindex" itoa screenindex]:: ["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 cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 430] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "camera") -> objname in 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 atoi (getPluginInstanceParam inst "enablekeyboard") -> enablekeyboard in let if enablekeyboard == nil then 1 else enablekeyboard -> enablekeyboard in let atoi (getPluginInstanceParam inst "enablemouse") -> enablemouse in let if enablemouse == nil then 1 else enablemouse -> enablemouse in let atoi (getPluginInstanceParam inst "ccolor") -> ccolor in let if ccolor == nil then 1 else ccolor -> ccolor in let atoi (getPluginInstanceParam inst "cdepth") -> cdepth in let if cdepth == nil then 1 else cdepth -> cdepth in let atoi (getPluginInstanceParam inst "bgcolor") -> bgcolor in let if bgcolor == nil then 0 else bgcolor -> bgcolor in let (getPluginInstanceParam inst "compositor") -> compositor in let atoi (getPluginInstanceParam inst "isbuffer") -> isbuffer in let if isbuffer == nil then 0 else isbuffer -> isbuffer in let atoi (getPluginInstanceParam inst "screenindex") -> screenindex in let if screenindex == nil then 0 else screenindex -> screenindex in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in let crEdFrameWindow _channel ewinstr 0 0 iw 55 EDWIN_RESIZE_MW nil (loc "OS3DVIEWPORT_0004") (loc "OS3DVIEWPORT_0014") -> 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) 170 20 (loc "OS3DVIEWPORT_0003") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 170 20 objname nil EDWIN_RESIZE_MW -> ctrlobjname in let crEdCtrlButton winstr 360 ypos 55 20 "..." nil -> pickbtn in let crEdCtrlButton winstr 420 ypos 35 20 "X" nil -> refreshobjname in let crEdFrameWindow _channel ewinstr 0 0 iw 135 EDWIN_RESIZE_MW nil (loc "OS3DVIEWPORT_0020") (loc "OS3DVIEWPORT_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 115 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DVIEWPORT_0017") 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 120 120 EDWIN_RESIZE_MW -> ctrlxalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DVIEWPORT_0018") 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 120 120 EDWIN_RESIZE_MW -> ctrlyalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DVIEWPORT_0025") 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 "OS3DVIEWPORT_0012") 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 crEdFrameWindow _channel ewinstr 0 0 iw 135 EDWIN_RESIZE_MW nil (loc "OS3DVIEWPORT_0024") (loc "OS3DVIEWPORT_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 115 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DVIEWPORT_0022") EDWIN_RESIZE_MW -> ctrlccolor in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DVIEWPORT_0001") nil -> labelobj in let crEdCtrlColorButton winstr 180 ypos 100 20 bgcolor 1 EDWIN_RESIZE_MW nil -> ctrlbg in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DVIEWPORT_0023") nil -> labelobj in let crEdCtrlSelect winstr 180 ypos (iw - 190) 120 CB_AHSCROLL -> ctrlcompositor in //let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DVIEWPORT_0010") EDWIN_RESIZE_MW -> ctrlkeyboard in //let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DVIEWPORT_0011") EDWIN_RESIZE_MW -> ctrlmouse in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DVIEWPORT_0006") EDWIN_RESIZE_MW -> ctrlcdepth in let crEdFrameWindow _channel ewinstr 0 0 iw 110 EDWIN_RESIZE_MW nil (loc "OS3DVIEWPORT_0015") (loc "OS3DVIEWPORT_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 90 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DVIEWPORT_0007") EDWIN_RESIZE_MW -> ctrlisbuffer in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DVIEWPORT_0016") nil -> labelmonitor in let crEdCtrlFloat winstr 180 ypos 100 20 itof screenindex 0.0 7.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlscreenindex in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DVIEWPORT_0008") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrlxalign (loc "OS3DVIEWPORT_0013")::(loc "OS3DVIEWPORT_0005")::(loc "OS3DVIEWPORT_0019")::nil; fillEdCtrlSelect ctrlyalign (loc "OS3DVIEWPORT_0021")::(loc "OS3DVIEWPORT_0005")::(loc "OS3DVIEWPORT_0002")::nil; selectEdCtrlSelectByPos ctrlxalign xalign; selectEdCtrlSelectByPos ctrlyalign yalign; setEdCtrlCheckState ctrlccolor ccolor; setEdCtrlCheckState ctrlcdepth cdepth; setEdCtrlCheckState ctrlisbuffer isbuffer; setEdCtrlCheckState ctrlinit init; //setEdCtrlCheckState ctrlkeyboard enablekeyboard; //setEdCtrlCheckState ctrlmouse enablemouse; setEdCtrlCheckState ctrlxpercent xpercent; setEdCtrlCheckState ctrlypercent ypercent; setEdCtrlCheckState ctrlwpercent wpercent; setEdCtrlCheckState ctrlhpercent hpercent; let V3DgetDefaultSession viewstr -> sessionstr in let lcat (V3DgetDefaultCompositorsList sessionstr) (SO3SceneParseCompositorsFromGroup (V3DgetSession sessionstr) inst.INST_groupstr.GRP_sName) -> lcomps in fillEdCtrlSelect ctrlcompositor "none"::lcomps; if compositor == nil then nil else selectEdCtrlSelect ctrlcompositor compositor; setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlobjname objname]; setEdCtrlTextLineEnable ctrlobjname 0; setEdCtrlButtonCb refreshobjname mkfun2 @cbRefreshBtn [ctrlobjname]; [mkfun1 @cbCloseEdit [ctrlobjname ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxalign ctrlyalign /*ctrlkeyboard ctrlmouse*/ ctrlbg ctrlcompositor ctrlccolor ctrlcdepth ctrlisbuffer ctrlscreenindex ctrlinit] @cbDestroyEdit]; ); );;