Skip to content

Commit

Permalink
Resize the text display widget when the buffer is changed.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelrsweet committed Aug 15, 2002
1 parent d3c1d6b commit 6c3f9a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES
@@ -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.
Expand Down
9 changes: 6 additions & 3 deletions src/Fl_Text_Display.cxx
@@ -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
Expand Down Expand Up @@ -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());
}

/*
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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 $".
//

0 comments on commit 6c3f9a0

Please sign in to comment.