How to customize flex tree icon programatically - apache-flex

I can modify the icons of mx.controls.Tree component using setStyle
tree.setStyle("disclosureOpenIcon",myIcon1);
tree.setStyle("disclosureClosedIcon",myIcon2);
tree.setStyle("folderClosedIcon",myIcon3);
tree.setStyle("folderOpenIcon",myIcon4);
tree.setStyle("defaultLeafIcon",myIcon5);
Where myIconx is of class "Class" which is embedded images.
But i need to customize the icons in a way that icons should be drawn using actionscript, we can use a component extended from sprite/uicomponent for showing an actionscript drawing. But how we can use that as a tree icon?

Make a custom item renderer, read documentation http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/treeClasses/TreeItemRenderer.html ,

Related

Dynamically change QStyle at runtime?

I want to tweak the existing style at runtime, specifically QStyle::PM_ToolBarIconSize. Can this be done? As far as I can tell, you can only inherit QStyle and override pixelMetric().
Edit 1: In the specific case of QStyle::PM_ToolBarIconSize, I could use QToolBar::setIconSize, but that would set the icon size for just a single toolbar instance. I want to change the underlying style hint to affect all toolbars everywhere with one fell swoop. And QStyle::PM_ToolBarIconSize may not be the only style I want to tweak, it's just the first one I'm looking at that just so happens to have a "change this instance's icon size" function.
Edit 2: I can't just make a new style subclass because the current style is already a custom style based on style sheets. There are several styles that a user can choose from. I don't want to create a bunch of new styles just so I can tweak a couple of toolbar icon or menu height size settings.
This is the exact purpose of QProxyStyle.
Why not overriding QStyle then? Your subclass would return an icon size (via pixelMetric) which depends on a settable parameter of your QStyle.
As Qt does not have a dynamic QStyle mechanism, it is better to create a new style instance with the changed icon size, then set it to the QApplication, rather than altering the current style.

Flex - Custom tooltip style for a single component

How can we customize the background and font color of a single instance of a tooltip for one component? (Without changing all tooltips in the application.)
This is needed for the HALO component set (4.1 SDK), not Spark (css methods preferred).
Created a named style, using styles that are applicable to the ToolTip component; and when you create the ToolTip specify that style.
You can read these instructions for customizing a ToolTip.
Basically, listen to the toolTipShown event and set the styleName on the toolTip.

Qt widget com problem

I have a Rectangle widget, and a resize box widget, and a text edit widget. How can I compose them without using layouts ? I want all of them as a single widget.
The documentation for how to do a manual layout is in Qt Layout Management here.
Are you sure you can't use one of the standard layouts? You can make a custom widget with three children positioned inside using a layout (or layouts) and your new custom widget will still be just a single widget.

How to customize accordion and panel look

I want to increase the (height) size and change the color of a spark accordion header, similarly I want to change the color of a spark panel header. Can I do this through mxml properties and css or will I need to use a custom skin?
I recommend creating a custom skin. That was the way Spark was designed to be customized. Specific styles and the sort are almost an afterthought.

Flex combobox custom icon

Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this?
The "properties" are actually styles on ComboBase: upSkin, downSkin, overSkin, disabledSkin.
The default is ComboBoxArrowSkin--take a look at the source code to get more details about overriding or customizing it.

Resources