/* ----------------------------------------------------------------------------- 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 getActionsList(nbinputs)= let nil -> actions in ( while (nbinputs > 0) do ( set nbinputs = nbinputs - 1; set actions = ["ACTION" (strcat "Input " (ctoa (65 + nbinputs)))]::actions; ); actions; );; fun cbCloseEdit(p)= let p -> [ctrlnbinputs ctrlformat ctrloutputmode ctrltimeinterval ctrlinit] in let ftoi getEdCtrlFloatValue ctrlnbinputs -> nbinputs in let getEdCtrlEditTextValue ctrlformat -> format in let getSelectedEdCtrlSelectPos ctrloutputmode -> outputmode in let getEdCtrlFloatValue ctrltimeinterval -> timeinterval in let getEdCtrlCheckState ctrlinit -> init in ["nbinputs" itoa nbinputs]:: ["format" format]:: ["outputmode" itoa outputmode]:: ["timeinterval" ftoa timeinterval]:: ["init" itoa init]:: (getActionsList nbinputs);; fun cbOutputModeSelect(ctrlstr, pos, name, p)= let p -> [labeltimeinterval ctrltimeinterval] in if (pos == 2) then ( setEdCtrlLabelEnable labeltimeinterval 1; setEdCtrlFloatEnable ctrltimeinterval 1; ) else ( setEdCtrlLabelEnable labeltimeinterval 0; setEdCtrlFloatEnable ctrltimeinterval 0; ); 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [440 290] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let atoi (getPluginInstanceParam inst "nbinputs") -> nbinputs in let if (nbinputs == nil) then 2 else nbinputs -> nbinputs in let getPluginInstanceParam inst "format" -> format in let if (format == nil) then "" else format -> format in let atoi (getPluginInstanceParam inst "outputmode") -> outputmode in let if (outputmode == nil) then 0 else outputmode -> outputmode in let atof (getPluginInstanceParam inst "timeinterval") -> timeinterval in let if (timeinterval == nil) then 1.0 else timeinterval -> timeinterval 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 "OS3DINPUTMIXER_0002") (loc "OS3DINPUTMIXER_0001") -> 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 "OS3DINPUTMIXER_0003") nil -> labelnbinputs in let crEdCtrlFloat winstr 190 ypos 100 20 (itof nbinputs) 2.0 26.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnbinputs in let crEdFrameWindow _channel ewinstr 0 0 iw 180 EDWIN_RESIZE_MW nil (loc "OS3DINPUTMIXER_0011") (loc "OS3DINPUTMIXER_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 160 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DINPUTMIXER_0004") nil -> labelformat in let crEdCtrlEditText winstr 10 (set ypos = ypos + 25) iw-10 70 format nil EDWIN_RESIZE_MW -> ctrlformat in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 75) + 2) 160 20 (loc "OS3DINPUTMIXER_0007") nil -> labeloutputmode in let crEdCtrlSelect winstr 190 ypos (iw - 190) 120 EDWIN_RESIZE_MW -> ctrloutputmode in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DINPUTMIXER_0012") nil -> labeltimeinterval in let crEdCtrlFloat winstr 190 ypos 100 20 timeinterval 1.0 1000000.0 1.0 3 nil EDWIN_RESIZE_MW -> ctrltimeinterval in let crEdFrameWindow _channel ewinstr 0 0 iw 55 EDWIN_RESIZE_MW nil (loc "OS3DINPUTMIXER_0005") (loc "OS3DINPUTMIXER_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 35 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DINPUTMIXER_0006") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrloutputmode (loc "OS3DINPUTMIXER_0008")::(loc "OS3DINPUTMIXER_0009")::(loc "OS3DINPUTMIXER_0010")::nil; selectEdCtrlSelectByPos ctrloutputmode outputmode; setEdCtrlSelectCb ctrloutputmode mkfun4 @cbOutputModeSelect [labeltimeinterval ctrltimeinterval]; cbOutputModeSelect ctrloutputmode outputmode nil [labeltimeinterval ctrltimeinterval]; setEdCtrlCheckState ctrlinit init; [(mkfun1 @cbCloseEdit [ctrlnbinputs ctrlformat ctrloutputmode ctrltimeinterval ctrlinit]) @cbDestroyEdit]; ); );;