/* ----------------------------------------------------------------------------- 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 -> [ctrlpath ctrleditsrv ctrlmask ctrltitle ctrlvalign ctrlhalign ctrlopacity ctrlshow] in let getEdCtrlTextLineValue ctrlpath -> path in let getEdCtrlCheckState ctrleditsrv -> editsrv in let getEdCtrlTextLineValue ctrlmask -> mask 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 ["path" path]:: ["editsrv" itoa editsrv]:: ["mask" mask]:: ["title" title]:: ["valign" itoa valign]:: ["halign" itoa halign]:: ["opacity" itoa opacity]:: ["show" itoa show]:: nil;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 245] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let getPluginInstanceParam inst "path" -> path in let if (path == nil) then "%documents%" else path -> path 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 100 EDWIN_RESIZE_MW nil (loc "OS3DFILESLIST_0002") (loc "OS3DFILESLIST_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 90 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DFILESLIST_0004") nil -> labelpath in let crEdCtrlTextLine winstr 180 ypos iw-200 20 path nil EDWIN_RESIZE_MW -> ctrlpath in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DFILESLIST_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 "OS3DFILESLIST_0005") EDWIN_RESIZE_MW -> ctrleditsrv in let crEdFrameWindow _channel ewinstr 0 0 iw 145 EDWIN_RESIZE_MW nil (loc "OS3DFILESLIST_0003") (loc "OS3DFILESLIST_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 "OS3DFILESLIST_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 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 [ctrlpath ctrleditsrv ctrlmask ctrltitle ctrlvalign ctrlhalign ctrlopacity ctrlshow] nil]; ); );;