CMFCToolbar and CMFCMenubar displaying wrong tooltips

Quastion asked also on
http://stackoverflow.com/questions/29800791/cmfctoolbar-and-cmfcmenubar-displaying-wrong-tooltips
Hello.
I am using Visual Studio 2010, but I suspect the bug is still present on the 2013 version, as I compared the winfrm.cpp file and the OnToolTipText are exactly equal on the two files.
The bug is happening always at the 7th, 8th or 16th element.
Although separators count as elements for this counting, the tooltips do not appear over them.
Element can be a textual MENUITEM, a POPUP menu or toolbar button.
The string table defines are:
    #define IDS_SEVEN            7
    #define IDS_EIGHT            8
    #define IDS_NINE             9
    #define IDS_TEN             10
    #define IDS_ELEVEN          11
    #define IDS_TWELVE          12
    #define IDS_THIRTEEN        13
    #define IDS_FOURTEEN        14
    #define IDS_FIFTEEN         15
    #define IDS_SIXTEEN         16
and the STRINGTABLE contents are:
    IDS_SEVEN           "Seven"
    IDS_EIGHT           "Eight"
    IDS_NINE            "Nine"
    IDS_TEN             "Ten"
    IDS_ELEVEN          "Eleven"
    IDS_TWELVE          "Twelve"
    IDS_THIRTEEN        "Thirteen"
    IDS_FOURTEEN        "Fourteen"
    IDS_FIFTEEN         "Fifteen"
    IDS_SIXTEEN         "Sixteen"
So, when I hover with the mouse pointer the 7th, 8th or 16th element I get WRONGLY a tooltip displaying the string with that ID (Example:7th element displays "Seven").
It happens with all my toolbars and all my menus with a sufficient number of items, including in the toplevel horizontal menubar.
I discovered that the guilty function is:
BOOL CFrameWnd::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
as the nID local variable does not get the ABSOLUTE ID of the Command, but the POSITIONAL order of the button, starting with 1 instead of 0.
If I would move the strings IDs out of that range, whenever a user wants to add new strings, the Visual Studio Resource Editor would see that space free and use it, filling it again. And the problem would happen again. So, it is not a valid solution.
I could also define strings for all commands. But as we are maintaining four TFS branches at the same time and the change needs to go to all branches, this change would be potentially very dangerous when doing merges after.
So, please what solution do you recommend to not display those stupid tooltips?
UPDATE: I didn't copy the string table exactly as it was. It was like this:
    IDS_SEVEN           "Seven\nSeven"
    IDS_EIGHT           "Eight\nEight"
    IDS_NINE            "Nine"
    IDS_TEN             "Ten"
    IDS_ELEVEN          "Eleven"
    IDS_TWELVE          "Twelve"
    IDS_THIRTEEN        "Thirteen"
    IDS_FOURTEEN        "Fourteen"
    IDS_FIFTEEN         "Fifteen"
    IDS_SIXTEEN         "Sixteen\nSixteen"

In the update I put a stringtable more similar to the one I had. I had not noticed before a common feature of 7, 8 and 16 th strings: they all had '\n' characters in their contents.
I think nobody will create a menu with more than 512 menuitems nor toolbars with more than 512 buttons, so my solution was to change all strings containing '\n' characters with an ID below 512 to numbers above 512.
And it works.

