{Standard startup views - might add a suitable setup option...}
{$I compdirs}
unit StdStart;

interface

const
	{start standard view constants}
	ssAltF 			= 0;
	ssDirDiary 	= 1;
	ssDirOnly   = 2;


implementation

uses
	{$IFDEF kdiary} 	kdiary, {$ENDIF}
	{$IFDEF kdirctry} kdirctry, {$ENDIF}
	tasks,
	jimindxs,
	global,
	drivers,
	app,
	tuiapp,
	kamsetup,
	minilib,
	tui,
	objects;

{$IFDEF kdirctry}{$IFDEF kdiary}
procedure StartDirDiary; far;
var Bounds, R : TRect;
		List : PDirectoryListView;
		Diary : PDayDiary;
begin
	Desktop^.GetExtent(Bounds);

	{directory, rhs}
	R.Copy(Bounds); R.A.X := R.B.X div 2 +1;
	List := New(PDirectoryListView, Init(R, lsDirectory, fiFullDirIdx,''));
	Kameleon^.InsertWindow(New(PIndexedJimmyListWindow, init(R, 'Full Directory', List)));

	{diary, lhs}
	R.Copy(Bounds); R.B.X := R.B.X div 2 +1;
	New(Diary, init(R,-1));
	Desktop^.Insert(Diary);
end;{}
{$ENDIF}{$ENDIF}


procedure StartStdView; far;
var Event : TEvent;
begin
	case S2Num(ProgramSetup.Get(siStartStdView,'')) of
		ssAltF 			: StartEvent(evKeyDown, kbAltF); {start the file menu}
		{$IFDEF kdirctry}{$IFDEF kdiary}
		ssDirDiary 	: StartDirDiary;
		{$ENDIF}{$ENDIF}
		{$IFDEF kdirctry}
		ssDirOnly 	: StartDirectoryList; {from kdirctry.pas}
		{$ENDIF}
	end;
end;



begin
	RegisterTask(StartUpTasks, 99, @StartStdView);
end.
