Recent

Author Topic: Help conerrting a Function to work on osx  (Read 2503 times)

Josh

  • Hero Member
  • *****
  • Posts: 1274
Help conerrting a Function to work on osx
« on: November 25, 2015, 12:38:14 pm »
Hi

I am trying to port one of my apps to osx, I use the following function to create panels with rounded corners on windows,
Does anyone know of a similar routine for osx

It errors on
Perform(EM_GETRECT, 0, lParam(@R));
Perform(EM_SETRECTNP, 0, lParam(@R));

Thanks

Josh

Code: [Select]
Function DrawRounded(Control: TWinControl; Diameter: LongInt):Boolean;
var
  R: TRect;
  Rgn: HRGN;
begin
  with Control do
  begin
    R := ClientRect;
    Rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, Diameter, Diameter);
    Perform(EM_GETRECT, 0, lParam(@R));
    InflateRect(R, -4, -4);
    Perform(EM_SETRECTNP, 0, lParam(@R));
    SetWindowRgn(Handle, Rgn, True);
  //  Invalidate;
  end;
  DrawRounded:=True;
end;
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018