Properties vs. Styles for Setting Visual Appearance of Controls?

I'm a bit confused by what seems to be a schizophrenic approach to properties and styles within the Flex 4 SDK. In some cases, components have properties that affect their visual appearance while in other cases they use styles. For example, here is a BorderContainer from an example in Adobe's Using Flex 4 docs:
<s:BorderContainer width="200" height="200"
                                   borderColor="0x000000"
                                  borderAlpha="1"
                                   cornerRadius="10"
                                   borderWeight="1">
borderColor, borderAlpha, cornerRadius and borderWeight are all styles. However, BorderContainer also has some properties for visual formatting; e.g.,: backgroundFill and borderStroke. The latter property equates to two of the styles: borderColor and borderWeight. But the former, backgroundFill, doesn't appear to have a corresponding style although there is a backgroundImage style.
So, I'm wondering why the SDK has this split personality. But more to the point, I'm wondering if there's some logical explanation. How do I know when to use a style rather than a property? Where should developers look first when seeking to modify the visual appearance of a control?
David Salahi

Thanks for the reply.
I am particular interested in column widths and the internal padding/margin of a cell. This is for a report which contains a table inside another table (using a tree, but with the sub-table in a column, rather than the detail facet).
By default, each sub-table is formatted with different column widths, which makes them hard to compare. If I can specify that explicitly, they all line up nicely. (Something weird also happens when a sub-table contains no data, since I'm not sure the cell with the message 'No rows yet' follows the same rules.)
(Specifying the internal margin is useful for removing the border between the sub-table and its surroundings)

Similar Messages

  • Testform for Setting Visual Attributes and Fonts

    Hello,
    I am looking for a Form for testing different
    colors and fonts.
    has somebody developed such a form or does an oracle
    demo form exist?
    [email protected]

    I have been tinkering with one that sets canvas background colors dynamically. Email me if you want a copy of the fmb.
    [email protected]

  • [svn] 3148: You can now use CSS styles to set the default text format for TextView.

    Revision: 3148
    Author: [email protected]
    Date: 2008-09-08 15:01:15 -0700 (Mon, 08 Sep 2008)
    Log Message:
    You can now use CSS styles to set the default text format for TextView. It no longer has any formatting properties. It supports the entire set of Gumbo text format styles.
    SkinnableComponent and Group now also support all these styles. However, skins such as ButtonSkin, TextInputSkin, and TextAreaSkin continue for now to specify instance styles on their TextBox, TextGraphic, and TextView, in order to give them a Gumbo look rather than a Halo look. So if you try setting, for example, the fontSize on the Application, it doesn't yet affect the text format of a Button, TextInput, TextArea, etc. unless you remove the instance style in the skin.
    Reviewer: Glenn
    Bugs: -
    QA: Lots of new stuff to test!
    Doc: No
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicEle ment.as

    Nevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
    Thanks for taking a look though!
    Shaun

  • Create a new set of skin and style for OC4J

    hi, I have created a new set of skin and style
    for example,
    just duplicated folders s_oracle10 , sk_oracle10 and rename them as s_oracle10b , sk_oracle10b (in \OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res)
    however, I found that there is no new choice - oracle10b in the dropdownlist for selecting style.
    how to create a new set of skin and style ??

    I have read Oracle® Business Intelligence Suite Enterprise Edition Release Notes Version 10.1.3.4.1 E10404-25
    =====================================================================
    In Chapter 10, the section "About Skins and Styles" contains incomplete
    information. The following information should appear after the section's first
    paragraph:
    Respective Web servers require resource files like styles to be deployed
    appropriately for those applications. For example, when using OC4J as is common
    in Oracle BI deployments, skins, styles and images need to be duplicated in the
    following directories:
    – {OracleBI}\oc4j_bi\j2ee\home\applications\analytics\analytics\res
    – {OracleBI}\web\app\res
    As a rule, customer-specific files like custom styles should live in the
    {OracleBIData} folders so these are not lost during upgrades. In this case, the
    custom style would then be deployed to OC4J as described above and to the
    following directory: {OracleBIData}\web\res
    ===================================================================== copied from the pdf
    we need to copy the new set to two directories.
    however, I found that resources of the new set are from {OracleBI}\oc4j_bi\j2ee\home\applications\analytics\analytics\res
    not from {OracleBI}\web\app\res
    if there is a upgrade or redeployment, will the new set be removed or replaced.
    why isn't load from {OracleBI}\web\app\res?
    how to configure to make it load from {OracleBI}\web\app\res?
    thanks

  • How do your turn off the "black and White" setting for the visually impaired?

    How do you turn off the "black and White" setting for the visually impaired?  Also known as the "tripple Click"

    Settings>General>Accessibilty>White on black--> Off

  • Correct way of setting styles for custom components

    Hey everyone,
                            I have a custom component which extends UIComponent and holds a image and a button. If I want to set the default style for my button where do I set it in the createChildren, stylesInitialized ,  updateDisplayList  or styleChanged ? I know styleChanged gets called first but the param is always null
    styleChanged = null
    stylesInitialized
    initialize
    createChildren
    initializationComplete
    commitProperties
    measure
    updateDisplayList
    Cheers,
    Firdosh

    Thanks for your recommendations. I have seen a lot of components (yahoo-astra e.g) call a static function or use Mixin (asfusion Rating Component)
    public class CustomComponent extends UIComponent {
              public static function initializeStyles():void
                   var styleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("BaseMultiFieldInput");
                   if(!styleDeclaration)
                        styleDeclaration = new CSSStyleDeclaration();
                   styleDeclaration.defaultFactory = function():void
                        this.backgroundColor = 0xffffff;
                        this.backgroundDisabledColor = 0xdddddd;
                        this.textAlign = TextFormatAlign.CENTER;
                        //other styles are based on the framework defaults
                   StyleManager.setStyleDeclaration("BaseMultiFieldInput", styleDeclaration, false);
              initializeStyles();
    is there a reasons why they are set in a static call?

  • Set default style for shapes

    Is there a way to set a default style for Shapes in Pages 5.2 ? 

    Accidentally discovered th answer to this (tried to delete the question but could not).... seems that if rearrange the "styles" in the format side bar, the first style will be the default style used....

  • Set by script the tag and/or the class of a paragraph style for HTML / EPUB export?

    Is it possible to set by script the tag and/or the class of a paragraph style for HTML / EPUB export?

    I found a way
    tell application "Adobe InDesign CS6"
      tell document 1
      tell paragraph style 2
      --get count of style export tag map
      tell style export tag map 1 -- HTML  , 2 = PDF
      --get export class
      --get export tag
      set export tag to "H1"
      set export class to "blue"
      end tell
      end tell
      end tell
    end tell
    and its works
    but thanks for help to use the class "style export tag map"

  • I wan't update using itunes, i want to make update using my phone, but when check for an update using software update in setting message appear " can't check for update....."?

    i wan't update using itunes, i want to make update using my phone, but when check for an update using software update in setting message appear " can't check for update....."?

    Reboot the device and see if the error happens again. Updating through iTunes is usually optimal, but the file size differs via Software Update on the device and iTunes (50MB vs ~800MB)

  • Setting style  for DatagridColumn?

    My dataGrid has a style set for it in the CSS stylesheet. How
    can I change the style for one of the columns please?

    If your DataGridColumn has an id set for it, you can use the
    setStyle() method to set individual styles.
    <?xml version="1.0"?>
    <!-- dragdrop\SimpleDGToDG.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initApp();">
    <mx:Script>
    <![CDATA[
    private function initApp():void {
    greg.setStyle("backgroundColor","#ff00ff");
    srcgrid.dataProvider = [
    {Artist:'Carole King', Album:'Tapestry', Price:11.99},
    {Artist:'Paul Simon', Album:'Graceland', Price:10.99},
    {Artist:'Original Cast', Album:'Camelot', Price:12.99},
    {Artist:'The Beatles', Album:'The White Album', Price:11.99}
    ]]>
    </mx:Script>
    <mx:DataGrid id="srcgrid">
    <mx:columns>
    <mx:DataGridColumn id="greg" dataField="Artist"/>
    <mx:DataGridColumn dataField="Album"/>
    <mx:DataGridColumn dataField="Price"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>

  • How to set different style for headings in quicklaunch

    Hi,
    would like to assign a special style for Headings in the Quicklaunch. Is it possible to assign a different style to headings using CSS?
    Thanks
    Sven

    Hi Sven,
    Please refer to the following article, it might help.
    Customize Change quick launch style and design SharePoint
    .s4-ql UL.root > LI > .menu-item {
    PADDING-BOTTOM: 1px; MIN-HEIGHT: 30px; BACKGROUND: url(http://md-jayabharathi:28586/SiteAssets/BCKHover.jpg) no-repeat 0px -10px; FONT-SIZE: 1em; PADDING-TOP: 1px
    Please don't forget to mark it as answered, if your problem resolved or helpful.

  • How does one define a default style for a custom Flex component?

    How does one define a default style for a custom Flex component?
    hello
    I created a new set of Flex component library slib.swc (Flex 4.5). Would also like to have a default style. defaults.css file, making it the default style of the component library.
    Like flex the builder install directory of sdks \ 4.5.0 \ frameworks out \ libs directory has a spark.swc file, open with Winrar will see defaults.css this file. Defaults.css file defines the default style of the flex spark components.
    How can it be achieved?
    As follows
    slib.swc contains a CLabelEx components, and a defaults.css file
    defaults.css source file as follows:
    @ namespace s "library :/ / ns.adobe.com / flex / spark";
    @ namespace mx "library :/ / ns.adobe.com / flex / mx";
    @ namespace cn "http://os.slib.cn";
    cn | CLabelEx
            styBackgroundAlpha: 1;
            styBackgroundColor: # 569CC0;
            styBorderAlpha: 1;
            styBorderColor: # 569CC0;
            styBorderWeight: 1;
            styCornerRadius: 3;
    In slib.swc the application MyLabel.mxml of the source file as follows:
    <? xml version = "1.0" encoding = "utf-8"?>
    <s: Application, the xmlns: fx = "http://ns.adobe.com/mxml/2009
                               xmlns: s = "library :/ / ns.adobe.com / flex / spark"
                               xmlns: mx = "library :/ / ns.adobe.com / flex / mx"
                               xmlns: cn = "http://os.slib.cn
                               the minWidth = "955" The minHeight = "600">
            <fxeclarations>
            </ fxeclarations>
            <cn:CLabelEx x="67" y="112"/>
    </ s: Application>
    I hope CLabelEx default use cn | CLabelEx, style to display its appearance.
    I refer to above approach, but failed to achieve. Can you please re-Detailed
    Thanks!

    dj is right. Any Folder can be a picture folder.
    Create a root level folder and add it to your Pictures Library in Windows.  It will show up with all the scattered pictures from other programs. It can even be a different dirve if you like.  You  can even specify one to be the default save location for pictures in this dialog.
    Navigate to Pictures in your Libraries in Windows Explorer Right Click and select Properties.
    Message was edited by: Rikk Flohr forgot the instructions...

  • [svn] 4735: Fixing id selectors for non-visual components.

    Revision: 4735
    Author: [email protected]
    Date: 2009-01-29 10:53:55 -0800 (Thu, 29 Jan 2009)
    Log Message:
    Fixing id selectors for non-visual components. This required a special modification to the compiler to include id properties in generated code if a component was guaranteed to have an id property. A new mx.core.IID interface was introduced to opt in to the id property to be included. This change also required TextGraphicElement based components to implement IAdvancedStyleClient instead of just IStyleClient (though note that pseudo-selectors have no meaning for these components as they do not possess states).
    QE: Yes
    Doc: It's reasonably advanced, but we may want to document mx.core.IID for the case where a custom component exists that needs to be styled but is not based on UIComponent or GraphicElement.
    Checkintests: Pass
    Reviewers: Glenn, Paul R
    Bugs:
    SDK-18651 - Advanced CSS not setting styles on FXG elements correctly when styling using IDs
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18651
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.a s
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicEleme nt.as
    flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
    Added Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IID.as

    Anyone able to help?

  • Best practices for setting up projects

    We recently adopted using Captivate for our WBT modules.
    As a former Flash and Director user, I can say it’s
    fast and does some great things. Doesn’t play so nice with
    others on different occasions, but I’m learning. This forum
    has been a great source for search and read on specific topics.
    I’m trying to understand best practices for using this
    product. We’ve had some problems with file size and
    incorporating audio and video into our projects. Fortunately, the
    forum has helped a lot with that. What I haven’t found a lot
    of information on is good or better ways to set up individual
    files, use multiple files and publish projects. We’ve decided
    to go the route of putting standalones on our Intranet. My gut says
    yuck, but for our situation I have yet to find a better way.
    My question for discussion, then is: what are some best
    practices for setting up individual files, using multiple files and
    publishing projects? Any references or input on this would be
    appreciated.

    Hi,
    Here are some of my suggestions:
    1) Set up a style guide for all your standard slides. Eg.
    Title slide, Index slide, chapter slide, end slide, screen capture,
    non-screen capture, quizzes etc. This makes life a lot easier.
    2) Create your own buttons and captions. The standard ones
    are pretty ordinary, and it's hard to get a slick looking style
    happening with the standard captions. They are pretty easy to
    create (search for add print button to learn how to create
    buttons). There should instructions on how to customise captions
    somewhere on this forum. Customising means that you can also use
    words, symbols, colours unique to your organisation.
    3) Google elearning providers. Most use captivate and will
    allow you to open samples or temporarily view selected modules.
    This will give you great insight on what not to do and some good
    ideas on what works well.
    4) Timings: Using the above research, I got others to
    complete the sample modules to get a feel for timings. The results
    were clear, 10 mins good, 15 mins okay, 20 mins kind of okay, 30
    mins bad, bad, bad. It's truly better to have a learner complete
    2-3 short modules in 30 mins than one big monster. The other
    benefit is that shorter files equal smaller size.
    5) Narration: It's best to narrate each slide individually
    (particularly for screen capture slides). You are more likely to
    get it right on the first take, it's easier to edit and you don't
    have to re-record the whole thing if you need to update it in
    future. To get a slicker effect, use at least two voices: one male,
    one female and use slightly different accents.
    6) Screen capture slides: If you are recording filling out
    long window based databse pages where the compulsory fields are
    marked (eg. with a red asterisk) - you don't need to show how to
    fill out every field. It's much easier for the learner (and you) to
    show how to fill out the first few fields, then fade the screen
    capture out, fade the end of the form in with the instructions on
    what to do next. This will reduce your file size. In one of my
    forms, this meant the removal of about 18 slides!
    7) Auto captions: they are verbose (eg. 'Click on Print
    Button' instead of 'Click Print'; 'Select the Print Preview item'
    instead of 'Select Print Preview'). You have to edit them.
    8) PC training syntax: Buttons and hyperlinks should normally
    be 'click'; selections from drop down boxes or file lists are
    normally 'select': Captivate sometimes mixes them up. Instructions
    should always be written in the correct order: eg. Good: Click
    'File', Select 'Print Preview'; Bad: Select 'Print Preview' from
    the 'File Menu'. Button names, hyperlinks, selections are normally
    written in bold
    9) Instruction syntax: should always be written in an active
    voice: eg. 'Click Options to open the printer menu' instead of
    'When the Options button is clicked on, the printer menu will open'
    10) Break all modules into chapters. Frame each chapter with
    a chapter slide. It's also a good idea to show the Index page
    before each chapter slide with a progress indicator (I use an
    animated arrow to flash next to the name of the next chapter), I
    use a start button rather a 'next' button for the start of each
    chapter. You should always have a module overview with the purpose
    of the course and a summary slide which states what was covered and
    they have complete the module.
    11) Put a transparent click button somewhere on each slide.
    Set the properties of the click box to take the learner back to the
    start of the current chapter by pressing F2. This allows them to
    jump back to the start of their chapter at any time. You can also
    do a similar thing on the index pages which jumps them to another
    chapter.
    12) Recording video capture: best to do it at normal speed
    and be concious of where your mouse is. Minimise your clicks. Most
    people (until they start working with captivate) are sloppy with
    their mouse and you end up with lots of unnecessarily slides that
    you have to delete out. The speed will default to how you recorded
    it and this will reduce the amount of time you spend on changing
    timings.
    13) Captions: My rule of thumb is minimum of 4 seconds - and
    longer depending on the amount of words. Eg. Click 'Print Preview'
    is 4 seconds, a paragraph is longer. If you creating knowledge
    based modules, make the timing long (eg. 2-3 minutes) and put in a
    next button so that the learner can click when they are ready.
    Also, narration means the slides will normally be slightly longer.
    14) Be creative: Capitvate is desk bound. There are some
    learners that just don't respond no matter how interactive
    Captivate can be. Incorporate non-captivate and desk free
    activities. Eg. As part of our OHS module, there is an activity
    where the learner has to print off the floor plan, and then wander
    around the floor marking on th emap key items such as: fire exits;
    first aid kit, broom and mop cupboard, stationary cupboard, etc.
    Good luck!

  • Is there a way to expose properties or styles from a skin part to the host component?

    For example, I have this skin that contains a border around an image. I would like to be able to let the user set the cornerRadius.
    Skin:
    <fx:Metadata>
    <![CDATA[
    [HostComponent("spark.components.Image")]
    [Style(name="cornerRadius", inherit="inherit", type="int")]
    ]]>
    </fx:Metadata>
    </code>
    I would like to see that style show up in code complete in a UIComponent that uses this skin,
    <s:Image x=”10″ y=”30″ width=”50″ cornerRadius=”12″ skinClass=”ScaleImageSkin” height=”50″ source=”avatar.png”/>
    However the style “cornerRadius” throws an error at compile time.

    The only way I've found to pass properties or styles to a skin is through CSS or extending the host component and adding the styles or properties onto it. However this seems like a hack. Shouldn't the skin expose it's configuration to the host component? I think that is what Flex themes are doing.

Maybe you are looking for