Use system colours for ownerdrawn highlighting (patch #1555426).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2704,15 +2704,12 @@ typedef unsigned long HGLOBAL;
|
|||||||
/* WIN32 graphics types for OS/2 GPI */
|
/* WIN32 graphics types for OS/2 GPI */
|
||||||
|
|
||||||
/* RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def */
|
/* RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def */
|
||||||
/* WARNING: The OS/2 headers typedef BYTE simply as 'char'; if the default is signed, all */
|
|
||||||
/* hell will break loose! */
|
|
||||||
/* #define OS2RGB(r,g,b) ((DWORD ((BYTE) (b) | ((WORD) (g) << 8)) | (((DWORD)(BYTE)(r)) << 16))) */
|
|
||||||
#define OS2RGB(r,g,b) ((DWORD)((unsigned char)(b) | ((unsigned char)(g) << 8)) | ((unsigned char)(r) << 16))
|
#define OS2RGB(r,g,b) ((DWORD)((unsigned char)(b) | ((unsigned char)(g) << 8)) | ((unsigned char)(r) << 16))
|
||||||
|
|
||||||
typedef unsigned long COLORREF;
|
typedef unsigned long COLORREF;
|
||||||
#define GetBValue(rgb) ((BYTE)((rgb) >> 16))
|
#define GetRValue(rgb) ((unsigned char)((rgb) >> 16))
|
||||||
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
|
#define GetGValue(rgb) ((unsigned char)(((unsigned short)(rgb)) >> 8))
|
||||||
#define GetRValue(rgb) ((BYTE)(rgb))
|
#define GetBValue(rgb) ((unsigned char)(rgb))
|
||||||
#define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))
|
#define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))
|
||||||
#define PALETTERGB(r,g,b) (0x02000000 | OS2RGB(r,g,b))
|
#define PALETTERGB(r,g,b) (0x02000000 | OS2RGB(r,g,b))
|
||||||
/* OS2's RGB/RGB2 is backwards from this */
|
/* OS2's RGB/RGB2 is backwards from this */
|
||||||
|
@@ -204,12 +204,22 @@ bool wxOwnerDrawn::OnDrawItem( wxDC& rDC,
|
|||||||
//
|
//
|
||||||
if (eStatus & wxODSelected)
|
if (eStatus & wxODSelected)
|
||||||
{
|
{
|
||||||
wxColour vCol2(wxT("WHITE"));
|
vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP
|
||||||
vColBack.Set( (unsigned char)0
|
,SYSCLR_MENUHILITEBGND
|
||||||
,(unsigned char)0
|
,0L
|
||||||
,(unsigned char)160
|
);
|
||||||
); // no dark blue in color table
|
vColBack.Set( GetRValue(vRef)
|
||||||
vColText = vCol2;
|
,GetGValue(vRef)
|
||||||
|
,GetBValue(vRef)
|
||||||
|
);
|
||||||
|
vRef = (ULONG)::WinQuerySysColor( HWND_DESKTOP
|
||||||
|
,SYSCLR_MENUHILITE
|
||||||
|
,0L
|
||||||
|
);
|
||||||
|
vColText.Set( GetRValue(vRef)
|
||||||
|
,GetGValue(vRef)
|
||||||
|
,GetBValue(vRef)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else if (eStatus & wxODDisabled)
|
else if (eStatus & wxODDisabled)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user