<?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>Saturnboy &#187; layout</title>
	<atom:link href="http://saturnboy.com/tag/layout/feed/" rel="self" type="application/rss+xml" />
	<link>http://saturnboy.com</link>
	<description>Code, Work, and Life</description>
	<lastBuildDate>Thu, 01 Mar 2012 22:35:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>FlexLayouts.org Launches, Custom Flex 4 Layouts for the Masses</title>
		<link>http://saturnboy.com/2010/08/flexlayouts-launchs/</link>
		<comments>http://saturnboy.com/2010/08/flexlayouts-launchs/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 03:23:09 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[flexlayouts]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://saturnboy.com/?p=1557</guid>
		<description><![CDATA[FlexLayouts is an open source library of custom Flex 4 layouts that I&#8217;ve veen working on with Gilles Guillemin. Today, I&#8217;m happy to announce the first public beta release, v0.5, is available for immediate download. The FlexLayouts Gallery will be your source for layouts, sample code, and documentation. Today&#8217;s release includes beta versions of two [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flexlayouts.org/">FlexLayouts</a> is an open source library of custom Flex 4 layouts that I&#8217;ve veen working on with <a href="http://www.flexstuff.co.uk/">Gilles Guillemin</a>.  Today, I&#8217;m happy to announce the first public beta release, v0.5, is available for immediate <a href="http://flexlayouts.org/download/">download</a>.  The FlexLayouts <a href="http://flexlayouts.org/gallery/">Gallery</a> will be your source for layouts, sample code, and documentation.  Today&#8217;s release includes beta versions of two simple 2D layouts: <a href="http://flexlayouts.org/2010/08/flowlayout/">FlowLayout</a> and <a href="http://flexlayouts.org/2010/08/snakelayout/">SnakeLayout</a>.</p>
<h3>Our Dream</h3>
<p>We admit v0.5 is not much to look at but imagine a future where a huge number of robust, well tested layouts (both 2D and 3D) exists and is readily available with both sample code and exceptional documentation.  You could just slap together some vanilla Flex components, drop in an awesome custom layout (like Gilles&#8217; <a href="http://www.flexstuff.co.uk/2009/12/23/flex-4-coverflow-layout/">CoverFlowLayout</a>), and ka-BOOM, you have an awesome custom component that impresses co-workers, bosses, and clients equally.  That&#8217;s the dream: to take one of the most portable, re-usable pieces of the Flex framework, make a massive library, and empower the next generation of custom components.</p>
<h3>Ransom Note</h3>
<p>I whipped together a quick sample application using <a href="http://flexlayouts.org/2010/08/flowlayout/">FlowLayout</a> that I&#8217;m calling Ransom Note.  It pulls together a list of images of letters that look as if they were cut out of a magazine or newspaper and pasted together.  It follows one of the most common custom layout patterns which is: <code>List</code> + <code>ItemRenderer</code> + custom layout.  The actual implementation uses the lighter weight version: <code>DataGroup</code> + <code>DataRenderer</code> + custom layout, because I don&#8217;t need any of the list selection stuff.</p>
<p>Check out the finished product:</p>
<p>&raquo; <a href="http://saturnboy.com/proj/flex4/ransom_note/RansomNote.html">RansomNote</a> (view source enabled)</p>
<h5>Files</h5>
<ul>
<li><a href="http://saturnboy.com/proj/flex4/ransom_note/RansomNote.html">RansomNote</a> (<a href="http://saturnboy.com/proj/flex4/ransom_note/srcview/RansomNote.zip">download</a>)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://saturnboy.com/2010/08/flexlayouts-launchs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FlowLayout in Flex 4</title>
		<link>http://saturnboy.com/2009/10/flow-layout/</link>
		<comments>http://saturnboy.com/2009/10/flow-layout/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 04:15:41 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[flex4]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://saturnboy.com/?p=717</guid>
		<description><![CDATA[NOTE: See FlexLayouts for all your custom Flex 4 layout needs, and FlowLayout for the latest version. Another one of my favorite improvements that found its way into Flex 4 is the separation of layouts from containers. The fact that layouts can customized and simply plugged into any container is pretty sweet. It&#8217;s a real [...]]]></description>
			<content:encoded><![CDATA[<p class="bottom"><b>NOTE:</b> See <a href="http://flexlayouts.org/">FlexLayouts</a> for all your custom Flex 4 layout needs, and <a href="http://flexlayouts.org/2010/08/flowlayout">FlowLayout</a> for the latest version.</p>
<hr />
<p>Another one of my favorite improvements that found its way into Flex 4 is the separation of layouts from containers.  The fact that layouts can customized and simply plugged into any container is pretty sweet.  It&#8217;s a real developer benefit because it makes me faster.  I can quickly develop a custom component by leveraging a stock layout.  Alternately, I can develop a &#8220;new&#8221; component by creating a custom layout and plugging it into a stock container.</p>
<h5>Layout References</h5>
<p class="bottom">Here&#8217;s a short list of useful Flex 4 layout references I was able to dig up.  If you have anything to add, please leave a comment, and I&#8217;ll update this list.</p>
<ul>
<li><a href="http://evtimmy.com/">Easy Flex</a> &#8211; Evtim&#8217;s blog (one of Adobe&#8217;s layout engineers)
<li><a href="http://www.adobe.com/devnet/flex/articles/spark_layouts.html">Spark Layouts in Flex 4</a> &#8211; various iterations on the Flow layout by Evtim
<li><a href="http://www.insideria.com/2009/05/flex-4-custom-layouts.html">Flex 4 Custom Layouts</a> &#8211; a nice circular layout
<li><a href="http://www.ryancampbell.com/2009/06/16/heres-5-3d-layouts-for-flex-4/">5 3D Layouts for Flex 4</a> &#8211; an awesome collection of 3D layouts
</ul>
<h5>My FlowLayout</h5>
<p>I started with <a href="http://evtimmy.com/2009/06/flowlayout-a-spark-custom-layout-example/">Evtim&#8217;s FlowLayout</a> and made a few modifications of my own.  I added a single <code>gap</code> parameter that controls both the horizontal and vertical separation of elements, and a <code>border</code> parameter that controls the padding around the outside of all the elements.  The other major difference is how my version of the Flow layout handles the very first element.</p>
<p class="bottom">I make sure the first element (when <code>i = 0</code>) is never shifted down, with a simple <code>if (i > 0)</code> check:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//does the element fit on this line, or should we move to the next line?</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">x</span> <span style="color: #000066; font-weight: bold;">+</span> elementWidth <span style="color: #000066; font-weight: bold;">&gt;</span> containerWidth<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #009900; font-style: italic;">//start from the left side</span>
    <span style="color: #004993;">x</span> = _border<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">//move to the next line, and add the gap</span>
    <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>i <span style="color: #000066; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//never shift the first element down</span>
        <span style="color: #004993;">y</span> <span style="color: #000066; font-weight: bold;">+</span>= elementHeight <span style="color: #000066; font-weight: bold;">+</span> _gap<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p class="bottom">Here it is (view source enabled):</p>
<div id="flashcontent-flow-layout-simple">
Flash is required.  <a href="http://www.adobe.com/go/getflashplayer">Get it here!</a>
</div>
<h5>Files</h5>
<ul>
<li><a href="http://saturnboy.com/proj/flex4/layouts/FlowLayoutSimple/FlowLayoutSimple.html">FlowLayoutSimple</a> (<a href="http://saturnboy.com/proj/flex4/layouts/FlowLayoutSimple/srcview/FlowLayoutSimple.zip">download</a>)</li>
</ul>
<blockquote><p><b>NOTE:</b> All code was built with Flash Builder 4 Beta 1.</p></blockquote>
<div>
<script type="text/javascript">
swfobject.embedSWF('http://saturnboy.com/proj/flex4/layouts/FlowLayoutSimple/FlowLayoutSimple.swf', 'flashcontent-flow-layout-simple', '550', '395', '10.0.0', 'playerProductInstall.swf', false, { bgColor:'#ffffff', base:'.' });
</script>
</div>
]]></content:encoded>
			<wfw:commentRss>http://saturnboy.com/2009/10/flow-layout/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

