Stuff that didn't get into 1.0.7:

Fix for Borland or other platforms where GLint != int.

Fixed browser scrollbars so they work if browser is inside a scroll
(it did not update their position to match where they were drawn)

Fl_Output (and non-focused Fl_Input) now scroll in response to position()
calls from the program to show the position.  In addition I cleaned up the
horizontal scrolling of Fl_Input to be less screwy, it now never scrolls
if the text actually fits in the widget.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@959 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Bill Spitzak 1999-12-19 05:32:34 +00:00
parent 96286acd1b
commit 8251826357
3 changed files with 28 additions and 21 deletions

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Browser_.cxx,v 1.10.2.6 1999/11/16 14:44:43 mike Exp $" // "$Id: Fl_Browser_.cxx,v 1.10.2.7 1999/12/19 05:32:33 bill Exp $"
// //
// Base Browser widget class for the Fast Light Tool Kit (FLTK). // Base Browser widget class for the Fast Light Tool Kit (FLTK).
// //
@ -88,11 +88,19 @@ int Fl_Browser_::leftedge() const {
return X; return X;
} }
// the scrollbars are resized & placed by draw(), since each one's size // The scrollbars may be moved again by draw(), since each one's size
// depends on whether the other is visible or not. This skips over // depends on whether the other is visible or not. This skips over
// Fl_Group::resize since it moves the scrollbars uselessly. // Fl_Group::resize since it moves the scrollbars uselessly.
void Fl_Browser_::resize(int X, int Y, int W, int H) { void Fl_Browser_::resize(int X, int Y, int W, int H) {
Fl_Widget::resize(X, Y, W, H); Fl_Widget::resize(X, Y, W, H);
// move the scrollbars so they can respond to events:
bbox(X,Y,W,H);
scrollbar.resize(
scrollbar.align()&FL_ALIGN_LEFT ? X-scrollbar_width_ : X+W,
Y, scrollbar_width_, H);
hscrollbar.resize(
X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollbar_width_ : Y+H,
W, scrollbar_width_);
} }
// Cause minimal update to redraw the given item: // Cause minimal update to redraw the given item:
@ -668,5 +676,5 @@ void Fl_Browser_::item_select(void*, int) {}
int Fl_Browser_::item_selected(void* l) const {return l==selection_;} int Fl_Browser_::item_selected(void* l) const {return l==selection_;}
// //
// End of "$Id: Fl_Browser_.cxx,v 1.10.2.6 1999/11/16 14:44:43 mike Exp $". // End of "$Id: Fl_Browser_.cxx,v 1.10.2.7 1999/12/19 05:32:33 bill Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.4 1999/10/14 04:56:08 bill Exp $" // "$Id: Fl_Gl_Window.cxx,v 1.12.2.5 1999/12/19 05:32:34 bill Exp $"
// //
// OpenGL window code for the Fast Light Tool Kit (FLTK). // OpenGL window code for the Fast Light Tool Kit (FLTK).
// //
@ -150,7 +150,7 @@ void Fl_Gl_Window::make_current() {
} }
void Fl_Gl_Window::ortho() { void Fl_Gl_Window::ortho() {
int p[2]; GLint p[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, p); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, p);
glLoadIdentity(); glLoadIdentity();
glViewport(w()-p[0], h()-p[1], p[0], p[1]); glViewport(w()-p[0], h()-p[1], p[0], p[1]);
@ -316,5 +316,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif #endif
// //
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.4 1999/10/14 04:56:08 bill Exp $". // End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.5 1999/12/19 05:32:34 bill Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $" // "$Id: Fl_Input_.cxx,v 1.21.2.3 1999/12/19 05:32:34 bill Exp $"
// //
// Common input widget routines for the Fast Light Tool Kit (FLTK). // Common input widget routines for the Fast Light Tool Kit (FLTK).
// //
@ -197,19 +197,18 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
curx = int(expandpos(p, value()+position(), buf, 0)+.5); curx = int(expandpos(p, value()+position(), buf, 0)+.5);
if (Fl::focus()==this && !was_up_down) up_down_pos = curx; if (Fl::focus()==this && !was_up_down) up_down_pos = curx;
cury = lines*height; cury = lines*height;
if (Fl::focus()==this) { int newscroll = xscroll_;
int fullw = int(expandpos(p, e, buf, 0)); if (expandpos(p, e, buf, 0) < W-1) {
if (curx > xscroll_+W-20) { newscroll = 0;
xscroll_ = curx+20-W; } else if (curx > newscroll+W-20) {
if (xscroll_ > fullw-W+2) xscroll_ = fullw-W+2; newscroll = curx+20-W;
mu_p = 0; erase_cursor_only = 0; } else if (curx < newscroll+20) {
} newscroll = curx-20;
if (curx < xscroll_+20 && xscroll_) { }
if (fullw > W-2) xscroll_ = curx-20; if (newscroll < 0) newscroll = 0;
else xscroll_ = 0; if (newscroll != xscroll_) {
mu_p = 0; erase_cursor_only = 0; xscroll_ = newscroll;
} mu_p = 0; erase_cursor_only = 0;
if (xscroll_ < 0) xscroll_ = 0;
} }
} }
lines++; lines++;
@ -745,5 +744,5 @@ Fl_Input_::~Fl_Input_() {
} }
// //
// End of "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $". // End of "$Id: Fl_Input_.cxx,v 1.21.2.3 1999/12/19 05:32:34 bill Exp $".
// //