wxTopLevelWindows is now a wxWindowList, better compatibility with the old

wxList in list.h


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-03-30 09:43:29 +00:00
parent 8ffd43c56b
commit e146b8c8bf
22 changed files with 206 additions and 185 deletions

View File

@@ -140,11 +140,11 @@ bool wxYield()
// it's necessary to call ProcessIdle() to update the frames sizes which
// might have been changed (it also will update other things set from
// OnUpdateUI() which is a nice (and desired) side effect)
for ( wxNode *node = wxTopLevelWindows.GetFirst();
for ( wxWindowList::Node *node = wxTopLevelWindows.GetFirst();
node;
node = node->GetNext() )
{
wxWindow *win = ((wxWindow*)node->GetData());
wxWindow *win = node->GetData();
win->OnInternalIdle();
}
@@ -312,14 +312,15 @@ bool wxApp::SendIdleEvents()
{
bool needMore = FALSE;
wxNode* node = wxTopLevelWindows.First();
wxWindowList::Node* node = wxTopLevelWindows.GetFirst();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
wxWindow* win = node->GetData();
if (SendIdleEvents(win))
needMore = TRUE;
node = node->Next();
node = node->GetNext();
}
return needMore;
}
@@ -385,7 +386,7 @@ void wxApp::ProcessPendingEvents()
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents.First();
@@ -411,10 +412,12 @@ void wxApp::DeletePendingObjects()
wxWindow *wxApp::GetTopWindow()
{
if (m_topWindow) return m_topWindow;
wxNode *node = wxTopLevelWindows.First();
if (!node) return (wxWindow *) NULL;
return (wxWindow*)node->Data();
if (m_topWindow)
return m_topWindow;
else if (wxTopLevelWindows.GetCount() > 0)
return wxTopLevelWindows.GetFirst()->GetData();
else
return NULL;
}
void wxApp::SetTopWindow( wxWindow *win )
@@ -565,7 +568,7 @@ int wxEntry( int argc, char *argv[] )
if (!wxTheApp->OnInit())
return 0;
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
int retValue = 0;

View File

@@ -33,7 +33,7 @@ XrmDatabase wxResourceDatabase;
char *wxBuffer = (char *) NULL;
/* Windows List */
wxList wxTopLevelWindows;
wxWindowList wxTopLevelWindows;
/* List of windows pending deletion */
wxList wxPendingDelete;
@@ -75,7 +75,7 @@ wxPenList *wxThePenList = (wxPenList *) NULL;
wxFontList *wxTheFontList = (wxFontList *) NULL;
wxColourDatabase *wxTheColourDatabase = (wxColourDatabase *) NULL;
wxBitmapList *wxTheBitmapList = (wxBitmapList *) NULL;
/* X only font names */
/*
wxFontNameDirectory *wxTheFontNameDirectory;
@@ -111,7 +111,7 @@ wxBrush *wxLIGHT_GREY_BRUSH;
wxColour *wxBLACK;
wxColour *wxWHITE;
wxColour *wxGREY;
wxColour *wxGREY;
wxColour *wxRED;
wxColour *wxBLUE;
wxColour *wxGREEN;
@@ -125,13 +125,13 @@ wxCursor *wxCROSS_CURSOR = (wxCursor *) NULL;
/* 'Null' objects */
wxAcceleratorTable wxNullAcceleratorTable;
wxBitmap wxNullBitmap;
wxIcon wxNullIcon;
wxIcon wxNullIcon;
wxCursor wxNullCursor;
wxPen wxNullPen;
wxBrush wxNullBrush;
wxFont wxNullFont;
wxColour wxNullColour;
wxPalette wxNullPalette;
wxPalette wxNullPalette;
/* Default window names */
const char *wxButtonNameStr = "button";

View File

@@ -142,7 +142,7 @@ bool wxDialog::Create( wxWindow *parent,
if (m_parent) m_parent->AddChild( this );
PostCreation();
gtk_widget_realize( m_widget );
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
@@ -337,7 +337,7 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
if ((m_x != old_x) || (m_y != old_y))
{
/* m_sizeSet = FALSE; */
gtk_widget_set_uposition( m_widget, m_x, m_y );
gtk_widget_set_uposition( m_widget, m_x, m_y );
}
}
@@ -413,7 +413,7 @@ bool wxDialog::Show( bool show )
}
wxWindow::Show( show );
if (show) InitDialog();
return TRUE;
@@ -442,7 +442,7 @@ int wxDialog::ShowModal()
wxFAIL_MSG( "wxDialog:ShowModal called twice" );
return GetReturnCode();
}
Show( TRUE );
m_modalShowing = TRUE;

View File

@@ -36,7 +36,6 @@ const int wxSTATUS_HEIGHT = 25;
// data
//-----------------------------------------------------------------------------
extern wxList wxTopLevelWindows;
extern wxList wxPendingDelete;
//-----------------------------------------------------------------------------

View File

@@ -171,7 +171,6 @@ void debug_focus_in( GtkWidget* widget, const char* name, const char *window )
//-----------------------------------------------------------------------------
extern wxList wxPendingDelete;
extern wxList wxTopLevelWindows;
extern bool g_blockEventsOnDrag;
extern bool g_blockEventsOnScroll;
static bool g_capturing = FALSE;