As TLama noted, the new identifier must be registered in both ScriptClasses_C.pas and ScriptClasses_R.pas . To be more specific in matters of the question:
In ScriptClasses_C.pas I created the RegisterTNewButton_C procedure so that the compiler ScriptClasses_C.pas out about my new identifier for the button:
procedure RegisterTNewButton_C(Cl: TPSPascalCompiler); begin with Cl.AddClassN(Cl.FindClass('TButton'), 'TNewButton') do begin RegisterProperty('NoShortcut', 'Boolean', iptrw); end; end;
In ScriptClasses_R.pas I basically do the same thing, but I additionally had to implement for getter and setter for the new identifier:
procedure TNewButtonNoShortcut_R(Self: TNewButton; var T: Boolean); begin T := Self.NoShortcut; end; procedure TNewButtonNoShortcut_W(Self: TNewButton; const T: Boolean); begin Self.NoShortcut := T; end; procedure RegisterTNewButton_R(CL: TPSRuntimeClassImporter); begin with CL.Add(TNewButton) do begin RegisterPropertyHelper(@TNewButtonNoShortcut_R,@TNewButtonNoShortcut_W,'NoShortcut'); end; end;
To do this, finally, the operation of RegisterTNewButton_C must be called in the ScriptClassesLibraryRegister_C and RegisterTNewButton_R ScriptClassesLibraryRegister_R in ScriptClassesLibraryRegister_R respectively.
In addition, I deleted / commented out the lines that TNewButton previously registered (in RegisterBidiCtrls_C and RegisterBidiCtrls_R ) to avoid errors that might occur when a component is registered twice. But I do not know if this is necessary.
Nurio source share