diff --git a/components/tvplanit/source/vpcontactgrid.pas b/components/tvplanit/source/vpcontactgrid.pas index cd905bdbb..3f98d2d1f 100644 --- a/components/tvplanit/source/vpcontactgrid.pas +++ b/components/tvplanit/source/vpcontactgrid.pas @@ -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; {=====} diff --git a/components/tvplanit/source/vptasklist.pas b/components/tvplanit/source/vptasklist.pas index 709f21c81..8441f5790 100644 --- a/components/tvplanit/source/vptasklist.pas +++ b/components/tvplanit/source/vptasklist.pas @@ -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;