/* ----------------------------------------------------------------------------- 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 getEvents(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 = ["EVENT" elem]::ndata; set i = i + 1; ); ndata; );; fun cbCloseEdit(p)= let p -> [ctrlevent ctrlfirst] in let getEdCtrlListElems ctrlevent -> levent in let getEdCtrlCheckState ctrlfirst -> firstword in ["firstword" (itoa firstword)]:: (getEvents levent);; fun cbAddActEvnt(ctrlstr, value, p)= let p -> [liststr ctrladdevent] in let strtrim value -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems liststr -> lelem in if (isStringInList lelem value) then nil else ( addEdCtrlList liststr value nil nil; setEdCtrlTextLineValue ctrlstr nil; ); 0;; fun cbAddList(ctrlstr, p)= let p -> [liststr ctrladdevent] in let strtrim (getEdCtrlTextLineValue ctrladdevent) -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems liststr -> lelem in if (isStringInList 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 150] -> [iw ih] in let 0 -> ypos in ( setEdWindowSize winstr iw ih; let getPluginInstanceUserEvents inst -> levent in let atoi (getPluginInstanceParam inst "firstword") -> firstword in let if firstword == nil then 0 else firstword -> firstword in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlevent 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 "OS3DSWITCHCASE_0001") EDWIN_RESIZE_MW -> ctrlfirst in ( setEdCtrlButtonCb ctrlbtnadd1 mkfun2 @cbAddList [ctrlevent ctrladdevent]; setEdCtrlButtonCb ctrlbtndel1 mkfun2 @cbDelList [ctrlevent ctrladdevent]; setEdCtrlTextLineCbValidate ctrladdevent mkfun3 @cbAddActEvnt [ctrlevent ctrladdevent]; setEdCtrlCheckState ctrlfirst firstword; fillEdCtrlList ctrlevent levent; [mkfun1 @cbCloseEdit [ctrlevent ctrlfirst] nil]; ); );;