/* ----------------------------------------------------------------------------- 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 -> [ctrlwinw ctrlwinh ctrldesksize ctrlresize ctrlborder ctrlcaption ctrldestroy ctrltitle] in let ftoi getEdCtrlFloatValue ctrlwinw -> width in let ftoi getEdCtrlFloatValue ctrlwinh -> height in let getEdCtrlCheckState ctrldesksize -> desksize in let getEdCtrlCheckState ctrlresize -> resize in let getEdCtrlCheckState ctrlborder -> border in let getEdCtrlCheckState ctrlcaption -> caption in let getEdCtrlCheckState ctrldestroy -> catchClose in let getEdCtrlTextLineValue ctrltitle -> title in ["width" itoa width]:: ["height" itoa height]:: ["desksize" itoa desksize]:: ["resize" itoa resize]:: ["border" itoa border]:: ["caption" itoa caption]:: ["catchClose" itoa catchClose]:: ["title" title]:: if (!catchClose) then nil else (["EVENT" "Closed"]::nil);; fun cbDeskSize(ctrl, state, p)= let p -> [ctrlwinw ctrlwinh] in ( setEdCtrlFloatEnable ctrlwinw !state; setEdCtrlFloatEnable ctrlwinh !state; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 240] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let atof (getPluginInstanceParam inst "width") -> width in let if width == nil then 800.0 else width -> width in let atof (getPluginInstanceParam inst "height") -> height in let if height == nil then 600.0 else height -> height in let atoi (getPluginInstanceParam inst "desksize") -> desksize in let if desksize == nil then 0 else desksize -> desksize in let atoi (getPluginInstanceParam inst "resize") -> resize in let if resize == nil then 1 else resize -> resize in let atoi (getPluginInstanceParam inst "border") -> border in let if border == nil then 1 else border -> border in let atoi (getPluginInstanceParam inst "caption") -> caption in let if caption == nil then 1 else caption -> caption in let atoi (getPluginInstanceParam inst "catchClose") -> catchClose in let if catchClose == nil then 0 else catchClose -> catchClose in let (getPluginInstanceParam inst "title") -> title in let crEdCtrlLabel winstr 10 ypos + 2 iw-20 20 (loc "OS3DMAINWINDOW_0006") nil -> warninglabel in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DMAINWINDOW_0009") nil -> labelwinw in let crEdCtrlFloat winstr 190 ypos 100 20 width 0.0 12000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwinw in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DMAINWINDOW_0007") nil -> labelwinh in let crEdCtrlFloat winstr 190 ypos 100 20 height 0.0 12000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwinh in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMAINWINDOW_0005") EDWIN_RESIZE_MW -> ctrldesksize in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMAINWINDOW_0001") EDWIN_RESIZE_MW -> ctrlresize in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMAINWINDOW_0003") EDWIN_RESIZE_MW -> ctrlborder in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMAINWINDOW_0004") EDWIN_RESIZE_MW -> ctrlcaption in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 160 20 (loc "OS3DMAINWINDOW_0008") nil -> labeltitle in let crEdCtrlTextLine winstr 180 ypos 200 20 title nil EDWIN_RESIZE_MW -> ctrltitle in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMAINWINDOW_0002") EDWIN_RESIZE_MW -> ctrldestroy in ( setEdCtrlCheckState ctrldesksize desksize; setEdCtrlCheckState ctrlresize resize; setEdCtrlCheckState ctrlborder border; setEdCtrlCheckState ctrlcaption caption; setEdCtrlCheckState ctrldestroy catchClose; if (!desksize) then nil else ( setEdCtrlFloatEnable ctrlwinw 0; setEdCtrlFloatEnable ctrlwinh 0; ); setEdCtrlCheckCbState ctrldesksize mkfun3 @cbDeskSize [ctrlwinw ctrlwinh]; [mkfun1 @cbCloseEdit [ctrlwinw ctrlwinh ctrldesksize ctrlresize ctrlborder ctrlcaption ctrldestroy ctrltitle] nil]; ); );;