Flex custom style (skin) - apache-flex

How can I modify standart style of progress bar controll?

If you want full control over the style, you can create your own programmatic skins and replace the default skins. Look at ProgressBarSkin, ProgressBarIndeterminateSkin, ProgressBarMaskSkin and ProgressBarTrackSkin in the SDK to see how they are drawn by default. You can then create your own versions of those skin files and draw them however you like. Then you just set those skin files to your ProgressBar. You can do that directly in MXML, or set it in CSS to change all of the ProgressBars in your app. Hope that helps.

Related

Flex Popup not setting child CSS from global style sheet

I have a CustomListItemRenderer class. It's styling, and contained components' styling, are set via an external CSS stylesheet.
When this renderer is used in a list in the main application, everything is set and styled correctly. When this renderer is being used in a list inside of a popup opened through the PopupManager class, the styling is not being set correctly.
This is a Flex Web Application: SDK 4.1
Help is greatly appreciated.
You need to define it in your CSS also as something like PopupManager CustomListItemRenderer{} since popups use different style ancestors. So defining it specifically for use in popups again will fix your issue.

Qt quick controls - where is defined ScrollView orientation?

i created my custom style for ScrollView, but actually i don't know how to check what orientation of scroll is it (horizontal or vertical? I need use different image for each of them).
source code of scrollview style
In this source code, that i found, is used word horizontal, but where it comes from? I don't see any declaration of horizontal property.
It comes from this line. In newer versions of Qt, properties for style components are exposed through the styleData object; this is now standard practice for all Qt Quick Controls styling. In the case of ScrollViewStyle, commit e0c8035c updated the code to use styleData instead.

Dynamically change background-color

I want to change the background color of my Vaadin app on the valueChange event of a OptionGroup component.
As there are a fairly big number of layouts on my page, what would be the best is to change every HorizontalLayout and VerticalLayout background-color, but every new component that could be added should have this color too.
How can I achieve that? Thanks.
Two approaches come to mind.
The simplest, conceptually, as well as in terms of implementation, would be to have a single component to serve as the background, and give your HorizontalLayout and VerticalLayout components a transparent background. If you're layout is too complex for this, you can have a number of base 'background' components, again, with your layout components on top being transparent. The idea is to reduce the components whose color you need to change to something manageable.
If that approach doesn't translate to your use case, you can always use JavaScript to select the layout components on the fly and redefine their background. This could be made more manageable by giving all the layout components a common CSS class (eg: 'dynamic-background').
JavaScript.getCurrent().execute("$('.dynamic-background').css('background-color', 'purple')");
Note that this JavaScript depends on JQuery, have a look around for more details on integrating JQuery with Vaadin:
Add javascript/Jquery & client side code in Vaadin 7
Integrating HTML and JavaScript in Vaadin 7

VScrollbar CSS for Scroller component in flex

Is there a way to customize the look of vertical scroll bar in the Scroller component in Flex? I am able to use CSS to customize the look of Vscrollbar component but I don't see the same option for Scroller component. For example, cornerRadius, fillAlphas isn't available in Scroller component. How can I set these option in Scroller component.
Thanks
Yes, but you can't use CSS. In FlashBuilder, you create a new MXML Skin and set a host component of Scroller and make sure you make it a copy of spark.skins.spark.ScrollerSkin. Then you just modify that skin to your heart's content. Not quite as easy as CSS, but it is much more powerful and you can do much, much more. I'm not sure if or how you do it in Flash CS or FlashDevelop, but it is fairly easy in FlashBuilder (and is the proper way to skin all Flex components)

Difference between skin and CSS in Flex

I am new in Flex. Was just wondering what is the difference between skin and CSS??
Why it is better to use skin over CSS in Flex. Could anybody please clear my doubt.
Thanks!!!
CSS usually sets the styles (colors, etc) on the out-of-the-box skin. Skins allow you to completely replace the visual appearance of a component with anything you want (images, vectors, whatever).
Here is a great example on creating custom skins. In my experience, I had to create an Up-state background color on a LinkButton, which when using the default skin cannot be set. By creating a custom skin, I was able to create functionality to respond to the color values I wanted.
So in short you can do a lot more with skins.

Resources