/* ----------------------------------------------------------------------------- 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 -> [ctrlxoffset ctrlyoffset ctrlscale ctrlfsize ctrlfcolor ctrlbcolor ctrlhalign ctrlpcolor ctrlclick ctrlpoint ctrlvisibility ctrlautoscale ctrlmaxautoscaledist ctrlontop ctrlsave ctrlinit] in let getEdCtrlFloatValue ctrlxoffset -> xoffset in let getEdCtrlFloatValue ctrlyoffset -> yoffset in let getEdCtrlFloatValue ctrlscale -> scale in let ftoi (getEdCtrlFloatValue ctrlfsize) -> fsize in let getEdCtrlColorButtonColor ctrlfcolor -> fcolor in let getEdCtrlColorButtonColor ctrlbcolor -> bcolor in let getSelectedEdCtrlSelectPos ctrlhalign -> halign in let getEdCtrlColorButtonColor ctrlpcolor -> pcolor in let getSelectedEdCtrlSelectPos ctrlclick -> click in let getEdCtrlCheckState ctrlpoint -> point in let getEdCtrlFloatValue ctrlvisibility -> visibility in let getEdCtrlCheckState ctrlautoscale -> autoscale in let getEdCtrlFloatValue ctrlmaxautoscaledist -> maxautoscaledist in let getEdCtrlCheckState ctrlontop -> showontop in let getEdCtrlCheckState ctrlsave -> autosave in let getEdCtrlCheckState ctrlinit -> init in ["xoffset" ftoa xoffset]:: ["yoffset" ftoa yoffset]:: ["scale" ftoa scale]:: ["fontsize" itoa fsize]:: ["fontcolor" itoa fcolor]:: ["backgroundcolor" itoa bcolor]:: ["horalign" itoa halign]:: ["pointcolor" itoa pcolor]:: ["pointclick" itoa click]:: ["point" itoa point]:: ["visibility" ftoa visibility]:: ["autoscale" itoa autoscale]:: ["maxautoscaledist" ftoa maxautoscaledist]:: ["showontop" itoa showontop]:: ["autosave" itoa autosave]:: ["init" itoa init]:: nil;; fun cbAutoscale(ctrlstr, state, ctrlmaxautoscaledist)= setEdCtrlFloatEnable ctrlmaxautoscaledist state; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [420 435] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let XMLloadString webtostr (getPluginInstanceParam inst "xmldata") -> xmldata in let if xmldata == nil then XMLcreate nil nil else xmldata -> xmldata in let if (XMLgetMarkByValue xmldata "labelList") == nil then (XMLaddMark xmldata "labelList" nil nil nil) else (XMLgetMarkByValue xmldata "labelList") -> configmark in //let XMLgetMarksParamByValueFromMarkSons configmark "var" "name" -> levent in let atof (getPluginInstanceParam inst "xoffset") -> xoffset in let if xoffset == nil then 0.5 else xoffset -> xoffset in let atof (getPluginInstanceParam inst "yoffset") -> yoffset in let if yoffset == nil then 0.5 else yoffset -> yoffset in let atof (getPluginInstanceParam inst "scale") -> scale in let if scale == nil then 1.0 else scale -> scale in let atoi (getPluginInstanceParam inst "fontsize") -> fsize in let if fsize == nil then 12 else fsize -> fsize in let atoi (getPluginInstanceParam inst "fonttype") -> ftype in let if ftype == nil then 1 else ftype -> ftype in let atoi (getPluginInstanceParam inst "maxwidth") -> maxwidth in let if maxwidth == nil then 0 else maxwidth -> maxwidth 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 80 else bcolor -> bcolor in let atoi (getPluginInstanceParam inst "horalign") -> halign in let if halign == nil then 1 else halign -> halign in let getPluginInstanceParam inst "text" -> text in let if text == nil then "" else text -> text in let atoi (getPluginInstanceParam inst "pointcolor") -> pcolor in let if pcolor == nil then 80 else pcolor -> pcolor in let atoi (getPluginInstanceParam inst "pointclick") -> click in let if click == nil then 0 else click -> click in let atoi (getPluginInstanceParam inst "point") -> point in let if point == nil then 0 else point -> point 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 5.0 else maxautoscaledist -> maxautoscaledist in let atoi (getPluginInstanceParam inst "showontop") -> showontop in let if showontop == nil then 1 else showontop -> showontop in let atoi (getPluginInstanceParam inst "autosave") -> autosave in let if autosave == nil then 1 else autosave -> autosave in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in ( if !point then nil else set ih = ih + 85; setEdWindowSize ewinstr iw ih; let crEdFrameWindow _channel ewinstr 0 0 iw 105 EDWIN_RESIZE_MW nil (loc "OS3DLABELLIST_0011") (loc "OS3DLABELLIST_0013") -> 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) 90 20 (loc "OS3DLABELLIST_0009") nil -> labelxo in let crEdCtrlFloat winstr 180 ypos 80 20 xoffset (-.10000.0) 10000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlxoffset in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 60 20 (loc "OS3DLABELLIST_0010") nil -> labelyo in let crEdCtrlFloat winstr 180 ypos 80 20 yoffset (-.10000.0) 10000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlyoffset in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 60 20 (loc "OS3DLABELLIST_0027") nil -> labelscale in let crEdCtrlFloat winstr 180 ypos 80 20 scale 0.001 10000.0 0.1 3 nil EDWIN_RESIZE_MW -> ctrlscale in let crEdFrameWindow _channel ewinstr 0 0 iw 130 EDWIN_RESIZE_MW nil (loc "OS3DLABELLIST_0012") (loc "OS3DLABELLIST_0013") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 110 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DLABELLIST_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 "OS3DLABELLIST_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 "OS3DLABELLIST_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 "OS3DLABELLIST_0014") nil -> labelhalign in let crEdCtrlSelect winstr 180 ypos 100 120 EDWIN_RESIZE_MW -> ctrlhalign in let crEdFrameWindowEx _channel ewinstr 0 0 iw 105 EDWIN_RESIZE_MW nil (loc "OS3DLABELLIST_0028") (loc "OS3DLABELLIST_0013") !point -> 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 "OS3DLABELLIST_0006") nil -> labelpcolor in let crEdCtrlColorButton winstr 180 ypos 100 20 pcolor 1 EDWIN_RESIZE_MW nil -> ctrlpcolor in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DLABELLIST_0029") nil -> labelclick in let crEdCtrlSelect winstr 180 ypos 100 120 EDWIN_RESIZE_MW -> ctrlclick in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLABELLIST_0023") EDWIN_RESIZE_MW -> ctrlpoint in let crEdFrameWindow _channel ewinstr 0 0 iw 180 EDWIN_RESIZE_MW nil (loc "OS3DLABELLIST_0022") (loc "OS3DLABELLIST_0013") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 160 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DLABELLIST_0034") 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 "OS3DLABELLIST_0026") EDWIN_RESIZE_MW -> ctrlautoscale in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DLABELLIST_0035") 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 "OS3DLABELLIST_0025") EDWIN_RESIZE_MW -> ctrlontop in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLABELLIST_0024") EDWIN_RESIZE_MW -> ctrlsave in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DLABELLIST_0005") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrlhalign (loc "OS3DLABELLIST_0016")::(loc "OS3DLABELLIST_0017")::(loc "OS3DLABELLIST_0018")::nil; selectEdCtrlSelectByPos ctrlhalign halign; setEdCtrlCheckState ctrlpoint point; fillEdCtrlSelect ctrlclick (loc "OS3DLABELLIST_0030")::(loc "OS3DLABELLIST_0031")::(loc "OS3DLABELLIST_0032")::(loc "OS3DLABELLIST_0033")::nil; selectEdCtrlSelectByPos ctrlclick click; setEdCtrlCheckState ctrlautoscale autoscale; setEdCtrlCheckCbState ctrlautoscale mkfun3 @cbAutoscale ctrlmaxautoscaledist; setEdCtrlFloatEnable ctrlmaxautoscaledist autoscale; setEdCtrlCheckState ctrlontop showontop; setEdCtrlCheckState ctrlsave autosave; setEdCtrlCheckState ctrlinit init; [mkfun1 @cbCloseEdit [ctrlxoffset ctrlyoffset ctrlscale ctrlfsize ctrlfcolor ctrlbcolor ctrlhalign ctrlpcolor ctrlclick ctrlpoint ctrlvisibility ctrlautoscale ctrlmaxautoscaledist ctrlontop ctrlsave ctrlinit] nil]; ); ); );;