wxBEGIN_PROPERTIES_TABLE(wxListCtrl)
wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
- wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+ wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxListCtrl)
// 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;
}
// 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)
{
// there's a GPF in Windows.
// By returning TRUE here, we avoid further processing
// of this strange message.
- if ( info->iItem >= GetColumnCount() )
+ if ( (unsigned)info->iItem >= (unsigned)GetColumnCount() )
return TRUE;
}
// fall through
case LVN_ITEMCHANGED:
// we translate this catch all message into more interesting
- // (and more easy to process) wxWindows events
+ // (and more easy to process) wxWidgets events
// first of all, we deal with the state change events only and
// only for valid items (item == -1 for the virtual list
// 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);
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;
}