/* ----------------------------------------------------------------------------- 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 ----------------------------------------------------------------------------- */ var lModules = "AM12"::"LM12"::"LM15ES"::"MS13E"::nil;; var lHouse = "A"::"B"::"C"::"D"::"E"::"F"::"G"::"H"::"I"::"J"::"K"::"L"::"N"::"M"::"O"::"P"::nil;; var lUnit = "1"::"2"::"3"::"4"::"5"::"6"::"7"::"8"::"9"::"10"::"11"::"12"::"13"::"14"::"15"::"16"::nil;; fun getActions(type)= let if ((!strcmp type "LM12") || (!strcmp type "LM15ES")) then ["ACTION" "Dim"]:: ["ACTION" "Bright"]:: ["EVENT" "Dim"]:: ["EVENT" "Bright"]::nil else nil -> light in let if (!strcmp type "MS13E") then ["EVENT" "Light On"]:: ["EVENT" "Light Off"]:: ["EVENT" "On"]:: ["EVENT" "Off"]::nil else ["ACTION" "On"]:: ["ACTION" "Off"]:: ["EVENT" "On"]:: ["EVENT" "Off"]::nil -> addition in lcat light addition;; fun cbCloseEdit(p)= let p -> [ctrltype ctrlhouse ctrlunit] in let getSelectedEdCtrlSelect ctrltype -> type in let getSelectedEdCtrlSelect ctrlhouse -> house in let getSelectedEdCtrlSelect ctrlunit -> unit in ["type" type]:: ["house" house]:: ["unit" unit]:: (getActions type);; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [400 95] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize winstr iw ih; let (getPluginInstanceParam inst "type") -> type in let if type == nil then "AM12" else type -> type in let (getPluginInstanceParam inst "house") -> house in let if house == nil then "A" else house -> house in let (getPluginInstanceParam inst "unit") -> unit in let if unit == nil then "1" else unit -> unit in let crEdCtrlLabel winstr 10 ypos + 1 160 20 (loc "OS3DX10UNIT_0004") nil -> labeltype in let crEdCtrlSelect winstr 180 ypos 200 120 EDWIN_RESIZE_MW -> ctrltype in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DX10UNIT_0003") nil -> labelhouse in let crEdCtrlSelect winstr 180 ypos 200 120 EDWIN_RESIZE_MW -> ctrlhouse in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DX10UNIT_0005") nil -> labelunit in let crEdCtrlSelect winstr 180 ypos 200 120 EDWIN_RESIZE_MW -> ctrlunit in ( fillEdCtrlSelect ctrltype lModules; selectEdCtrlSelect ctrltype type; fillEdCtrlSelect ctrlhouse lHouse; selectEdCtrlSelect ctrlhouse house; fillEdCtrlSelect ctrlunit lUnit; selectEdCtrlSelect ctrlunit unit; [mkfun1 @cbCloseEdit [ctrltype ctrlhouse ctrlunit] nil]; ); );;