Forum > Beginners
Overriding does not work [SOLVED]
(1/1)
CodenameLambda:
Hello,
I have a little problem:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TFormula = class private atoms: TAtomCollection; position: TPoint; mouse_position: TPoint; public constructor Create(); constructor FromData(atoms_data: TAtomCollection; position_data: TPoint; mouse_position_data: TPoint); function AddAtom(atom_type: integer; atom_position: TPoint): integer; // returns the new id procedure AddBonds(atom1: integer; atom2: integer; amount: integer); procedure RemoveAtom(atom_id: integer); procedure RemoveBonds(atom1: integer; atom2: integer); function BondAmount(atom1: integer; atom2: integer): integer; procedure MoveTo(new_position: TPoint); procedure Shift(delta: TPoint); function GetPosition(): TPoint; procedure Draw(canvas: TCanvas; width: integer; height: integer); procedure MouseMove(new_position: TPoint); procedure Click(); function ToLewis(): TFormula; function ToStructure(): TFormula; destructor Destroy(); override; end; type TLewis = class(TFormula) public procedure Draw(canvas: TCanvas; width: Integer; height: Integer); override; // Lazarus says that it doesn't find any methods to override procedure Click(); override; // same end;
How can I fix this?
Thanks,
CodenameLambda
marcov:
Declare "click" virtual in TFormula.
Override always only overrides virtual methods, and default methods are not virtual
CodenameLambda:
Thanks ^^
Navigation
[0] Message Index