X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/97c611f84745e193ac2b156a92dd127aaa9c7d51..7848088476db284a94f19eeb24411b45d676ac46:/src/msw/listctrl.cpp diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index c3193b7198..44321084d7 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -353,23 +353,16 @@ bool wxListCtrl::Create(wxWindow *parent, // explicitly say that we want to use Unicode because otherwise we get ANSI // versions of _some_ messages (notably LVN_GETDISPINFOA) in MSLU build -#if wxUSE_UNICODE - ::SendMessage(GetHwnd(), LVM_SETUNICODEFORMAT, TRUE, 0); -#endif + wxSetCCUnicodeFormat(GetHwnd()); // for comctl32.dll v 4.70+ we want to have this attribute because it's // prettier (and also because wxGTK does it like this) - if ( HasFlag(wxLC_REPORT) && wxTheApp->GetComCtl32Version() >= 470 ) + if ( InReportView() && wxTheApp->GetComCtl32Version() >= 470 ) { ::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); } - // inherit foreground colour but our background should be the same as for - // listboxes and other such "container" windows and not inherited - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetForegroundColour(GetParent()->GetForegroundColour()); - return TRUE; } @@ -548,6 +541,17 @@ void wxListCtrl::SetWindowStyleFlag(long flag) // accessors // ---------------------------------------------------------------------------- +/* static */ wxVisualAttributes +wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant) +{ + wxVisualAttributes attrs = GetCompositeControlsDefaultAttributes(variant); + + // common controls have their own default font + attrs.font = wxGetCCDefaultFont(); + + return attrs; +} + // Sets the foreground, i.e. text, colour bool wxListCtrl::SetForegroundColour(const wxColour& col) { @@ -2297,12 +2301,10 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) // Reset the device origin since it may have been set dc.SetDeviceOrigin(0, 0); - bool drawHRules = ((GetWindowStyle() & wxLC_HRULES) != 0); - bool drawVRules = ((GetWindowStyle() & wxLC_VRULES) != 0); + bool drawHRules = HasFlag(wxLC_HRULES); + bool drawVRules = HasFlag(wxLC_VRULES); - if (!drawHRules && !drawVRules) - return; - if ((GetWindowStyle() & wxLC_REPORT) == 0) + if (!InReportView() || !drawHRules && !drawVRules) return; wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); @@ -2614,7 +2616,7 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl, if (info.m_mask & wxLIST_MASK_TEXT) { lvItem.mask |= LVIF_TEXT; - if ( ctrl->GetWindowStyleFlag() & wxLC_USER_TEXT ) + if ( ctrl->HasFlag(wxLC_USER_TEXT) ) { lvItem.pszText = LPSTR_TEXTCALLBACK; }