/* ----------------------------------------------------------------------------- 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 -> [ctrlurl ctrleditsrv ctrlmask ctrlshowlocal ctrltitle ctrlvalign ctrlhalign ctrlopacity ctrlshow] in let getEdCtrlTextLineValue ctrlurl -> url in let getEdCtrlCheckState ctrleditsrv -> editsrv in let getEdCtrlTextLineValue ctrlmask -> mask in let getEdCtrlCheckState ctrlshowlocal -> showlocal in let getEdCtrlTextLineValue ctrltitle -> title in let getSelectedEdCtrlSelectPos ctrlvalign -> valign in let getSelectedEdCtrlSelectPos ctrlhalign -> halign in let ftoi getEdCtrlFloatValue ctrlopacity -> opacity in let getEdCtrlCheckState ctrlshow -> show in ["url" url]:: ["editsrv" itoa editsrv]:: ["mask" mask]:: ["showlocal" itoa showlocal]:: ["title" title]:: ["valign" itoa valign]:: ["halign" itoa halign]:: ["opacity" itoa opacity]:: ["show" itoa show]:: nil;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 270] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let getPluginInstanceParam inst "url" -> url in let if (url == nil) then "http://" else url -> url in let atoi (getPluginInstanceParam inst "editsrv") -> editsrv in let if (editsrv == nil) then 1 else editsrv -> editsrv in let atoi (getPluginInstanceParam inst "showlocal") -> showlocal in let if (showlocal == nil) then 1 else showlocal -> showlocal in let getPluginInstanceParam inst "mask" -> mask in let if (mask == nil) || (!strcmp mask "") then "*.*" else mask -> mask in let getPluginInstanceParam inst "title" -> title in let if title == nil then "" else title -> title 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 "show") -> show in let if (show == nil) then 1 else show -> show in let crEdFrameWindow _channel ewinstr 0 0 iw 125 EDWIN_RESIZE_MW nil (loc "OS3DONLINEFILES_0002") (loc "OS3DONLINEFILES_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 115 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DONLINEFILES_0004") nil -> labelurl in let crEdCtrlTextLine winstr 180 ypos iw-200 20 url nil EDWIN_RESIZE_MW -> ctrlurl in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DONLINEFILES_0006") nil -> labelmask in let crEdCtrlTextLine winstr 180 ypos iw-200 20 mask nil EDWIN_RESIZE_MW -> ctrlmask in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DONLINEFILES_0005") EDWIN_RESIZE_MW -> ctrleditsrv in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DONLINEFILES_0007") EDWIN_RESIZE_MW -> ctrlshowlocal in let crEdFrameWindow _channel ewinstr 0 0 iw 145 EDWIN_RESIZE_MW nil (loc "OS3DONLINEFILES_0003") (loc "OS3DONLINEFILES_0001") -> 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) 160 20 (loc "OS3DONLINEFILES_0008") nil -> labeltitle in let crEdCtrlTextLine winstr 180 ypos iw-200 20 title nil EDWIN_RESIZE_MW -> ctrltitle in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DDIALOG_0016") 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 "OS3DDIALOG_0017") 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 "OS3DDIALOG_0009") 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 crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DDIALOG_0010") EDWIN_RESIZE_MW -> ctrlshow in let V3DgetDefaultSession viewstr -> sessionstr in ( setEdCtrlCheckState ctrlshow show; setEdCtrlCheckState ctrlshowlocal showlocal; setEdCtrlCheckState ctrleditsrv editsrv; fillEdCtrlSelect ctrlvalign (loc "OS3DDIALOG_0014")::(loc "OS3DDIALOG_0012")::(loc "OS3DDIALOG_0015")::nil; selectEdCtrlSelectByPos ctrlvalign valign; fillEdCtrlSelect ctrlhalign (loc "OS3DDIALOG_0011")::(loc "OS3DDIALOG_0012")::(loc "OS3DDIALOG_0013")::nil; selectEdCtrlSelectByPos ctrlhalign halign; [mkfun1 @cbCloseEdit [ctrlurl ctrleditsrv ctrlmask ctrlshowlocal ctrltitle ctrlvalign ctrlhalign ctrlopacity ctrlshow] nil]; ); );;