/* ----------------------------------------------------------------------------- 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 -> [ctrlwindowmode ctrlmodeName ctrlcurrent ctrlinit] in let itoa getEdCtrlCheckState ctrlwindowmode -> windowmode in let getSelectedEdCtrlSelect ctrlmodeName -> modeName in let itoa getEdCtrlCheckState ctrlcurrent -> current in let itoa getEdCtrlCheckState ctrlinit -> init in ["windowmode" windowmode]:: ["mode" modeName]:: ["current" current]:: ["init" init]:: nil;; fun cbCheckCurrent(ctrlstr, state, ctrlmodeName)= setEdCtrlSelectEnable ctrlmodeName !state; 0;; fun cbCheckWindowMode(ctrlstr, state, p)= let p -> [ctrlmodeName ctrlcurrent] in let getEdCtrlCheckState ctrlcurrent -> current in ( setEdCtrlSelectEnable ctrlmodeName !(current || state); setEdCtrlCheckEnable ctrlcurrent !state; ); 0;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 115] -> [iw ih] in ( setEdWindowSize winstr iw ih; let atoi (getPluginInstanceParam inst "windowmode") -> windowmode in let if windowmode == nil then 0 else windowmode -> windowmode in let (getPluginInstanceParam inst "mode") -> mode in let atoi (getPluginInstanceParam inst "current") -> current in let if current == nil then 1 else current -> current in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 0 else init -> init in let 10 -> ypos in let crEdCtrlLabel winstr 10 (ypos + 2) 160 20 (strcat (loc "OS3DFULLSCREEN_0002") " ") nil -> labelMode in let crEdCtrlSelect winstr 180 ypos (iw - 190) 120 CB_AHSCROLL -> ctrlmodeName in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DFULLSCREEN_0003") EDWIN_RESIZE_MW -> ctrlcurrent in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DFULLSCREEN_0004") EDWIN_RESIZE_MW -> ctrlwindowmode in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DFULLSCREEN_0001") EDWIN_RESIZE_MW -> ctrlinit in ( //http://en.wikipedia.org/wiki/List_of_common_resolutions fillEdCtrlSelect ctrlmodeName "640x480 (VGA 4:3)"::"768x480 (WVGA 16:10)"::"768x480 (WVGA 16:10)"::"800x600 (SVGA 4:3)"::"1024x576 (WSVGA 16:9)"::"1024x768 (XGA 4:3)"::"1280x720 (WXGA 16:9)"::"1280x768 (WXGA 5:3)"::"1280x800 (WXGA 16:10)"::"1280x1024 (SXGA 5:4)"::"1366x768 (WXGA HDTV 16:9)"::"1440x900 (WXGA+ HDTV 16:10)"::"1600x1024 (WSXGA 25:16)"::"1680x1050 (WSXGA+ 16:10)"::"1920x1080 (1080p HDTV 16:9)"::nil; selectEdCtrlSelect ctrlmodeName mode; setEdCtrlCheckState ctrlwindowmode windowmode; setEdCtrlCheckState ctrlcurrent current; setEdCtrlCheckState ctrlinit init; setEdCtrlCheckCbState ctrlwindowmode mkfun3 @cbCheckWindowMode [ctrlmodeName ctrlcurrent]; setEdCtrlCheckCbState ctrlcurrent mkfun3 @cbCheckCurrent ctrlmodeName; setEdCtrlSelectEnable ctrlmodeName !(current || windowmode); setEdCtrlCheckEnable ctrlcurrent !windowmode; [mkfun1 @cbCloseEdit [ctrlwindowmode ctrlmodeName ctrlcurrent ctrlinit] @cbDestroyEdit]; ); );;