UniqueInstance needs new event
Alexey-T opened this issue · 8 comments
Alexey-T commented
Alexey-T commented
it is almost ok.
now I think that CudaText needs another change in UniqInst.
my app calls Loaded() method
a) we need to move Loaded from 'protected' to 'public' (app needs TUniqIntanceHack type if Loaded is 'protected')
b) we need Loaded with parameter - "const array of string".
so Cud will prepare this 'array of string' w/o events. and give it to Loaded().
blikblum commented
Loaded is called by lcl without parameters so It cannot be changed.
Please create a simple example so we evaluate the use case
Alexey-T commented
pseudo code -
var p: array of string;
SetLength(p, ParamCount);
for i:= 1 to ParamCount do
p[i-1]:= mydir+'/'+ParamStr(i);
UniqInst.NewLoadedNeeded(p);
blikblum commented
You can already mutate the command line parameter using OnPrepareParam
that is called internally by Loaded
, so no need to a new Loaded method
blikblum commented
TForm.PrepareParam(Sender : TObject; var Param: String);
begin
Param := mydir+'/'+ Param;
end;
Alexey-T commented
Ok thanks.
blikblum commented
If you want to remove an Param, set Param to ''