<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Idle Hacking &#187; XBL</title>
	<atom:link href="http://www.idle-hacking.com/tag/xbl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.idle-hacking.com</link>
	<description>Ruby, XUL/Javascript, C/C++, and more...</description>
	<lastBuildDate>Tue, 11 May 2010 02:15:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Understanding nsITreeView getCellProperties and getRowProperties</title>
		<link>http://www.idle-hacking.com/2006/06/understanding-nsitreeview-getcellproperties-and-getrowproperties/</link>
		<comments>http://www.idle-hacking.com/2006/06/understanding-nsitreeview-getcellproperties-and-getrowproperties/#comments</comments>
		<pubDate>Sun, 18 Jun 2006 16:13:00 +0000</pubDate>
		<dc:creator>taf2</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XBL]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://www.idle-hacking.com/2006/06/understanding-nsitreeview-getcellproperties-and-getrowproperties/</guid>
		<description><![CDATA[You may have read the following text from xulplanet An atomized list of properties for a given cell. Each property, x, that the view gives back will cause the pseudoclass :moz-tree-cell-x to be matched on the ::moz-tree-cell pseudoelement. and start scratching your head wondering what it means. After searching through mozilla source for some examples [...]]]></description>
			<content:encoded><![CDATA[<p>You may have read the following text from <a href="http://www.xulplanet.com/references/xpcomref/ifaces/nsITreeView.html#method_getCellProperties">xulplanet</a><br />
<br/></p>
<blockquote><p>An atomized list of properties for a given cell.  Each property, x, that the view gives back will cause the pseudoclass :moz-tree-cell-x to be matched on the ::moz-tree-cell pseudoelement.</p></blockquote>
<p><br/><br />
and start scratching your head wondering what it means.  After searching through mozilla source for some examples of how <a href="http://lxr.mozilla.org/mozilla1.8/source/calendar/resources/content/unifinderToDo.js#301">getCellProperties </a>or getRowProperties work, I finally figured it out and have a much greater respect for how the nsITreeView can really be customized.   First an example of styling a specific cell and a complete row, assuming you already know how to setup your own <a href="http://www.xulplanet.com/tutorials/xultu/treeview.html">nsITreeView</a>:<br/><br />
<br/><br />
The getCellProperties in our nsITreeView, checks the status column on a row and sets a property record_closed if the records status is closed:<br />
<br/></p>
<pre lang="javascript">
 getCellProperties: function(row,col,props){
  this._fetchToRow(row);
  var record = this.records[row];
  if( record.status == "Closed" ){
    var aserv=CC["@mozilla.org/atom-service;1"].getService(CI.nsIAtomService);
    props.AppendElement(aserv.getAtom("record_closed"));
    if( col.id == "status_id" ){
      props.AppendElement(aserv.getAtom("record_status_closed"));
    }
  }
}
</pre>
<p>So, what is this property on the cell &#8216;record_closed&#8217; and &#8216;record_status_closed&#8217;?  It made sense to me once I found this using lxr, and realized I could control the style on the cell using it like this:</p>
<pre lang="css">
treechildren::-moz-tree-cell-text(record_closed,record_status_closed) {
text-decoration:line-through;
font-weight:bold;
}
treechildren::-moz-tree-cell-text(record_closed) {
color:gray;
}
</pre>
<p>Basically, it works like a <a href="http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors">CSS attribute selector</a>.</p>
<p>So, now I can style the column that indicates the status as closed with a line through and color each of the cells with a gray font.   getRowProperties works the same you just can&#8217;t effect the cell fonts, but you can effect the whole row background.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.idle-hacking.com/2006/06/understanding-nsitreeview-getcellproperties-and-getrowproperties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XUL Datepicker XBL Binding</title>
		<link>http://www.idle-hacking.com/2005/09/xul-datepicker-xbl-binding/</link>
		<comments>http://www.idle-hacking.com/2005/09/xul-datepicker-xbl-binding/#comments</comments>
		<pubDate>Thu, 15 Sep 2005 00:42:00 +0000</pubDate>
		<dc:creator>taf2</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Datepicker]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XBL]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://www.idle-hacking.com/2005/09/xul-datepicker-xbl-binding/</guid>
		<description><![CDATA[I&#8217;ve been using this great datepicker for some projects. The only thing about it that hasn&#8217;t been very nice is that its an overlay so when used you have to be careful about mixing up ids. I typically use it with an input box and a nice calendar button. So, building on the work of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://in.geocities.com/skexz/tuts/xul/datepicker.htm">this</a> great datepicker for some projects.  The only thing about it that hasn&#8217;t been very nice is that its an overlay so when used you have to be careful about mixing up ids.   I typically use it with an input box and a nice calendar button.  So, building on the work of the datepicker I bundled it into an easy to use XBL widget.</p>
<p><span style="text-decoration: line-through;"><a href="http://xullicious.com/datepicker/datepicker.tar.gz">datepicker XBL binding</a></span><br />
<strong>Updated Link:</strong><a href="http://xullicious.com/datepicker/datepicker.tar.gz">datepicker XBL binding</a></p>
<p>to use it unpack the tar ball, and add some css like:</p>
<p><code><br />
datepicker{<br />
-moz-binding: url("chrome://<strong>package</strong>/content/datepicker.xml#datepicker");<br />
}<br />
</code></p>
<p>Also, note that you&#8217;ll have to go through the files and fix the chrome paths to match the <strong>package</strong> your using the datepicker from.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.idle-hacking.com/2005/09/xul-datepicker-xbl-binding/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
