/* ----------------------------------------------------------------------------- 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 ctrlreadinit] in let getEdCtrlTextLineValue ctrlpath -> path in let getEdCtrlCheckState ctrlreadinit -> readinit in ["path" path]:: ["readinit" itoa readinit]:: nil;; fun cbDlgGetPath(pfile, p)= let p -> [inst ctrlbtn winstr ctrlpath] in ( if pfile == nil then nil else let _PtoScol pfile -> file in if file == nil then ( _DLGMessageBox _channel winstr.EDW_win (loc "OS3DFILECONTENT_0002") (loc "OS3DFILECONTENT_0003") 0; 0; ) else ( setEdCtrlTextLineValue ctrlpath file; 0; ); setEdCtrlButtonEnable ctrlbtn 1; ); 0;; fun cbBtnPickFile(ctrlbtn, p)= let p -> [inst winstr ctrlpath] in let getEdCtrlTextLineValue ctrlpath -> path in ( setEdCtrlButtonEnable ctrlbtn 1; let _GETdesktopSize -> [sw sh] in let getEdWindowPos mainInterf.MINT_winMain -> [nx ny] in let getEdWindowSize mainInterf.MINT_winMain -> [nmw nmh] in let [750 450] -> [iw ih] in let crEdOpenFileDialog _channel winstr nx + ((nmw / 2) - (iw / 2)) ny + ((nmh / 2) - (ih / 2)) iw ih "" ["All" "*.*"::nil]::nil EDFILE_DIALOG_LIST_FOLDERS|EDFILE_DIALOG_SHOW_TOOLBAR nil path -> dlgfstr in ( setEdWindowIcon dlgfstr.EDFD_dialog sWinDlgIcon; setEdOpenFileDialogCb dlgfstr mkfun2 @cbDlgGetPath [inst ctrlbtn winstr ctrlpath]; 0; ); ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 60] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let getPluginInstanceParam inst "path" -> path in let if (path == nil) then "" else path -> path in let atoi (getPluginInstanceParam inst "readinit") -> readinit in let if (readinit == nil) then 0 else readinit -> readinit in let crEdCtrlLabel winstr 10 (ypos + 2) 100 20 (loc "OS3DFILECONTENT_0001") nil -> labelurl in let crEdCtrlTextLine winstr 120 ypos 170 20 path nil EDWIN_RESIZE_MW -> ctrlpath in let crEdCtrlButton winstr 300 ypos 55 20 "..." nil -> pickfilebtn in let crEdCtrlButton winstr 360 ypos 35 20 "X" nil -> refreshpath in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DFILECONTENT_0004") EDWIN_RESIZE_MW -> ctrlreadinit in ( //setEdCtrlTextLineEnable ctrlpath 0; setEdCtrlButtonCb pickfilebtn mkfun2 @cbBtnPickFile [inst winstr ctrlpath]; setEdCtrlButtonCb refreshpath mkfun2 @cbRefreshBtn [ctrlpath]; setEdCtrlCheckState ctrlreadinit readinit; [mkfun1 @cbCloseEdit [ctrlpath ctrlreadinit] nil]; ); );;