/* ----------------------------------------------------------------------------- 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 -> [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlphpurl ctrlkeycode ctrlfrom ctrlto] in let itoa getEdCtrlRadioState ctrlusesmtp -> usesmtp in let getEdCtrlTextLineValue ctrlsmtp -> smtp in let itoa (ftoi getEdCtrlFloatValue ctrlsmtpport) -> smtpport in let getEdCtrlTextLineValue ctrlphpurl -> phpurl in let getEdCtrlTextLineValue ctrlkeycode -> keycode in let getEdCtrlTextLineValue ctrlfrom -> from in let getEdCtrlTextLineValue ctrlto -> to in ["usesmtp" usesmtp]:: ["smtp" smtp]:: ["smtpport" smtpport]:: ["phpurl" phpurl]:: ["keycode" keycode]:: ["from" from]:: ["to" to]:: nil;; fun cbCheckSmtp(ctrl, state, p)= let p -> [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlusephp ctrlphpurl ctrlkeycode] in ( if (state) then ( setEdCtrlTextLineEnable ctrlsmtp 1; setEdCtrlFloatEnable ctrlsmtpport 1; setEdCtrlTextLineEnable ctrlphpurl 0; setEdCtrlTextLineEnable ctrlkeycode 0; 0; ) else ( setEdCtrlTextLineEnable ctrlsmtp 0; setEdCtrlFloatEnable ctrlsmtpport 0; setEdCtrlTextLineEnable ctrlphpurl 1; setEdCtrlTextLineEnable ctrlkeycode 1; 0; ); setEdCtrlRadioState ctrlusephp !state; ); 0;; fun cbCheckPhp(ctrl, state, p)= let p -> [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlusephp ctrlphpurl ctrlkeycode] in ( if (!state) then ( setEdCtrlTextLineEnable ctrlsmtp 1; setEdCtrlFloatEnable ctrlsmtpport 1; setEdCtrlTextLineEnable ctrlphpurl 0; setEdCtrlTextLineEnable ctrlkeycode 0; 0; ) else ( setEdCtrlTextLineEnable ctrlsmtp 0; setEdCtrlFloatEnable ctrlsmtpport 0; setEdCtrlTextLineEnable ctrlphpurl 1; setEdCtrlTextLineEnable ctrlkeycode 1; 0; ); setEdCtrlRadioState ctrlusesmtp !state; ); 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [400 290] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "smtp") -> smtp in let (getPluginInstanceParam inst "smtpport") -> smtpport in let if (smtpport == nil) then 25 else atoi smtpport -> smtpport in let (getPluginInstanceParam inst "usesmtp") -> usesmtp in let if (usesmtp == nil) then 1 else atoi usesmtp -> usesmtp in let (getPluginInstanceParam inst "keycode") -> keycode in let if (keycode == nil) then "update me" else keycode -> keycode in let (getPluginInstanceParam inst "phpurl") -> phpurl in let (getPluginInstanceParam inst "from") -> from in let (getPluginInstanceParam inst "to") -> to in let crEdFrameWindow _channel ewinstr 0 0 iw 105 EDWIN_RESIZE_MW nil (loc "OS3DMAIL_0001") (loc "OS3DMAIL_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 85 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlRadio winstr 10 ypos (iw - 20) 20 (loc "OS3DMAIL_0003") EDWIN_RESIZE_MW -> ctrlusesmtp in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMAIL_0004") nil -> labelsmtp in let crEdCtrlTextLine winstr 180 ypos (iw - 200) 20 smtp nil EDWIN_RESIZE_MW -> ctrlsmtp in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMAIL_0005") nil -> labelport in let crEdCtrlFloat winstr 180 ypos 60 20 itof smtpport (0.0) 65534.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlsmtpport in let crEdFrameWindow _channel ewinstr 0 0 iw 105 EDWIN_RESIZE_MW nil (loc "OS3DMAIL_0006") (loc "OS3DMAIL_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 85 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlRadio winstr 10 (set ypos = 10) (iw - 20) 20 (loc "OS3DMAIL_0007") EDWIN_RESIZE_MW -> ctrlusephp in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMAIL_0008") nil -> labelphp in let crEdCtrlTextLine winstr 180 ypos (iw - 200) 20 phpurl nil EDWIN_RESIZE_MW -> ctrlphpurl in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMAIL_0009") nil -> labelkey in let crEdCtrlTextLine winstr 180 ypos (iw - 200) 20 keycode nil EDWIN_RESIZE_MW -> ctrlkeycode in let crEdFrameWindow _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DMAIL_0010") (loc "OS3DMAIL_0002") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DMAIL_0011") nil -> labelfrom in let crEdCtrlTextLine winstr 180 ypos (iw - 200) 20 from nil EDWIN_RESIZE_MW -> ctrlfrom in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DMAIL_0012") nil -> labelto in let crEdCtrlTextLine winstr 180 ypos (iw - 200) 20 to nil EDWIN_RESIZE_MW -> ctrlto in ( setEdCtrlRadioState ctrlusesmtp usesmtp; setEdCtrlRadioState ctrlusephp !usesmtp; setEdCtrlCheckCbState ctrlusesmtp mkfun3 @cbCheckSmtp [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlusephp ctrlphpurl ctrlkeycode]; setEdCtrlCheckCbState ctrlusephp mkfun3 @cbCheckPhp [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlusephp ctrlphpurl ctrlkeycode]; if (usesmtp) then ( setEdCtrlTextLineEnable ctrlsmtp 1; setEdCtrlFloatEnable ctrlsmtpport 1; setEdCtrlTextLineEnable ctrlphpurl 0; setEdCtrlTextLineEnable ctrlkeycode 0; 0; ) else ( setEdCtrlTextLineEnable ctrlsmtp 0; setEdCtrlFloatEnable ctrlsmtpport 0; setEdCtrlTextLineEnable ctrlphpurl 1; setEdCtrlTextLineEnable ctrlkeycode 1; 0; ); [mkfun1 @cbCloseEdit [ctrlusesmtp ctrlsmtp ctrlsmtpport ctrlphpurl ctrlkeycode ctrlfrom ctrlto] nil]; ); );;