home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 June
/
CHIP_CD_2004-06.iso
/
bonus
/
buhgal
/
files
/
M12USWEB.exe
/
RCDATA
/
CABINET
/
money.cab
/
ChkBxCls.htc
< prev
next >
Wrap
Text File
|
2003-06-18
|
5KB
|
185 lines
<PUBLIC:COMPONENT tagName=CheckBox >
<public:defaults
viewLinkContent
tabStop = true
viewMasterTab = true
/>
<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="Main()" />
<PRIVATE:PROPERTY NAME="StaticColor" />
<PRIVATE:PROPERTY NAME="HoverColor" />
<PRIVATE:PROPERTY NAME="Value" />
<PUBLIC:METHOD NAME="SetValue" />
<PUBLIC:METHOD NAME="GetValue" />
</PUBLIC:COMPONENT>
<!----------------------------------------------------------
Copyright (c) 2001 Microsoft Corporation.
All rights reserved.
File: ChkBxCls.htc
Revised: Oct 26 2001
--------------------------------------------------------- -->
<HTML xmlns:mnydraw="urn:schemas-microsoft-com:vml">
<HEAD>
<STYLE TYPE="text/css">
<!--
mnydraw\:*{behavior: url(#default#VML);}
-->
</STYLE>
<SCRIPT TYPE="text/jscript" LANGUAGE="JScript">
<!--
@set @debug = false;
//**************************************************
function GetChecked()
{
if(element.checked)
{
var fChckd = new Boolean();
fChckd = eval(element.checked);
return fChckd;
}
else
{
return false;
}
}
//**************************************************
function SetValue(fState)
{
Value = fState;
htmCaption.style.top = (Value) ? "-2pt" : "-50";
}
//**************************************************
function GetValue()
{
return Value;
}
//**************************************************
function Main()
{
element.style.width = "10pt";
element.style.height = "9pt";
StaticColor = "#ffffff";
HoverColor = "#eeeeee";
var fChckd = GetChecked();
var hChkBx = new CheckBox();
document.body.appendChild(hChkBx);
SetValue(fChckd);
document.body.onselectstart = function()
{
return false;
}
document.body.oncontextmenu = function()
{
return false;
}
document.body.onkeydown = function()
{
if(window.event.keyCode == 32)
{
window.event.cancelBubble = true;
window.event.returnValue = false;
var fChkd = GetValue();
fChkd = (fChkd) ? false : true;
SetValue(fChkd);
chkBox.blur();
}
}
}
//**************************************************
function CheckBox()
{
var hChkBx = document.createElement("DIV");
var hCptn = new Caption();
var hPlyLn = document.createElement("mnydraw:polyline");
hChkBx.id = "chkBox";
hChkBx.tabIndex = 1;
hChkBx.hideFocus = true;
hChkBx.style.position = "absolute";
hChkBx.style.top = 0;
hChkBx.style.left = 0;
hChkBx.style.width = "15pt";
hChkBx.style.height = "15pt";
hChkBx.style.cursor = "default";
hPlyLn.id = "shpOutline";
hPlyLn.fillcolor = StaticColor;
hPlyLn.strokecolor = "#999999";
hPlyLn.points = "0pt,0pt 0pt,8pt 8pt,8pt 8pt,0pt 0pt,0pt";
hChkBx.onfocus = CheckBox_Focus;
hChkBx.onblur = CheckBox_Blur;
hChkBx.onclick = CheckBox_Click;
hChkBx.onkeydown = CheckBox_KeyDown;
hChkBx.appendChild(hCptn);
hChkBx.appendChild(hPlyLn);
return hChkBx;
}
//**************************************************
function Caption()
{
var hCptn = document.createElement("DIV");
hCptn.id = "htmCaption";
hCptn.style.position = "absolute";
hCptn.style.top = "-50pt";
hCptn.style.left = 0;
hCptn.style.fontFamily = ResourceList.documentElement.selectSingleNode("properties/member[@name='Caption']/style[@name='cssFontFamily']").text;
hCptn.style.fontSize = "10pt";
hCptn.style.zIndex = 2;
var hSprt = document.createTextNode(String.fromCharCode(97));
hCptn.appendChild(hSprt);
return hCptn;
}
//**************************************************
function CheckBox_Click()
{
var fVlu = GetValue();
fVlu = (fVlu) ? false : true;
SetValue(fVlu);
chkBox.blur();
}
//**************************************************
function CheckBox_KeyDown()
{
if(window.event.keyCode == 13)
{
var fVlu = GetValue();
fVlu = (fVlu) ? false : true;
SetValue(fVlu);
chkBox.blur();
}
}
//**************************************************
function CheckBox_Focus()
{
shpOutline.fillcolor = HoverColor;
}
//**************************************************
function CheckBox_Blur()
{
shpOutline.fillcolor = StaticColor;
}
//-->
</SCRIPT>
<XML ID="ResourceList">
<MnyVwrRsrc xmlns="urn:schemas-microsoft.com:mnyvwr-resource">
<properties>
<member name="Caption">
<style name="cssFontFamily">Webdings</style>
</member>
</properties>
</MnyVwrRsrc>
</XML>
</HEAD><BODY></BODY></HTML>