ScriptUI: Change element back to default color

I have a script in which I am changing the color of StaticText, but later want to change it back to the default color. Is there a way to set it back to "default", or do I need to hard code in a color that is the same as the default? The problem is that hard coding in a number will no longer dynamically react to changes in the UI color.
var myWindGfx = myWind.grp.bottom.eight.update.graphics;
myWindGfx.foregroundColor = myWindGfx.newPen (myWindGfx.PenType.SOLID_COLOR, [1, 0, 0], 1);

Yep you're right.
I had the && for some purpose but made changes to the script so they became redundant.
In fact the script should remove the "if"s and be as follows.  This will make sure the values are reset to undefined when they should.
// Theme Color Snippet by Trevor creative-scripts.com (Coming soonish!)
// https://forums.adobe.com/message/7139857#7139857
// Credits to Loic Aigon http://www.ozalto.com for the Basic Idea
function addBiState (_parent, UIType, themeStateDetails, modifiedStateDetails, groupDetails) {
    var bounds, _string, setupProperties, newGroup;
    // Set theme group setup properties
    bounds = groupDetails && groupDetails[0];
    _string = groupDetails && groupDetails[1];
    setupProperties = groupDetails && groupDetails[2];
    newGroup = _parent.add('group', bounds, _string, setupProperties);
    newGroup.margins = [0,0,0,0];
    newGroup.orientation='stack';
    // Set theme state setup properties
    bounds = themeStateDetails && themeStateDetails[0];
    _string = themeStateDetails && themeStateDetails[1];
    setupProperties = themeStateDetails && themeStateDetails[2];
    newGroup[0] = newGroup.add(UIType, bounds, _string, setupProperties);
    // Set modified state setup properties
    bounds = modifiedStateDetails && modifiedStateDetails[0];
    _string = modifiedStateDetails && modifiedStateDetails[1];
    setupProperties = modifiedStateDetails && modifiedStateDetails[2];
    newGroup[1] = newGroup.add(UIType, bounds, _string, setupProperties);
    newGroup[1].visible = false;
    return newGroup;
Group.prototype.biStateChange = function (state) {
    if (state) {
        this[+state].visible = true;
        this[+!state].visible = false;
    else {
        this[0].visible = !this[0].visible;
        this[1].visible = !this[1].visible;
/********** Example Usage *************/
var w = new Window('dialog'),
    greenPen = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[0, .6, .2],1),
    yellowBrush =w.graphics.newBrush(w.graphics.BrushType.SOLID_COLOR,[1, 1, 0],1),
    myBiStateButton = addBiState (w, 'button', [undefined, "Theme"], [undefined, "Green"]),
    myBiStateStaticText = addBiState (w, 'staticText', [undefined, "Theme"], [undefined, "Green"]),
    stGroup = w.add('group'),
    st = stGroup.add('statictext', undefined, "Toggle"),
    highlightGroup = addBiState(stGroup, 'group');
st = highlightGroup[0].add('statictext', undefined, "highlight")
st = highlightGroup[1].add('statictext', undefined, "highlight")
myBiStateButton[1].graphics.foregroundColor = greenPen;
myBiStateStaticText[1].graphics.foregroundColor = greenPen;
highlightGroup[1].graphics.backgroundColor = yellowBrush;
highlightGroup[0].margins = highlightGroup[1].margins = [3, 3, 3, 3];
stGroup.spacing = 4;
myBiStateButton.addEventListener ('mousedown', function () {
    myBiStateButton.biStateChange();
    myBiStateStaticText.biStateChange();
    highlightGroup.biStateChange();
w.show();

Similar Messages

  • Getting back the default color....

    Hi there!
    When you change the color of a component is there an easy way to switch it back to the UI-default color that it had when you started the application (without having to save the original color)?
    Regards

    I set a lot of customs defaults when I start the application
    (UIManager.put("TextField.background", new ColorUIResource(...)
    But when the users work with the application some components get changed their color in case the user enters wrong values or whatever.
    This is done directly with setBackground... /setForeground..., my customs values in the UI defaults table remain untouched.
    I just need a way to tell all components to look what their default color is depending on the value in the defaults table and set that color accordingly.
    This will clear all warnings in the GUI that have been set due to wrong inputs by the user and now he deserves a second chance to enter correct things.
    Something like updateComponentTreeUI?

  • Change Mailbox Behavior - Can it be changed back to default?

    I mistakenly changed the setting and want to change it back to default, i.e. keep sent box on the server rather than on my iPhone. Is it possible? If not, does not mean the messages in my sent box will stay on my server AS WELL AS on my iPhone? Thanks.
    I was a blackberry user and find I can not set the mail account as my blackberry. I want my iPhone to just check new emails when I am by my desktop. I do not want it to sync with my mail system which take too much space. Can anybody here help me?

    # Click the orange Firefox button or, if the application menu is enabled, click '''Tools''' followed by '''Options'''
    # Click on the '''Content''' icon/category
    # Next to where it says ''Block popup windows ''click the '''Exceptions''' button
    # Select the site for which you wish to revoke the exception then click the '''Remove Site''' button

  • Changing interop mode 1 back to default

    Hello,
    i need to connect MDS 9513 to McData 6140 for migration purposes, plan is to get rid of McData in the near future.  McData is running in open mode 1.0 so i am planning to set VSAN mode to 1. After all systems get migrated to Cisco i would like to convert interop mode back to default, what will happen ? Will all systems get new FCID ?  What else should i think about ?
    Thanks

    While in interop mode 1, the domain IDs must fall with in a defined range.  In order for you to change a VSAN to interop mode 1, you have to set the domain ID to a value of decimal 97 to 127 and do an fcdomain restart.  This would be distuprtive to any devices currently logged into that VSAN as their FCID would change.  The message below indicated that VSAN 1 currentluy does not have a domain ID that is in the interop 1 range.
    MDS2-98(config-vsan-db)# vsan 1 interop 1
    vsan 1:interoperability mode 1 allowed domain list [97-127] does not include all assigned and configured domains or conflicts with existing allowed domain lists
    The command to see the current domain ID is
    show fcdomain vsan 1
    The config command to set it to 124 is
    fcdomain domain 124 static van 1
    Then to restart the VSAN to make the new domain ID effective
    fcdomain restart vsan 1
    If you are using a newly created VSAN, I then I believe that when you create the VSAN in interop mode 1, it will automatically use one of the needed domain IDs.  When you change it back to default, the domain ID should remain the same.
    In interop 1, I believe that you can only zone by PWWN, so migrating the VSAN back to default should not be an issue with zoning.
    Hope this helps,
    Mike

  • Changing your contacts names back to default.

    At the moment there is no possibility to give a person their default name back after you changed it.For example, I have SuperUb0rPet0r in my contacts and just rename him to Peter but now I won't know if he changed his name to something else.

    I found a way to change it back to default. Right click on the name in the contacts list, click Rename..., delete the name in there, hit enter, delete the name again in the window that pops up, hit ok.

  • My screen is in gamma display, how do i turn it back to normal colors?

    My screen has changed to gamma mode. How do i change it back to display colors normlly?

    Yes, you probably have the tripple-click Home button option off.
    Just visit the Accessibility pane under General settings (as described by King_Penguin above) and choose to assign what you need for your tripple click command, in this case toggling the black & white option.
    You can also tell it to 'ask' you what you want from that command each time.
    Hope this helps.

  • How do I change font and colors back to default?

    I have changed the font and color of the text through the tools button and the options button and the content tab. I find nothing telling me how to change the font and colors back to default font and colors. Can you advise me? I'm using Windows 7 Home Premium OS. Thanks.

    Hi Brenda19605,
    You can use this article to set the fonts and colors: https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use?esab=a&s=font&r=0&as=s
    The default settings for the font are in this article:
    https://support.mozilla.org/en-US/kb/Some%20text%20shows%20up%20bold%20after%20upgrade
    Unfortunately for the default colors has no good reference. But for text it is black (most lower left) color, background is white (most upper left color). Unvisited links is blue (column 8, row 5) and visited link is purple (column 9, row 5).
    Let me know if you need anymore help!
    Lordfreak

  • Background color of TestStand 2012 User Interface Reverts Back to Default After Changing

    I changed the background color and other properties of the Execution and Sequence TestStand Controls in the TestStand 2012 User Interface example code. When I execute the Top Level.vi the TestStand User Controls revert back to their default colors/properties. I saw this problem in the list of TestStand 2010 known issues, is it also a known problem in 2012?

    Hey kelsayd,
    I just tried changing the color of the user interface controls in my user interface (from TestStand 2012) and saw the same behavior. I believe this is because the controls are ActiveX controls and do not permit the same level of customization as LabVIEW controls. I did find this KnowledgeBase article, which mentions the issue and gives one possible solution to the issue: http://digital.ni.com/public.nsf/allkb/4E40FA5AEAF3937B86256E89007C74C4?OpenDocument
    Hopefully that will help show how you can set this up, and let us know if you have any further questions about it!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • Can I change the default color of a calendar event?

    I have a couple calendars that will be using the overlay functionality in 2010, and chosing colors for the overlays is no problem.  However the main calendar defaults to green, and then when you open any of the overlay calendars their default color
    is green on their calendar but different on the main version.  Is there a way I can change the default so that either the main calendar doesn't show green (then each overlay owner wouldn't be confused), or to change the seperate overlay calendars to have
    their default match the selected overlay color?Denzel

    Hi Denzel,
    SharePoint 2010 calendar makes use of CALENDARV4.CSS file.  The default location of this file is [C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\Themable\]
    Search for .ms-acal-item element in this CSS file and make changes to
    background-color property to suit your requirement.  A trial and error method could allow you to achieve your functionality.
    CAUTION: Kindly make backup of your original CALENDARV4.CSS file, before making any changes.
    There is a good reference/sample of Calendar Styles by Heather Solomon for earlier SharePoint version 2007 here:
    http://www.heathersolomon.com/blog/archive/2007/11/20/SharePoint-Calendar-CSS--Clean-and-Condensed.aspx
    Additionally, please make use of Internet Explorer 8 Developer Tools (F12) to further explore the overlay calendar CSS.  Hope this helps.
    Thanks & Regards,
    Kamlesh | Blog |
    Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    If you get your Question answered, please come back and mark the reply as an Answer, so others can find it.
    If you get helped by an Answer to someone else's question, please vote the Post as Helpful.

  • Help, Does anyone know why my default color change when running a action?

    I have just bought and installed cs3 extended and when I run a action after a few steps it changes my default colors back to black and white and then at the end of the action it changes back to the colors I picked for the element I am making but the results are a black element. I have downloaded and ran the update to 10.0.1 and am not aware if there are others or if this is just a setting I can make inside the program. Please help! Thanks Jana

    well, I am talking about the default color buttons on the left hand side toward the botton but, the action says at the first to pick the color of your flower so I pick red and the action takes off... then a few steps in it would change to black and white and then back to red and white at the end but the flower came out all black. Okay I am tell you this because so if anyone else has this problem they will know.
    This morning I got up and uninstalled my later version of Photoshop PSE6 that was still on my computer( after moving all shared files needed for new PS to my external HD) and deleted the action (drag to trash can ) then loaded the action again and it worked fine pretty little red flower! Now I hope it will remember my styles! I have had to reload them twice.
    Thank you, Jana

  • Is there a way to change the default colors for iPad apps?

    I noticed one of my friends iPad 2 had a different color scheme for apps and I would like to change my iPad 2's default ( which is currently grey). To elaborate, the default color for the borders and tabs in Safari are grey on my iPad, my friends are blue. Would like to change from the drab grey color to blue also but I cannot find a setting for this. All applications and Setup apps have this default color scheme on my ipad. Do I have to reset the iPad and start over with setup to achieve this? Hope not, perhaps someone can shed some light on an easy way to do this. Thank You!

    You can apply  system-wise "negative" color effect under Settings > General > Accessibility, by toggling the White and Black switch - and, in iCab Mobile (and some other, better browsers / PDF readers), its own "night mode" negative color scheme.
    Otherwise, no, you can't do anything else except for asking third party app authors to add selectable back/froeground (=text) colors to their apps.
    There is an article dedicated to this question: http://www.iphonelife.com/blog/87/do-you-find-your-idevices-screen-be-too-blueis h-or-just-too-harsh-bedtime-reading

  • Pebrot MSN in cli. Change default colors

    hi! im looking forward to know how to change the default colors in pebrot (http://pebrot.sourceforge.net/) so it shows a transparent background in urxvt instead the default black solid color
    pebrot has a ~/.pebrot/pebrotrc file:
    # Pebrot config file
    #################################### COLORS ####################################
    # Valid colors names are: white, blue, red, cyan, yellow, green, magenta.
    col_default= white
    col_info= cyan
    col_info_delim= red
    col_error= yellow
    col_error_delim= red
    col_chat_bar= blue
    col_chat_bar_name= blue
    col_chat_bar_name_typing= green
    col_state_bar= blue
    col_state_bar_written= yellow
    col_state_bar_not_written= blue
    col_my_name= blue
    col_others_name= red
    col_list_delim= white
    col_list_num= red
    col_list_pass= blue
    col_list_state= green
    col_list_name= white
    col_list_parens= white
    col_timestamp= white
    so, there's no black there... so, the black background is not set there...
    but here:
    /usr/lib/python2.5/site-packages/pypebrot/pebrot.py
    def defineColors( self ):
    colors= ['WHITE', 'BLUE', 'RED', 'CYAN', 'YELLOW', 'GREEN', 'MAGENTA' ]
    for f in (COLORABLE + colors):
    self.COLORS[f]= ''
    def defaultColors( self ):
    self.COLORS['DEFAULT']= self.COLORS['WHITE']
    self.COLORS['INFO']= self.COLORS['CYAN']
    self.COLORS['INFO_DELIM']= self.COLORS['RED']
    self.COLORS['ERROR']= self.COLORS['YELLOW']
    self.COLORS['ERROR_DELIM']= self.COLORS['RED']
    self.COLORS['CHAT_BAR']= self.COLORS['BLUE']
    self.COLORS['CHAT_BAR_NAME']= self.COLORS['BLUE']
    self.COLORS['CHAT_BAR_NAME_TYPING']= self.COLORS['GREEN']
    self.COLORS['STATE_BAR']= self.COLORS['BLUE']
    self.COLORS['STATE_BAR_WRITTEN']= self.COLORS['YELLOW']
    self.COLORS['STATE_BAR_NOT_WRITTEN']= self.COLORS['BLUE']
    self.COLORS['MY_NAME']= self.COLORS['BLUE']
    self.COLORS['OTHERS_NAME']= self.COLORS['RED']
    self.COLORS['LIST_DELIM']= self.COLORS['WHITE']
    self.COLORS['LIST_NUM']= self.COLORS['RED']
    self.COLORS['LIST_PASS']= self.COLORS['BLUE']
    self.COLORS['LIST_STATE']= self.COLORS['GREEN']
    self.COLORS['LIST_PARENS']= self.COLORS['WHITE']
    self.COLORS['LIST_NAME']= self.COLORS['WHITE']
    self.COLORS['TIMESTAMP']= self.COLORS['WHITE']
    def initBarColors( self ):
    if curses.has_colors() and not MONOCHROME:
    self.ChatBar.attrset( self.COLORS['CHAT_BAR'] )
    self.StateBar.attrset( self.COLORS['STATE_BAR'] )
    self.Text.setAttr( self.COLORS['DEFAULT'] )
    or here (same file)
    def setColors( self, background ):
    try:
    import usedefault
    usedefault.use_default_colors()
    back= -1 <------------------ i think it's here
    except ImportError:
    back= background <------------------ i think it's here
    curses.init_pair( 1, curses.COLOR_WHITE, back )
    curses.init_pair( 2, curses.COLOR_BLUE, back )
    curses.init_pair( 3, curses.COLOR_RED, back )
    curses.init_pair( 4, curses.COLOR_CYAN, back )
    curses.init_pair( 5, curses.COLOR_YELLOW, back )
    curses.init_pair( 6, curses.COLOR_GREEN, back )
    curses.init_pair( 7, curses.COLOR_MAGENTA, back )
    curses.init_pair( 8, curses.COLOR_MAGENTA, back )
    self.COLORS['WHITE']= curses.color_pair( 1 )
    self.COLORS['BLUE']= curses.color_pair( 2 )
    self.COLORS['RED']= curses.color_pair( 3 )
    self.COLORS['CYAN']= curses.color_pair( 4 )
    self.COLORS['YELLOW']= curses.color_pair( 5 )
    self.COLORS['GREEN']= curses.color_pair( 6 )
    self.COLORS['MAGENTA']= curses.color_pair( 7 )
    #self.stdscr.touchwin()
    #self.stdscr.refresh()
    #self.stdscr.bkgdset( curses.color_pair(8) ) <------------------ i think it's here
    Thankyou for read!

    now that i see is not possible, or at last can't found a way, i want to make the background grey, say #222222 as my other CLI apps...
    but i cant seem to find the "setting" in the app script to do that

  • Change (default) color 'blue'

    Hello experts,
    my problem: i want to change the default color 'blue'. In 'green'. I meen for example ui-element captions is with the attribute rowBackgroundDesign blue, or by tables with CellDesign standard are the readOnly columns blue. I want it in green.
    Can anybody help me? What must i do?
    Thanks for help
    greetings
    Raier

    Hi Rainer,
    there is no direct property like semanticcolor for label , you have to change through kind off design..
    which release you are working on.. i have an idea u go to application configuration in admin mode and go to UI element property and as ulltimately HTML is rendered so there is a trick to handle this..
    For the “Width” parameter, you enter
    6ex; color: white; font-weight:bold; background-color: yellow
    this is a trick and it works for releases prior to NW 7.1
    Let me know if it needs more explanation..
    Regards
    Anuj Goyal

  • Why is iCal changing the color of my calendars to purple even after trying to change it back to my original color?

    iCal is changing the color of my calendars to purple on all my devices even after trying to change it back to the original color. Tried turning them off, same thing.

    I, too, had this problem.  This is how I fixed it:
    Select the calendar that changes color and export the calendar to desktop.
    Delete the calendar from ical.
    Create new calendar in Ical and name it to your specifications
    Go to desk top and choose the calendar you moved and choose to open with Ical.  This should import it back to ical.
    Go into settings in ical and choose that calendar as your default calendar.
    It sounds complicated but is actually easy to do. I hope this helps.

  • IOS 7 changed all the colors. How do you change it back?

    When I upgraded to IOS 7, the default colors changed. They are too light. The only thing I found was to "Invert colore" which is not too good either. Can you change the color scheme back?
    Is it possible to change the background colors of the Icons? Such as for Calendar, instaed of white change to something else?

    Nope

Maybe you are looking for

  • 2nd hard drive for Dual 500 MHz Sawtooth

    I have a G4 dual 500 MHz sawtooth with a 40 GB hard drive and 1 GB of RAM. I don't have any PCI slots left and I was hoping to add a second drive. Is this possible? Does this model have the ribbon and power supply for a second drive? I've been search

  • Database in Use During Export

    We have a data export scheduled every day, during the daytime (not sure why). However, we often run into an issue where the script tries to run, but cannot do the export because the "Database is in use". This is probably because users are executing c

  • After Pc doing a scan I cant open facebook in any browser

    After Pc doing a scan I cant open facebook in any browser

  • CUG log in and log out

    Hi, I am testing out the Closed User Group feature. I've created a user group and its members. I applied this group and administrator group to the content page. I have no problem logging in as the admin but when I log in as the user I've created, it

  • Fireworks PNG file to iPhone

    I am trying to use Fireworks to create PNG files to use in my iPhone app and they are not rendering properly.  I have read that Firworks has it's own PNG format, do I need to do something special to make it work with the iPhone? Thanks for any assist