Numeric Control - Text and Background Color changes when operating inc/dec arrows

Hi,
I'm developing an application that has a panel with black background and green or red numbers. I've added numeric controls and configured the text color and text background color attributes accordinglingy. I set the numeric control to hot or validate  control mode and show the inc/dec arrows, since I want to be able to incr/decr the numbers.
The problem is that when I run the application and I hit the inc/dec arrows, then the colors inside the numeric control frame become inverted: the black background becomes white and the green number becomes cyan. I've created a callback function assosicated with the numeric control and tried forcing the text and background color, in the EVENT_VAL_CHANGED section, using the SetCtrlAttrribute() function, but to no avail. Also added ProcessDrawEvents didn't help.
When I mouse click again outside the numeric control, then it reverts back to its original colors (green text, black background).
Any suggestions as to how I can fix this ?
I want it to keep its original colors at all times, even when I'm clicking the incr/decr arrows...
Kind regards,
pgriep
Solved!
Go to Solution.

Ok, now I see what's happening.
The effect you are seeing is a resul of standard numeric control behaviour combined with the black bcakground: when you use arrows to increment/decrement a numeric control its value will be automatically highlighted; on the default background you'll see the white area and figures highlighted in black (white numbers on balck background). If you set the background to black the system will automatically change the colors used to highlight the text, and that's what you're seeing.
By the way, this does not happens if you use up and down keys on the keyboard: text is not highlighted so colors are not changing.
Additionally, this is not only valid for numerics: see the behaviour of the string controls on the bottom of your panel when you tab up to them. This effect does not happen on controls set as indicator like the big clock in the upper part of the panel.
The only way I can see to overcome this behaviour is to hide control built-in arrows and create your own up and down buttons with which you can manipulate the numeric control. I am attaching a modified version of your project with buttons on the left numeric; sorry for the poor aesthetic:  I have used some arrow icons I had on my disk, you may want to create your own arrows with the colors and shape you prefer.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Attachments:
ModifiedApplication.zip ‏9 KB

