From f5f0d8a013ef84df176604357b20eff933ed6abe Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 30 Sep 2001 12:42:33 +0000 Subject: [PATCH] Save/restore GDI pen. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1621 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 13 +++++++++++++ src/Fl_win32.cxx | 9 +++++++-- src/fl_color_win32.cxx | 18 ++++++++++++++---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 171cc998f..e7ad016dc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,16 @@ +CHANGES IN FLTK 1.1.0b3 + + - The top-level makefile did not include the makeinclude + file, causing the fltk-config installation commands to + fail. + + - The fl_file_chooser.cxx source file conflicted with + Fl_File_Chooser.cxx under Windows. + + - Now save and restore the GDI pen object when + responding to WIN32 paint messages. + + CHANGES IN FLTK 1.1.0b2 - New fltk-config script. diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index f44cd57a8..2b6ba8061 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.37.2.3 2001/08/03 15:48:20 easysw Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.37.2.4 2001/09/30 12:42:32 easysw Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -425,6 +425,9 @@ extern HPALETTE fl_select_palette(void); // in fl_color_win32.C static Fl_Window* resize_bug_fix; +extern void fl_save_pen(void); +extern void fl_restore_pen(void); + static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { // Matt: When dragging a full window, MSWindows on 'slow' @@ -477,7 +480,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar // is deferred until Fl::flush() is called during idle. However Win32 // apparently is very unhappy if we don't obey it and draw right now. // Very annoying! + fl_save_pen(); i->flush(); + fl_restore_pen(); window->clear_damage(); // This convinces MSWindows we have painted whatever they wanted // us to paint, and stops it from sending WM_PAINT messages: @@ -993,5 +998,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.37.2.3 2001/08/03 15:48:20 easysw Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.37.2.4 2001/09/30 12:42:32 easysw Exp $". // diff --git a/src/fl_color_win32.cxx b/src/fl_color_win32.cxx index 7156b4ac4..b0549e91a 100644 --- a/src/fl_color_win32.cxx +++ b/src/fl_color_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_color_win32.cxx,v 1.14.2.3 2001/01/22 15:13:40 easysw Exp $" +// "$Id: fl_color_win32.cxx,v 1.14.2.3.2.1 2001/09/30 12:42:33 easysw Exp $" // // WIN32 color functions for the Fast Light Tool Kit (FLTK). // @@ -47,8 +47,18 @@ Fl_XMap fl_xmap[256]; Fl_XMap* fl_current_xmap; HPALETTE fl_palette; -HPEN tmppen=0; -HBRUSH tmpbrush=0; +static HPEN tmppen=0; +static HBRUSH tmpbrush=0; +static HPEN savepen=0; + +void fl_save_pen(void) { + if(!tmppen) tmppen = CreatePen(PS_SOLID, 1, 0); + savepen = (HPEN)SelectObject(fl_gc, tmppen); +} + +void fl_restore_pen(void) { + SelectObject(fl_gc, savepen); +} static void clear_xmap(Fl_XMap& xmap) { if (xmap.pen) { @@ -206,5 +216,5 @@ fl_select_palette(void) #endif // -// End of "$Id: fl_color_win32.cxx,v 1.14.2.3 2001/01/22 15:13:40 easysw Exp $". +// End of "$Id: fl_color_win32.cxx,v 1.14.2.3.2.1 2001/09/30 12:42:33 easysw Exp $". //