<?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>Flex Examples &#187; arrowButtonWidth</title>
	<atom:link href="http://blog.flexexamples.com/tag/arrowbuttonwidth/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing the width of the arrow button in a Flex PopUpButton control</title>
		<link>http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 08:29:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[arrowButtonWidth]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/</guid>
		<description><![CDATA[<p>The following example shows you how you can customize the width of the PopUpButton control&#8217;s arrow button in Flex by setting the arrowButtonWidth style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_arrowButtonWidth_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Style&#62; PopUpButton { popUpStyleName: myCustomPopUpStyleName; } .myCustomPopUpStyleName { fontWeight: normal; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can customize the width of the PopUpButton control&#8217;s arrow button in Flex by setting the <code>arrowButtonWidth</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-500"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_arrowButtonWidth_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        PopUpButton {
            popUpStyleName: myCustomPopUpStyleName;
        }

        .myCustomPopUpStyleName {
            fontWeight: normal;
            textAlign: left;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Menu;

            private var menu:Menu;

            private function init():void {
                menu = new Menu();
                menu.labelField = "@label";
                menu.dataProvider = xmlList;
                popUpButton.popUp = menu;
                menu.maxWidth = popUpButton.width;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XMLList id="xmlList"&gt;
        &lt;node label="Alert" /&gt;
        &lt;node label="Button" /&gt;
        &lt;node label="ButtonBar" /&gt;
        &lt;node label="CheckBox" /&gt;
        &lt;node label="ColorPicker" /&gt;
        &lt;node label="ComboBox" /&gt;
    &lt;/mx:XMLList&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="arrowButtonWidth:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="16"
                        maximum="64"
                        value="16"
                        snapInterval="1"
                        tickInterval="4"
                        showTrackHighlight="true"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:PopUpButton id="popUpButton"
            label="Please select an item..."
            openAlways="true"
            arrowButtonWidth="{slider.value}"
            creationComplete="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_arrowButtonWidth_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_arrowButtonWidth_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>Since <code>arrowButtonWidth</code> is a style, you can also set it&#8217;s value in an external .CSS file or within an &lt;mx:Style /&gt; block, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    PopUpButton {
        <strong style="color:red;">arrowButtonWidth: 96;</strong>
        popUpStyleName: myCustomPopUpStyleName;
    }

    .myCustomPopUpStyleName {
        fontWeight: normal;
        textAlign: left;
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you can set the <code>arrowButtonWidth</code> style using ActionScript, as seen in the following snippet:</p>
<pre class="code">
popUpButton.setStyle("arrowButtonWidth", 96);
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the width of the arrow button in a Flex PopUpButton control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/',contentID: 'post-500',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'arrowButtonWidth',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/30/changing-the-width-of-the-arrow-button-in-a-flex-popupbutton-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

