Your SlideShare is downloading. ×
0
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Specifying tree control icons
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Specifying tree control icons

867

Published on

Specifying Tree Control icons in Flex

Specifying Tree Control icons in Flex

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
867
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Specifying Tree control icons Hemakumar.S Open Source Developer
  • 2. Specifying Tree control icons <ul><li>The Tree control provides four techniques for specifying node icons: </li></ul><ul><li>The folderOpenIcon, folderClosedIcon, and defaultLeafIcon properties </li></ul><ul><li>Data provider node icon fields </li></ul><ul><li>The set Item Icon() method </li></ul><ul><li>The iconFunction property </li></ul><ul><li>Using icon properties: </li></ul><ul><li>You can use the folderOpenIcon, folderClosedIcon, and default Leaf Icon properties to control the Tree control icons. </li></ul>
  • 3. Using icon fields <ul><li>Example: </li></ul><ul><li>&lt;?xml version=&amp;quot;1.0&amp;quot;?&gt; </li></ul><ul><li>&lt;!-- dpcontrols/TreeIconField.mxml --&gt; </li></ul><ul><li>&lt;mx:Application xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot;&gt; </li></ul><ul><li>&lt;mx:Script&gt; </li></ul><ul><li>&lt;![CDATA[ </li></ul><ul><li>[Bindable] </li></ul><ul><li>[Embed(source=&amp;quot;assets/images.jpg&amp;quot;)] </li></ul><ul><li>public var iconSymbol1:Class; </li></ul><ul><li>[Bindable] </li></ul><ul><li>[Embed(source=&amp;quot;assets/images1.jpg&amp;quot;)] </li></ul><ul><li>public var iconSymbol2:Class; </li></ul><ul><li>]]&gt; </li></ul><ul><li>&lt;/mx:Script&gt; </li></ul>
  • 4. Cont…. <ul><li>&lt;mx:Tree iconField=&amp;quot;@icon&amp;quot; labelField=&amp;quot;@label&amp;quot; showRoot=&amp;quot;false&amp;quot; width=&amp;quot;160&amp;quot;&gt; </li></ul><ul><li>&lt;mx:XMLList&gt; </li></ul><ul><li>&lt;node label=&amp;quot;New&amp;quot;&gt; </li></ul><ul><li>&lt;node label=&amp;quot;HTML Document&amp;quot; icon=&amp;quot;iconSymbol2&amp;quot;/&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Text Document&amp;quot; icon=&amp;quot;iconSymbol2&amp;quot;/&gt; </li></ul><ul><li>&lt;/node&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Close&amp;quot; icon=&amp;quot;iconSymbol1&amp;quot;/&gt; </li></ul><ul><li>&lt;/mx:XMLList&gt; </li></ul><ul><li>&lt;/mx:Tree&gt; </li></ul><ul><li>&lt;/mx:Application&gt; </li></ul>
  • 5. Screen Shot
  • 6. Using the setItemIcon() method <ul><li>Example: </li></ul><ul><li>&lt;?xml version=&amp;quot;1.0&amp;quot;?&gt; </li></ul><ul><li>&lt;!-- dpcontrols/TreeOpenNode.mxml --&gt; </li></ul><ul><li>&lt;mx:Application xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot;&gt; &lt;mx:Script&gt; </li></ul><ul><li>&lt;![CDATA[ </li></ul><ul><li>import flash.events.*; </li></ul><ul><li>import mx.events.*; </li></ul><ul><li>import mx.controls.*; </li></ul><ul><li>private function initTree():void </li></ul><ul><li>{ </li></ul><ul><li>XMLTree1.expandItem(MailBox.getItemAt(0), true); </li></ul><ul><li>XMLTree1.selectedIndex = 2; </li></ul>
  • 7. Cont…. <ul><li>} </li></ul><ul><li>]]&gt; </li></ul><ul><li>&lt;/mx:Script&gt; </li></ul><ul><li>&lt;mx:Tree id=&amp;quot;XMLTree1&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;170&amp;quot; labelField=&amp;quot;@label&amp;quot; creationComplete=&amp;quot;initTree();&amp;quot;&gt; </li></ul><ul><li>&lt;mx:XMLListCollection id=&amp;quot;MailBox&amp;quot;&gt; </li></ul><ul><li>&lt;mx:XMLList&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Mail&amp;quot; data=&amp;quot;100&amp;quot;&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Inbox&amp;quot; data=&amp;quot;70&amp;quot;/&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Personal Folder&amp;quot; data=&amp;quot;10&amp;quot;&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Business&amp;quot; data=&amp;quot;2&amp;quot;/&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Demo&amp;quot; data=&amp;quot;3&amp;quot;/&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Saved Mail&amp;quot; data=&amp;quot;5&amp;quot; /&gt; </li></ul><ul><li>&lt;/node&gt; </li></ul>
  • 8. Cont…. <ul><li>&lt;node label=&amp;quot;Sent&amp;quot; data=&amp;quot;15&amp;quot;/&gt; </li></ul><ul><li>&lt;node label=&amp;quot;Trash&amp;quot; data=&amp;quot;5&amp;quot;/&gt; </li></ul><ul><li>&lt;/node&gt; </li></ul><ul><li>&lt;/mx:XMLList&gt; </li></ul><ul><li>&lt;/mx:XMLListCollection&gt; </li></ul><ul><li>&lt;/mx:Tree&gt; </li></ul><ul><li>&lt;/mx:Application&gt; </li></ul>
  • 9. Screen Shot
  • 10. Thank you....

×