/* ----------------------------------------------------------------------------- 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 ----------------------------------------------------------------------------- */ //TODO use _addExe to put any command file fun cbCloseEdit(p)= let p -> [ctrlexe ctrlparam] in let getSelectedEdCtrlSelect ctrlexe -> exe in let getEdCtrlEditTextValue ctrlparam -> param in ["exe" exe]:: ["param" param]:: nil;; fun cbDlgGetPath(dlg, p, pfile)= let p -> [inst winstr ctrlbtn ctrlpath] in ( if pfile == nil then nil else let _PtoScol pfile -> file in if file == nil then ( _DLGMessageBox _channel winstr.EDW_win (loc "OS3DARMARKER_0006") (loc "OS3DARMARKER_0016") 0; 0; ) else //let _PtoS pfile -> file in setEdCtrlEditTextValue ctrlpath file; setEdCtrlButtonEnable ctrlbtn 1; ); 0;; fun cbBtnPickFile(ctrlbtn, p)= let p -> [inst winstr ctrlpath] in ( setEdCtrlButtonEnable ctrlbtn 1; _DLGrflopen _DLGOpenFile _channel winstr.EDW_win nil nil "All\0*.*\0\0" @cbDlgGetPath [inst winstr ctrlbtn ctrlpath]; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 160] -> [iw ih] in ( setEdWindowSize winstr iw ih; let (getPluginInstanceParam inst "exe") -> exe in let (getPluginInstanceParam inst "param") -> param in let crEdCtrlLabel winstr 10 12 160 20 (loc "OS3DEXEC_0001") nil -> labelexe in let crEdCtrlSelect winstr 180 10 200 120 EDWIN_RESIZE_MW -> ctrlexe in let crEdCtrlLabel winstr 10 62 (iw - 75) 20 (loc "OS3DEXEC_0003") nil -> labelparam in let crEdCtrlButton winstr (iw - 65) 60 55 20 "..." nil -> pickbtn in let crEdCtrlEditText winstr 10 85 (iw - 20) 60 param nil EDWIN_RESIZE_MW -> ctrlparam in ( setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickFile [inst winstr ctrlparam]; let _getExe "launch" -> le in fillEdCtrlSelect ctrlexe le; selectEdCtrlSelect ctrlexe exe; [mkfun1 @cbCloseEdit [ctrlexe ctrlparam] nil]; ); );;