diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-08-08 01:31:03 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-08-08 01:31:03 +0000 |
| commit | eaaae8b05e78c85f9046d64b1bc400596fc8df82 (patch) | |
| tree | 265ae0899bb481d00512937145770ed6715d6483 /src | |
| parent | 3b659149e6a0f9d3bf0134a368fc870ee98a1038 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Help_View.cxx | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 0eb2b3da4..870bf958b 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -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(); } |
