On Tue, Mar 19, 2013 at 9:48 AM, Juha Manninen
<juha.mannine...@gmail.com> wrote:
> It does not compile here. It complains about BiDiMode in
> TEditButtonSpacing.GetSpaceAround.

Ok, I changed it as below and it works. I don't know how you tested
the broken code but it looks very nice.
No widgetset code and the component inherits from TCustomEdit.
The code is also clean, no ugly hacks. Why didn't you show it earlier?

Regards
Juha


-------------------

procedure TEditButtonSpacing.GetSpaceAround(out SpaceAround: TRect);
begin
  inherited GetSpaceAround(SpaceAround);
  if Control.BiDiMode = bdLeftToRight then
    Inc(SpaceAround.Right, TCustomEditButton(Control).ButtonWidth)
  else
    Inc(SpaceAround.Left, TCustomEditButton(Control).ButtonWidth)
end;

function TEditButtonSpacing.GetSideSpace(Kind: TAnchorKind): Integer;
begin
  Result := inherited GetSideSpace(Kind);
  if Kind = akRight then
  begin
    if Control.BiDiMode = bdLeftToRight then
      Inc(Result, TCustomEditButton(Control).ButtonWidth);
  end
  else if (Kind = akLeft) and (Control.BiDiMode <> bdLeftToRight) then
    Inc(Result, TCustomEditButton(Control).ButtonWidth);
end;

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to