Make it possible to disable listboxes b=98595 r=varga sr=bryner

git-svn-id: svn://10.0.0.236/trunk@168347 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk 2005-01-26 09:54:33 +00:00
parent 3ad030d95e
commit 0c704ef8d8
4 changed files with 27 additions and 4 deletions

View File

@ -56,6 +56,10 @@ listbox {
color: -moz-FieldText;
}
listbox[disabled="true"] {
color: GrayText;
}
.listcell-label {
margin: 0px !important;
padding: 0px 0px 1px 4px;
@ -170,4 +174,4 @@ listheader[sortable="true"]:hover:active {
.listcell-check[disabled="true"][checked="true"] {
background-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
}
}

View File

@ -57,6 +57,10 @@ listbox {
-moz-appearance: listbox;
}
listbox[disabled="true"] {
color: GrayText;
}
/* ::::: listitem ::::: */
listitem {

View File

@ -56,6 +56,10 @@ listbox {
color: #000000;
}
listbox[disabled="true"] {
color: #999999;
}
/* ::::: listitem ::::: */
listitem {

View File

@ -59,6 +59,11 @@
<!-- ///////////////// public listbox members ///////////////// -->
<property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
else this.removeAttribute('disabled');
return val;"
onget="return this.hasAttribute('disabled');"/>
<property name="listBoxObject"
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIListBoxObject);"
readonly="true"/>
@ -800,6 +805,7 @@
click, so that drags work correctly. -->
<handler event="mousedown">
<![CDATA[
if (this.parentNode.disabled) return;
if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {
if (!this.selected) {
parentNode.selectItem(this);
@ -811,9 +817,9 @@
<!-- On a click (up+down on the same item), deselect everything
except this item. -->
<handler event="click">
<handler event="click" button="0">
<![CDATA[
if (event.button != 0) return;
if (this.parentNode.disabled) return;
if (parentNode.selType != "multiple") {
parentNode.selectItem(this);
}
@ -889,7 +895,12 @@
</implementation>
<handlers>
<handler event="mousedown" button="0" action="if (!this.disabled) this.checked = !this.checked;"/>
<handler event="mousedown" button="0">
<![CDATA[
if (!this.disabled && !this.parentNode.disabled)
this.checked = !this.checked;
]]>
</handler>
</handlers>
</binding>