diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2010-06-12 13:32:45 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2010-06-12 13:32:45 +0200 |
commit | c360255b3d0dd5a67b8d1f5d860656b3d4927400 (patch) | |
tree | 4cdaa74200cbe45cb923fcc99cfdc4a6ba722b57 | |
parent | 2364f2115ffccd71464da8fc2e68b7074bb262f2 (diff) | |
download | fpGUI-c360255b3d0dd5a67b8d1f5d860656b3d4927400.tar.xz |
TextEdit: fixed sync between textedit content and scrollbars.
-rw-r--r-- | prototypes/textedit/fpg_textedit.pas | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/prototypes/textedit/fpg_textedit.pas b/prototypes/textedit/fpg_textedit.pas index 4cbaa996..0adfb821 100644 --- a/prototypes/textedit/fpg_textedit.pas +++ b/prototypes/textedit/fpg_textedit.pas @@ -460,6 +460,8 @@ begin if FLines.Count > 0 then FVScrollBar.SliderSize := FVisLines / FLines.Count; FVScrollBar.Visible := FLines.Count > FVisLines; + if FVScrollBar.Visible then + FVScrollBar.RepaintSlider; FHScrollBar.Min := 0; FHScrollBar.PageSize := FVisCols div 2; //FMaxScrollH div 4; @@ -467,8 +469,11 @@ begin FHScrollBar.Position := HPos; FHScrollBar.SliderSize := FVisCols / FMaxScrollH; FHScrollBar.Visible := FMaxScrollH > FVisCols; + if FHScrollBar.Visible then + FHScrollBar.RepaintSlider; -// UpdateScrollBarCoords; + UpdateScrollBarCoords; + UpdateCharBounds; end; procedure TfpgBaseTextEdit.VScrollBarMove(Sender: TObject; position: integer); @@ -522,7 +527,7 @@ var begin OldPos := VPos; VPos := p; - UpdateScrollBars; + {$IFDEF gDEBUG} writeln('OldPos:', OldPos, ' NewPos:', VPos, ' SB.Max:', FVScrollBar.Max); {$ENDIF} @@ -556,7 +561,7 @@ var begin OldPos := HPos; HPos := p; - UpdateScrollBars; + {$IFDEF gDEBUG} writeln('OldPos:', OldPos, ' NewPos:', HPos, ' SB.Max:', FHScrollBar.Max); {$ENDIF} @@ -588,11 +593,6 @@ begin VHeight := r.Height; HWidth := r.Width; - //if FVScrollBar.Visible then - //Dec(HWidth, FVScrollBar.Width); - //if FHScrollBar.Visible then - //Dec(VHeight, FHScrollBar.Height); - FHScrollBar.Top := Height - FHScrollBar.Height - r.Top; FHScrollBar.Left := r.Top; FHScrollBar.Width := HWidth; |