Author: manolo
Date: 2011-04-18 13:47:32 -0700 (Mon, 18 Apr 2011)
New Revision: 8606
Log:
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.

Modified:
   branches/branch-1.3/src/Fl_Paged_Device.cxx
   branches/branch-1.3/src/Fl_win32.cxx
   branches/branch-1.3/test/device.cxx

Modified: branches/branch-1.3/src/Fl_Paged_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-04-18 14:34:20 UTC (rev 
8605)
+++ branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-04-18 20:47:32 UTC (rev 
8606)
@@ -138,10 +138,14 @@
   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
 }
 
 /**

Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx        2011-04-18 14:34:20 UTC (rev 
8605)
+++ branches/branch-1.3/src/Fl_win32.cxx        2011-04-18 20:47:32 UTC (rev 
8606)
@@ -1997,6 +1997,8 @@
   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

Modified: branches/branch-1.3/test/device.cxx
===================================================================
--- branches/branch-1.3/test/device.cxx 2011-04-18 14:34:20 UTC (rev 8605)
+++ branches/branch-1.3/test/device.cxx 2011-04-18 20:47:32 UTC (rev 8606)
@@ -599,11 +599,9 @@
     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,8 +714,8 @@
   tx.box(FL_SHADOW_BOX);
   tx.labelsize(12);
 
+  tx.hide();
 
-
   c2->end();
   Fl_Button *b4 = new Fl_Button(10,5, 150, 25, "Print");
   b4->callback(print,c2);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to