/* ----------------------------------------------------------------------------- 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 ctrlokbtn ctrlcancelbtn ctrlmultiline ctrltext theltselector ctrlvalign ctrlhalign ctrlopacity ctrlfadespeed ctrlshow] in let getEdCtrlTextLineValue ctrltitle -> title in let getEdCtrlTextLineValue ctrlokbtn -> okbtn in let getEdCtrlTextLineValue ctrlcancelbtn -> cancelbtn in let getEdCtrlCheckState ctrlmultiline -> multiline in let getEdCtrlEditTextValue ctrltext -> text in let getThemeEltSelectorSave theltselector -> thdefsave in let itoa getSelectedEdCtrlSelectPos ctrlvalign -> valign in let itoa getSelectedEdCtrlSelectPos ctrlhalign -> halign in let ftoi getEdCtrlFloatValue ctrlopacity -> opacity in let ftoi getEdCtrlFloatValue ctrlfadespeed -> fadespeed in let getEdCtrlCheckState ctrlshow -> show in ["title" title]:: ["okbtn" okbtn]:: ["cancelbtn" cancelbtn]:: ["multiline" itoa multiline]:: ["text" text]:: ["valign" valign]:: ["halign" halign]:: ["opacity" itoa opacity]:: ["fadespeed" itoa fadespeed]:: ["show" itoa show]:: thdefsave;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 480] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let getPluginInstanceParam inst "title" -> title in let if title == nil then "" else title -> title in let getPluginInstanceParam inst "okbtn" -> okbtn in let if (okbtn == nil) then "" else okbtn -> okbtn in let getPluginInstanceParam inst "cancelbtn" -> cancelbtn in let if (cancelbtn == nil) then "" else cancelbtn -> cancelbtn in let atoi (getPluginInstanceParam inst "multiline") -> multiline in let if (multiline == nil) then 0 else multiline -> multiline in let getPluginInstanceParam inst "text" -> text in let if (text == nil) then "" else text -> text in let atoi (getPluginInstanceParam inst "valign") -> valign in let if valign == nil then 1 else valign -> valign in let atoi (getPluginInstanceParam inst "halign") -> halign in let if halign == nil then 1 else halign -> halign in let atoi (getPluginInstanceParam inst "opacity") -> opacity in let if (opacity == nil) then 100 else opacity -> opacity in let atoi (getPluginInstanceParam inst "fadespeed") -> fadespeed in let if (fadespeed == nil) then 0 else fadespeed -> fadespeed in let atoi (getPluginInstanceParam inst "show") -> show in let if (show == nil) then 1 else show -> show in let crEdFrameWindow _channel ewinstr 0 0 iw 110 EDWIN_RESIZE_MW nil (loc "OS3DDTEXTINPUT_0004") (loc "OS3DDTEXTINPUT_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 85 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DDTEXTINPUT_0005") nil -> labeltitle in let crEdCtrlTextLine winstr 180 ypos 170 20 title nil EDWIN_RESIZE_MW -> ctrltitle in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DDTEXTINPUT_0006") nil -> labelok in let crEdCtrlTextLine winstr 180 ypos 170 20 okbtn nil EDWIN_RESIZE_MW -> ctrlokbtn in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DDTEXTINPUT_0007") nil -> labelcancel in let crEdCtrlTextLine winstr 180 ypos 170 20 cancelbtn nil EDWIN_RESIZE_MW -> ctrlcancelbtn in let crEdFrameWindow _channel ewinstr 0 0 iw 210 EDWIN_RESIZE_MW nil (loc "OS3DDTEXTINPUT_0008") (loc "OS3DDTEXTINPUT_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 185 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DDTEXTINPUT_0009") EDWIN_RESIZE_MW -> ctrlmultiline in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DDTEXTINPUT_0010") nil -> labeltext in let crEdCtrlEditText winstr 10 (set ypos = ypos + 25) iw-20 120 text nil EDWIN_RESIZE_MW -> ctrltext in let crThemeEltSelector inst ewinstr nil "dialogBox"::"common/editText"::nil iw ih -> theltselector in let crEdFrameWindow _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DDTEXTINPUT_0003") (loc "OS3DDTEXTINPUT_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 170 20 (loc "OS3DDTEXTINPUT_0017") nil -> labelvalign in let crEdCtrlSelect winstr 180 ypos 100 120 EDWIN_RESIZE_MW -> ctrlvalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DDTEXTINPUT_0018") nil -> labelhalign in let crEdCtrlSelect winstr 180 ypos 100 120 EDWIN_RESIZE_MW -> ctrlhalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DDTEXTINPUT_0011") nil -> labelo in let crEdCtrlFloat winstr 180 ypos 100 20 itof opacity 0.0 100.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlopacity in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DDTEXTINPUT_0019") nil -> labelf in let crEdCtrlFloat winstr 180 ypos 100 20 itof fadespeed 0.0 1000.0 10.0 0 nil EDWIN_RESIZE_MW -> ctrlfadespeed in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DDTEXTINPUT_0001") EDWIN_RESIZE_MW -> ctrlshow in ( setEdCtrlCheckState ctrlmultiline multiline; fillEdCtrlSelect ctrlvalign (loc "OS3DDTEXTINPUT_0015")::(loc "OS3DDTEXTINPUT_0013")::(loc "OS3DDTEXTINPUT_0016")::nil; selectEdCtrlSelectByPos ctrlvalign valign; fillEdCtrlSelect ctrlhalign (loc "OS3DDTEXTINPUT_0012")::(loc "OS3DDTEXTINPUT_0013")::(loc "OS3DDTEXTINPUT_0014")::nil; selectEdCtrlSelectByPos ctrlhalign halign; setEdCtrlCheckState ctrlshow show; [mkfun1 @cbCloseEdit [ctrltitle ctrlokbtn ctrlcancelbtn ctrlmultiline ctrltext theltselector ctrlvalign ctrlhalign ctrlopacity ctrlfadespeed ctrlshow] nil]; ); );;