<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Styling Flexlib&#8217;s WindowShade</title>
	<atom:link href="http://saturnboy.com/2009/03/styling-flexlib-windowshade/feed/" rel="self" type="application/rss+xml" />
	<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/</link>
	<description>Code, Work, and Life</description>
	<lastBuildDate>Mon, 23 Jan 2012 16:21:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: xiahui</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-302</link>
		<dc:creator>xiahui</dc:creator>
		<pubDate>Wed, 29 Jun 2011 13:44:49 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-302</guid>
		<description>thanks for your answer.  I have solved this question, but the solved method isn&#039;t clever.
the reason of checkbox&#039;s icon can&#039;t updated with the current state of the shade (open or closed) is that checkbox locate in headerRenderer. If open/close the WindowShade, headerRenderer is not changed, so the data of headerRenderer is not changed.
    
The property selected of checkbox isn&#039;t changed because the render isn&#039;t updated. So, I update the headerRenderer.

		
		
			
				
			
		
	
  
    
protected function shade_creationCompleteHandler(event:FlexEvent):void
			{
				shade.headerRenderer=new  ClassFactory(itemh); 
				//headerRenderer=&quot;itemh&quot;
				
			}
			
			protected function shade_openedChangedHandler(event:WindowShadeEvent):void
			{
				shade.headerRenderer=new  ClassFactory(itemh); 
			}
