1. wxWizard appears in the centre of the screen by default
2. the selected brush isn't damaged any more by DrawBitmap() 3. corrected confusion between current and bg brush in DrawBitmap() 4. added wxGetColourFromUser() (to match wxGetTextFromUser() &c) 5. mem leak/crash in wxListCtrl on mode change fixed 6. wxListCtrl::Set{Fore|Back}groundColour() work as expected now git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -239,7 +239,7 @@ void wxListCtrl::UpdateStyle()
|
||||
}
|
||||
}
|
||||
|
||||
void wxListCtrl::FreeAllAttrs()
|
||||
void wxListCtrl::FreeAllAttrs(bool dontRecreate)
|
||||
{
|
||||
if ( m_hasAnyAttr )
|
||||
{
|
||||
@@ -249,6 +249,10 @@ void wxListCtrl::FreeAllAttrs()
|
||||
}
|
||||
|
||||
m_attrs.Destroy();
|
||||
if ( !dontRecreate )
|
||||
{
|
||||
m_attrs.Create(wxKEY_INTEGER, 1000); // just as def ctor
|
||||
}
|
||||
|
||||
m_hasAnyAttr = FALSE;
|
||||
}
|
||||
@@ -256,6 +260,8 @@ void wxListCtrl::FreeAllAttrs()
|
||||
|
||||
wxListCtrl::~wxListCtrl()
|
||||
{
|
||||
FreeAllAttrs(TRUE /* no need to recreate hash any more */);
|
||||
|
||||
if ( m_textCtrl )
|
||||
{
|
||||
m_textCtrl->UnsubclassWin();
|
||||
@@ -416,14 +422,28 @@ long wxListCtrl::ConvertToMSWStyle(long& oldStyle, long style) const
|
||||
// accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Sets the background colour (GetBackgroundColour already implicit in
|
||||
// wxWindow class)
|
||||
// Sets the foreground, i.e. text, colour
|
||||
bool wxListCtrl::SetForegroundColour(const wxColour& col)
|
||||
{
|
||||
if ( !wxWindow::SetForegroundColour(col) )
|
||||
return FALSE;
|
||||
|
||||
ListView_SetTextColor(GetHwnd(), wxColourToRGB(col));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Sets the background colour
|
||||
bool wxListCtrl::SetBackgroundColour(const wxColour& col)
|
||||
{
|
||||
if ( !wxWindow::SetBackgroundColour(col) )
|
||||
return FALSE;
|
||||
|
||||
ListView_SetBkColor(GetHwnd(), PALETTERGB(col.Red(), col.Green(), col.Blue()));
|
||||
// we set the same colour for both the "empty" background and the items
|
||||
// background
|
||||
COLORREF color = wxColourToRGB(col);
|
||||
ListView_SetBkColor(GetHwnd(), color);
|
||||
ListView_SetTextBkColor(GetHwnd(), color);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user