Flex combobox custom icon - apache-flex

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.

Related

Qt Designer button image change while keeping windows style?

I can change the image or any other style of a QPushButton in the designer by changing the stylesheet, but any change in the style sheet changes all the other properties.
For instance, when I change the border image everything else is changed and it does not inherit the rest of the properties from the parent (or windows style).
How can I keep the windows style while changing only the image?
From How can I set Styles to a QTabwidget without overwriting existing styles in QT ?:
A style sheet is all or nothing. so if u all apply style sheet, it
might sort of reset the look for some widgets and to fix that, you
must supply a full stylesheet.
The key parts are:
A style sheet is all or nothing.
you must supply a full stylesheet.
You can set an image for the QPushButton from the code or by using QtDesigner like this:
Select the button
In the properties window set the image and the
size (properties icon and iconSize).
Did you try set style to the single push button:
your_push_button_pointer->setStyleSheet(
"QPushButton{background-image: url(:/images/call_up.bmp);}"
"QPushButton:hover{background-image: url(:/images/call_hov.bmp);}"
"QPushButton:pressed{background-image: url(:/images/call_down.bmp);}");

Change BorderColor of clicked item (itemrenderer) in List

Hello I want to set the BorderColor of certain Item Renderers (textInput) of a List. By default all have a common border color, but I want for example when clicking in an item to have a red border.
I tried this on a click event in my itemRenderer,
mytextInput.setStyle("color", 0xDDDDDD);
But it does not seem to work.
Any help.
Thx
As far as you're extending Spark TextInput control all the problems of that kind should be solved using skins. Create custom skin with the border you like.

Is there a css attribute to specify a background color for a LinkButton's up state?

There are styles for over and clicked but no up state.
Is it possible?
You can use the upSkin style or the skin style to define the background of a button
So, instead of referencing the downSkin, or overSkin, or disabledSkin, you would just reference 'skin' or upSkin.
I believe you'll need an actual skin, and not an image to accomplish this, though.
http://www.adobe.com/devnet/flex/articles/skins_styles.html

flex custom itemRenderer doesn't use the styles specified

I have a custom item renderer which I use for my DataGrid. The DataGrid has specified selectionColor, rollOverColor and themeColor. The Problem is that the custom item renderer, does ignore those colors, and doesn't give any Feedback...
I tried to add the lines:
setStyle("selectionColor", 0xEDF1F7);
setStyle("rollOverColor", 0xE1F5DE);
setStyle("themeColor", 0x3569B0);
But with no effect...
Who can help on that?
Thanks,
Markus
Those styles won't apply to the component you are using for your itemRenderer (which you don't mention). They're styles of the DataGrid itself.
So let's say you're using a Canvas. Try setting the backgroundAlpha of the Canvas to 0.0 so that your DataGrid's selection and other colors will show through.

Flex LinkBar: how to set a selected button's background color?

I was able to set the text color of a selected LinkBar button by "disabledColor" style of LinkBar. Accordingly, I expect to set the background color of the selected button by "backgroundDisabledColor" style, however, it didn't work; and except "backgroundDisabledColor", I didn't see any other style that could possibly achieve this. Please help. Thanks.
The problem is probably that you're setting the style on the LinkBar itself - try setting the LinkBar's linkButtonStyleName style to a different style selector that contains all of the styles you need for your button. You should be able to set the fillColors style of the buttons themselves there - this will change the default look of the button.
If you need to adjust the "selected" color or if you need something more advanced than just skinning the button background you'll need to write a custom skin class. This isn't too difficult - the Button class has a whole set of "Selected" styles - selectedDownSkin, selectedUpSkin, selectedDisabledSkin, etc. IMO the best practice is to set your button skin to a custom skin class that sets the different individual styles based on state.
David Flately illustrates this method here. Check out his source - that should get you what you need. A good book on this topic that has this sort of thing along with lots of other examples is Juan Sanchez and Andy McIntosh's Creating Visual Experiences with Flex 3.0. I can't post a link to it because my reputation isn't high enough here yet, but you can find it on amazon or barnes and noble or any other online bookstore.
FYI - answer here....
http://dezeloper.wordpress.com/2010/02/24/flex-css-linkbar-togglebuttonbar-selected-text-color/
Haha, was looking for same thing, you can see on the source code of LinkBar:
// Hilite the new selection.
child = Button(getChildAt(selectedIndex));
child.enabled = false;
Which is clever!!! Rather than set selected to true, they disable the selected button ... why not ;-( Took me half an hour to understand the Flex team logical ...
eBuildy, Flex Specialists

Resources