On Wednesday 17 December 2014 21:31:17 Fred van Stappen wrote:
> Hello Martin.
>
> I try to find the code where MSEIde save history of file open with
> mainfo.openfile and mainfo.openproject.
>
> I want to add a option => x Save history of open file-project in project
> file
>
> What i do now is to set as option =>  filedialog.controler.historycount :=
> 0 but i would prefer to act on the part where the history is writed in
> project.prj and not change historycount.
>
I probably don't understand.
MSEide "tmainfo.opensource()" calls
" result:= openfile.execute = mr_ok;". "mainfo.openfile.statfile" is set 
to "projectstatfile", a "tstatfile" instance 
in "mainfo". "mainfo.projectstatfile. "tfiledialog" implements 
the "istatfile" interface: 
"
 istatfile = interface(iobjectlink)[miid_istatfile]
  procedure dostatread(const reader: tstatreader);
  procedure dostatwrite(const writer: tstatwriter);
  procedure statreading;
  procedure statread;
  function getstatvarname: msestring;
  function getstatpriority: integer;
 end;
"
In "tstatfile.writestat()" "mainfo.openfile.dostatwrite()" will be called:
"
procedure tfiledialog.dostatwrite(const writer: tstatwriter);
begin
 if canstatvalue(foptionsedit1,writer) then begin
  fcontroller.writestatvalue(writer);
 end;
 if canstatstate(foptionsedit1,writer) then begin
  fcontroller.writestatstate(writer);
 end;
 if canstatoptions(foptionsedit1,writer) then begin
  fcontroller.writestatoptions(writer);
 end;
end;
"
In "t*.optionsedit1" "oe1_savevalue", "oe1_savestate", "oe1_saveoptions" 
define in conjunction 
with "tstatfile.options" "sfo_nodata", "sfo_nostate", "sfo_nooptions" which 
of the "fcontroller.writestat*" procedures are called:
"
procedure tfiledialogcontroller.writestatvalue(const writer: tstatwriter);
begin
 writer.writearray('filenames',ffilenames);
 if fdo_params in foptions then begin
  writer.writemsestring('params',fparams);
 end;
end;

procedure tfiledialogcontroller.writestatstate(const writer: tstatwriter);
begin
 if fdo_savelastdir in foptions then begin
  writer.writemsestring('lastdir',flastdir);
 end;
 if fhistorymaxcount > 0 then begin
  writer.writearray('filehistory',fhistory);
 end;
 writer.writeinteger('filefilterindex',ffilterindex);
 writer.writestring('filefilter',ffilter);
 writer.writeinteger('filecolwidth',fcolwidth);
 writer.writeinteger('x',fwindowrect.x);
 writer.writeinteger('y',fwindowrect.y);
 writer.writeinteger('cx',fwindowrect.cx);
 writer.writeinteger('cy',fwindowrect.cy);
end;

procedure tfiledialogcontroller.writestatoptions(const writer: tstatwriter);
begin
 //dummy
end;
"
The file history is written in "tfiledialogcontroller.writestatstate()".

Martin

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to