HowTo (Programming tricks )
Given: exists a class with certain properties and methods
For example: FormMain = class (TForm)
There is a button, which makes a call to external procedure.
External procedure must:
0. Detect the call origin (? Sender) // not sure this is right
1. Edit properties of FormMain (get it's interface: properties and methods),
if propertyExists('Color'), then begin setColor ('blue'); end
2. Call method of FormMain
if MethodExists('minimize'), then begin callMethod('minimize'); end;
3. if this is possible by any chance: add / remove properties, methods from CallerClass.
Two cases: procedure i located in
a. uProcedures.pas.
-> uMainForm>uses uProcedures;
b. ObjectEditorClass, located in uObjectEditor
->uMainForm>uses uObjectEditor;
Edit class state with procedure, Edit TForm with external procedure.