summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2004-04-11 01:40:12 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2004-04-11 01:40:12 +0000
commit26dcd2e0858ae92bb057c9d11f9b2e61c443a9b0 (patch)
tree8df7a1d25ad00edd507b8f02a7a6890761890c98 /src
parent77aca2728ff34042f3213c30df6c4a5bd891a5c9 (diff)
Fix fl_scroll() on WIN32 (STR #315)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3387 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Scroll.cxx6
-rw-r--r--src/fl_scroll_area.cxx35
2 files changed, 36 insertions, 5 deletions
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index d60160674..2df87e793 100644
--- a/src/Fl_Scroll.cxx
+++ b/src/Fl_Scroll.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.8 2004/04/10 00:37:03 easysw Exp $"
+// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.9 2004/04/11 01:39:57 easysw Exp $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
@@ -74,7 +74,7 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) {
W+Fl::scheme_bg_->w(),
H+Fl::scheme_bg_->h());
break;
- } else if (s->box() == FL_NO_BOX) break;
+ }
default :
fl_color(s->color());
@@ -271,5 +271,5 @@ int Fl_Scroll::handle(int event) {
}
//
-// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.8 2004/04/10 00:37:03 easysw Exp $".
+// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.9 2004/04/11 01:39:57 easysw Exp $".
//
diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx
index b58e3e8c6..373a8f70e 100644
--- a/src/fl_scroll_area.cxx
+++ b/src/fl_scroll_area.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_scroll_area.cxx,v 1.4.2.3.2.4 2003/01/30 21:44:12 easysw Exp $"
+// "$Id: fl_scroll_area.cxx,v 1.4.2.3.2.5 2004/04/11 01:40:12 easysw Exp $"
//
// Scrolling routines for the Fast Light Tool Kit (FLTK).
//
@@ -27,6 +27,7 @@
// a "callback" which is called to draw rectangular areas that are moved
// into the drawing area.
+#include <FL/Fl.H>
#include <FL/x.H>
// scroll a rectangle and redraw the newly exposed portions:
@@ -71,6 +72,36 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
BitBlt(fl_gc, dest_x, dest_y, src_w, src_h, fl_gc, src_x, src_y,SRCCOPY);
// NYI: need to redraw areas that the source of BitBlt was bad due to
// overlapped windows, probably similar to X version:
+ // MRS: basic code needs to redraw parts that scrolled from off-screen...
+ int temp, limit;
+ int wx, wy;
+
+ // Compute the X position of the current window;
+ // this only works when scrolling in response to
+ // a user event; Fl_Window::x/y_root() do not work
+ // on WIN32...
+ wx = Fl::event_x_root() - Fl::event_x();
+ wy = Fl::event_y_root() - Fl::event_y();
+
+ temp = wx + src_x;
+ if (temp < Fl::x()) {
+ draw_area(data, dest_x, dest_y, Fl::x() - temp, src_h);
+ }
+ temp = wx + src_x + src_w;
+ limit = Fl::x() + Fl::w();
+ if (temp > limit) {
+ draw_area(data, dest_x + src_w - temp + limit, dest_y, temp - limit, src_h);
+ }
+
+ temp = wy + src_y;
+ if (temp < Fl::y()) {
+ draw_area(data, dest_x, dest_y, src_w, Fl::y() - temp);
+ }
+ temp = wy + src_y + src_h;
+ limit = Fl::y() + Fl::h();
+ if (temp > limit) {
+ draw_area(data, dest_x, dest_y + src_h - temp + limit, src_w, temp - limit);
+ }
#elif defined(__APPLE__)
Rect src = { src_y, src_x, src_y+src_h, src_x+src_w };
Rect dst = { dest_y, dest_x, dest_y+src_h, dest_x+src_w };
@@ -96,5 +127,5 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
}
//
-// End of "$Id: fl_scroll_area.cxx,v 1.4.2.3.2.4 2003/01/30 21:44:12 easysw Exp $".
+// End of "$Id: fl_scroll_area.cxx,v 1.4.2.3.2.5 2004/04/11 01:40:12 easysw Exp $".
//