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:
Vadim Zeitlin
2008-09-14 19:15:19 +00:00
parent f379342915
commit a6aa377bb3
6 changed files with 668 additions and 673 deletions

View File

@@ -925,21 +925,15 @@ void MyTreeCtrl::CreateStateImageList(bool del)
}
else
{
#if 0
int width = ::GetSystemMetrics(SM_CXMENUCHECK),
height = ::GetSystemMetrics(SM_CYMENUCHECK);
#else
int width = 16;
int height = 16;
#endif
wxRendererNative& renderer = wxRendererNative::Get();
wxSize size(renderer.GetCheckBoxSize(this));
// make an state checkbox image list
states = new wxImageList(width, height, true);
states = new wxImageList(size.GetWidth(), size.GetHeight(), true);
wxBitmap checkBmp(width, height);
wxRect rect (0, 0, width, height);
wxRendererNative& renderer = wxRendererNative::Get();
wxBitmap checkBmp(size.GetWidth(), size.GetHeight());
wxRect rect(size);
// create no checked image
{
@@ -955,6 +949,7 @@ void MyTreeCtrl::CreateStateImageList(bool del)
// create checked image
{
wxMemoryDC memDC(checkBmp);
memDC.Clear();
renderer.DrawCheckBox(this, memDC, rect, wxCONTROL_CHECKED);
}