Solves STR#3395.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12529 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
6774852be5
commit
a27da5e582
@ -293,7 +293,7 @@ public:
|
||||
Sets the default font used when drawing text in the widget.
|
||||
\param s default text font face
|
||||
*/
|
||||
void textfont(Fl_Font s) {textfont_ = s; mColumnScale = 0;}
|
||||
void textfont(Fl_Font s) {textfont_ = s; mColumnScale = 0; recalc_display(); }
|
||||
|
||||
/**
|
||||
Gets the default size of text in the widget.
|
||||
@ -305,7 +305,7 @@ public:
|
||||
Sets the default size of text in the widget.
|
||||
\param s new text size
|
||||
*/
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s; mColumnScale = 0;}
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s; mColumnScale = 0; recalc_display(); }
|
||||
|
||||
/**
|
||||
Gets the default color of text in the widget.
|
||||
@ -323,6 +323,7 @@ public:
|
||||
int wrapped_row(int row) const;
|
||||
void wrap_mode(int wrap, int wrap_margin);
|
||||
|
||||
virtual void recalc_display();
|
||||
virtual void resize(int X, int Y, int W, int H);
|
||||
|
||||
/**
|
||||
|
@ -212,7 +212,7 @@ Fl_Text_Display::~Fl_Text_Display() {
|
||||
void Fl_Text_Display::linenumber_width(int width) {
|
||||
if (width < 0) return;
|
||||
mLineNumWidth = width;
|
||||
resize(x(), y(), w(), h()); // triggers code to recalculate line#s
|
||||
recalc_display(); // recalc line#s // resize(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -365,7 +365,7 @@ void Fl_Text_Display::buffer( Fl_Text_Buffer *buf ) {
|
||||
}
|
||||
|
||||
/* Resize the widget to update the screen... */
|
||||
resize(x(), y(), w(), h());
|
||||
recalc_display(); // resize(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
|
||||
@ -431,8 +431,6 @@ int Fl_Text_Display::longest_vline() const {
|
||||
return longest;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Change the size of the displayed text area.
|
||||
|
||||
@ -456,6 +454,13 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
|
||||
#endif // DEBUG2
|
||||
|
||||
Fl_Widget::resize(X,Y,W,H);
|
||||
recalc_display();
|
||||
}
|
||||
|
||||
/**
|
||||
Recalculate the display's visible lines and scrollbar sizes.
|
||||
*/
|
||||
void Fl_Text_Display::recalc_display() {
|
||||
if (!buffer()) return;
|
||||
|
||||
// did we have scrollbars initially?
|
||||
@ -464,10 +469,10 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
|
||||
|
||||
int oldTAWidth = text_area.w;
|
||||
|
||||
X += Fl::box_dx(box());
|
||||
Y += Fl::box_dy(box());
|
||||
W -= Fl::box_dw(box());
|
||||
H -= Fl::box_dh(box());
|
||||
int X = x() + Fl::box_dx(box());
|
||||
int Y = y() + Fl::box_dy(box());
|
||||
int W = w() - Fl::box_dw(box());
|
||||
int H = h() - Fl::box_dh(box());
|
||||
|
||||
text_area.x = X + LEFT_MARGIN + mLineNumWidth;
|
||||
text_area.y = Y + TOP_MARGIN;
|
||||
@ -680,7 +685,6 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Refresh a rectangle of the text display.
|
||||
\param left, top are in coordinates of the text drawing window.
|
||||
@ -941,7 +945,7 @@ void Fl_Text_Display::wrap_mode(int wrap, int wrapMargin) {
|
||||
mAbsTopLineNum = 1; // changed from 0 to 1 -- LZA / STR#2621
|
||||
}
|
||||
|
||||
resize(x(), y(), w(), h());
|
||||
recalc_display(); // resize(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
|
||||
@ -1250,7 +1254,7 @@ void Fl_Text_Display::display_insert() {
|
||||
*/
|
||||
void Fl_Text_Display::show_insert_position() {
|
||||
display_insert_position_hint = 1;
|
||||
resize(x(), y(), w(), h());
|
||||
recalc_display(); // resize(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
|
||||
@ -2817,7 +2821,7 @@ void Fl_Text_Display::calc_last_char() {
|
||||
void Fl_Text_Display::scroll(int topLineNum, int horizOffset) {
|
||||
mTopLineNumHint = topLineNum;
|
||||
mHorizOffsetHint = horizOffset;
|
||||
resize(x(), y(), w(), h());
|
||||
recalc_display(); // resize(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user