summaryrefslogtreecommitdiff
path: root/src/Fl_Window.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-03-13 22:16:37 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-03-13 22:16:37 +0000
commitb496d18b85917106c48e8e6f74115b3122b603d1 (patch)
tree4d96befa4377a81c89c6a32f4d66220199572938 /src/Fl_Window.cxx
parent30756ae3500a62bd8f63b4df3eb3ca8f6b8b0b70 (diff)
Fixed 'flush()' code for single, double, and overlay buffering
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11359 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window.cxx')
-rw-r--r--src/Fl_Window.cxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index 97045174b..98882591e 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -435,6 +435,46 @@ int Fl_Window::decorated_h()
}
+void Fl_Window::flush()
+{
+ driver()->flush_single();
+}
+
+
+void Fl_Window::draw()
+{
+ pWindowDriver->draw_begin();
+
+ // The following is similar to Fl_Group::draw(), but ...
+ //
+ // - draws the box at (0,0), i.e. with x=0 and y=0 instead of x() and y()
+ // - does NOT draw the label (text)
+ // - draws the image only if FL_ALIGN_INSIDE is set
+ //
+ // Note: The label (text) of top level windows is drawn in the title bar.
+ // Other windows do not draw their labels at all, unless drawn by their
+ // parent widgets or by special draw() methods (derived classes).
+
+ if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing
+ draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0
+
+ if (image() && (align() & FL_ALIGN_INSIDE)) { // draw the image only
+ Fl_Label l1;
+ memset(&l1,0,sizeof(l1));
+ l1.align_ = align();
+ l1.image = image();
+ if (!active_r() && l1.image && l1.deimage) l1.image = l1.deimage;
+ l1.type = labeltype();
+ l1.draw(0,0,w(),h(),align());
+ }
+ }
+ draw_children();
+
+ pWindowDriver->draw_end();
+}
+
+
+
//
// End of "$Id$".
//