From 22be600ffb8ab2afb5fb44c20f4f1e8dc3ff9065 Mon Sep 17 00:00:00 2001 From: lazarus Date: Tue, 10 Jul 2001 13:25:49 +0000 Subject: [PATCH] MG: repaints reduced git-svn-id: trunk@320 - --- components/synedit/syncompletion.pas | 17 ++++++++++++----- lcl/include/customform.inc | 7 ++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/components/synedit/syncompletion.pas b/components/synedit/syncompletion.pas index 7b69c808a2..9ffdb58298 100644 --- a/components/synedit/syncompletion.pas +++ b/components/synedit/syncompletion.pas @@ -348,7 +348,9 @@ begin CurrentString := Copy(CurrentString, 1, Length(CurrentString) - 1); end; end; - Paint; + {$ifdef SYN_LAZARUS} + Invalidate; + {$ENDIF} end; procedure TSynBaseCompletionForm.KeyPress(var Key: char); @@ -364,7 +366,9 @@ begin else if Assigned(OnCancel) then OnCancel(Self); end; // case - Paint; + {$ifdef SYN_LAZARUS} + Invalidate; + {$ENDIF} end; procedure TSynBaseCompletionForm.MouseDown(Button: TMouseButton; @@ -394,7 +398,9 @@ begin Scroll.Max := 0 else Scroll.Max := ItemList.Count - NbLinesInWindow; + {$IFNDEF SYN_LAZARUS} Position := Position; + {$ENDIF} Scroll.LargeChange := NbLinesInWindow; // draw a rectangle around the window @@ -418,7 +424,7 @@ begin Canvas.Rectangle(0, FFontHeight * i, width, FFontHeight * (i + 1)); Canvas.Pen.Color := clBlack; Canvas.Font.Color := clWhite; - Hint := ItemList[Scroll.Position + i]; + Hint := ItemList[Position]; end else Begin @@ -445,7 +451,8 @@ begin Position := Scroll.Position else if Position > Scroll.Position + NbLinesInWindow - 1 then Position := Scroll.Position + NbLinesInWindow - 1; - Paint; +writeln('TSynBaseCompletionForm.ScrollChange'); + Invalidate; end; procedure TSynBaseCompletionForm.ScrollGetFocus(Sender: TObject); @@ -539,7 +546,7 @@ begin Scroll.Position := Position else if Scroll.Position < Position - NbLinesInWindow + 1 then Scroll.Position := Position - NbLinesInWindow + 1; - invalidate; + Invalidate; end; end; end; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index a48aafd7cd..d192c497cf 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -251,8 +251,9 @@ begin Include(FControlState, csCustomPaint); try + ControlState := ControlState + [csCustomPaint]; inherited WMPaint(Message); - Paint; // TODO: move this to the PaintWindow function; + ControlState := ControlState - [csCustomPaint]; finally Exclude(FControlState, csCustomPaint); end; @@ -938,8 +939,8 @@ end; { ============================================================================= $Log$ - Revision 1.23 2001/07/06 06:25:37 lazarus - MG: fixes for ide speedbuttons, form.showmodal, initial lazarus.dci + Revision 1.24 2001/07/10 13:25:49 lazarus + MG: repaints reduced Revision 1.22 2001/06/28 18:15:03 lazarus MG: bugfixes for destroying controls