summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-04-18 20:47:32 +0000
committerManolo Gouy <Manolo>2011-04-18 20:47:32 +0000
commit1ad8cf320da6f8ce917c4f0f962dc9c9fef019da (patch)
tree58a977ff37fa9a6848abc3251c4c52ca6c56c7f5
parent451b91ea4635f03cf6a07a999903215af1b6b683 (diff)
Fixed a problem in the WIN32 version of Fl_Paged_Device::print_window_part() and
Fl_Paged_Device::print_window() where the window didn't redraw well in some cases after printing. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8606 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Paged_Device.cxx6
-rw-r--r--src/Fl_win32.cxx2
-rw-r--r--test/device.cxx6
3 files changed, 9 insertions, 5 deletions
diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx
index 75c0e9dc1..ae7f7d832 100644
--- a/src/Fl_Paged_Device.cxx
+++ b/src/Fl_Paged_Device.cxx
@@ -138,10 +138,14 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
win->make_current();
uchar *image_data;
image_data = fl_read_image(NULL, x, y, w, h);
- save_front->show();
+ if (save_front != win) save_front->show();
current->set_current();
fl_draw_image(image_data, delta_x, delta_y, w, h, 3);
delete[] image_data;
+#ifdef WIN32
+ fl_gc = GetDC(fl_xid(win));
+ ReleaseDC(fl_xid(win), fl_gc);
+#endif
}
/**
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 734e6a60a..1fae9cf52 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1997,6 +1997,8 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
delete[] bottom_image;
// print the window inner part
this->print_widget(win, x_offset + bx, y_offset + bt + by);
+ fl_gc = GetDC(fl_xid(win));
+ ReleaseDC(fl_xid(win), fl_gc);
}
#ifdef USE_PRINT_BUTTON
diff --git a/test/device.cxx b/test/device.cxx
index 050b159cd..b4a4e0ee1 100644
--- a/test/device.cxx
+++ b/test/device.cxx
@@ -599,11 +599,9 @@ void print(Fl_Widget *, void *w) {
Fl_Widget * g = (Fl_Widget *)w;
Fl_Printer * p = new Fl_Printer();
- //p->page(Fl_Printer::A4);
- //p->place(g, 70, 70, p->page_width() - 140, p->page_height() - 140, FL_ALIGN_CENTER);
if (!p->start_job(1)) {
p->start_page();
- p->print_widget(g);
+ p->print_window(g->window());
p->end_page();
p->end_job();
}
@@ -716,7 +714,7 @@ b_bitmap.labelcolor(FL_GREEN);
tx.box(FL_SHADOW_BOX);
tx.labelsize(12);
-
+ tx.hide();
c2->end();
Fl_Button *b4 = new Fl_Button(10,5, 150, 25, "Print");