Fixed wxListCtrl::GetNextItem()
Fixed bug in handling wxLC_NO_HEADER, Moved logmessage stuff out of idle_recursion protection so that log dialogs get idle events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2334,7 +2334,7 @@ long wxListMainWindow::GetNextItem( long item, int WXUNUSED(geometry), int state
|
|||||||
long ret = 0;
|
long ret = 0;
|
||||||
if (item > 0) ret = item;
|
if (item > 0) ret = item;
|
||||||
if(ret >= GetItemCount()) return -1;
|
if(ret >= GetItemCount()) return -1;
|
||||||
wxNode *node = m_lines.Nth( (size_t)ret );
|
wxNode *node = m_lines.Nth( (size_t)++ret );
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxListLineData *line = (wxListLineData*)node->Data();
|
wxListLineData *line = (wxListLineData*)node->Data();
|
||||||
@@ -2715,9 +2715,15 @@ bool wxListCtrl::Create(wxWindow *parent,
|
|||||||
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style );
|
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style );
|
||||||
|
|
||||||
if (HasFlag(wxLC_REPORT))
|
if (HasFlag(wxLC_REPORT))
|
||||||
|
{
|
||||||
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL );
|
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL );
|
||||||
|
if (HasFlag(wxLC_NO_HEADER))
|
||||||
|
m_headerWin->Show( FALSE );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_headerWin = (wxListHeaderWindow *) NULL;
|
m_headerWin = (wxListHeaderWindow *) NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SetBackgroundColour( *wxWHITE );
|
SetBackgroundColour( *wxWHITE );
|
||||||
|
|
||||||
|
@@ -636,7 +636,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
const wxArrayLong& times,
|
const wxArrayLong& times,
|
||||||
const wxString& caption,
|
const wxString& caption,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog(parent, -1, caption),
|
: wxDialog(parent, -1, caption ),
|
||||||
m_messages(messages), m_severity(severity), m_times(times)
|
m_messages(messages), m_severity(severity), m_times(times)
|
||||||
{
|
{
|
||||||
m_showingDetails = FALSE; // not initially
|
m_showingDetails = FALSE; // not initially
|
||||||
@@ -697,7 +697,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
|
|||||||
// create it now
|
// create it now
|
||||||
m_listctrl = new wxListCtrl(this, -1,
|
m_listctrl = new wxListCtrl(this, -1,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxLC_REPORT | wxLC_NO_HEADER);
|
wxLC_REPORT | wxLC_NO_HEADER );
|
||||||
m_listctrl->InsertColumn(0, _("Message"));
|
m_listctrl->InsertColumn(0, _("Message"));
|
||||||
m_listctrl->InsertColumn(1, _("Time"));
|
m_listctrl->InsertColumn(1, _("Time"));
|
||||||
|
|
||||||
@@ -775,6 +775,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
|
|||||||
m_showingDetails = !m_showingDetails;
|
m_showingDetails = !m_showingDetails;
|
||||||
|
|
||||||
// in any case, our size changed - update
|
// in any case, our size changed - update
|
||||||
|
sizer->SetSizeHints(this);
|
||||||
sizer->Fit(this);
|
sizer->Fit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
#include "wx/colour.h"
|
#include "wx/colour.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
#include "wx/log.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/generic/panelg.h"
|
#include "wx/generic/panelg.h"
|
||||||
|
@@ -138,9 +138,6 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
|||||||
// thread so we must lock it here ourselves
|
// thread so we must lock it here ourselves
|
||||||
gdk_threads_enter();
|
gdk_threads_enter();
|
||||||
|
|
||||||
/* sent idle event to all who request them */
|
|
||||||
while (wxTheApp->ProcessIdle()) { }
|
|
||||||
|
|
||||||
/* we don't want any more idle events until the next event is
|
/* we don't want any more idle events until the next event is
|
||||||
sent to wxGTK */
|
sent to wxGTK */
|
||||||
gtk_idle_remove( wxTheApp->m_idleTag );
|
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||||
@@ -153,6 +150,9 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
|||||||
emptied */
|
emptied */
|
||||||
g_isIdle = TRUE;
|
g_isIdle = TRUE;
|
||||||
|
|
||||||
|
/* sent idle event to all who request them */
|
||||||
|
while (wxTheApp->ProcessIdle()) { }
|
||||||
|
|
||||||
// release lock again
|
// release lock again
|
||||||
gdk_threads_leave();
|
gdk_threads_leave();
|
||||||
|
|
||||||
@@ -352,11 +352,11 @@ bool wxApp::ProcessIdle()
|
|||||||
void wxApp::OnIdle( wxIdleEvent &event )
|
void wxApp::OnIdle( wxIdleEvent &event )
|
||||||
{
|
{
|
||||||
static bool s_inOnIdle = FALSE;
|
static bool s_inOnIdle = FALSE;
|
||||||
|
|
||||||
/* Avoid recursion (via ProcessEvent default case) */
|
/* Avoid recursion (via ProcessEvent default case) */
|
||||||
if (s_inOnIdle)
|
if (s_inOnIdle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_inOnIdle = TRUE;
|
s_inOnIdle = TRUE;
|
||||||
|
|
||||||
/* Resend in the main thread events which have been prepared in other
|
/* Resend in the main thread events which have been prepared in other
|
||||||
@@ -366,13 +366,6 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
/* 'Garbage' collection of windows deleted with Close(). */
|
/* 'Garbage' collection of windows deleted with Close(). */
|
||||||
DeletePendingObjects();
|
DeletePendingObjects();
|
||||||
|
|
||||||
/* flush the logged messages if any */
|
|
||||||
#if wxUSE_LOG
|
|
||||||
wxLog *log = wxLog::GetActiveTarget();
|
|
||||||
if (log != NULL && log->HasPendingMessages())
|
|
||||||
log->Flush();
|
|
||||||
#endif // wxUSE_LOG
|
|
||||||
|
|
||||||
/* Send OnIdle events to all windows */
|
/* Send OnIdle events to all windows */
|
||||||
bool needMore = SendIdleEvents();
|
bool needMore = SendIdleEvents();
|
||||||
|
|
||||||
@@ -380,6 +373,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
event.RequestMore(TRUE);
|
event.RequestMore(TRUE);
|
||||||
|
|
||||||
s_inOnIdle = FALSE;
|
s_inOnIdle = FALSE;
|
||||||
|
|
||||||
|
/* flush the logged messages if any */
|
||||||
|
#if wxUSE_LOG
|
||||||
|
wxLog *log = wxLog::GetActiveTarget();
|
||||||
|
if (log != NULL && log->HasPendingMessages())
|
||||||
|
log->Flush();
|
||||||
|
#endif // wxUSE_LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxApp::SendIdleEvents()
|
bool wxApp::SendIdleEvents()
|
||||||
|
@@ -138,9 +138,6 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
|||||||
// thread so we must lock it here ourselves
|
// thread so we must lock it here ourselves
|
||||||
gdk_threads_enter();
|
gdk_threads_enter();
|
||||||
|
|
||||||
/* sent idle event to all who request them */
|
|
||||||
while (wxTheApp->ProcessIdle()) { }
|
|
||||||
|
|
||||||
/* we don't want any more idle events until the next event is
|
/* we don't want any more idle events until the next event is
|
||||||
sent to wxGTK */
|
sent to wxGTK */
|
||||||
gtk_idle_remove( wxTheApp->m_idleTag );
|
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||||
@@ -153,6 +150,9 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
|||||||
emptied */
|
emptied */
|
||||||
g_isIdle = TRUE;
|
g_isIdle = TRUE;
|
||||||
|
|
||||||
|
/* sent idle event to all who request them */
|
||||||
|
while (wxTheApp->ProcessIdle()) { }
|
||||||
|
|
||||||
// release lock again
|
// release lock again
|
||||||
gdk_threads_leave();
|
gdk_threads_leave();
|
||||||
|
|
||||||
@@ -352,11 +352,11 @@ bool wxApp::ProcessIdle()
|
|||||||
void wxApp::OnIdle( wxIdleEvent &event )
|
void wxApp::OnIdle( wxIdleEvent &event )
|
||||||
{
|
{
|
||||||
static bool s_inOnIdle = FALSE;
|
static bool s_inOnIdle = FALSE;
|
||||||
|
|
||||||
/* Avoid recursion (via ProcessEvent default case) */
|
/* Avoid recursion (via ProcessEvent default case) */
|
||||||
if (s_inOnIdle)
|
if (s_inOnIdle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_inOnIdle = TRUE;
|
s_inOnIdle = TRUE;
|
||||||
|
|
||||||
/* Resend in the main thread events which have been prepared in other
|
/* Resend in the main thread events which have been prepared in other
|
||||||
@@ -366,13 +366,6 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
/* 'Garbage' collection of windows deleted with Close(). */
|
/* 'Garbage' collection of windows deleted with Close(). */
|
||||||
DeletePendingObjects();
|
DeletePendingObjects();
|
||||||
|
|
||||||
/* flush the logged messages if any */
|
|
||||||
#if wxUSE_LOG
|
|
||||||
wxLog *log = wxLog::GetActiveTarget();
|
|
||||||
if (log != NULL && log->HasPendingMessages())
|
|
||||||
log->Flush();
|
|
||||||
#endif // wxUSE_LOG
|
|
||||||
|
|
||||||
/* Send OnIdle events to all windows */
|
/* Send OnIdle events to all windows */
|
||||||
bool needMore = SendIdleEvents();
|
bool needMore = SendIdleEvents();
|
||||||
|
|
||||||
@@ -380,6 +373,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
event.RequestMore(TRUE);
|
event.RequestMore(TRUE);
|
||||||
|
|
||||||
s_inOnIdle = FALSE;
|
s_inOnIdle = FALSE;
|
||||||
|
|
||||||
|
/* flush the logged messages if any */
|
||||||
|
#if wxUSE_LOG
|
||||||
|
wxLog *log = wxLog::GetActiveTarget();
|
||||||
|
if (log != NULL && log->HasPendingMessages())
|
||||||
|
log->Flush();
|
||||||
|
#endif // wxUSE_LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxApp::SendIdleEvents()
|
bool wxApp::SendIdleEvents()
|
||||||
|
Reference in New Issue
Block a user