Save/restore GDI pen.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1621 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2001-09-30 12:42:33 +00:00
parent 9208e9d007
commit f5f0d8a013
3 changed files with 34 additions and 6 deletions

13
CHANGES
View File

@ -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.

View File

@ -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 $".
//

View File

@ -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 $".
//