tvplanit: Add missing destruction of Task list inplace editor. Fix Task list inplace editor painting issue.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4714 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-10 21:20:06 +00:00
parent 924efdfcb1
commit 8a7f8615fc
2 changed files with 12 additions and 12 deletions

View File

@ -345,17 +345,18 @@ begin
Margin := 0;
if (Field = 'Address') or (Field = 'Company') or (Field ='CSZ') then
Margin := TextMargin * 2;
{$IFDEF LCL}
SetBounds(
Left + Margin,
Top + TextMargin div 2,
Right - Left - TextMargin * 2,
Bottom - Top
);
(*
{$ELSE}
SetWindowPos(Handle, HWND_TOP, Left + Margin,
Top + (TextMargin div 2), Right - Left - TextMargin * 2, Bottom - Top,
{SWP_SHOWWINDOW or} SWP_NOREDRAW);
*)
SWP_NOREDRAW);
{$ENDIF}
end;
if Redraw then Invalidate;
SetFocus;
@ -466,8 +467,6 @@ end;
destructor TVpContactGrid.Destroy;
begin
FreeAndNil(cgInplaceEditor);
if (HandleAllocated) and
(Assigned (DataStore)) and
(not (csDesigning in ComponentState)) then
@ -476,6 +475,8 @@ begin
cgClickTimer.Free;
FContactHeadAttr.Free;
FDefaultPopup.Free;
FreeAndNil(cgInplaceEditor);
inherited;
end;
{=====}

View File

@ -110,7 +110,7 @@ type
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
public
constructor Create(AOwner: TComponent); override;
procedure Move(const Loc: TRect; Redraw: Boolean);
// procedure Move(const Loc: TRect; Redraw: Boolean);
end;
TVpTaskHeadAttr = class(TVpPersistent)
@ -451,18 +451,16 @@ begin
{$ENDIF}
end;
{=====}
{
procedure TVpTLInPlaceEdit.Move(const Loc: TRect; Redraw: Boolean);
begin
CreateHandle;
Redraw := Redraw or not IsWindowVisible(Handle);
Invalidate;
with Loc do
SetWindowPos(Handle, HWND_TOP, Left, Top, Right - Left, Bottom - Top,
{SWP_SHOWWINDOW or} SWP_NOREDRAW);
SetBounds(Loc.Left, Loc.Top, Loc.Right-Loc.Left, Loc.Bottom-Loc.Top);
if Redraw then Invalidate;
SetFocus;
end;
end; }
{=====}
procedure TVpTLInPlaceEdit.CreateParams(var Params: TCreateParams);
@ -554,6 +552,7 @@ end;
destructor TVpTaskList.Destroy;
begin
FreeAndNil(tlInplaceEditor);
tlClickTimer.Free;
FDisplayOptions.Free;
tlAllTaskList.Free;
@ -1528,7 +1527,7 @@ begin
tlInPlaceEditor.OnExit := EndEdit;
end;
tlInplaceEditor.Show;
tlInPlaceEditor.Move(R, true);
tlInPlaceEditor.SetBounds(R.Left, R.Top, R.Right-R.Left, R.Bottom-R.Top); //Move(R, true);
tlInPlaceEditor.Text := FActiveTask.Description;
tlInPlaceEditor.Font.Assign(Font);
tlInPlaceEditor.SelectAll;