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:
parent
29e7e51a4d
commit
ea451729db
@ -2334,7 +2334,7 @@ long wxListMainWindow::GetNextItem( long item, int WXUNUSED(geometry), int state
|
||||
long ret = 0;
|
||||
if (item > 0) ret = item;
|
||||
if(ret >= GetItemCount()) return -1;
|
||||
wxNode *node = m_lines.Nth( (size_t)ret );
|
||||
wxNode *node = m_lines.Nth( (size_t)++ret );
|
||||
while (node)
|
||||
{
|
||||
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 );
|
||||
|
||||
if (HasFlag(wxLC_REPORT))
|
||||
{
|
||||
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
|
||||
{
|
||||
m_headerWin = (wxListHeaderWindow *) NULL;
|
||||
}
|
||||
|
||||
SetBackgroundColour( *wxWHITE );
|
||||
|
||||
|
@ -636,7 +636,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
||||
const wxArrayLong& times,
|
||||
const wxString& caption,
|
||||
long style)
|
||||
: wxDialog(parent, -1, caption),
|
||||
: wxDialog(parent, -1, caption ),
|
||||
m_messages(messages), m_severity(severity), m_times(times)
|
||||
{
|
||||
m_showingDetails = FALSE; // not initially
|
||||
@ -697,7 +697,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
|
||||
// create it now
|
||||
m_listctrl = new wxListCtrl(this, -1,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxLC_REPORT | wxLC_NO_HEADER);
|
||||
wxLC_REPORT | wxLC_NO_HEADER );
|
||||
m_listctrl->InsertColumn(0, _("Message"));
|
||||
m_listctrl->InsertColumn(1, _("Time"));
|
||||
|
||||
@ -775,6 +775,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
|
||||
m_showingDetails = !m_showingDetails;
|
||||
|
||||
// in any case, our size changed - update
|
||||
sizer->SetSizeHints(this);
|
||||
sizer->Fit(this);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "wx/font.h"
|
||||
#include "wx/colour.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/generic/panelg.h"
|
||||
|
@ -138,9 +138,6 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
// thread so we must lock it here ourselves
|
||||
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
|
||||
sent to wxGTK */
|
||||
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||
@ -153,6 +150,9 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
emptied */
|
||||
g_isIdle = TRUE;
|
||||
|
||||
/* sent idle event to all who request them */
|
||||
while (wxTheApp->ProcessIdle()) { }
|
||||
|
||||
// release lock again
|
||||
gdk_threads_leave();
|
||||
|
||||
@ -352,11 +352,11 @@ bool wxApp::ProcessIdle()
|
||||
void wxApp::OnIdle( wxIdleEvent &event )
|
||||
{
|
||||
static bool s_inOnIdle = FALSE;
|
||||
|
||||
|
||||
/* Avoid recursion (via ProcessEvent default case) */
|
||||
if (s_inOnIdle)
|
||||
return;
|
||||
|
||||
|
||||
s_inOnIdle = TRUE;
|
||||
|
||||
/* 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(). */
|
||||
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 */
|
||||
bool needMore = SendIdleEvents();
|
||||
|
||||
@ -380,6 +373,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
||||
event.RequestMore(TRUE);
|
||||
|
||||
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()
|
||||
|
@ -138,9 +138,6 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
// thread so we must lock it here ourselves
|
||||
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
|
||||
sent to wxGTK */
|
||||
gtk_idle_remove( wxTheApp->m_idleTag );
|
||||
@ -153,6 +150,9 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
emptied */
|
||||
g_isIdle = TRUE;
|
||||
|
||||
/* sent idle event to all who request them */
|
||||
while (wxTheApp->ProcessIdle()) { }
|
||||
|
||||
// release lock again
|
||||
gdk_threads_leave();
|
||||
|
||||
@ -352,11 +352,11 @@ bool wxApp::ProcessIdle()
|
||||
void wxApp::OnIdle( wxIdleEvent &event )
|
||||
{
|
||||
static bool s_inOnIdle = FALSE;
|
||||
|
||||
|
||||
/* Avoid recursion (via ProcessEvent default case) */
|
||||
if (s_inOnIdle)
|
||||
return;
|
||||
|
||||
|
||||
s_inOnIdle = TRUE;
|
||||
|
||||
/* 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(). */
|
||||
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 */
|
||||
bool needMore = SendIdleEvents();
|
||||
|
||||
@ -380,6 +373,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
||||
event.RequestMore(TRUE);
|
||||
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user