mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 07:26:57 +08:00
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:
@@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
|
|||||||
|
|
||||||
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
||||||
#744, STR #745, STR #942, STR #931)
|
#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
|
- The fltk-config script now handles invocation via a
|
||||||
symlink (STR #869)
|
symlink (STR #869)
|
||||||
- Updated WIN32 cut/paste code to consistently handle DOS
|
- Updated WIN32 cut/paste code to consistently handle DOS
|
||||||
|
|||||||
+23
-9
@@ -338,6 +338,8 @@ Fl_Help_View::draw()
|
|||||||
hh = h();
|
hh = h();
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
draw_box(b, x(), y(), ww, hh, bgcolor_);
|
||||||
|
|
||||||
if (hscrollbar_.visible()) {
|
if (hscrollbar_.visible()) {
|
||||||
draw_child(hscrollbar_);
|
draw_child(hscrollbar_);
|
||||||
hh -= 17;
|
hh -= 17;
|
||||||
@@ -350,11 +352,10 @@ Fl_Help_View::draw()
|
|||||||
}
|
}
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
fl_color(FL_GRAY);
|
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_)
|
if (!value_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -927,6 +928,8 @@ Fl_Help_View::format()
|
|||||||
columns[MAX_COLUMNS];
|
columns[MAX_COLUMNS];
|
||||||
// Column widths
|
// Column widths
|
||||||
Fl_Color tc, rc; // Table/row background color
|
Fl_Color tc, rc; // Table/row background color
|
||||||
|
Fl_Boxtype b = box() ? box() : FL_DOWN_BOX;
|
||||||
|
// Box to draw...
|
||||||
|
|
||||||
|
|
||||||
// Reset document width...
|
// Reset document width...
|
||||||
@@ -1637,23 +1640,26 @@ Fl_Help_View::format()
|
|||||||
qsort(targets_, ntargets_, sizeof(Fl_Help_Target),
|
qsort(targets_, ntargets_, sizeof(Fl_Help_Target),
|
||||||
(compare_func_t)compare_targets);
|
(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)) {
|
if (hsize_ > (w() - 24)) {
|
||||||
hscrollbar_.show();
|
hscrollbar_.show();
|
||||||
|
|
||||||
if (size_ < (h() - 24)) {
|
if (size_ < (h() - 24)) {
|
||||||
scrollbar_.hide();
|
scrollbar_.hide();
|
||||||
hscrollbar_.resize(x(), y() + h() - 17, w(), 17);
|
hscrollbar_.resize(x() + Fl::box_dx(b), y() + h() - 17 - dy, w(), 17);
|
||||||
} else {
|
} else {
|
||||||
scrollbar_.show();
|
scrollbar_.show();
|
||||||
scrollbar_.resize(x() + w() - 17, y(), 17, h() - 17);
|
scrollbar_.resize(x() + w() - 17 - dx, y() + Fl::box_dy(b), 17, h() - 17 - Fl::box_dh(b));
|
||||||
hscrollbar_.resize(x(), y() + h() - 17, w() - 17, 17);
|
hscrollbar_.resize(x() + Fl::box_dx(b), y() + h() - 17 - dy, w() - 17 - Fl::box_dw(b), 17);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hscrollbar_.hide();
|
hscrollbar_.hide();
|
||||||
|
|
||||||
if (size_ < (h() - 8)) scrollbar_.hide();
|
if (size_ < (h() - 8)) scrollbar_.hide();
|
||||||
else {
|
else {
|
||||||
scrollbar_.resize(x() + w() - 17, y(), 17, h());
|
scrollbar_.resize(x() + w() - 17 - dx, y() + Fl::box_dy(b), 17, h());
|
||||||
scrollbar_.show();
|
scrollbar_.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2505,6 +2511,8 @@ Fl_Help_View::Fl_Help_View(int xx, // I - Left position
|
|||||||
hscrollbar_.callback(hscrollbar_callback);
|
hscrollbar_.callback(hscrollbar_callback);
|
||||||
hscrollbar_.type(FL_HORIZONTAL);
|
hscrollbar_.type(FL_HORIZONTAL);
|
||||||
end();
|
end();
|
||||||
|
|
||||||
|
resize(xx, yy, ww, hh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2633,10 +2641,16 @@ Fl_Help_View::resize(int xx, // I - New left position
|
|||||||
int ww, // I - New width
|
int ww, // I - New width
|
||||||
int hh) // I - New height
|
int hh) // I - New height
|
||||||
{
|
{
|
||||||
|
Fl_Boxtype b = box() ? box() : FL_DOWN_BOX;
|
||||||
|
// Box to draw...
|
||||||
|
|
||||||
|
|
||||||
Fl_Widget::resize(xx, yy, ww, hh);
|
Fl_Widget::resize(xx, yy, ww, hh);
|
||||||
|
|
||||||
scrollbar_.resize(x() + w() - 17, y(), 17, h() - 17);
|
scrollbar_.resize(x() + w() - 17 - Fl::box_dw(b) + Fl::box_dx(b), y() + Fl::box_dy(b),
|
||||||
hscrollbar_.resize(x(), y() + h() - 17, w() - 17, 17);
|
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();
|
format();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user