Fix fl_scroll() on WIN32 (STR #315)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3387 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2004-04-11 01:40:12 +00:00
parent 77aca2728f
commit 26dcd2e085
3 changed files with 38 additions and 5 deletions
+2
View File
@@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.5rc1
- Documentation updates (STR #245, STR #250, STR #277,
STR #281, STR #328, STR #338)
- fl_scroll() did not handle scrolling from off-screen on
WIN32 (STR #315)
- Fl_File_Chooser did not allow manual entry of a drive
letter (STR #339)
- Fl_Menu now uses the boxtype to redraw the menu
+3 -3
View File
@@ -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 $".
//
+33 -2
View File
@@ -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 $".
//