You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhky/web/js/2k3ButtonBar.htc

129 lines
3.2 KiB

1 year ago
<PUBLIC:COMPONENT
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>lightWeight<EFBFBD>=<3D>true
>
<PUBLIC:DEFAULTS
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>contentEditable<EFBFBD>=<3D>false
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>tabStop<EFBFBD>=<3D>true
/>
<PUBLIC:attach event="ondocumentready" onevent="initElement()" />
<PUBLIC:attach event="onmouseover" onevent="elementOnMouseOver()" />
<PUBLIC:attach event="onmouseout" onevent="elementOnMouseOut()" />
<PUBLIC:attach event="onmousedown" onevent="elementOnMouseDown()" />
<PUBLIC:attach event="onmouseup" onevent="elementOnMouseUp()" />
<PUBLIC:attach event="onselectstart" onevent="elementOnSelect()" />
<PUBLIC:attach event="oncontextmenu" onevent="elementOnContextMenu()" />
<PUBLIC:attach event="ondetach" onevent="cleanupElement()" />
<PUBLIC:property name="activeChild" value=null put="setActiveChild" get="returnActiveChild" />
<script language="jscript">
// ----------------------------------------------------
// 2k3Widgets: 2k3ButtonBar
//
// Copyright <20>2002-2004 Stedy Software and Systems
// Please see http://www.stedy.com for terms of use.
// ----------------------------------------------------
var objTableBody = null ;
var objTableRow = null ;
var objTableEndCap = null ;
var objTableSpacerCell = null ;
function initElement() {
objTableBody = element.tBodies[0] ;
objTableRow = objTableBody.children[0] ;
objTableEndCap = objTableRow.children[objTableRow.children.length - 1] ;
objTableEndCap.title = "Toolbar Options" ;
objTableSpacerCell = objTableRow.insertCell() ;
objTableSpacerCell.style.width = "100%" ;
if (element.className == "2k3StaticButtonBar") {
objTableSpacerCell.className = "2k3ButtonContainer" ;
}
}
function cleanupElement() {
if (objTableSpacerCell != null) {
objTableSpacerCell.removeNode(true) ;
}
}
function elementOnMouseOver() {
if (window.event.srcElement == objTableEndCap) {
if (element.className != "2k3StaticButtonBar") {
objTableEndCap.className = "2k3ButtonBarEndCapOver" ;
}
}
}
function elementOnMouseOut() {
if (window.event.srcElement == objTableEndCap) {
if (element.className != "2k3StaticButtonBar") {
objTableEndCap.className = "2k3ButtonBarEndCap" ;
}
}
}
function elementOnMouseDown() {
if (window.event.srcElement == objTableEndCap) {
if (element.className != "2k3StaticButtonBar") {
objTableEndCap.className = "2k3ButtonBarEndCapActive" ;
}
}
}
function elementOnMouseUp() {
if (window.event.srcElement == objTableEndCap) {
if (element.className != "2k3StaticButtonBar") {
objTableEndCap.className = "2k3ButtonBarEndCapOver" ;
}
}
}
function elementOnSelect() {
with (window.event) {
cancelBubble = true ;
returnValue = false ;
}
return false ;
}
function elementOnContextMenu() {
with (window.event) {
cancelBubble = true ;
returnValue = false ;
}
return false ;
}
function setActiveChild(el) {
element.parentElement.activeChild = el ;
}
function returnActiveChild() {
return element.parentElement.activeChild ;
}
function makeBooleanOfAttribute(attName) {
a = element.getAttribute(attName) ;
if (typeof(a) == "boolean") {
return a ;
}
else if (a == null) {
a = false ;
}
else if (typeof(a) == "string") {
a = a.toLowerCase() ;
a = (a == "true" || a == "1" || a == "yes") ;
}
else {
a = new Boolean(a) ;
}
return a ;
}
</script>
</PUBLIC:COMPONENT>