Merge branch 'listctrl-fixes'

Various generic wxListCtrl fixes and improvements.

Closes https://github.com/wxWidgets/wxWidgets/pull/2340
This commit is contained in:
Vadim Zeitlin
2021-04-27 14:05:12 +02:00
10 changed files with 106 additions and 82 deletions

View File

@@ -150,9 +150,6 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(LIST_TOGGLE_HEADER, MyFrame::OnToggleHeader)
EVT_MENU(LIST_TOGGLE_BELL, MyFrame::OnToggleBell)
EVT_MENU(LIST_CHECKVISIBILITY, MyFrame::OnCheckVisibility)
#ifdef __WXOSX__
EVT_MENU(LIST_MAC_USE_GENERIC, MyFrame::OnToggleMacUseGeneric)
#endif // __WXOSX__
EVT_MENU(LIST_FIND, MyFrame::OnFind)
EVT_MENU(LIST_TOGGLE_CHECKBOX, MyFrame::OnToggleItemCheckBox)
EVT_MENU(LIST_GET_CHECKBOX, MyFrame::OnGetItemCheckBox)
@@ -229,10 +226,6 @@ MyFrame::MyFrame(const wxString& title)
menuView->Append(LIST_SMALL_VIRTUAL_VIEW, "Small virtual vie&w\tF8");
menuView->AppendSeparator();
menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items");
#ifdef __WXOSX__
menuView->AppendSeparator();
menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, "Mac: Use Generic Control");
#endif
wxMenu *menuList = new wxMenu;
menuList->Append(LIST_GOTO, "&Go to item #3\tCtrl-3");
@@ -391,15 +384,6 @@ void MyFrame::OnCheckVisibility(wxCommandEvent& WXUNUSED(event))
wxLogMessage( "Line 9 is not visible" );
}
#ifdef __WXOSX__
void MyFrame::OnToggleMacUseGeneric(wxCommandEvent& event)
{
wxSystemOptions::SetOption("mac.listctrl.always_use_generic", event.IsChecked());
}
#endif // __WXOSX__
void MyFrame::OnGoTo(wxCommandEvent& WXUNUSED(event))
{
if ( m_listCtrl->IsEmpty() )
@@ -433,7 +417,7 @@ void MyFrame::OnFocusLast(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnToggleFirstSel(wxCommandEvent& WXUNUSED(event))
{
if ( !m_listCtrl->IsEmpty() )
{
{
m_listCtrl->SetItemState(0, (~m_listCtrl->GetItemState(0, wxLIST_STATE_SELECTED) ) & wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
else

View File

@@ -148,9 +148,6 @@ protected:
void OnToggleLines(wxCommandEvent& event);
void OnToggleHeader(wxCommandEvent& event);
void OnToggleBell(wxCommandEvent& event);
#ifdef __WXOSX__
void OnToggleMacUseGeneric(wxCommandEvent& event);
#endif // __WXOSX__
void OnFind(wxCommandEvent& event);
void OnToggleItemCheckBox(wxCommandEvent& event);
void OnGetItemCheckBox(wxCommandEvent& event);
@@ -245,9 +242,6 @@ enum
LIST_FREEZE,
LIST_THAW,
LIST_TOGGLE_LINES,
#ifdef __WXOSX__
LIST_MAC_USE_GENERIC,
#endif
LIST_CHECKVISIBILITY,
LIST_CTRL = 1000
};