home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
ib
/
setups
/
intrabld
/
data.z
/
GBCONFIG.JFM
< prev
next >
Wrap
Text File
|
1996-12-11
|
6KB
|
187 lines
/****************************************************************************\
* *
* GbConfig.jfm -- Guest Book Mail Configuration Page *
* *
* GbConfig.jfm is part of the Guest Book prebuilt business solution. It is *
* used to configure the name of the SMTP mail server. This configuration *
* information is then used by the Guest Book Mail page to send messages to *
* people who have signed the Guest Book. *
* *
* Dependencies: mailto71.gif *
* homepg31.gif *
* apps/shared/controls.cc *
* apps/shared/registry.js *
* *
* Links to: /ibapps/index.htm *
* *
* Updated 11/12/96 by IntraBuilder Samples Group *
* $Revision: 1.4 $ *
* *
* Copyright (c) 1996, Borland International, Inc. All rights reserved. *
* *
\****************************************************************************/
#include "winreg.h"
//
// Define the registry key for the Guest Book Settings
//
#define GUEST_BOOK_REG_KEY "SOFTWARE\\Borland\\IntraBuilder\\1.0\\Guest Book"
// {End Header} Do not remove this comment//
// Generated on 11/12/96
//
var f = new gbconfigForm();
f.open();
class gbconfigForm extends Form {
_sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC")
with (this) {
onServerSubmit = class::Form_onServerSubmit;
onServerLoad = class::Form_onServerLoad;
color = "a4d5ff";
height = 13.6667;
left = 0;
top = 0;
width = 74;
title = "Mail Server Configuration";
}
with (this.rule1 = new Rule(this)){
top = 4;
size = 2;
right = 70;
}
with (this.rule2 = new Rule(this)){
top = 12;
size = 2;
right = 70;
}
with (this.rule3 = new Rule(this)){
top = 7.5;
size = 2;
right = 70;
}
with (this.mailToLogo = new Image(this)){
height = 3.4167;
width = 10.25;
dataSource = "filename MAILTO71.GIF";
alignment = 4;
}
with (this.titleHTML = new HTML(this)){
height = 2;
left = 12;
width = 58;
color = "steelblue";
text = '<H1><FONT SIZE="+4"><FONT COLOR="mediumvioletred">M</FONT></FONT>ail <FONT SIZE="+4"><FONT COLOR="mediumvioletred">S</FONT></FONT>erver <FONT SIZE="+4"><FONT COLOR="mediumvioletred">C</FONT></FONT>onfiguration</H1>';
}
with (this.homePageLinkImage = new Image(this)){
onImageClick = class::link_to_home_page;
height = 3.4167;
top = 8;
width = 10.25;
dataSource = "filename HOMEPG31.GIF";
alignment = 4;
}
with (this.homePageLinkHTML = new HTML(this)){
height = 1;
left = 12;
top = 9;
width = 58;
color = "black";
text = "<A HREF='/ibapps/index.htm'>Return to Home Page</A>";
}
with (this.generatedHTML1 = new GeneratedHTML(this)){
height = 1;
top = 12.5;
width = 58;
}
with (this.smtpHTML = new HTML(this)){
height = 1;
top = 4.5;
width = 30;
color = "black";
alignVertical = 1;
text = "Outgoing Mail (SMTP) Server";
}
with (this.smtpText = new Text(this)){
left = 30;
top = 4.5;
width = 32;
value = "";
}
with (this.submitButton = new Button(this)){
onClick = class::submitButton_onClick;
top = 6;
width = 10.5;
text = "Submit";
}
with (this.reset1 = new Reset(this)){
left = 16;
top = 6;
width = 10;
text = "Reset";
}
function Form_onServerLoad()
{
// read mail setting from Registry
_sys.scripts.load(_sys.env.home() + "apps\\shared\\registry.js");
form.registry = new Registry(HKEY_LOCAL_MACHINE, GUEST_BOOK_REG_KEY );
if (form.registry.error == 0)
form.smtpText.value = form.registry.queryValue("SMTP Server");
// pad or replace as appropriate
if (form.registry.error == 0)
form.smtpText.value += new StringEx().replicate(" ",80);
else
form.smtpText.value = new StringEx().replicate(" ",80);
}
function link_to_home_page()
{
location.href="/ibapps/index.htm";
}
function submitButton_onClick()
{
// client side code
this.form.submit();
}
function Form_onServerSubmit()
{
val=new StringEx(form.smtpText.value);
val=new StringEx(val.rightTrim()); //remove all spaces
val=new StringEx(val.leftTrim());
form.registry.setValue("SMTP Server",val);
form.close();
form.release();
}
function submit()
{
class::Form_onServerSubmit();
}
}