/* ----------------------------------------------------------------------------- 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 -> [ctrlradiochar ctrlsep ctrloccurence ctrlorder ctrlradionb ctrlnb] in let getEdCtrlRadioState ctrlradionb -> mode in let getEdCtrlTextLineValue ctrlsep -> sep in let ftoi getEdCtrlFloatValue ctrloccurence -> occurence in let getSelectedEdCtrlSelectPos ctrlorder -> order in let ftoi getEdCtrlFloatValue ctrlnb -> number in ["mode" itoa mode]:: ["sep" sep]:: ["occurence" itoa occurence]:: ["order" itoa order]:: ["number" itoa number]:: nil;; fun cbRadioMode(ctrlradio, state, p)= if (!state) then nil else let p -> [id ctrlradio2 labelsep ctrlsep labeloccurence ctrloccurence labelnb ctrlnb] in ( setEdCtrlRadioState ctrlradio2 0; setEdCtrlLabelEnable labelsep !id; setEdCtrlEditTextEnable ctrlsep !id; setEdCtrlLabelEnable labeloccurence !id; setEdCtrlFloatEnable ctrloccurence !id; setEdCtrlLabelEnable labelnb id; setEdCtrlFloatEnable ctrlnb id; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 160] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let atoi (getPluginInstanceParam inst "mode") -> mode in let if (mode == nil) then 0 else mode -> mode in let (getPluginInstanceParam inst "sep") -> sep in let if (sep == nil) then ";" else sep -> sep in let atoi (getPluginInstanceParam inst "occurence") -> occurence in let if (occurence == nil) then 1 else occurence -> occurence in let atoi (getPluginInstanceParam inst "order") -> order in let if (order == nil) then 0 else order -> order in let atoi (getPluginInstanceParam inst "number") -> number in let if (number == nil) then 1 else number -> number in let crEdCtrlRadio winstr 10 (set ypos = 10) 280 20 (loc "OS3DSTRINGSEPARATE_0001") EDWIN_RESIZE_MW -> ctrlradiochar in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 200 20 (loc "OS3DSTRINGSEPARATE_0002") nil -> labelsep in let crEdCtrlTextLine winstr 220 ypos 100 20 sep nil nil -> ctrlsep in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 200 20 (loc "OS3DSTRINGSEPARATE_0003") nil -> labeloccurence in let crEdCtrlFloat winstr 220 ypos 100 20 (itof occurence) 1.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrloccurence in let crEdCtrlRadio winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DSTRINGSEPARATE_0005") EDWIN_RESIZE_MW -> ctrlradionb in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 200 20 (loc "OS3DSTRINGSEPARATE_0006") nil -> labelnb in let crEdCtrlFloat winstr 220 ypos 100 20 (itof number) 1.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnb in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 200 20 (loc "OS3DSTRINGSEPARATE_0004") nil -> labelorder in let crEdCtrlSelect winstr 220 ypos 100 120 EDWIN_RESIZE_MW -> ctrlorder in ( setEdCtrlRadioCbState ctrlradiochar mkfun3 @cbRadioMode [0 ctrlradionb labelsep ctrlsep labeloccurence ctrloccurence labelnb ctrlnb]; setEdCtrlRadioCbState ctrlradionb mkfun3 @cbRadioMode [1 ctrlradiochar labelsep ctrlsep labeloccurence ctrloccurence labelnb ctrlnb]; if (mode == 0) then ( setEdCtrlRadioState ctrlradiochar 1; cbRadioMode ctrlradiochar 1 [0 ctrlradionb labelsep ctrlsep labeloccurence ctrloccurence labelnb ctrlnb]; ) else ( setEdCtrlRadioState ctrlradionb (mode == 1); cbRadioMode ctrlradionb 1 [1 ctrlradiochar labelsep ctrlsep labeloccurence ctrloccurence labelnb ctrlnb]; ); fillEdCtrlSelect ctrlorder (loc "OS3DSTRINGSEPARATE_0007")::(loc "OS3DSTRINGSEPARATE_0008")::nil; selectEdCtrlSelectByPos ctrlorder order; [mkfun1 @cbCloseEdit [ctrlradiochar ctrlsep ctrloccurence ctrlorder ctrlradionb ctrlnb] nil]; ); );;