Fl_Help_View now draws the box outside the scrollbars, like the

other scrollable widgets (STR #871)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-08-08 01:31:03 +00:00
parent 3b659149e6
commit eaaae8b05e
2 changed files with 29 additions and 13 deletions

View File

@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745, STR #942, STR #931)
- Fl_Help_View now draws the box outside the scrollbars,
like the other scrollable widgets (STR #871)
- The fltk-config script now handles invocation via a
symlink (STR #869)
- Updated WIN32 cut/paste code to consistently handle DOS

View File

@ -334,10 +334,12 @@ Fl_Help_View::draw()
// Draw the scrollbar(s) and box first...
ww = w();
ww = w() ;
hh = h();
i = 0;
draw_box(b, x(), y(), ww, hh, bgcolor_);
if (hscrollbar_.visible()) {
draw_child(hscrollbar_);
hh -= 17;
@ -350,11 +352,10 @@ Fl_Help_View::draw()
}
if (i == 2) {
fl_color(FL_GRAY);
fl_rectf(x() + ww, y() + hh, 17, 17);
fl_rectf(x() + ww - Fl::box_dw(b) + Fl::box_dx(b),
y() + hh - Fl::box_dh(b) + Fl::box_dy(b), 17, 17);
}
draw_box(b, x(), y(), ww, hh, bgcolor_);
if (!value_)
return;
@ -927,6 +928,8 @@ Fl_Help_View::format()
columns[MAX_COLUMNS];
// Column widths
Fl_Color tc, rc; // Table/row background color
Fl_Boxtype b = box() ? box() : FL_DOWN_BOX;
// Box to draw...
// Reset document width...
@ -1637,23 +1640,26 @@ Fl_Help_View::format()
qsort(targets_, ntargets_, sizeof(Fl_Help_Target),
(compare_func_t)compare_targets);
int dx = Fl::box_dw(b) - Fl::box_dx(b);
int dy = Fl::box_dh(b) - Fl::box_dy(b);
if (hsize_ > (w() - 24)) {
hscrollbar_.show();
if (size_ < (h() - 24)) {
scrollbar_.hide();
hscrollbar_.resize(x(), y() + h() - 17, w(), 17);
hscrollbar_.resize(x() + Fl::box_dx(b), y() + h() - 17 - dy, w(), 17);
} else {
scrollbar_.show();
scrollbar_.resize(x() + w() - 17, y(), 17, h() - 17);
hscrollbar_.resize(x(), y() + h() - 17, w() - 17, 17);
scrollbar_.resize(x() + w() - 17 - dx, y() + Fl::box_dy(b), 17, h() - 17 - Fl::box_dh(b));
hscrollbar_.resize(x() + Fl::box_dx(b), y() + h() - 17 - dy, w() - 17 - Fl::box_dw(b), 17);
}
} else {
hscrollbar_.hide();
if (size_ < (h() - 8)) scrollbar_.hide();
else {
scrollbar_.resize(x() + w() - 17, y(), 17, h());
scrollbar_.resize(x() + w() - 17 - dx, y() + Fl::box_dy(b), 17, h());
scrollbar_.show();
}
}
@ -2505,6 +2511,8 @@ Fl_Help_View::Fl_Help_View(int xx, // I - Left position
hscrollbar_.callback(hscrollbar_callback);
hscrollbar_.type(FL_HORIZONTAL);
end();
resize(xx, yy, ww, hh);
}
@ -2629,14 +2637,20 @@ Fl_Help_View::load(const char *f)// I - Filename to load (may also have target)
void
Fl_Help_View::resize(int xx, // I - New left position
int yy, // I - New top position
int ww, // I - New width
int hh) // I - New height
int yy, // I - New top position
int ww, // I - New width
int hh) // I - New height
{
Fl_Boxtype b = box() ? box() : FL_DOWN_BOX;
// Box to draw...
Fl_Widget::resize(xx, yy, ww, hh);
scrollbar_.resize(x() + w() - 17, y(), 17, h() - 17);
hscrollbar_.resize(x(), y() + h() - 17, w() - 17, 17);
scrollbar_.resize(x() + w() - 17 - Fl::box_dw(b) + Fl::box_dx(b), y() + Fl::box_dy(b),
17, h() - 17 - Fl::box_dh(b));
hscrollbar_.resize(x() + Fl::box_dx(b), y() + h() - 17 - Fl::box_dh(b) + Fl::box_dy(b),
w() - 17 - Fl::box_dw(b), 17);
format();
}