git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25640
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_logWindow->SetSize(0, y + 1, size.x, size.y - y);
}
m_logWindow->SetSize(0, y + 1, size.x, size.y - y);
}
+bool MyFrame::CheckNonVirtual() const
+{
+ if ( !m_listCtrl->HasFlag(wxLC_VIRTUAL) )
+ return true;
+
+ // "this" == whatever
+ wxLogWarning(_T("Can't do this in virtual view, sorry."));
+
+ return false;
+}
+
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
void MyFrame::OnDeselectAll(wxCommandEvent& WXUNUSED(event))
{
void MyFrame::OnDeselectAll(wxCommandEvent& WXUNUSED(event))
{
+ if ( !CheckNonVirtual() )
+ return;
+
int n = m_listCtrl->GetItemCount();
for (int i = 0; i < n; i++)
m_listCtrl->SetItemState(i,0,wxLIST_STATE_SELECTED);
int n = m_listCtrl->GetItemCount();
for (int i = 0; i < n; i++)
m_listCtrl->SetItemState(i,0,wxLIST_STATE_SELECTED);
void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event))
{
void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event))
{
+ if ( !CheckNonVirtual() )
+ return;
+
int n = m_listCtrl->GetItemCount();
for (int i = 0; i < n; i++)
m_listCtrl->SetItemState(i,wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
int n = m_listCtrl->GetItemCount();
for (int i = 0; i < n; i++)
m_listCtrl->SetItemState(i,wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
void InitWithIconItems(bool withText, bool sameIcon = FALSE);
void InitWithVirtualItems();
void InitWithIconItems(bool withText, bool sameIcon = FALSE);
void InitWithVirtualItems();
+ // return true if the control is not in virtual view, give an error message
+ // and return false if it is
+ bool CheckNonVirtual() const;
+
+
wxLog *m_logOld;
DECLARE_NO_COPY_CLASS(MyFrame)
wxLog *m_logOld;
DECLARE_NO_COPY_CLASS(MyFrame)