At last,I want to ask why header is only in render,but a component member of windowshade
Thanks</description>
		<content:encoded><![CDATA[<p>thanks for your answer.  I have solved this question, but the solved method isn&#8217;t clever.<br />
the reason of checkbox&#8217;s icon can&#8217;t updated with the current state of the shade (open or closed) is that checkbox locate in headerRenderer. If open/close the WindowShade, headerRenderer is not changed, so the data of headerRenderer is not changed.</p>
<p>The property selected of checkbox isn&#8217;t changed because the render isn&#8217;t updated. So, I update the headerRenderer.</p>
<p>protected function shade_creationCompleteHandler(event:FlexEvent):void<br />
			{<br />
				shade.headerRenderer=new  ClassFactory(itemh);<br />
				//headerRenderer=&#8221;itemh&#8221;</p>
<p>			}</p>
<p>			protected function shade_openedChangedHandler(event:WindowShadeEvent):void<br />
			{<br />
				shade.headerRenderer=new  ClassFactory(itemh);<br />
			}<br />
At last,I want to ask why header is only in render,but a component member of windowshade<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-301</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Tue, 28 Jun 2011 20:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-301</guid>
		<description>@xiahui: Something must get updated with the current state of the shade (open or closed).  I suggest using the debugger.  Wire up the event listeners and set a breakpoint inside &lt;code&gt;openHandler()&lt;/code&gt;.

Alternately, you can keep track of the state manually, just say &lt;code&gt;isOpen = true&lt;/code&gt; in the &lt;code&gt;openHandler()&lt;/code&gt; and &lt;code&gt;isOpen = false&lt;/code&gt; in the &lt;code&gt;closeHandler()&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>@xiahui: Something must get updated with the current state of the shade (open or closed).  I suggest using the debugger.  Wire up the event listeners and set a breakpoint inside <code>openHandler()</code>.</p>
<p>Alternately, you can keep track of the state manually, just say <code>isOpen = true</code> in the <code>openHandler()</code> and <code>isOpen = false</code> in the <code>closeHandler()</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xiahui</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-300</link>
		<dc:creator>xiahui</dc:creator>
		<pubDate>Tue, 28 Jun 2011 13:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-300</guid>
		<description>I maybe describe my question.
I only want to change checkbox&#039;s icon when opening/closing the shade, but &lt;code&gt;WindowShade(parent).opened&lt;/code&gt; doesn’t get updated  – it just keeps the initial value. how can i do?</description>
		<content:encoded><![CDATA[<p>I maybe describe my question.<br />
I only want to change checkbox&#8217;s icon when opening/closing the shade, but <code>WindowShade(parent).opened</code> doesn’t get updated  – it just keeps the initial value. how can i do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xiahui</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-299</link>
		<dc:creator>xiahui</dc:creator>
		<pubDate>Tue, 28 Jun 2011 13:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-299</guid>
		<description>i meet the same quesion with Opher in flex4, i also want to  use 
  &lt;code&gt;shade.addEventListener(WindowShadeEvent.OPEN_BEGIN, openHandler);&lt;/code&gt;
but how to write &lt;code&gt;openHandler()&lt;/code&gt; function?</description>
		<content:encoded><![CDATA[<p>i meet the same quesion with Opher in flex4, i also want to  use<br />
  <code>shade.addEventListener(WindowShadeEvent.OPEN_BEGIN, openHandler);</code><br />
but how to write <code>openHandler()</code> function?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-277</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Wed, 06 Apr 2011 21:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-277</guid>
		<description>@Opher:  You could try to listen for the open/close events directly on the shade like this:

&lt;pre lang=&quot;actionscript&quot;&gt;
shade.addEventListener(WindowShadeEvent.OPEN_BEGIN, openHandler);
shade.addEventListener(WindowShadeEvent.CLOSE_END, closeHandler);
&lt;/pre&gt;

Then you can do whatever you need to do in the event handlers.</description>
		<content:encoded><![CDATA[<p>@Opher:  You could try to listen for the open/close events directly on the shade like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">OPEN_BEGIN</span>, openHandler<span style="color: #66cc66;">&#41;</span>;
shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">CLOSE_END</span>, closeHandler<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Then you can do whatever you need to do in the event handlers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Opher</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-276</link>
		<dc:creator>Opher</dc:creator>
		<pubDate>Wed, 06 Apr 2011 21:00:47 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-276</guid>
		<description>Hi,

I&#039;ve been trying to use this technique, but it seems like &quot;WindowShade(parent).opened&quot; doesn&#039;t get updated when opening/closing the shade - it just keeps the initial value, so the checkbox doesn&#039;t change its state. . Any idea what I&#039;m doing wrong?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;ve been trying to use this technique, but it seems like &#8220;WindowShade(parent).opened&#8221; doesn&#8217;t get updated when opening/closing the shade &#8211; it just keeps the initial value, so the checkbox doesn&#8217;t change its state. . Any idea what I&#8217;m doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-273</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Tue, 29 Mar 2011 05:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-273</guid>
		<description>Thanks! That works for me!</description>
		<content:encoded><![CDATA[<p>Thanks! That works for me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-272</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Mon, 28 Mar 2011 17:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-272</guid>
		<description>@Abhishek: If you want a border outside the windowshade, I&#039;d be tempted to just put the shade into a container with a border.  Simple is best.</description>
		<content:encoded><![CDATA[<p>@Abhishek: If you want a border outside the windowshade, I&#8217;d be tempted to just put the shade into a container with a border.  Simple is best.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-271</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Mon, 28 Mar 2011 17:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-271</guid>
		<description>Great read! I am using the &lt;code&gt;flexlib:WindowShade&lt;/code&gt; for a project myself, and I found your article very helpful. I have a question though - is it possible to draw a border around the whole windowshade? Say, to signify the user wants focus on a current windowshade?</description>
		<content:encoded><![CDATA[<p>Great read! I am using the <code>flexlib:WindowShade</code> for a project myself, and I found your article very helpful. I have a question though &#8211; is it possible to draw a border around the whole windowshade? Say, to signify the user wants focus on a current windowshade?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-141</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Wed, 19 May 2010 16:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-141</guid>
		<description>@Umesh:  If you want to change the style at runtime, the easiest thing to do is to use &lt;code&gt;getStyle()&lt;/code&gt; and &lt;code&gt;setStyle()&lt;/code&gt;.

So, if I wanted to switch styles on the header on open &amp; close, I just listen for the correct events and use &lt;code&gt;setStyle()&lt;/code&gt; to make the switch.

&lt;pre lang=&quot;actionscript&quot;&gt;
shade.addEventListener(WindowShadeEvent.OPEN_BEGIN,
    function(e:Event):void {
        shade.setStyle(&#039;headerStyleName&#039;, &#039;headOpen&#039;);
    });
shade.addEventListener(WindowShadeEvent.CLOSE_END,
    function(e:Event):void {
        shade.setStyle(&#039;headerStyleName&#039;, &#039;headClose&#039;);
    });
&lt;/pre&gt;

And then define two CSS styles for &lt;code&gt;headOpen&lt;/code&gt; and &lt;code&gt;headClose&lt;/code&gt; with different background colors.

Good luck.</description>
		<content:encoded><![CDATA[<p>@Umesh:  If you want to change the style at runtime, the easiest thing to do is to use <code>getStyle()</code> and <code>setStyle()</code>.</p>
<p>So, if I wanted to switch styles on the header on open &#038; close, I just listen for the correct events and use <code>setStyle()</code> to make the switch.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">OPEN_BEGIN</span>,
    <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        shade.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'headerStyleName'</span>, <span style="color: #ff0000;">'headOpen'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">CLOSE_END</span>,
    <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        shade.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'headerStyleName'</span>, <span style="color: #ff0000;">'headClose'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>And then define two CSS styles for <code>headOpen</code> and <code>headClose</code> with different background colors.</p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

