/* ----------------------------------------------------------------------------- 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 cbDestroyEdit()= 0;; fun cbCloseEdit(p)= let p -> [ctrlfile ctrlformat ctrldialog ctrl3donly ctrlhideoverlay ctrlalpha ctrlauto ctrlwidth ctrlheight] in let getEdCtrlTextLineValue ctrlfile -> filePrefix in let itoa getSelectedEdCtrlSelectPos ctrlformat -> dateformat in let itoa getEdCtrlCheckState ctrldialog -> dialog in let itoa getEdCtrlCheckState ctrl3donly -> only3d in let itoa getEdCtrlCheckState ctrlhideoverlay -> hideoverlay in let itoa getEdCtrlCheckState ctrlalpha -> withalpha in let itoa getEdCtrlCheckState ctrlauto -> currentsize in let ftoi getEdCtrlFloatValue ctrlwidth -> width in let ftoi getEdCtrlFloatValue ctrlheight -> height in ["filePrefix" filePrefix]:: ["dateFormat" dateformat]:: ["useFileDialog" dialog]:: ["only3d" only3d]:: ["hideOverlay" hideoverlay]:: ["withAlpha" withalpha]:: ["currentSize" currentsize]:: ["width" (itoa width)]:: ["height" (itoa height)]:: nil;; fun cbCheckSize(ctrlstr, state, p)= let p -> [ctrlwidth ctrlheight] in ( setEdCtrlFloatEnable ctrlwidth !state; setEdCtrlFloatEnable ctrlheight !state; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 235] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let (getPluginInstanceParam inst "filePrefix") -> filePrefix in let if filePrefix == nil then "%pictures%/screenshots/" else filePrefix -> filePrefix in let atoi (getPluginInstanceParam inst "dateFormat") -> dateFormat in let if dateFormat == nil then 0 else dateFormat -> dateFormat in let atoi (getPluginInstanceParam inst "useFileDialog") -> usedialog in let if (usedialog == nil) then 0 else usedialog -> usedialog in let atoi (getPluginInstanceParam inst "only3d") -> only3d in let if (only3d == nil) then 1 else only3d -> only3d in let atoi (getPluginInstanceParam inst "hideOverlay") -> hideoverlay in let if (hideoverlay == nil) then 0 else hideoverlay -> hideoverlay in let atoi (getPluginInstanceParam inst "withAlpha") -> withalpha in let if (withalpha == nil) then 0 else withalpha -> withalpha in let atoi (getPluginInstanceParam inst "currentSize") -> currentSize in let if (currentSize == nil) then 1 else currentSize -> currentSize in let atoi (getPluginInstanceParam inst "width") -> width in let if (width == nil) then 1280 else width -> width in let atoi (getPluginInstanceParam inst "height") -> height in let if (height == nil) then 720 else height -> height in let crEdCtrlLabel winstr 10 (ypos + 2) 160 20 (strcat (loc "OS3DSCREENSHOT_0001") " ") nil -> labelprefix in let crEdCtrlTextLine winstr 180 ypos 200 20 filePrefix nil EDWIN_RESIZE_MW -> ctrlfile in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 160 20 (loc "OS3DSCREENSHOT_0002") nil -> labelformat in let crEdCtrlSelect winstr 180 ypos 200 120 EDWIN_RESIZE_MW -> ctrlformat in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSCREENSHOT_0003") EDWIN_RESIZE_MW -> ctrldialog in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSCREENSHOT_0004") EDWIN_RESIZE_MW -> ctrl3donly in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSCREENSHOT_0005") EDWIN_RESIZE_MW -> ctrlhideoverlay in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSCREENSHOT_0006") EDWIN_RESIZE_MW -> ctrlalpha in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSCREENSHOT_0007") EDWIN_RESIZE_MW -> ctrlauto in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSCREENSHOT_0008") nil -> labelwidth in let crEdCtrlFloat winstr 180 ypos 90 20 itof width 16.0 15000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwidth in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSCREENSHOT_0009") nil -> labelheight in let crEdCtrlFloat winstr 180 ypos 90 20 itof height 16.0 15000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlheight in ( fillEdCtrlSelect ctrlformat "Full date"::"Date and time"::"Time stamp"::nil; selectEdCtrlSelectByPos ctrlformat dateFormat; setEdCtrlCheckState ctrldialog usedialog; setEdCtrlCheckState ctrl3donly only3d; setEdCtrlCheckState ctrlhideoverlay hideoverlay; setEdCtrlCheckState ctrlalpha withalpha; setEdCtrlCheckState ctrlauto currentSize; setEdCtrlCheckCbState ctrlauto mkfun3 @cbCheckSize [ctrlwidth ctrlheight]; if (!currentSize) then nil else ( setEdCtrlFloatEnable ctrlwidth 0; setEdCtrlFloatEnable ctrlheight 0; ); [mkfun1 @cbCloseEdit [ctrlfile ctrlformat ctrldialog ctrl3donly ctrlhideoverlay ctrlalpha ctrlauto ctrlwidth ctrlheight] @cbDestroyEdit]; ); );;