1. fixed typo ('&' instead of '|') in wxNotebook
2. changed wxTC_MULTILINE to be equal to wxNB_MULTILINE and != 0 3. much more efficient selection handling in virtual wxListCtrl, we can now select 1000000 items without problems 4. kbd/mouse selection (ctrl/shift handling) fixed in wxListCtrl 5. added wxSortedArray::IndexForInsert() and AddAt(), remove Remove(size_t), use RemoveAt() instead git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -71,6 +71,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(LIST_SET_BG_COL, MyFrame::OnSetBgColour)
|
||||
EVT_MENU(LIST_TOGGLE_MULTI_SEL, MyFrame::OnToggleMultiSel)
|
||||
EVT_MENU(LIST_SHOW_COL_INFO, MyFrame::OnShowColInfo)
|
||||
EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo)
|
||||
|
||||
EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo)
|
||||
END_EVENT_TABLE()
|
||||
@@ -181,7 +182,9 @@ MyFrame::MyFrame(const wxChar *title, int x, int y, int w, int h)
|
||||
menuList->Append(LIST_TOGGLE_FIRST, _T("&Toggle first item\tCtrl-T"));
|
||||
menuList->Append(LIST_DESELECT_ALL, _T("&Deselect All\tCtrl-D"));
|
||||
menuList->Append(LIST_SELECT_ALL, _T("S&elect All\tCtrl-A"));
|
||||
menuList->AppendSeparator();
|
||||
menuList->Append(LIST_SHOW_COL_INFO, _T("Show &column info\tCtrl-C"));
|
||||
menuList->Append(LIST_SHOW_SEL_INFO, _T("Show &selected items\tCtrl-S"));
|
||||
menuList->AppendSeparator();
|
||||
menuList->Append(LIST_SORT, _T("&Sort\tCtrl-S"));
|
||||
menuList->AppendSeparator();
|
||||
@@ -459,6 +462,32 @@ void MyFrame::OnSort(wxCommandEvent& WXUNUSED(event))
|
||||
sw.Time()));
|
||||
}
|
||||
|
||||
void MyFrame::OnShowSelInfo(wxCommandEvent& event)
|
||||
{
|
||||
int selCount = m_listCtrl->GetSelectedItemCount();
|
||||
wxLogMessage(_T("%d items selected:"), selCount);
|
||||
|
||||
// don't show too many items
|
||||
size_t shownCount = 0;
|
||||
|
||||
long item = m_listCtrl->GetNextItem(-1, wxLIST_NEXT_ALL,
|
||||
wxLIST_STATE_SELECTED);
|
||||
while ( item != -1 )
|
||||
{
|
||||
wxLogMessage(_T("\t%ld (%s)"),
|
||||
item, m_listCtrl->GetItemText(item).c_str());
|
||||
|
||||
if ( ++shownCount > 10 )
|
||||
{
|
||||
wxLogMessage(_T("\t... more selected items snipped..."));
|
||||
break;
|
||||
}
|
||||
|
||||
item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL,
|
||||
wxLIST_STATE_SELECTED);
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::OnShowColInfo(wxCommandEvent& event)
|
||||
{
|
||||
int count = m_listCtrl->GetColumnCount();
|
||||
|
Reference in New Issue
Block a user