listview has LVS_EX_FULLROWSELECT style when supported
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3e4efd7cb9
commit
0b5efdc724
@ -47,10 +47,9 @@ static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, L
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
|
||||
#endif // USE_SHARED_LIBRARY
|
||||
|
||||
#endif
|
||||
|
||||
wxListCtrl::wxListCtrl(void)
|
||||
wxListCtrl::wxListCtrl()
|
||||
{
|
||||
m_imageListNormal = NULL;
|
||||
m_imageListSmall = NULL;
|
||||
@ -60,8 +59,13 @@ wxListCtrl::wxListCtrl(void)
|
||||
m_textCtrl = NULL;
|
||||
}
|
||||
|
||||
bool wxListCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxValidator& validator, const wxString& name)
|
||||
bool wxListCtrl::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_imageListNormal = NULL;
|
||||
m_imageListSmall = NULL;
|
||||
@ -125,6 +129,16 @@ bool wxListCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, con
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// for comctl32.dll v 4.70+ we want to have this attribute because it's
|
||||
// prettier (and also because wxGTK does it like this)
|
||||
#ifdef ListView_SetExtendedListViewStyle
|
||||
if ( wstyle & LVS_REPORT )
|
||||
{
|
||||
ListView_SetExtendedListViewStyle((HWND)GetHWND(),
|
||||
LVS_EX_FULLROWSELECT);
|
||||
}
|
||||
#endif // ListView_SetExtendedListViewStyle
|
||||
|
||||
wxSystemSettings settings;
|
||||
SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||
SetForegroundColour(parent->GetForegroundColour());
|
||||
@ -136,7 +150,7 @@ bool wxListCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, con
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxListCtrl::~wxListCtrl(void)
|
||||
wxListCtrl::~wxListCtrl()
|
||||
{
|
||||
if (m_textCtrl)
|
||||
{
|
||||
@ -189,7 +203,7 @@ void wxListCtrl::SetWindowStyleFlag(long flag)
|
||||
RecreateWindow();
|
||||
}
|
||||
|
||||
void wxListCtrl::RecreateWindow(void)
|
||||
void wxListCtrl::RecreateWindow()
|
||||
{
|
||||
if ( GetHWND() )
|
||||
{
|
||||
@ -226,6 +240,14 @@ void wxListCtrl::RecreateWindow(void)
|
||||
m_hWnd = (WXHWND) hWndListControl;
|
||||
SubclassWin((WXHWND) m_hWnd);
|
||||
|
||||
#ifdef ListView_SetExtendedListViewStyle
|
||||
if ( style & LVS_REPORT )
|
||||
{
|
||||
ListView_SetExtendedListViewStyle((HWND)GetHWND(),
|
||||
LVS_EX_FULLROWSELECT);
|
||||
}
|
||||
#endif // ListView_SetExtendedListViewStyle
|
||||
|
||||
if ( m_imageListNormal )
|
||||
SetImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL);
|
||||
if ( m_imageListSmall )
|
||||
@ -280,6 +302,7 @@ long wxListCtrl::ConvertToMSWStyle(long& oldStyle, long style) const
|
||||
oldStyle -= LVS_LIST;
|
||||
if ( (oldStyle & LVS_TYPEMASK) == LVS_SMALLICON )
|
||||
oldStyle -= LVS_SMALLICON;
|
||||
|
||||
wstyle |= LVS_REPORT;
|
||||
}
|
||||
|
||||
@ -806,13 +829,13 @@ bool wxListCtrl::DeleteItem(long item)
|
||||
}
|
||||
|
||||
// Deletes all items
|
||||
bool wxListCtrl::DeleteAllItems(void)
|
||||
bool wxListCtrl::DeleteAllItems()
|
||||
{
|
||||
return (ListView_DeleteAllItems((HWND) GetHWND()) != 0);
|
||||
}
|
||||
|
||||
// Deletes all items
|
||||
bool wxListCtrl::DeleteAllColumns(void)
|
||||
bool wxListCtrl::DeleteAllColumns()
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < m_colCount; i++)
|
||||
@ -834,7 +857,7 @@ bool wxListCtrl::DeleteColumn(int col)
|
||||
}
|
||||
|
||||
// Clears items, and columns if there are any.
|
||||
void wxListCtrl::ClearAll(void)
|
||||
void wxListCtrl::ClearAll()
|
||||
{
|
||||
DeleteAllItems();
|
||||
if ( m_colCount > 0 )
|
||||
@ -1276,7 +1299,7 @@ char *wxListCtrl::AddPool(const wxString& str)
|
||||
}
|
||||
|
||||
// List item structure
|
||||
wxListItem::wxListItem(void)
|
||||
wxListItem::wxListItem()
|
||||
{
|
||||
m_mask = 0;
|
||||
m_itemId = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user