The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Vista Gadget Settings Help ---sorry Pandy!
Leffonzell
post Jun 18 2007, 01:16 PM
Post #1





Group: Members
Posts: 2
Joined: 9-June 07
From: Chucktown SC
Member No.: 3,046



After many nights of web surfing, I finally figured out how to get an options button on my gadget. In the options page, I also figured out how to add SUBMIT buttons, and display the different options in a category. What I dont know how to do is get the gadget to display different things when the settings are changed. I can create all of the different pictures and figure out how to change the text, but I dont know how to link the SUBMIT button of a category to a different picture, and then have the gadget display it.

Here is the main Gadget HTML:

<html>
<head>
<title>Flying Text</title>
<style>
body
{
margin: 0;
width: 130px;
height: 65px;
}
#gadgetContent
{
width: 130px;
top: 10px;
color: black;
text-align: center;
font-family: Monotype Corsiva;
font-size: 16pt;
font-weight: none;
position: absolute;
}
#background
{
<!--Width and height dont change anything up here-->
width: 130px;
height: 65px;

z-index: -1;
background-repeat: no-repeat;
visibility: none;
<!-- this is the old border. border: 5px Solid rgb(155,170,225); -->
}
</style>
<script>
var defaultText = "Chris Rocks!";
var variableName = "ProgramFiles";

<!-- Show settings wrench button-->
System.Gadget.settingsUI = "settings.html";
System.Gadget.onSettingsClosed = settingsClosed;
</script>
</head>
<body>
<g:background
src="background.png"
id="background"
style="position:absolute;width:130px; height:65px;z-index:-1"/>
<span
id="gadgetContent"
style="font-family: Monotype Corsiva; font-size: 16pt;">
<MARQUEE direction=left hspace=5>
Chris is the coolest person in the world!
</MARQUEE>

</span>
</body>
</html>

And here is the settings HTML:

<html>
<head>
<meta http-equiv="MSThemeCompatible" CONTENT="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<title>My Settings</title>
<style>
body
{
width: 200px;
height: 400px; <!--Put Text here because the program doesnt read it-->
font-family: Tahoma;
font-size: 10px;
}
</style>
<script>
System.Gadget.onSettingsClosing = settingsClosing;
function loadSettings()
{
var currentSetting = System.Gadget.Settings.read("variableName");
if (currentSetting = text)
{
envVar.innerText = currentSetting;
}
}

function settingsClosing(event)
{
if (event.closeAction == event.Action.commit)
{
variableName = envVar.variable;
System.Gadget.Settings.write("variableName", variableName);
}
}
</script>
</head>

<body onload="loadSettings()">
<label for="envVar">Phrase:</label><br />
<div style="padding-bottom:10px"></div>
<input type="text" size="22" name="envVar" id="envVar" style="color:#FFFFFF; background-color:rgb(20,165,255);" />
<div style="padding-bottom:10px"></div>
Type in anything and watch it fly across the gadget!
<HR SIZE="1">
Choose a Color Scheme:
<SELECT>
<OPTION>Red
<OPTION>Orange
<OPTION>Yellow
<OPTION>Green
<OPTION selected>Blue
<OPTION>Purple
</SELECT>
<INPUT type="Submit" VALUE="Submit Color Scheme">
<HR SIZE="1">
Choose a Text Color:
<SELECT>
<OPTION selected>Black
<OPTION>Gray
<OPTION>White
<OPTION>Red
<OPTION>Orange
<OPTION>Yellow
<OPTION>Green
<OPTION>Blue
<OPTION>Purple
</SELECT>
<INPUT type="Submit" VALUE="Submit Text Color">
<HR SIZE="1">

<div style="padding-bottom:10px"></div>
<MARQUEE direction=left bgcolor=rgb(20,165,255) STYLE="color:white" >
This was produced by a very skillful Chris.
</MARQUEE>

</body>
</html>

This post has been edited by Leffonzell: Jun 18 2007, 01:55 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2007, 02:11 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,731
Joined: 9-August 06
Member No.: 6



You called, sir? smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 12:13 PM