/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2014 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 -> [ctrlfsize ctrlfcolor ctrlbcolor ctrllcolor ctrlvisibility ctrlautoscale ctrlmaxautoscaledist ctrltotal ctrlautosave ctrlshow ctrlontop ctrlinit] in let ftoi (getEdCtrlFloatValue ctrlfsize) -> fsize in let getEdCtrlColorButtonColor ctrlfcolor -> fcolor in let getEdCtrlColorButtonColor ctrlbcolor -> bcolor in let getEdCtrlColorButtonColor ctrllcolor -> lcolor in let getEdCtrlFloatValue ctrlvisibility -> visibility in let getEdCtrlCheckState ctrlautoscale -> autoscale in let getEdCtrlFloatValue ctrlmaxautoscaledist -> maxautoscaledist in let getEdCtrlCheckState ctrltotal -> totallength in let getEdCtrlCheckState ctrlautosave -> autosave in let getEdCtrlCheckState ctrlshow -> show in let getEdCtrlCheckState ctrlontop -> ontop in let getEdCtrlCheckState ctrlinit -> init in ["fontsize" itoa fsize]:: ["fontcolor" itoa fcolor]:: ["backgroundcolor" itoa bcolor]:: ["linecolor" itoa lcolor]:: ["visibility" ftoa visibility]:: ["autoscale" itoa autoscale]:: ["maxautoscaledist" ftoa maxautoscaledist]:: ["totallength" itoa totallength]:: ["autosave" itoa autosave]:: ["show" itoa show]:: ["ontop" itoa ontop]:: ["init" itoa init]:: nil;; fun cbAutoscale(ctrlstr, state, ctrlmaxautoscaledist)= setEdCtrlFloatEnable ctrlmaxautoscaledist state; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [420 360] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let atoi (getPluginInstanceParam inst "fontsize") -> fsize in let if fsize == nil then 9 else fsize -> fsize in let atoi (getPluginInstanceParam inst "fontcolor") -> fcolor in let if fcolor == nil then 0xffffff else fcolor -> fcolor in let atoi (getPluginInstanceParam inst "backgroundcolor") -> bcolor in let if bcolor == nil then 64 else bcolor -> bcolor in let atoi (getPluginInstanceParam inst "linecolor") -> lcolor in let if lcolor == nil then 0x0000ff else lcolor -> lcolor in let atof (getPluginInstanceParam inst "visibility") -> visibility in let if visibility == nil then 0.0 else visibility -> visibility in let atoi (getPluginInstanceParam inst "autoscale") -> autoscale in let if autoscale == nil then 1 else autoscale -> autoscale in let atof (getPluginInstanceParam inst "maxautoscaledist") -> maxautoscaledist in let if maxautoscaledist == nil then 10.0 else maxautoscaledist -> maxautoscaledist in let atoi (getPluginInstanceParam inst "totallength") -> totallength in let if totallength == nil then 0 else totallength -> totallength in let atoi (getPluginInstanceParam inst "autosave") -> autosave in let if autosave == nil then 0 else autosave -> autosave in let atoi (getPluginInstanceParam inst "show") -> show in let if show == nil then 1 else show -> show in let atoi (getPluginInstanceParam inst "ontop") -> ontop in let if ontop == nil then 1 else ontop -> ontop in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in let crEdFrameWindow _channel ewinstr 0 0 iw 230 EDWIN_RESIZE_MW nil (loc "OS3DMEASURE_0014") (loc "OS3DMEASURE_0016") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 210 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DMEASURE_0007") nil -> labelfsize in let crEdCtrlFloat winstr 180 ypos 60 20 (itof fsize) 1.0 1024.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlfsize in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMEASURE_0004") nil -> labelfcolor in let crEdCtrlColorButton winstr 180 ypos 100 20 fcolor 0 EDWIN_RESIZE_MW nil -> ctrlfcolor in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMEASURE_0008") nil -> labelbcolor in let crEdCtrlColorButton winstr 180 ypos 100 20 bcolor 1 EDWIN_RESIZE_MW nil -> ctrlbcolor in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMEASURE_0006") nil -> labellcolor in let crEdCtrlColorButton winstr 180 ypos 100 20 lcolor 0 EDWIN_RESIZE_MW nil -> ctrllcolor in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMEASURE_0011") nil -> labeldist in let crEdCtrlFloat winstr 180 ypos 60 20 visibility 0.0 1000000.0 0.1 2 nil EDWIN_RESIZE_MW -> ctrlvisibility in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMEASURE_0017") EDWIN_RESIZE_MW -> ctrlautoscale in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMEASURE_0018") nil -> labelmaxautoscaledist in let crEdCtrlFloat winstr 180 ypos 60 20 maxautoscaledist 0.0 1000000.0 0.1 2 nil EDWIN_RESIZE_MW -> ctrlmaxautoscaledist in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMEASURE_0013") EDWIN_RESIZE_MW -> ctrltotal in let crEdFrameWindow _channel ewinstr 0 0 iw 130 EDWIN_RESIZE_MW nil (loc "OS3DMEASURE_0015") (loc "OS3DMEASURE_0016") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 110 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DMEASURE_0009") EDWIN_RESIZE_MW -> ctrlautosave in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMEASURE_0010") EDWIN_RESIZE_MW -> ctrlshow in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMEASURE_0012") EDWIN_RESIZE_MW -> ctrlontop in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMEASURE_0005") EDWIN_RESIZE_MW -> ctrlinit in ( setEdCtrlCheckState ctrlautoscale autoscale; setEdCtrlCheckCbState ctrlautoscale mkfun3 @cbAutoscale ctrlmaxautoscaledist; setEdCtrlFloatEnable ctrlmaxautoscaledist autoscale; setEdCtrlCheckState ctrltotal totallength; setEdCtrlCheckState ctrlautosave autosave; setEdCtrlCheckState ctrlshow show; setEdCtrlCheckState ctrlontop ontop; setEdCtrlCheckState ctrlinit init; [mkfun1 @cbCloseEdit [ctrlfsize ctrlfcolor ctrlbcolor ctrllcolor ctrlvisibility ctrlautoscale ctrlmaxautoscaledist ctrltotal ctrlautosave ctrlshow ctrlontop ctrlinit] nil]; ); );;