Similar Messages

  • Gnome-music and Rhythmbox display wrong audio tags

    Hi,
    I've seen that both these two audio players (and maybe others, I don't know) show wrong audio tags. The "album year" tag is set correctly for all my .m4a songs (it can be seen from nautilus or from any tagging software) but Rhythmbox and Gnome-music always show the wrong year, without any apparent reason.
    Did anyone encounter the same problem? How to fix?
    Thanks in advance

    Lello wrote:
    Hi,
    I've seen that both these two audio players (and maybe others, I don't know) show wrong audio tags. The "album year" tag is set correctly for all my .m4a songs (it can be seen from nautilus or from any tagging software) but Rhythmbox and Gnome-music always show the wrong year, without any apparent reason.
    Did anyone encounter the same problem? How to fix?
    Thanks in advance
    Yeah I found that I had inconsistencies with Rhythmbox and tags as well. This is how I fixed my problems.
    1) Install Easytag.
    2) Open Rhythmbox, right click on the song (or select all the tracks and then right click) and hit properties.
    3) Change the incorrect tag to what it should be.
    4) Open Easytag, locate the tarcks that you just edited in Rhythmbox. You should find that they are highlighted in bold. Select the tracks and then click the "Save changes to selected files" button in the Easytag toolbar. If you've selected multiple tracks then you'll need to tick the box saying you want to apply the action to all files.
    The tags should be consistent across all your music programs now. Hope this helps!

  • When combine multiple PDFs into one, some letters are missing and display wrong letter

    Hi all. I get a problem with combine multiple PDFs into a single PDF document. There are some PDF documents and they are working fine to open each document separately. But after I use Adobe Acrobat 8 Standard to combine them into one, some letters are missing and some display wrong letter (e.g. "forums" display "fo ums"). Our company has Adobe Acrobat 8 Standard, Adobe Acrobat 7 Professional and Standard. But all of them have some problem. Does anyone have idea for that? Please help me! Thanks very much!

    I have a similar situation, but my PDFs look fine in Acrobat Pro 8,Acrobat Reader 8, and Apple preview, but are missing letters in Acrobat Pro 7. I think it stems from the files being combined all having the same font, but each having a unique subset stored in the respective files, but with the same name (and ID?), and when they are combined, the character sets are getting hosed somehow.

  • My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?

    My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?
    I have a two and half year mac book pro... I've had some issues with the screen looking scrambled when I quit certain applications, but now it's turned into something worse.  I'll be working on my computer and the thing will freeze.  When I force restart, the first screen, the apple logo, will be a blue tint and won't boot up normally.  Then I try safe mood and it will then boot just fine.  But there are blue stripes on my screen.  The screen alternates from a blue tint to normal and if the computer freezes again the screen will become completely blue with black stripes.  I haven't tried reinstalling my software because I don't have the startup discs that came with my computer.  If I was sure that would fix it I would purchase them, but if it's a hardware issue I'm afraid that I'm screwed.  I've been able to successfully get the blue off my screen by putting it to sleep and then waking it up, but that's not working well anymore either. 
    Does anyone else have experience with this?  Is it the firmware or what?  I have a MacBook Pro from early 2011 and I'm running Mac OS X 10.6.8.
    Please help... Thanks!

    I just experienced this exact same issue with my early 2011 15" macbook pro. Since like a month after purchasing it I had issues with the screen randomly going dark on me. I sent it in for repair inder waranty they replaced the gpu and logic board but I continued to have the same issues with the screen randomly going black sometimes I would need to reboot it in order to get the screen to go back on but it happened so infrequently and I used the computer for school so disnt find the time to resend it in to apple. Just last night the screen started to display the blue screen with black verticle lines on it. I called apple and explained to them  the issues that had been ongoing since I purchased the laptop but they said because I was now outside of warantee that any repairs at thia point wouldn't be covered. Fml so glad I spent 2200 on this future proof macbook pro what a joke my sister purchased a toshiba laptop for 300 4 years ago and it still running like a champ. I loved my macbook but at the price I paid I expect it to last longer than 2 years before leaving me high and dry. *** apple??

  • New MacBook Pro and 30" display - resolution wrong

    Just got new MBP with Snow Leopard. Had 30" Cinema Display connected to old mbp with dual DVI (at least, I think that's what it is - I'm not connector/adapter literate). Since there was no port for the multi-pin part of the adapter I called Apple support, who told me I needed "dual link DVI cable" - she told me it sells for about $10. The Apple store Genius told me I already had a dual link DVI cable, based on the fact that the display worked with my old mbp and that I needed a Mini DisplayPort to DVI Adapter, which cost $29. Hooked it up and 30" display came to life, but the maximum resolution available in system preferences is 1280 x 800. I really need the full resolution for work. Can anyone give me a solution or will I have to go back to the Apple store tomorrow?

    Thanks. That was exactly what I needed. I'm a little disappointed with the initial tech support solution and the genius at the store. I've never been steered wrong by apple support before.

  • How to Block Themes, Wallpapers and other Display Customizations (DPI, Scaling, Window Color and Appearance) with USMT 5.0?

    I'm doing something wrong, but I can't figure out what.
    I've read some great write ups on the subject:
    USMT Custom XML the Free and Easy Way
    USMT
    4.0 Custom Sample - Blocking Wallpaper and Theme Migration from Windows Vista and Windows 7
    Blocking
    Wallpaper Migration with USMT (or: you are a jerk)
    and used part of the XML in their example, but the wallpaper, themes and other display customizations are still coming over.  Now I'm trying to use MigXmlHelper.DestinationPriority() but really its just my last ditch effort.
    From an elevated command prompt in C:\USMT\amd64\, I'm executing:
    scanstate.exe E:\USMTBackup /config:nothemeuiconfig.xml /i:MigApp.xml /i:MigDocs.xml /i:MigUser.xml /i:unconditionalexclusions.xml /i:blockwallpaperandthemev3.xml /i:getlocalpsts.xml /i:inclusions.xml /ui:domain1\user1 /ue:*\* /vsc /c /o /nocompress /localonly /v:13 /l:\\path\to\scanstate.log /progress:\\path\to\scanstate_progress.log /listfiles:\\path\to\scanstate_listfiles.log
    The blockwallpaperandthemev3.xml contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/blockwallpaperandthemev3">
    <component type="Documents" context="User">
    <displayName>Block Wallpaper, Theme and Display Registry Settings</displayName>
    <role role="Data">
    <rules>
    <unconditionalExclude>
    <objectSet>
    <!-- Blocks wallpaper, themes (which include wallpaper) and other display/visual customizations (DPI, Screen Saver, Window Color & Appearance etc.) in the registry when migrating from Vista, 7 and beyond -->
    <pattern type="Registry">HKCU\Control Panel\Appearance\* [*]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [Pattern]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [SCRNSAVE.EXE]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [TileWallpaper]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaperStyle]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop\Colors [*]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop\WindowMetrics [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperSource]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\* [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\ThemeManager\* [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\* [*]</pattern>
    </objectSet>
    </unconditionalExclude>
    <merge script="MigXmlHelper.DestinationPriority()">
    <objectSet>
    <pattern type="Registry">HKCU\Control Panel\Appearance\* [*]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [Pattern]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [SCRNSAVE.EXE]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [TileWallpaper]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaperStyle]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop\Colors [*]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop\WindowMetrics [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperSource]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\* [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\ThemeManager\* [*]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\* [*]</pattern>
    </objectSet>
    </merge>
    </rules>
    </role>
    </component>
    <!-- This component blocks wallpaper & screen saver files -->
    <component type="Documents" context="User">
    <displayName>Block Wallpapers and Theme Files</displayName>
    <role role="Data">
    <rules>
    <unconditionalExclude>
    <objectSet>
    <content filter="MigXmlHelper.ExtractSingleFile(NULL, NULL)">
    <objectSet>
    <pattern type="Registry">HKCU\Control Panel\Desktop [SCRNSAVE.EXE]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperSource]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\* [*]</pattern>
    </objectSet>
    </content>
    </objectSet>
    </unconditionalExclude>
    <merge script="MigXmlHelper.DestinationPriority()">
    <objectSet>
    <content filter="MigXmlHelper.ExtractSingleFile(NULL, NULL)">
    <objectSet>
    <pattern type="Registry">HKCU\Control Panel\Desktop [SCRNSAVE.EXE]</pattern>
    <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperSource]</pattern>
    <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\* [*]</pattern>
    </objectSet>
    </content>
    </objectSet>
    </merge>
    <unconditionalExclude>
    <objectSet>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_APPDATA%\Microsoft\Windows\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Resources\Ease of Access Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Resources\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Web\Wallpaper\* [*]</pattern>
    </objectSet>
    </unconditionalExclude>
    <merge script="MigXmlHelper.DestinationPriority()">
    <objectSet>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_APPDATA%\Microsoft\Windows\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Resources\Ease of Access Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Resources\Themes\* [*]</pattern>
    <pattern type="File">%CSIDL_WINDOWS%\Web\Wallpaper\* [*]</pattern>
    </objectSet>
    </merge>
    <unconditionalExclude>
    <objectSet>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Users\*\AppData\Local\Microsoft\Windows\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Users\*\AppData\Roaming\Microsoft\Windows\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Resources\Ease of Access Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Resources\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Web\Wallpaper\* [*]","Fixed")</script>
    </objectSet>
    </unconditionalExclude>
    <merge script="MigXmlHelper.DestinationPriority()">
    <objectSet>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Users\*\AppData\Local\Microsoft\Windows\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Users\*\AppData\Roaming\Microsoft\Windows\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Resources\Ease of Access Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Resources\Themes\* [*]","Fixed")</script>
    <script>MigXmlHelper.GenerateDrivePatterns ("\Windows\Web\Wallpaper\* [*]","Fixed")</script>
    </objectSet>
    </merge>
    </rules>
    </role>
    </component>
    </migration>
    I generated a config.xml called nothemeuiconfig.xml and changed this:
    <component displayname="Microsoft-Windows-themeui" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-themeui/microsoft-windows-themeui/settings"/>
    To this:
    <component displayname="Microsoft-Windows-themeui" migrate="no" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-themeui/microsoft-windows-themeui/settings"/>
    But themes, wallpapers - everything - still come over.
    Opened a case with Microsoft, sent them:
    the XML's I'm using
    the command I used to generate the config.xml
    the command I used for scanstate
    the log files generated by scanstate
    the command I used for loadstate
    the log files generated by loadstate
    Summary result of the MS case:
    After much review & scrutiny, the command line and XML files are syntactically correct and rules are sound.
    The articles I referenced in the ticket are indeed old and speak of an older version of USMT, so I can accept the possibility that something may have changed between USMT versions that render those suggested rules & instructions invalid.
    Despite using
    unconditionalExclude to unconditionally globally exclude objects, something else is trumping that rule, and there’s no way around that.
    Even using
    MigXmlHelper.DestinationPrioity() won’t help us here because, like above, something else trumps that rule, and there’s no way around that.
    The last proposed suggestion is to disable the shmig component, which may or may not break or otherwise adversely affect the backup/restore of other things.  (This may be too difficult to detect easily or in initial testing and the uncertainty doesn’t
    give us confidence problems won’t arise as a result of this change.  Also,
    Ned Pyle's post post says NOT to, but then again that's an old post.)
    Is this no longer possible or am I'm just doing it wrong?

    Thanks for the reply
    TimAmico!
    I saw your responses on Friday & Saturday, but didn't reply because I wanted to think this over a bit and try to get a second opinion.
    The 'Appearance and Display' component looks to have a has a number of sub-components.
    <component displayname="Appearance and Display" migrate="yes" ID="appearance_and_display">
    <component displayname="Windows Games Settings" migrate="yes" ID="appearance_and_display\windows_games_settings">
    <component displayname="Microsoft-Windows-GameExplorer" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-gameexplorer/microsoft-windows-gameexplorer/settings"/>
    </component>
    <component displayname="Taskbar and Start Menu" migrate="yes" ID="appearance_and_display\taskbar_and_start_menu">
    <component displayname="Microsoft-Windows-stobject" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-stobject/microsoft-windows-stobject/settings"/>
    <component displayname="Microsoft-Windows-explorer" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-explorer/microsoft-windows-explorer/settings"/>
    </component>
    <component displayname="Personalized Settings" migrate="yes" ID="appearance_and_display\personalized_settings">
    <component displayname="Microsoft-Windows-uxtheme" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-uxtheme/microsoft-windows-uxtheme/settings"/>
    <component displayname="Microsoft-Windows-themeui" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-themeui/microsoft-windows-themeui/settings"/>
    <component displayname="Microsoft-Windows-shmig" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-shmig/microsoft-windows-shmig/settings"/>
    <component displayname="Microsoft-Windows-shell32" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-shell32/microsoft-windows-shell32/settings"/>
    <component displayname="Microsoft-Windows-CommandPrompt" migrate="yes" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-commandprompt/microsoft-windows-commandprompt/settings"/>
    </component>
    </component>
    If I'm understanding the XML correctly, setting 'Appearance and Display' to 'no' will not bring over any of the sub components:
    Windows Games Settings: Microsoft-Windows-GameExplorer
    Tarkbar & Start Menu: Microsoft-Windows-stobject
    Tarkbar & Start Menu: Microsoft-Windows-explorer
    Personalized Settings: Microsoft-Windows-uxtheme
    Personalized Settings: Microsoft-Windows-themeui
    Personalized Settings: Microsoft-Windows-shmig
    Personalized Settings: Microsoft-Windows-shell32
    Personalized Settings: Microsoft-Windows-CommandPrompt
    If so, that, to me at least, represents a pretty significant change!  We want the pinned items but not the backgrounds and themes so that specific change won't work for us, but glad to hear it meets your needs.  (Also greatly appreciate your sharing
    your results with us.)
    I'll admit, even before reaching out to MS, the logs clearly show that the themes/backgrounds are all part of the 'Microsoft-Windows-shmig' component but dang it if I want something of substance (read: official documentation) that covers what exactly that
    component handles.  (I like to know what I'm potentially getting myself into.)

  • How can I display the tooltip in a tree node?

    I implement a TreeCellRenderer and has already set the tooltiptext through the following code:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
            Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
            if(Leaf.class.isInstance(userObject)) {
                    Leaf leaf = (Leaf)userObject;
                    setToolTipText(leaf.getString());
        }Why can't the tree display the tooltip when a move the mouse on the leaf of the tree?
    Thank you!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class Test3 extends JFrame {
    public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    JTree jt = new JTree() {
    public String getToolTipText(MouseEvent evt) {
    if (getRowForLocation(evt.getX(), evt.getY()) == -1)
    return null;
    TreePath curPath = getPathForLocation(evt.getX(),
    evt.getY());
    return curPath.getLastPathComponent().toString();
    content.add(new JScrollPane(jt), BorderLayout.CENTER);
    jt.setToolTipText("");
    setSize(400, 400);
    setVisible(true);
    public static void main(String[] args) { new Test3();
    }It sounds a solution. I use the following code and also can display the tooltip,but there's also a problem:
        mytree.setCellRenderer(new MyTreeCellRenderer());
        ToolTipManager.sharedInstance().registerComponent(mytree);the above code only effective when the function getTreeCellRendererComponent in MyTreeCellRenderer like the following:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }but when the code is bellow,it displays nothing(Only the leaf node need tooltip):
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         //setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
                         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
             if(b.isShowOrder())
                 setToolTipText(b.getContaId());  // only some node need tooltip, not all  node
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }Anyone knows why?

  • Need Help in installations and connecting displays. Please!

    Hello Everyone,
    Need Help in installations and connecting displays. Please!
    Im planning on installing in a cafe shop : (Store Self improvement)
    4 TV's (can be  Built in Wi-Fi) Store menus
    2 touch screen tablets.  To be use as Emenu (digital Menu)
    1 60' TV ( Built in Wi-Fi) as Entrainment displays and in store advertising
    What do I need to organize my project and make it looks cool and how to manageand controll all of the displays TV.

    TNSTAAFL
    I DO NOT work for Best Buy, Geek Squad and any way affiliated with them. I am a self-employed repairman. I specialize in TV's and desktop computers. I do not take sides. If BB is wrong I will say so. If you are a moron with a false sense of entitlement, then I will tell you.

  • BEx Displays Wrong Values After Reloading InfoCube

    I am very new to all of this, so there is a good chance I have just done something stupid.  I have an InfoCube in which I deleted all of the data, and then reloaded it with corrected data from the PSA.  If I look at the raw data in the InfoCube, it looks fine.  If I run a query with either BEx Analyzer or BEx Web Analyzer, key figure data is doubled, as are the result rows.  I believe it has to do caching for that particular Query, because I can create a new one and it will display the data correctly.  Does anyone have any ideas what might be causing this to happen? Or how to clear out the cache?
    Thanks

    Well, by the time I got back to look at it, it was working fine.  Which told me it was related to caching.  So I decided to recreate it.  In order to do this, I cleared out the request from the InfoCube, and then went and modified a few rows in the PSA.  After the DTP, I once again checked the Query and it was wrong.  I first checked the Request IDs, and I only had the new one.  I then went into RSRT and deleted just the cache for that query.  After that, the query was working again!  Thanks for your help. 
    Now my questions are how long does it take for the cache to recycle, and what actions can prompt it to recycle (such as changing the query)?

  • Images are displayed wrong in firefox

    Hello!
    I am a photographer, uploading images in png to my gallery at deviantart.com. I noticed that the images are displayed wrongly in firefox - but in IE9 and Opera they are shown correctly. I have tried with different color management settings in about:config but none of that has solved the problem. I would like to know why it is that firefox can't show the colours correctly, like opera and IE?
    If it's impossible to fix I will just simply have to stop using firefox which would be a shame when I have been using the browser for many years. The problem has not existed earlier.
    Best regards

    http://kasperarts.deviantart.com/gallery/#/d2to4iq
    That image for instance. And I save them using Adobe RGB since thtat's the colour space I work in, but this has never been a problem before.

  • Mx Components displaying wrong the embedded Font

    Hi, I'm developing with Adobe Flash Builder 4.5 and I have a problem that the mx components displaying wrong the embedded font which is embedded in a css-file. But spark components have no problems with displaying the embedded font.
    thanks

    See the embedded fonts post on my blog.  The MX components default to a
    different embedded font subsystem.
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • Fonts display wrong in Final Cut Pro

    One of the other editors in the office put together this piece and now I am making some changes to it on my machine. We're using the font "Baskerville" a common font that comes on the computer, and it is showing up correctly in the Font Book, but it is not showing up correctly in Final Cut Pro.
    There should be other options like regular, bold, semiBold etc, but there's only bold, italic, and bold italic.
    The other strange part is that when I first opened it on my computer it displayed wrong, and I tried reinstalling the fonts, and then it worked fine. I tried reinstalling the font again but it didn't help. I also tried restarting and that didn't help either. I checked in the Library > Fonts folder as well as the fonts folder under my user and the fonts match.
    Any suggestions as to what I could do?

    As far as I remember, Final Cut has always had this issue....
    I believe it has something to do with Final Cut only reading True Type (not Post script) fonts.
    That's why I only use Text for simple things like legals. For all other text uses, I use Photoshop...

  • Bug report : Navigator display wrong messages in package body

    Just run some code , you can see the Navigator display wrong messages in the package body,but the package work fine in sqlplus / toad or other tools.
    create or replace package SIMPLE AS
    Procedure simple_proc ;
    END;
    create or replace package body SIMPLE AS
    Procedure simple_proc
    IS
    v_tname varchar2(100);
    begin
    SELECT PERCENTILE_disc(0.5) WITHIN GROUP (ORDER BY tabtype DESC)
              INTO v_tname
              FROM tab;
    END simple_proc;
    END;
    Then open the package body in the Navigator (Connection Pane==> Connection Name ==> Packages ==> Simple Body ) , and show the error message:
    Unexpected token
    Missing Expression
    But if I just create the procedure out of the package , it work fine.
    CREATE OR REPLACE
    Procedure simple_proc
    IS
    v_tname varchar2(100);
    begin
    SELECT PERCENTILE_disc(0.5) WITHIN GROUP (ORDER BY tabtype DESC)
              INTO v_tname
              FROM tab;
    END simple_proc;
    /

    This has already been discussed a number of times (see http://forums.oracle.com/forums/search.jspa?objID=f260&q=Unexpected+token).
    As I understand it, it is related to the parser that SQL Developer is using to display the package decomposition in the navigator not coping with the full PL/SQL and SQL syntax (largely analytical functions from memory).

  • HTML formatted email with international content displays wrong character

    When reading HTML formatted email on the iPhone iOS4.1, it will sometimes display wrong characters.
    Comparing email source content from various html formatted emails I can see that;
    it displays incorrectly when:
    - HTML formatted content
    - Content type is marked as text/html with charset ISO-8859-1 (Latin1) which is the default html standard character encoding.
    - The international characters are not written in html conversion format, i.e. ø instead of ø
    It displays correctly when:
    - The content is marked as text/plain and encoded as Quoted-printable
    Anyway, the email which is display wrong characters on iPhone displayes correctly on OS X Mail app. Leading me to a temporary conclusion that it is a bug in iOS4.
    Can anybody confirm this?

    No matter which format you choose, you're sure to offend some recipients. Some people object to HTML, based on security or privacy concerns. Some prefer HTML because it's a more effective means of communication for some purposes.
    If your default composition format is HTML (or plain text), hold Shift when you click Write, Reply or Forward to switch the format to the opposite type, or if HTML is the default, select Options/Delivery Format/Plain text only in the Write window to make a one-off change.

  • JSP page display wrong time when compared to the server time

    Hi,
    This problem seems to weird but it is happening
    I have web application running where time is displayed in the page. In this application time is very critical. Currently, time is an hour behind the orginal time.
    I checked the server it is displaying proper time.
    As a matter of troubleshooting, I wrote a java program and run the program in the same server, where the application is running. The java program returns me proper time , but JSP is still displaying time an hour behind. To trouble shoot further, I created a test jsp page to just display the time and accessed the time and the jsp displayed wrong time as well, an hour behind.
    I am running[ tomcat 4.0.3 and j2sdk1.4.3 in suse linux enterprise server 9.0
    My Java program
    import java.util.*;
    import java.text.*;
    public class TestDate
    public static void main(String s[])
         try{
              DateFormat DF = new SimpleDateFormat( "dd/MM/yyyy");
    DateFormat DT = new SimpleDateFormat("hh:mm aa");
              SimpleDateFormat fmt=new SimpleDateFormat("HH.mm");
              Calendar cal= Calendar.getInstance();
              java.util.Date dt=cal.getTime();
              String curdt=DT.format(dt);
              System.out.println("Server Time" + curdt + "\n");
              int hh = cal.get(Calendar.HOUR);
              int mm = cal.get(Calendar.MINUTE);
              int aa = cal.get(Calendar.AM_PM);
              System.out.println("Time" + hh +":"+mm+":"+aa+"\n");
         }catch(Exception e) {
         e.printStackTrace();
    This display Time3:30:1
    My JSP Page
    <%@ page import="java.util.*,java.text.*"%>
    <%
    Calendar calen;
    calen = Calendar.getInstance();
    int hh=calen.get(Calendar.HOUR);
         int mm=calen.get(Calendar.MINUTE);
         int aa=calen.get(Calendar.AM_PM);
    %>
    <%=hh%> <%=mm%> <%=aa%>
    This display 2 30 1
    When I run Date in linux server it gives 3:30 PM EST 2004
    I am really confused, why this is happening, If you have any solutions or idea please post the solution.

    My guess is that the weirdness is caused by Daylight savings time.
    I will presume that you and the server are in the same timezone :-)
    Alternatively it could be caused by getting a different Locale.
    Try the following
    Print out "date.getTime()" value (ie long representing number of millis)
    They should be the same (or close) in both the app and in JSP
    Try simple date format in your JSP as well - what does that result in?
    Print the calendar object, and look for the difference.
    It might be in Locale, Timezone, or whether DST is set or not.
    Hope this helps,
    evnafets

Maybe you are looking for

  • How to change File Kind (not "how to assign an application to open a file?)

    I build the toc.ncx file (part of the ePub setup) automatically, based on user input and source file content. It's fine, except that the file Kind (as shown in Finder Preview, for example) is Plain Text. The Kind should be Unix Executable File (the a

  • Give information/site for  Complete one QM Cycle, please!!!

    Hi! SAP QM Gurus Please give information about one QM complete cycle. Thanks & Regard MDS Edited by: MOHAMMAD SUBHANI on Feb 20, 2012 9:52 AM

  • Startup disk

    I am getting an error message that my "startup disk is full.  Please delete files."   I am not that good with figuring this out, so I was hoping someone could help me out.  Any ideas?

  • Wrapping a design around a 3D object

    Hello, I'm trying to figure out how to take the fish scale pattern that I have made (out of ovals) and transform it so that it not only fits the shape of the three sections of the outline, but also that the scales stay aligned with each other once th

  • Install Adobe Acrobat X Pro

    I need to install Adobe Acrobat X pro on my desktop as I have to stop working with my laptop. I have a offical serial no for the adobe acrobat x pro. where can I find an xpro version to be downloaded? Tks for helping Alexandre