/* ----------------------------------------------------------------------------- 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 getActions(l)= let sizelist l -> size in let nil -> ndata in let 0 -> i in ( while i < size do ( let nth_list l i -> elem in set ndata = ["ACTION" elem]::ndata; set i = i + 1; ); ndata; );; fun cbCloseEdit(p)= let p -> [ctrlparams ctrladdtime ctrladdelapsedtime ctrlautostart] in let getEdCtrlCheckState ctrladdtime -> addtime in let getEdCtrlCheckState ctrladdelapsedtime -> addelapsedtime in let getEdCtrlListElems ctrlparams -> laction in let getEdCtrlCheckState ctrlautostart -> autostart in ["addtime" (itoa addtime)]:: ["addelapsedtime" (itoa addelapsedtime)]:: ["init" (itoa autostart)]:: (getActions laction);; fun cbAddActEvnt(ctrlstr, value, p)= let p -> [liststr ctrladdevent] in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems liststr -> lelem in if (isStringInListi lelem value) then nil else ( addEdCtrlList liststr value nil nil; setEdCtrlTextLineValue ctrlstr nil; ); 0;; fun cbAddList(ctrlstr, p)= let p -> [liststr ctrladdevent] in let getEdCtrlTextLineValue ctrladdevent -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems liststr -> lelem in if (isStringInListi lelem value) then nil else ( addEdCtrlList liststr value nil nil; setEdCtrlTextLineValue ctrladdevent nil; ); 0;; fun cbDelList(ctrlstr, p)= let p -> [liststr ctrladdevent] in let getSelectedEdCtrlList liststr -> [name _ _] in delEdCtrlList liststr name; 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 200] -> [iw ih] in let 0 -> ypos in ( setEdWindowSize winstr iw ih; let getPluginInstanceUserActions inst -> laction in let atoi (getPluginInstanceParam inst "addtime") -> addtime in let if addtime == nil then 0 else addtime -> addtime in let atoi (getPluginInstanceParam inst "addelapsedtime") -> addelapsedtime in let if addelapsedtime == nil then 0 else addelapsedtime -> addelapsedtime in let atoi (getPluginInstanceParam inst "init") -> autostart in let if autostart == nil then 1 else autostart -> autostart in let crEdCtrlLabel winstr 10 (set ypos = 10) + 2 170 20 (loc "OS3DLOGFILE_0001") nil -> label in let crEdCtrlList winstr 10 (set ypos = ypos + 25) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlparams in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 70) 20 nil nil EDWIN_RESIZE_MW -> ctrladdevent in let crEdCtrlButton winstr (iw - 55) ypos 20 20 "+" EDWIN_RESIZE_MW -> ctrlbtnadd1 in let crEdCtrlButton winstr (iw - 30) ypos 20 20 "-" EDWIN_RESIZE_MW -> ctrlbtndel1 in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLOGFILE_0002") EDWIN_RESIZE_MW -> ctrladdtime in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLOGFILE_0003") EDWIN_RESIZE_MW -> ctrladdelapsedtime in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLOGFILE_0004") EDWIN_RESIZE_MW -> ctrlautostart in ( setEdCtrlButtonCb ctrlbtnadd1 mkfun2 @cbAddList [ctrlparams ctrladdevent]; setEdCtrlButtonCb ctrlbtndel1 mkfun2 @cbDelList [ctrlparams ctrladdevent]; setEdCtrlTextLineCbValidate ctrladdevent mkfun3 @cbAddActEvnt [ctrlparams ctrladdevent]; setEdCtrlCheckState ctrladdtime addtime; setEdCtrlCheckState ctrladdelapsedtime addelapsedtime; setEdCtrlCheckState ctrlautostart autostart; fillEdCtrlList ctrlparams laction; [mkfun1 @cbCloseEdit [ctrlparams ctrladdtime ctrladdelapsedtime ctrlautostart] nil]; ); );;