/* ----------------------------------------------------------------------------- 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 -> [ctrlmode ctrlcurve ctrlinit] in let getSelectedEdCtrlSelectPos ctrlmode -> mode in let getSelectedEdCtrlSelectPos ctrlcurve -> curve in let getEdCtrlCheckState ctrlinit -> init in ["mode" itoa mode]:: ["curve" itoa curve]:: ["init" itoa init]:: nil;; fun cbModeSelect(ctrlstr, pos, name, ctrlcurve)= if pos == 1 || pos == 3 then setEdCtrlSelectEnable ctrlcurve 1 else setEdCtrlSelectEnable ctrlcurve 0; 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 145] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let atoi(getPluginInstanceParam inst "mode") -> mode in let if mode == nil then 3 else mode -> mode in let atoi(getPluginInstanceParam inst "curve") -> curve in let if curve == nil then 1 else curve -> curve in let atoi(getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in let crEdFrameWindow _channel ewinstr 0 0 iw 85 EDWIN_RESIZE_MW nil (loc "OS3D3DRUDDER_0008") (loc "OS3D3DRUDDER_0010") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 65 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3D3DRUDDER_0002") EDWIN_RESIZE_MW -> labelmode in let crEdCtrlSelect winstr 180 ypos (iw - 180 - 10) 120 EDWIN_RESIZE_MW -> ctrlmode in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3D3DRUDDER_0003") EDWIN_RESIZE_MW -> labelcurve in let crEdCtrlSelect winstr 180 ypos (iw - 180 - 10) 120 EDWIN_RESIZE_MW -> ctrlcurve in let crEdFrameWindow _channel ewinstr 0 0 iw 60 EDWIN_RESIZE_MW nil (loc "OS3D3DRUDDER_0009") (loc "OS3D3DRUDDER_0010") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 40 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3D3DRUDDER_0001") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrlmode (loc "OS3D3DRUDDER_0004")::(loc "OS3D3DRUDDER_0005")::(loc "OS3D3DRUDDER_0006")::(loc "OS3D3DRUDDER_0007")::nil; setEdCtrlSelectCb ctrlmode mkfun4 @cbModeSelect ctrlcurve; selectEdCtrlSelectByPos ctrlmode mode; fillEdCtrlSelect ctrlcurve (loc "OS3D3DRUDDER_0011")::(loc "OS3D3DRUDDER_0012")::nil; selectEdCtrlSelectByPos ctrlcurve curve; if mode == 1 || mode == 3 then nil else setEdCtrlSelectEnable ctrlcurve 0; setEdCtrlCheckState ctrlinit init; [mkfun1 @cbCloseEdit [ctrlmode ctrlcurve ctrlinit] nil]; ); );;