JDK-4781104 : Background color of Menu is different from that of MenuBar:Windows Classic style
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.1_07
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2002-11-19
  • Updated: 2003-02-04
  • Resolved: 2002-12-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other Other
1.3.1_08 08Fixed 1.4.0_04Fixed 1.4.1_03Fixed 1.4.2Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
With WindowsXP, the background color of Menu is different from
that of MenuBar in Windows Classic Style.

Fix for bug #4551985 fixed the same problem in Windows XP style only.

We need a fix for all the style in windows XP. 

See bug # 4551985 for sample testcase.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.3.1_08 1.4.0_04 1.4.1_03 mantis-beta FIXED IN: 1.3.1_08 1.4.0_04 1.4.1_03 mantis-beta INTEGRATED IN: 1.3.1_08 1.4.0_04 1.4.1_03 mantis-beta
14-06-2004

EVALUATION Commit to fix in Mantis (customer escalated). ###@###.### 2002-11-20 Name: rpR10076 Date: 11/26/2002 We need to use COLOR_MENUBAR to draw top-menus only if WinXP Style is active in the system. For Windows classic style, we need to act as on non-XP windows systems. We can read registry entries to figure out which style is active. ###@###.### ======================================================================
11-06-2004

SUGGESTED FIX Name: rpR10076 Date: 11/26/2002 ------- awt_MenuItem.cpp ------- *** /tmp/sccs.leaigC Tue Nov 26 13:02:24 2002 --- awt_MenuItem.cpp Tue Nov 26 12:43:01 2002 *************** *** 8,13 **** --- 8,14 ---- #include "awt_MenuItem.h" #include "awt_Menu.h" #include "awt_MenuBar.h" + #include "awt_DesktopProperties.h" #include <sun_awt_windows_WCheckboxMenuItemPeer.h> // Begin -- Win32 SDK include files *************** *** 234,240 **** #define COLOR_MENUBAR 30 #endif // Set background and text colors for unselected item ! if (IS_WINXP && IsTopMenu()) { crBack = ::GetSysColor (COLOR_MENUBAR); } else { crBack = ::GetSysColor (COLOR_MENU); --- 235,241 ---- #define COLOR_MENUBAR 30 #endif // Set background and text colors for unselected item ! if (IS_WINXP && IsTopMenu() && AwtDesktopProperties::IsXPStyle()) { crBack = ::GetSysColor (COLOR_MENUBAR); } else { crBack = ::GetSysColor (COLOR_MENU); ------- awt_DesktopProperties.h ------- *** /tmp/sccs.VFaGaC Tue Nov 26 13:01:45 2002 --- awt_DesktopProperties.h Tue Nov 26 12:35:54 2002 *************** *** 27,32 **** --- 27,33 ---- void GetWindowsParameters(); void PlayWindowsSound(const char * eventName); + static BOOL IsXPStyle(); static jfieldID pDataID; static jmethodID setStringPropertyID; ------- awt_DesktopProperties.cpp ------- *** /tmp/sccs.x2aq.V Tue Nov 26 14:36:52 2002 --- awt_DesktopProperties.cpp Tue Nov 26 13:19:16 2002 *************** *** 110,115 **** --- 110,125 ---- } } + // Used in AwtMenuItem to determine the color of top menus, + // since they depend on XP style. ThemeActive property is + // '1' for XP Style, '0' for Windows classic style. + BOOL AwtDesktopProperties::IsXPStyle() { + char* style = getXPStylePropFromReg("ThemeActive"); + BOOL result = (style != NULL && *style == '1'); + free(style); + return result; + } + void AwtDesktopProperties::GetXPStyleProperties() { char* value; ###@###.### ====================================================================== ###@###.### 2002-12-12 For the 1.4.1 & below releases along with the above changes, the implementation of getXPStylePropFromReg(....) also needs to be present.
12-12-2002