From: Robert Roebling Date: Fri, 19 Apr 2002 17:39:49 +0000 (+0000) Subject: Updated makefile for mobile sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/010afced511d74f4f1c10390da96c6ccf687d574 Updated makefile for mobile sample. Updated changes.txt. Moved contents of ::Update() to ::GtkUpdate() Moved internal idle functions in wxApp to its own function. Tried to fix themed background redraw problem (probably same bug in wxNotebook and in wxStatusBar and others). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/Makefile.in b/Makefile.in index 0c706ee022..946687f0bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1061,6 +1061,13 @@ SAMPLES_DIST: ALL_GUI_DIST cp $(SAMPDIR)/minimal/*.xpm $(DISTDIR)/samples/minimal cp $(SAMPDIR)/minimal/*.mms $(DISTDIR)/samples/minimal + mkdir $(DISTDIR)/samples/mobile + cp $(SAMPDIR)/mobile/Makefile.in $(DISTDIR)/samples/mobile + mkdir $(DISTDIR)/samples/mobile/wxedit + cp $(SAMPDIR)/mobile/wxedit/Makefile.in $(DISTDIR)/samples/mobile/wxedit + cp $(SAMPDIR)/mobile/wxedit/*.cpp $(DISTDIR)/samples/mobile/wxedit + cp $(SAMPDIR)/mobile/wxedit/*.h $(DISTDIR)/samples/mobile/wxedit + mkdir $(DISTDIR)/samples/dialup cp $(SAMPDIR)/dialup/Makefile.in $(DISTDIR)/samples/dialup cp $(SAMPDIR)/dialup/makefile.unx $(DISTDIR)/samples/dialup diff --git a/docs/gtk/changes.txt b/docs/gtk/changes.txt index f70807fd93..e0352be6eb 100644 --- a/docs/gtk/changes.txt +++ b/docs/gtk/changes.txt @@ -1,6 +1,23 @@ *** wxWindows 2.3.3 *** +Beta support for GTK 2.0. + +Added wxArtProvider for changing default icons and more. + +Corrected wxScrolledWindow in some rare cases. + +Added wxIconBundle for mini- and normal icons. + +Made wxWindow::SetFocus() work before a wxDialog +is created. Until now always the first item +was focussed. + +Corrected wxComboBox's semantics of pressing . + +Corrected SeekI() return values and other related functions +in wxFilterStream and wxBufferedStream. + Implemented new ref-counting for GDI classes. New implemenation of wxCondition. @@ -39,7 +56,7 @@ Added IFF image handler. Added ICO, CUR and ANI image handler. -wxFrame::SetMenuBar() corrected. +wxFrame::SetMenuBar() corrected (for NULL etc.) wxButton honours wxBU_EXACTFIT. diff --git a/docs/gtk/readme.txt b/docs/gtk/readme.txt index bf37a03d83..58a83d81e2 100644 --- a/docs/gtk/readme.txt +++ b/docs/gtk/readme.txt @@ -7,13 +7,10 @@ wxWindows GUI library. wxWindows no longer supports GTK 1.0 (as did some early snapshots) so that you will need GTK 1.2 when using it. GTK 1.2.6 or above is recommended although some programs -will work with GTK 1.2.3 onwards. +will work with GTK 1.2.3 onwards. There is now beta support +for GTK 2.0. -More information is available from my homepage at: - - http://wesley.informatik.uni-freiburg.de/~wxxt - -and about the wxWindows project as a whole (and the MSW +More info about the wxWindows project (and the Windows and Motif ports in particular) can be found at Julian's homepage at: diff --git a/include/wx/gtk/app.h b/include/wx/gtk/app.h index f8b359a39f..d10118ecf3 100644 --- a/include/wx/gtk/app.h +++ b/include/wx/gtk/app.h @@ -87,6 +87,8 @@ private: bool m_isInAssert; #endif // __WXDEBUG__ + bool CallInternalIdle( wxWindow* win ); + DECLARE_DYNAMIC_CLASS(wxApp) DECLARE_EVENT_TABLE() }; diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index cd5b5c16a5..e8e7944efc 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -112,6 +112,9 @@ public: // OnInternalIdle virtual void OnInternalIdle(); + // Internal represention of Update() + void GtkUpdate(); + // For delayed background void GtkSetBackgroundColour( const wxColour &colour ); void GtkSetForegroundColour( const wxColour &colour ); diff --git a/include/wx/gtk1/app.h b/include/wx/gtk1/app.h index f8b359a39f..d10118ecf3 100644 --- a/include/wx/gtk1/app.h +++ b/include/wx/gtk1/app.h @@ -87,6 +87,8 @@ private: bool m_isInAssert; #endif // __WXDEBUG__ + bool CallInternalIdle( wxWindow* win ); + DECLARE_DYNAMIC_CLASS(wxApp) DECLARE_EVENT_TABLE() }; diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index cd5b5c16a5..e8e7944efc 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -112,6 +112,9 @@ public: // OnInternalIdle virtual void OnInternalIdle(); + // Internal represention of Update() + void GtkUpdate(); + // For delayed background void GtkSetBackgroundColour( const wxColour &colour ); void GtkSetForegroundColour( const wxColour &colour ); diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 43d42a540f..6e1c25de26 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -486,12 +486,37 @@ bool wxApp::SendIdleEvents() wxWindow* win = node->GetData(); if (SendIdleEvents(win)) needMore = TRUE; + node = node->GetNext(); } + node = wxTopLevelWindows.GetFirst(); + while (node) + { + wxWindow* win = node->GetData(); + CallInternalIdle( win ); + + node = node->GetNext(); + } return needMore; } +bool wxApp::CallInternalIdle( wxWindow* win ) +{ + win->OnInternalIdle(); + + wxNode* node = win->GetChildren().First(); + while (node) + { + wxWindow* win = (wxWindow*) node->Data(); + CallInternalIdle( win ); + + node = node->Next(); + } + + return TRUE; +} + bool wxApp::SendIdleEvents( wxWindow* win ) { bool needMore = FALSE; @@ -514,8 +539,6 @@ bool wxApp::SendIdleEvents( wxWindow* win ) node = node->Next(); } - win->OnInternalIdle(); - return needMore; } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index efc124ac8d..c15e735d2b 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -551,35 +551,13 @@ static int gtk_window_expose_callback( GtkWidget *widget, } #endif -#ifndef __WXUNIVERSAL__ - GtkPizza *pizza = GTK_PIZZA (widget); - - if (win->GetThemeEnabled()) - { - wxWindow *parent = win->GetParent(); - while (parent && !parent->IsTopLevel()) - parent = parent->GetParent(); - if (!parent) - parent = win; - - gtk_paint_flat_box (parent->m_widget->style, - pizza->bin_window, - GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - &gdk_event->area, - parent->m_widget, - (char *)"base", - 0, 0, -1, -1); - } -#endif - win->GetUpdateRegion().Union( gdk_event->area.x, gdk_event->area.y, gdk_event->area.width, gdk_event->area.height ); // Actual redrawing takes place in idle time. - win->Update(); + win->GtkUpdate(); #ifdef __WXGTK20__ @@ -686,7 +664,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, // Actual redrawing takes place in idle time. - win->Update(); + win->GtkUpdate(); #ifndef __WXUNIVERSAL__ // Redraw child widgets @@ -2902,7 +2880,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags void wxWindowGTK::OnInternalIdle() { // Update invalidated regions. - Update(); + GtkUpdate(); // Synthetize activate events. if ( g_sendActivateEvent != -1 ) @@ -3500,6 +3478,11 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) } void wxWindowGTK::Update() +{ + GtkUpdate(); +} + +void wxWindowGTK::GtkUpdate() { #ifdef __WXGTK20__ if (m_wxwindow && GTK_PIZZA(m_wxwindow)->bin_window) @@ -3538,11 +3521,41 @@ void wxWindowGTK::GtkSendPaintEvents() } gdk_gc_set_foreground( g_eraseGC, m_backgroundColour.GetColor() ); + // widget to draw on + GtkPizza *pizza = GTK_PIZZA (m_wxwindow); + + // find ancestor from which to steal background + wxWindow *parent = GetParent(); + while (parent && !parent->IsTopLevel()) + parent = parent->GetParent(); + if (!parent) + parent = this; + wxRegionIterator upd( m_clearRegion ); while (upd) { - gdk_draw_rectangle( GTK_PIZZA(m_wxwindow)->bin_window, g_eraseGC, 1, - upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + if (GetThemeEnabled()) + { + GdkRectangle rect; + rect.x = upd.GetX(); + rect.y = upd.GetY(); + rect.width = upd.GetWidth(); + rect.height = upd.GetHeight(); + + gtk_paint_flat_box( parent->m_widget->style, + pizza->bin_window, + GTK_STATE_NORMAL, + GTK_SHADOW_NONE, + &rect, + parent->m_widget, + (char *)"base", + 0, 0, -1, -1 ); + } + else + { + gdk_draw_rectangle( pizza->bin_window, g_eraseGC, 1, + upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + } upd ++; } } @@ -3619,7 +3632,7 @@ void wxWindowGTK::Clear() m_clearRegion.Union( 0,0,size.x,size.y ); // Better do this in idle? - Update(); + GtkUpdate(); } } diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 43d42a540f..6e1c25de26 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -486,12 +486,37 @@ bool wxApp::SendIdleEvents() wxWindow* win = node->GetData(); if (SendIdleEvents(win)) needMore = TRUE; + node = node->GetNext(); } + node = wxTopLevelWindows.GetFirst(); + while (node) + { + wxWindow* win = node->GetData(); + CallInternalIdle( win ); + + node = node->GetNext(); + } return needMore; } +bool wxApp::CallInternalIdle( wxWindow* win ) +{ + win->OnInternalIdle(); + + wxNode* node = win->GetChildren().First(); + while (node) + { + wxWindow* win = (wxWindow*) node->Data(); + CallInternalIdle( win ); + + node = node->Next(); + } + + return TRUE; +} + bool wxApp::SendIdleEvents( wxWindow* win ) { bool needMore = FALSE; @@ -514,8 +539,6 @@ bool wxApp::SendIdleEvents( wxWindow* win ) node = node->Next(); } - win->OnInternalIdle(); - return needMore; } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index efc124ac8d..c15e735d2b 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -551,35 +551,13 @@ static int gtk_window_expose_callback( GtkWidget *widget, } #endif -#ifndef __WXUNIVERSAL__ - GtkPizza *pizza = GTK_PIZZA (widget); - - if (win->GetThemeEnabled()) - { - wxWindow *parent = win->GetParent(); - while (parent && !parent->IsTopLevel()) - parent = parent->GetParent(); - if (!parent) - parent = win; - - gtk_paint_flat_box (parent->m_widget->style, - pizza->bin_window, - GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - &gdk_event->area, - parent->m_widget, - (char *)"base", - 0, 0, -1, -1); - } -#endif - win->GetUpdateRegion().Union( gdk_event->area.x, gdk_event->area.y, gdk_event->area.width, gdk_event->area.height ); // Actual redrawing takes place in idle time. - win->Update(); + win->GtkUpdate(); #ifdef __WXGTK20__ @@ -686,7 +664,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, // Actual redrawing takes place in idle time. - win->Update(); + win->GtkUpdate(); #ifndef __WXUNIVERSAL__ // Redraw child widgets @@ -2902,7 +2880,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags void wxWindowGTK::OnInternalIdle() { // Update invalidated regions. - Update(); + GtkUpdate(); // Synthetize activate events. if ( g_sendActivateEvent != -1 ) @@ -3500,6 +3478,11 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) } void wxWindowGTK::Update() +{ + GtkUpdate(); +} + +void wxWindowGTK::GtkUpdate() { #ifdef __WXGTK20__ if (m_wxwindow && GTK_PIZZA(m_wxwindow)->bin_window) @@ -3538,11 +3521,41 @@ void wxWindowGTK::GtkSendPaintEvents() } gdk_gc_set_foreground( g_eraseGC, m_backgroundColour.GetColor() ); + // widget to draw on + GtkPizza *pizza = GTK_PIZZA (m_wxwindow); + + // find ancestor from which to steal background + wxWindow *parent = GetParent(); + while (parent && !parent->IsTopLevel()) + parent = parent->GetParent(); + if (!parent) + parent = this; + wxRegionIterator upd( m_clearRegion ); while (upd) { - gdk_draw_rectangle( GTK_PIZZA(m_wxwindow)->bin_window, g_eraseGC, 1, - upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + if (GetThemeEnabled()) + { + GdkRectangle rect; + rect.x = upd.GetX(); + rect.y = upd.GetY(); + rect.width = upd.GetWidth(); + rect.height = upd.GetHeight(); + + gtk_paint_flat_box( parent->m_widget->style, + pizza->bin_window, + GTK_STATE_NORMAL, + GTK_SHADOW_NONE, + &rect, + parent->m_widget, + (char *)"base", + 0, 0, -1, -1 ); + } + else + { + gdk_draw_rectangle( pizza->bin_window, g_eraseGC, 1, + upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + } upd ++; } } @@ -3619,7 +3632,7 @@ void wxWindowGTK::Clear() m_clearRegion.Union( 0,0,size.x,size.y ); // Better do this in idle? - Update(); + GtkUpdate(); } }