Similar Messages

  • Why does JButton background color change when  clicking ?

    Hello,
    I have defined :
    JButton mybutton = new JButton(Icon xxx) ;
    with no associated text and I set both foreground and background colors to black, and an empty border.
    This is because the background color of the container which contents this button is also black and I want to see only the button icon.
    When I click on the icon , the button background color becomes grey. How can I change this to make it remains black ?
    Thanks a lot.
    Gege

    Well, the color changes because that is how the look and feel is defined,
    presumably to give better feedback to the user that she has clicked the
    button.
    If you don't want this, you could try using a different L&F which doesn't do this.
    Alternatively, If you've only got the one button, you could just do
        UIManager.put( "Button.select", Color.BLACK );If you have multiple buttons, and you want the other buttons to behave
    normally, you can extend the one button and have it change the color
    while it is pressed, e.g.,
    import java.awt.*;
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.*;
    public class ButtonSelect extends JFrame {
         public ButtonSelect() throws IOException {
              super();
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel panel = new JPanel();
              panel.add( new JButton( "Normal" ) );
              Image img = Toolkit.getDefaultToolkit().getImage( new URL("http://www.google.com/intl/en/images/logo.gif" ) );
              ImageIcon ii = new ImageIcon( img );
              JButton b = new JButton( ii ) {
                   static final private String KEY = "Button.select";
                   public void paint( Graphics g ) {
                        Color save = null;
                        if ( getModel().isArmed() && getModel().isPressed() ) {
                             save = UIManager.getColor( KEY );
                             UIManager.put( KEY, Color.WHITE );
                        super.paint( g );
                        if ( save != null )
                             UIManager.put( KEY, save );
              b.setForeground( Color.WHITE );
              b.setBackground( Color.WHITE );
              b.setFocusPainted( false );
              panel.add( b );
              getContentPane().add( panel );
              pack();
              setVisible( true );
         public static void main( String[] a ) throws IOException {
              new ButtonSelect();
    }

  • Cell/Background color changes when copying to other Excel 2010 document

    When you copy and paste report cells (e.g. CO report outputted in Office integration, MS Excel) to a new Excel file, the background color changed dramatically (to bright red).
    SAP Theme:  SAP Signature Theme
    Excel 2010
    We tried paste option > match destination formatting but does not help.
    Anyone has similiar problems?  Appreciate any help.

    dear friend,
    you would do:
    1. search SAP Notes;
    2. check out the updates/patches for your MS Office;
    3. replicate it on another computer/another sap user (make sure it is a local issue)
    good luck!

  • How to set text and background color of current row in a adf table?

    Hi,
    In jdev 11.1.2.3,
    How to set text fond and background color of current row in a adf table?
    I tried to set Background color in table property, but that is not what i want.
    Thanks.

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • SWF background color changes when uploaded to server

    I built my Flash all pretty, based upon a black background.
    When ran on the local copy, the black shows up as black & the
    Flash is like it should be. However, as soon as I upload it to the
    server and run it from there, the Flash background changes to
    white, which as you can imagine, royally screws up the visuals. Any
    clue as to why it would do this?! I can't think of any reason why
    it should. The server is in-house and will only be used for an
    Intranet page, so any possible corruption over the web should be
    negated. Help!!

    I'd like to post a link, but like I said, it's only internal.
    When I look at the HTML, it's set to black (background-color:
    #000000). Also, when I load it, the page itself is black, but the
    background of the Flash *only* has turned white. I can load the
    exact same page on my local drive and it comes up black. I've got
    publish settings to Flash 8 (my version) and AS 2.0. I checked that
    first because I've published lower in the past and had
    issues.

  • Logon Page - Trademark text and background color

    Hi Guys,
    I just customized the Logon Page of the Portal successfully. The only two things which are missing are the trademark as well as a new background color. So ... can anybody tell how to:
    1. Change the SAP Trademark text in the Logon Page?
    2. Change the background color of the background page?
    Hopefully I can do it in the portal. Thanks for your answers and your help.
    Best regards
    Alexander

    Alexander,
    In addition to the tips you already got from the other members...
    1. The Background colour is the background colour that is defined in the theme assigned in the Default Portal Desktop (defaultDesktop) that is located in the folder: pcd:portal_content/every_user/general/. By default the Tradeshow theme is selected in this desktop if you create your own theme and assign it to this desktop and set it as default then the background colour of your theme will be the background colour visible in the login page....
    2. The Trademark text is a "Locale text" this means that the strin is not visible in the code but referenced by a variable based on the language of the browser. You can find this copywrite text in the following location:
    a. Download the com.sap.portal.runtime.logon.par file from your Portal
    b. Import it in NWDS or unzip it.
    c. inside the structure look for the folder PORTAL-INF\lib
    d. there is a .jar file called umelogonbase.jar. extract this file with winzip
    e. inside the structure you now see allot of .properties files.. look for the loginLabels_<yourcountrycode>.properties and inside this file look for the variable called "COPY_RIGHT" there you can edit it.
    f. do this for all the languages you need and create a new par file again in your customer namespace so that you don't overwrite the one from SAP.
    Good Luck,
    Benjamin Houttuin

  • Item Background Color changes when placed in production (Forms 10g)

    Hello All,
    I have searched the forum on this topic, but have not been successful in finding a topic/solution for multi-line items that need to render a different color than the rest.
    I have used set_item_instance_property (and set_item_property) as well as using a VA to resolve this issue to no avail.
    When I view the form in the browser - initially in query-mode, I see the color that I have set for the item. Once the query is fetched and I am in non-query mode (display), the items background color is replaced to the standard color (off yellow) for non-editable fields.
    I have taken all of the subclasses off, used the item property from the pallette as well as manually programmed within a trigger and cannot get this item to stay the color that I have set.
    Can anyone help me get this working?

    Are you using the 0 to 100 rgb color assignments you see in the Forms Builder color palette? If so, that is your problem. At run time, you have to convert the color numbers to 0 to 255 numbers. Just multiply each of the three parts by 2.55
    Or maybe there is come code running elsewhere in your form that is setting the color after your code is run.
    Search your form for background_color.

  • Background color changes when using AJAX

    I'm using NetBeans and the plugin Project Dynamic Faces Ajax Components. Each time a radio button is selected a few textfields are hidden/shown.
    But each time I press a radio button, my background color of my JSF page is changed (from blue) back to white.
    Does anyone know how to disable this, or just how I can set the background of the page manualy in the java code.
    I've tried this.setBackground(...); , but it doesn't work.

    Hi. I currently use Canon, and i only see it in my RAW files.  All camera firmware is up-to-date. I am running latest version of Aperture, but still running 10.6.8. I went through a bunch of old photos where there was a good red color of something and i was able to duplicate the problem each time. Where there was a large area of red, it was VERY noticable. Also, I used to shoot with Nikon and my NEF files do the same thing where there is a nice red.  It seems to be an Aperature "thing."
    What i find so curious, is that even if I make no adjustments to the Levels sliders, just checking the box alters the color, same with the Vignette brick.  Also, I do color calibrate my monitor. thanks.

  • Menu text and background colors

    The menus in Acrobat Reader on Windows 7 seem to use:
    - System colors for text,
    - Forced grey for background color.
    My Windows 7 is setup to have light grey text on dark background. All other programs honor this. The result in Reader is that I have light grey text on grey background, which is not readable:
    The same is valid for the bookmarks field, as shown above.
    It's either:
    - take system colors for both background and foreground (preferred)
    - force colors for both background and foreground.
    You'd think that Adobe would know about that kind of problems...
    Is there a work-around?

    You have to clear your browser history/cache or all of the links you have visited in the past (while previewing) will show as the visited style which is a white background and black text.

  • How can I make FF use custom visited/unvisited link colors but allow the website to choose the other text and background colors?

    websites often choose colors that I have trouble distinguishing between but overriding the other colors can cause color defects on certain websites.

    Add code like this to userContent.css in the chrome folder.<br />
    There can however still be problems with clickable elements that use background images.
    Remove that link from the history to restore that background image.
    *http://kb.mozillazine.org/userContent.css
    *http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    *ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>a:visited, a:visited * {
    color:#CC33CC!important;
    background-color:#F8F8F8;
    </nowiki></pre>

  • Change text and background color when multiple tracks of text

    I am finishing up a project and the client wants the final title card to be white background with colored text. I have read a bit about how to do this but I can't fit it into my situation. My text is on four different tracks, each piece of text "For more information," "email address", "contact", "phone number" So I need to change each one. But the way that I have read about it, it seems those answers are only for one level of text.
    Help?

    You should probably be using boris title 3D rather than the default text generator.  title 3D is part of the fcp default install and is available in the same generator options where the text generator is found under Boris.
    It will allow you to conbine fonts, font sizes, etc in the same clip.
    And then you'll just have to put a color matte on a video track under the clip.
    You can of course just put all your text clips on a track above the color matte and manually change the color of all the text.

  • Tab background color changes when saving or downloading (Ubuntu) - bug ?

    I'm using Firefox 20.0 on Linux Ubuntu.
    When I'm opening and using Firefox, the active tab background is light gray, and the other tabs are black (with white/gray text). But as soon as I have downloaded a file (saving an image for example, or a pdf), the tabs change color: the non active tabs turn gray instead of black, and the tab text is almost unreadable (gray on gray).
    I have disabled ALL extensions (including the Ubuntu/Unity extensions) and restarted Firefox, and get the same result. See screenshot with before/after downloading: http://imagesup.net/?di=113687926169
    On the other hand, when I start Firefox in safe mode, all is well, the tabs don't change color when downloading or saving a file.
    What to do? Could this be a bug ?

    Hey, I'm on Ubuntu, too.
    It seems like you don't use Ubuntu's default theme, or at least, you have some modifications there, right? Try disabling your customizations to see if it works, I never saw / heard of this problem anywhere.
    Also update your Firefox, there are changes that your problem is fixed after updating.
    Another suggestion would be hacking about:config, for example, it might be the Download Manager's arrow flashing ( just guessing ), so you might want to disable that and see if something changes.
    search 'browser.download.manager' in about:config and play with those configs to see if anything changes.

  • Images are ghosted, text and background colors are reverted

    My 12 in Powerbook fell from its stand on the wireless keyboard. Now all images are ghosted and the text has gone from black to white and the background has gone from white to black. On startup everything is fine until everything is loaded, then the changes kick in, colors reverse, and the images become ghosted. What do I do?

    Joseph
    It might be possible that the "Switch to white on black" setting in Universal Access has been activated.
    Try pressing the following key combination: apple-alt-control-8
    EDIT: It may be worth checking out the PowerBook with the Apple Hardware Test.
    2.0GHz MacBook, 15" 1.25GHz/12" 1GHz PBs, 2xPPC Mac minis, 12" iBook G4,   Mac OS X (10.4.8)   Cube, 2xTAMs, iPod 4G & nano 2G, 1G & 2G iPs, AEBS, AX

  • How cna I change the text and background colours in iTunes?

    Can anyone tell me how I can change the text and background colours in iTunes? I am a visually impared user and my main requirement on a PC is to change the colour schemem to white text on a black background. Most software adopts the settings of your colour scheme but iTunes goes it's own and has everything on white backgrounds. I cannot read from white backgrounds (dazzle - that sort of thing). I have never used iTunes for this reason. I have always been a devotee of by far the best media player out there Musicmatch Jukebox, who allow you to edit skins in every detail. However, recently Musicmatch was taken over and users were forced to migrate to the ridiculously poor Yahoo Music Jukebox. A massive downgrade in so many ways.
    I want to use iTunes but will not be able to if I cannot sort this issue out. I downloaded 7.5 before discovering that if you want to use Multi Plugin for skins you need to go back to iTunes 7.02. I've done that, but the skins available are completely pointless to my eyes. They don't change the colours of the main components, just the graphical bit at the top.
    What I need to do is change the background of the main browser windows so that they are black and the text is white (you know the track lists and tree views, etc). This must be a very simple case of just changing the codes somewhere, but I can't find where. I read somewhere that you need to hack into something call ResourceDB inside a file called iTunes.jar. There is no such file on my PC. Could that be a Mac thing?
    Please help someone if you can. I would like to become an iTunes user. There seems to be more music available than on Napster which I currently use.
    Thanks in advance
    Z

    In my opinion, it seems that Apple has decided to sacrifice usability so that iTunes would look more like a Mac application. You are probably already aware that using Windows' built-in high-contrast settings do not work in iTunes.
    I did some hacking at the resource file a while back, but I was unable to figure out how to change the color of the background. IIRC there was a resource whose description indicated it would change the background color, but when I changed the resource, nothing happened.
    I was, however, able to figure out how to make the "large" font much larger (any size you want, I suppose). Will that help? See
    http://home.comcast.net/~teridon73/ituneshacks/index.html
    You should provide feedback to Apple:
    http://www.apple.com/feedback/
    I don't think it is too harsh to call it "shameful" that Apple has chosen this design path. Where I work, we are required to make ALL applications (or any computer interface, such as a website) section 508 compliant. Of course, I'm being a bit of a hypocrite, because I've made no effort to make my website compliant. If you have trouble reading it, please let me know.

  • Background color changed from white to yellow and =25% changed to %% on email

    I type =25% on my email and sent out, background color changed from white to yellow and =25% changed to %%.

    Try leaving a space after the =
    Thus: = 25%
    Where and when did it change? Did it change inside Thunderbird? Did it change in the Sent folder? Or in a reply to you?
    = and % are used in certain types of email encoding; =20% often appears, meaning character 0x20 which is 32 denary or the space character. It is often used where an explicit space would be illegal, and this is common in URLs and other links. I'm thinking that =25% similarly has a special meaning. It ''shouldn't'' get decoded, but software is buggy.
    I can't reproduce it here, which is why I'm asking about how and when it changes. Where does the Microsoft software come into it?

Maybe you are looking for

  • Multiple records in Indesign Data merge

    When I select the option for multiple records in InDesign Date Merge, I still only get one record on a page in preview. When I ask it to create a merged document, each item from the excell file is put on a separate page.  Why is this happening, I wan

  • Music playback is very strange

    I recently added a new album to my iTunes library and synced it to my iPod Nano 4G. I started listening to it and the music would randomly skip back and forth between the current song and another song on a different album. It appeared as though the s

  • Java.lang.ExceptionInInitializerError in JBuilder9

    Hello all, I am currently developing a webapp using Kodo-2.5.3, MySQL-DB, JBuilder9, Tomcat4.1. Everything worked as expected until I have been running the Metadata tool and Schematool from within JBuilder for a new class. After doing this , when I a

  • Cant add 3 addresses to DB in a loop?

    Using the code shown below, I am trying to add 3 different addresses to the database. The code exists in a session ejb. It will only add one address. What is also odd is that it adds the address with the first ID number, but the second type & isPrima

  • Photoshop 7.0 Install Move Data Error

    I have reinstalled my operating system twice, after complete format, and both times when I have tried to install Photoshop 7.0 I get an error message; "Component Move Data Error Info, Media name: Data, Component: App-Photoshop, File Group: App-PS, Fi