/* ----------------------------------------------------------------------------- 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 -> [ctrltitle ctrlmessage ctrltype ctrlenable] in let getEdCtrlTextLineValue ctrltitle -> title in let getEdCtrlEditTextValue ctrlmessage -> message in let getSelectedEdCtrlSelect ctrltype -> type in let itoa getEdCtrlCheckState ctrlenable -> enable in ["title" title]:: ["message" message]:: ["type" type]:: ["enable" enable]:: nil;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 180] -> [iw ih] in ( setEdWindowSize winstr iw ih; let (getPluginInstanceParam inst "title") -> title in let if title == nil then "Info" else title -> title in let (getPluginInstanceParam inst "message") -> message in let (getPluginInstanceParam inst "type") -> type in let if title == nil then "Ok" else type -> type in let atoi (getPluginInstanceParam inst "enable") -> enable in let if enable == nil then 1 else enable -> enable in let crEdCtrlLabel winstr 10 12 160 20 (loc "OS3DDIALOGBOX_0007") nil -> labeltitle in let crEdCtrlTextLine winstr 180 10 200 20 title nil EDWIN_RESIZE_MW -> ctrltitle in let crEdCtrlLabel winstr 10 37 160 20 (loc "OS3DDIALOGBOX_0001") nil -> labeltype in let crEdCtrlSelect winstr 180 35 200 120 EDWIN_RESIZE_MW -> ctrltype in let crEdCtrlLabel winstr 10 62 (iw - 20) 20 (loc "OS3DDIALOGBOX_0004") nil -> labelmessage in let crEdCtrlEditText winstr 10 80 (iw - 20) 60 message nil EDWIN_RESIZE_MW -> ctrlmessage in let crEdCtrlCheck winstr 10 150 280 20 (loc "OS3DDIALOGBOX_0002") EDWIN_RESIZE_MW -> ctrlenable in ( setEdCtrlCheckState ctrlenable enable; fillEdCtrlSelect ctrltype "Ok"::"Ok/Cancel"::"Yes/No"::nil; selectEdCtrlSelect ctrltype type; [mkfun1 @cbCloseEdit [ctrltitle ctrlmessage ctrltype ctrlenable] nil]; ); );;