use transparent icons and clear the DC before drawing them to fix the background of state icons appearance (part of #9591)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,7 +14,7 @@ static const char *state1_xpm[] = {
|
|||||||
"6. c #A6A800",
|
"6. c #A6A800",
|
||||||
"M c #EDF00E",
|
"M c #EDF00E",
|
||||||
"$. c #A6A802",
|
"$. c #A6A802",
|
||||||
" c #FFFFFF",
|
" c None",
|
||||||
"H c #DEE104",
|
"H c #DEE104",
|
||||||
"0 c #F5F802",
|
"0 c #F5F802",
|
||||||
"o c #FCFF22",
|
"o c #FCFF22",
|
||||||
|
@@ -13,7 +13,7 @@ static const char *state2_xpm[] = {
|
|||||||
"' c #3F8620",
|
"' c #3F8620",
|
||||||
"x c #9FD488",
|
"x c #9FD488",
|
||||||
"6. c #37751C",
|
"6. c #37751C",
|
||||||
" c #FFFFFF",
|
" c None",
|
||||||
"A c #8CCB71",
|
"A c #8CCB71",
|
||||||
"# c #98D07F",
|
"# c #98D07F",
|
||||||
"5. c #3A7C1E",
|
"5. c #3A7C1E",
|
||||||
|
@@ -17,7 +17,7 @@ static const char *state3_xpm[] = {
|
|||||||
"0 c #C62B2B",
|
"0 c #C62B2B",
|
||||||
"$ c #DF7A7A",
|
"$ c #DF7A7A",
|
||||||
"t c #D14949",
|
"t c #D14949",
|
||||||
" c #FFFFFF",
|
" c None",
|
||||||
"o. c #962020",
|
"o. c #962020",
|
||||||
"&. c #B82C2C",
|
"&. c #B82C2C",
|
||||||
"p c #E8A1A1",
|
"p c #E8A1A1",
|
||||||
|
@@ -12,7 +12,7 @@ static const char *state4_xpm[] = {
|
|||||||
"=. c #2C67B8",
|
"=. c #2C67B8",
|
||||||
"| c #2760AD",
|
"| c #2760AD",
|
||||||
".. c #3672C5",
|
".. c #3672C5",
|
||||||
" c #FFFFFF",
|
" c None",
|
||||||
"U c #548AD4",
|
"U c #548AD4",
|
||||||
"s c #2A6AC1",
|
"s c #2A6AC1",
|
||||||
"% c #3475CD",
|
"% c #3475CD",
|
||||||
|
@@ -7,7 +7,7 @@ static const char *state5_xpm[] = {
|
|||||||
"O c #3C3C3C",
|
"O c #3C3C3C",
|
||||||
"l c #080808",
|
"l c #080808",
|
||||||
"w c #353535",
|
"w c #353535",
|
||||||
" c #FFFFFF",
|
" c None",
|
||||||
"u c #010101",
|
"u c #010101",
|
||||||
"C c #101010",
|
"C c #101010",
|
||||||
"< c #1F1F1F",
|
"< c #1F1F1F",
|
||||||
|
@@ -925,21 +925,15 @@ void MyTreeCtrl::CreateStateImageList(bool del)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if 0
|
wxRendererNative& renderer = wxRendererNative::Get();
|
||||||
int width = ::GetSystemMetrics(SM_CXMENUCHECK),
|
|
||||||
height = ::GetSystemMetrics(SM_CYMENUCHECK);
|
wxSize size(renderer.GetCheckBoxSize(this));
|
||||||
#else
|
|
||||||
int width = 16;
|
|
||||||
int height = 16;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// make an state checkbox image list
|
// make an state checkbox image list
|
||||||
states = new wxImageList(width, height, true);
|
states = new wxImageList(size.GetWidth(), size.GetHeight(), true);
|
||||||
|
|
||||||
wxBitmap checkBmp(width, height);
|
wxBitmap checkBmp(size.GetWidth(), size.GetHeight());
|
||||||
wxRect rect (0, 0, width, height);
|
wxRect rect(size);
|
||||||
|
|
||||||
wxRendererNative& renderer = wxRendererNative::Get();
|
|
||||||
|
|
||||||
// create no checked image
|
// create no checked image
|
||||||
{
|
{
|
||||||
@@ -955,6 +949,7 @@ void MyTreeCtrl::CreateStateImageList(bool del)
|
|||||||
// create checked image
|
// create checked image
|
||||||
{
|
{
|
||||||
wxMemoryDC memDC(checkBmp);
|
wxMemoryDC memDC(checkBmp);
|
||||||
|
memDC.Clear();
|
||||||
renderer.DrawCheckBox(this, memDC, rect, wxCONTROL_CHECKED);
|
renderer.DrawCheckBox(this, memDC, rect, wxCONTROL_CHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user