Resize the text display widget when the buffer is changed.

Don't stop a resize if we are not visible (holdover from 2.0 code...)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2587 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2002-08-15 17:26:46 +00:00
parent d3c1d6b8ad
commit 6c3f9a03d1
2 changed files with 12 additions and 3 deletions
+6
View File
@@ -1,3 +1,9 @@
CHANGES IN FLTK 1.1.0
- Fl_Text_Display::buffer() now calls resize() to show
the buffer.
CHANGES IN FLTK 1.1.0rc6
- Documentation updates.
+6 -3
View File
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Display.cxx,v 1.12.2.25 2002/08/12 20:24:31 easysw Exp $"
// "$Id: Fl_Text_Display.cxx,v 1.12.2.26 2002/08/15 17:26:46 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -150,6 +150,9 @@ void Fl_Text_Display::buffer( Fl_Text_Buffer *buf ) {
/* Update the display */
buffer_modified_cb( 0, buf->length(), 0, 0, 0, this );
/* Resize the widget to update the screen... */
resize(x(), y(), w(), h());
}
/*
@@ -193,7 +196,7 @@ int Fl_Text_Display::longest_vline() {
*/
void Fl_Text_Display::resize(int X, int Y, int W, int H) {
Fl_Widget::resize(X,Y,W,H);
if (!buffer() || !visible_r()) return;
if (!buffer()) return;
X += Fl::box_dx(box());
Y += Fl::box_dy(box());
W -= Fl::box_dw(box());
@@ -1973,5 +1976,5 @@ int Fl_Text_Display::handle(int event) {
//
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.25 2002/08/12 20:24:31 easysw Exp $".
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.26 2002/08/15 17:26:46 easysw Exp $".
//