In mode objfpc it is not allowed that parameters of methods have the same name as properties. Therefore, in Lazarus parameters usually are named with a prepended "A" -- "AActive" instead of "Active". Alternatively you can use mode Delphi where parameters and properties can be named equally.
But even after this modification your code will not work in Lazarus due to the widgetset-dependence of the control. In fact, the pagecontrol does not expose a canvas, and its method OnDrawTab has been removed a long time ago.