{******************************************************************
 ***               SECONDARY START UP                           ***
 ******************************************************************}
{startup1 just displays a message to the user to say things are happening.
This one was created in order to allow kamapp to handle jimmys, as the
dependant jimmy units required kamapp menu in order to create the various
options.  This unit does that setting up (removing all that init code
to a loaded-once-only unit), and maybe can be expanded to do other kinds
of setting up.}

{because this should be the *last* unit initialised, it should not be
included in any other units uses clause - only in kameleon.pas}

{$I compdirs}

unit startup2;

INTERFACE

{var AppMenu : PMenu; see tuiapp/winapp}

IMPLEMENTATION

uses	global, {for cm...}
			help,  {for hc....}
			tasks, {for desktop new menu}
{$IFDEF Windows}
			win, winprocs, wintypes,	{for menu operations}
			winapp, {for hAppmenu}
			wincrt; {for fixit startup comment}
{$ELSE}
			video, {for screen mode video menu}
			views, {for cm...}
			tui, {for menu operations}
			app, {for cm & some hc's}
			drivers, {kbxxx}
			menus,
			tuiapp; {for appmenubar}
{$ENDIF}

{$IFNDEF Windows}
{removes any surplus lines at the start/end of menus, empty menus, etc}
procedure TidyUp(Menu : PMenu);
var Prev, Work,W : PMenuItem;
begin
	Work := Menu^.Items;
	Prev := nil;

	while (Work<>nil) and (Work^.Name = nil) do begin
		{first menu item(s) is a line}
		Menu^.Items := Work^.Next;
		if Menu^.Default = Work then Menu^.Default := Work^.Next;
		dispose(Work);
		Work := Menu^.Items;
	end;

	while WOrk<>nil do begin
		if (WOrk^.SubMenu<>nil) then begin

			{Tidy up submenu}
			TidyUp(Work^.SubMenu);

			{Now check if it's empty, and if so, remove}
			if Work^.SubMenu^.Items = nil then begin
				{empty submenu - remove}
				if Menu^.Default = Work then Menu^.Default := Work^.Next;
				W := Work^.Next;
				dispose(Work);
				Work := W;
				if Prev<>nil then Prev^.Next := W else Menu^.Items := W;
			end;
		end;

		{double lines}
		if (Prev<>nil) and (Prev^.Name=nil) and (Work <> nil) and (Work^.Name=nil) then begin
			Prev^.Next := Work^.Next;
			if Menu^.Default = Work then Menu^.Default := Work^.Next;
			dispose(Work);
			Work := nil;
		end;

		if Work = nil then
			Work := Prev^.Next
		else begin
			Prev := Work;
			Work := Work^.Next;
		end;

		{last one is a line}
		if (Work<>nil) and (Work^.Name=nil) and (Work^.Next = nil) then begin
			Prev^.Next := nil;
			dispose(Work);
			Work := nil;
		end;
	end;
end;
{$ENDIF}

const
	{--- Menu texts ----}
	{$IFDEF Windows}
		mnSystem = '~S~ystem';
	{$ELSE}
		mnSystem = '~'#240'~'; {system menu - alt space}
	{$ENDIF}
	mnReports = '~R~eports';
	mnDirectorySearch = '~S~earch/Analysis';

	mnTools = '~T~ools';
	mnOptions = '~O~ptions';	mnSetup = '~S~etup';
	mnTrays = 'Tra~y~s';
	mnWindow = '~W~indow';
	mnFile = '~F~ile';
	mnSearch = '~S~earch';
	mnHelp = '~H~elp';

procedure MakeKameleonMenu;
var TempTasks : PTaskItem;
{$IFDEF Windows}  AppMenu : word; {$ENDIF}

begin
	{$IFDEF Windows}
		hAppMenu := CreateMenu; {create start of menu}
		AppMenu := hAppMenu; {for compatibility below}
	{$ELSE}
		AppMenu := NewMenu(nil); {create start of menu}
	{$ENDIF}

	{================== SKELETON MENU =============================}
	AddItemEnd(AppMenu,
			{Start off with system menu at extreme left}
			NewSubMenu(mnSystem, kbNone, hcNoContext,
				NewMenu(
					NewItem('~A~bout',  '', kbNone, cmShowAbout, hcAbout,
					NewItem('~S~tatus',  '', kbNone, cmShowStatus, hcStatus,
					NewLine(
					NewItem('~C~alculator',  '', kbNone, cmCalculator, hcCalculator,
					NewLine(
					NewItem('Ca~l~ender',  '', kbNone, cmCalendar, hcCalendar,
					NewLine(
					NewItem('ASCII ~T~able',  '', kbNone, cmASCIITable, hcNoContext,
				nil))))))))),
			NewSubMenu(mnFile, kbNone, hcNoContext,
				NewMenu(nil),
			NewSubMenu('~N~ew', kbNew, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnSearch, kbSearch, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnTrays, kbNone, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnTools, kbNone, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnOptions, kbNone, hcNoContext,
				NewMenu(
					NewSubMenu(mnSetup, kbNone, hcNoContext,
					NewMenu(nil),
				NewLine(
				nil))),
			NewSubMenu(mnReports, kbNone, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnWindow, kbNone, hcNoContext,
				NewMenu(nil),
			NewSubMenu(mnHelp,  kbNone, hcNoContext,
				NewMenu(
					NewItem('~I~ndex',  				ksHelpIndex, 	kbHelpIndex, 	cmHelpIndex, hcHelpOnHelp,
					NewItem('Current ~T~ask',  	ksHelp, 			kbHelp, 			cmHelp, 		 hcHelpOnHelp,
					NewItem('~D~etail',  				ksHelpLow, 		kbHelpLow,		cmHelpLow, 		hcHelpOnHelp,
					NewItem('~L~ast Topic',  		ksHelpLast, 	kbHelpLast, 	cmHelpLast, 	hcHelpOnHelp,
					NewLine(
					NewItem('~A~bout',  '', kbNone, cmShowAbout, hcAbout,
				nil))))))),
			nil)
		))))))))));


	{================ GENERAL MAINTENANCE ====================}
{$IFDEF kmaint}
	{Tools, etc}
	AddItemSubMenu(AppMenu, mnTools,
		NewSubMenu('Database ~M~anagement', kbNone, hcDatabaseManagement,
			NewMenu(
				NewItem('~B~ackup Data',    '', kbNone, 	cmBackup, 		hcBackup,
				NewItem('~R~estore Data',   '', kbNone, 	cmRestore, 		hcRestore,
				NewLine(
				NewItem('~H~ole Creater',   '', kbNone, 	cmMakeHoles, 	hcHoleCreator,
				NewLine(
				NewItem('~A~rchive Index',   '', kbNone, 	cmArchiveList, hcArchive,
			nil))))))),
		NewLine(
		NewItem('Import',  '', 					kbNone, 	cmImport, 		hcImport,
		NewLine(
		NewItem('Shell to ~D~os',   '', kbNone, 	cmKamDosShell, hcDOSShell,
		NewLine(
		NewItem('Release ~L~icence', '', kbNone, 	cmDoLicence, hcAntiPiracy,
		NewLine(
		NewItem('Edit ~F~orm',  '', 			kbNone, cmEditForm, 		hcEditForm,
		{$IFDEF kwplink}	NewItem('Edit ~W~P Form',  '', 			kbNone, cmEditWPForm, 	hcEditWPForm, {$ENDIF}
		NewLine(
	nil)))))))))){$IFDEF kwplink}){$ENDIF});

	{Setup & Configuration}
	AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,
		NewItem('~G~eneral', '', 				kbNone, cmEditProgramSetup, hcGeneralSetup,
		NewLine(
		NewItem('~B~ackup/Restore', '', kbNone, cmEditBackupSetup, 	hcBackupSetup,
		NewLine(
		NewItem('~P~rinter/Paper/Labels', '', kbNone, cmSetPrinter, hcSetPrinter,
		NewItem('~F~ax', 			'', 				kbNone, 		cmSetFax, 		hcSetFax,
		NewItem('~e~mail', 		'', 				kbNone, 		cmEditemailSetup, hcEmailSetup,
		NewLine(
		NewItem('~M~odem', 		'', 				kbNone, 		cmSetModem, 	hcSetModem,
		NewItem('~A~utoDial', 		'', 		kbNone, 		cmEditDialSetup, 	hcAutoDial,
		NewLine(
		NewItem('~T~echnical',   '', 		kbNone, cmTekkyEditProgramSetup, hcTekkySetup,
		NewLine(
	nil))))))))))))));

	AddItemSubMenu(AppMenu, mnOptions,
		NewItem('Set Da~t~e & Time',  '', kbNone, cmSetDateTime, 	hcSetDateTime,
		NewLine(
		NewItem('Short ~C~odes', '', 			kbNone, cmEditSCodes, 	hcEditSCodes,
		NewLine(
		StdVideoMenu( {see video.pas}
		NewItem('Co~l~ours','',						kbNone, cmEditPalette, 	hcEditPalette,
		NewLine(
	nil))))))));
	{$ENDIF}


	{==== NEW ======}
	{add "new" jimmys, checking lsDesktopNew}
	AddCommandsToListMenu(lsDesktop, AppMenu, TempTasks);{}

	{============== DIARY ===========================}
	{$IFDEF kdiary}
		AddItemSubMenu(AppMenu, mnFile,
			NewItem('Diar~y~ (Today)', 		'', kbNone, cmStartDiary, 				hcDiary,
{			NewItem('Diary (~W~eek)', 		'', kbNone, cmStartWeekDiary, 				hcDiary,{}
			{$IFDEF Kusers}
			NewItem('~M~y Diary', '', kbNone, cmStartUserDiary, 		hcYourStaffDiary,
			{$ENDIF}
			NewItem('S~t~aff Diary', 			'', kbNone, cmStartStaffDiary, 		hcStaffDiary,
			NewLine(
		nil)){$IFDEF kusers}){$ENDIF}));

		AddItemSubMenu(AppMenu, mnTools,
			NewItem('Diar~y~ AutoActions',	'', kbNone, cmStartDiaryRepeater, hcAutoActions,
			NewLine(
		nil)));
	{$ENDIF}


	{==================== DIRECTORY/KORE ==================}
	{$IFDEF kdirctry}
		AddItemSubMenu(AppMenu, mnFile, NewItem('Full ~D~irectory',   '', kbNone, cmStartDirectoryList, hcDirectory, nil));

		AddItemSubMenu(AppMenu, mnFile, OftenDirItem[1]); {set in kdirctry init}
		AddItemSubMenu(AppMenu, mnFile, OftenDirItem[2]);
		AddItemSubMenu(AppMenu, mnFile, OftenDirItem[3]);

		AddItemSubMenu(AppMenu, mnFile,	NewItem('Select',   '', kbNone, cmMakeSpecialDirList, hcSelectDirectory, nil));

		AddItemSubMenu(AppMenu, mnFile, DirCategoryMenu); {set in kdirctry init}

		AddItemSubMenu(AppMenu, mnFile, NewLine(nil));

		AddItemSubMenu(AppMenu, mnSearch,
			NewItem('~D~irectory Entry','',kbNone, cmFindDirectory, hcFindDirectory,
			NewLine(
		nil)));

		AddItemSubMenu(AppMenu, mnReports,
			NewItem('~G~eneral Analysis', 	'', kbNone, cmGeneralAnalysis, hcGeneralAnalysis,
			NewItem('~D~irectory Report', '', kbNone, cmDirectoryReport, hcDirectoryReport,
			NewLine(
			NewItem('Deferred L~a~bels', 					'', kbNone, cmDeferredLabels, hcPrintDeferredLabels,
		nil)))));

		AddItemSubMenu(AppMenu, mnTrays,
			NewItem('~L~etters Out', '', kbNone, cmStartLettersOutTray, hcLettersOutTray,
		nil));

		AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,
			NewLine(
			NewItem('~D~irectory', '', kbNone, cmEditDirectorySetup, hcEditDirectorySetup,
		nil)));{}

		{$IFDEF kusers}
			AddItemSubMenu(AppMenu, mnOptions,
				NewItem('~U~sers',   '', kbNone, cmNewUserList, hcUserList,
				NewLine(
			nil)));
		{$ENDIF}

	{$ENDIF}


	{===================== PRODUCTS =======================}
	{$IFDEF kforsale}
		AddItemSubMenu(AppMenu, mnFile,
			NewItem('For ~S~ale List',        '', 	kbNone, cmStartForSaleList, 	hcForSale,
			NewItem('Goods by ~R~ef Number',   '', 	kbNone, cmStartGoodsCodeList, hcForSaleByRef,
			NewLine(
		nil))));
	{$ENDIF}


	{==================== OPTIONS =========================}
	{$IFDEF KOptions}
		{--- "Find" ----}
		AddItemSubMenu(AppMenu, mnSearch,
			NewItem('~S~tudent','',kbNone, cmFindStudent, hcNoContext,
			NewLine(
		nil)));

		AddItemSubMenu(AppMenu, mnOptions,
			NewItem('~A~ction Codes', '', kbNone, cmMaintainActionCodes, hcNoContext,
			NewLine(
		nil)));
	{$ENDIF}

	{==================== RONGAI =========================}
{$IFDEF kRongai}
	AddItemSubMenu(AppMenu, mnFile,
		NewItem('~P~arts',    '', 		kbNone, cmStartPartCatgyList, hcNoContext,
		NEwItem('Part ~N~umbers', '', kbNone, cmStartPartNumList, 	hcNoContext,
		NewLine(
		NewItem('~V~ehicles', '', kbNone, cmStartVehicleList, hcNoContext,
		NewItem('S~h~ips', 		'', kbNone, cmStartShipList, 		hcNoContext,
		NewLine(
		NewItem('C~o~ntainer Stock', 	'', kbNone, cmStartRongaiContainerList, hcNoContext,
		NewItem('All Containers', 		'', kbNone, cmStartContainerList, 			hcNoContext,
		NewLine(
	nil))))))))));

	{--- "Find" ----}
	AddItemSubMenu(AppMenu, mnSearch,
		NewItem('D~e~livery Order','',kbNone, cmFindDelivery, hcNoContext,
		NewItem('~P~art','',kbNone, cmFindPart, hcNoContext,
	nil)));
{$ENDIF}


	{==================== LIVESTOCK =========================}
{$IFDEF klivestk}
	AddItemSubMenu(AppMenu, mnFile,
		NewItem('~H~erd',       '', kbNone, cmNewHerdList, 			hcNoContext,
		NewItem('~L~ivestock',  '', kbNone, cmNewLivestockList, hcNoContext,
		NewItem('~D~ead stock', '', kbNone, cmNewDeadstockList, hcNoContext,
		NewItem('F~u~ll stock', '', kbNone, cmNewFullstockList, hcNoContext,
		NewLine(
	nil))))));
{$ENDIF}


	{==================== RALLY =========================}
{$IFDEF krally}
	AddItemSubMenu(AppMenu, mnReports,
		NewItem('Time S~h~eet', 		'', kbNone, cmDoLegBullshitSheet, hcNoContext,
		NewItem('~S~ection Times', 	'', kbNone, cmPrintSectionTimes, 	hcNoContext,
{		NewItem('~O~verall Section Times', '', kbNone, cmPrintOverallSectionTimes, hcNoContext,
{		NewItem('~C~ETS List', '', kbNone, cmPrintCETSList, hcNoContext,
		NewItem('~S~tart List', '', kbNone, cmPrintCETSList, hcNoContext,{}
	nil)));

	{$IFNDEF RallyPress}
		AddItemSubMenu(AppMenu, mnFile,
			NewItem('~A~udit View', '', kbNone, cmRallyAuditLists, hcNoContext,
			NewItem('Set~u~p View', '', kbNone, cmRallySetupLists, hcNoContext,
			NewItem('~P~ress View', '', kbNone, cmRallyPressLists, hcNoContext,
			NewLine(
			NewItem('~L~egs', 		'', kbNone, cmNewLegList, hcNoContext,
			NewItem('C~o~ntrols', '', kbNone, cmNewControlList, hcNoContext,
			NewItem('~R~oute',		'',kbNone, cmNewRouteList, hcNoContext,
			NewItem('~C~ars', 		'', kbNone, cmNewCarNumberList, hcNoContext,
			NewItem('Race Pos List', 		'', kbNone, cmNewCarRacePosList, hcNoContext,
			NewItem('~S~tart List', '', kbNone, cmNewStartList, hcNoContext,
			NewLine(
			NewItem('~G~eog Pos Picture', '', kbNone, cmGeogPos, hcNoContext,
			NewItem('Co~m~p Pos Picture', '', kbNone, cmCompPos, hcNoContext,
		nil))))))))))))));
	AddItemSubMenu(AppMenu, mnReports,
		NewItem('Final Results', '', kbNone, cmPrintFinalResults, hcNoContext,
	nil));
	{$ELSE}
		AddItemSubMenu(AppMenu, mnFile,
			NewItem('~P~ress View', '', kbNone, cmRallyPressLists, hcNoContext,
			NewLine(
			NewItem('~S~tart List', '', kbNone, cmNewStartList, hcNoContext,
		nil))));
	{$ENDIF}

	{$IFDEF KRally}
		AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,
			NewItem('~R~ally', '', kbNone, cmEditRallySetup, hcNoContext,
		nil));

		AddItemSubMenu(AppMenu, mnTools,
			NewSubMenu('~R~ally', kbNone, hcNoContext,
				NewMenu(
					NewItem('Make Start List', '', kbNone, cmMakeStartList, hcNoContext,
					NewItem('Recreate Route', '', kbNone, cmMakeRoute, hcNoContext,
				nil))),
			nil)
		);
	{$ENDIF}

{$ENDIF}

	{=================== BOOKS ==================================}
{$IFDEF kBooks}
	AddItemSubMenu(AppMenu, mnFile,
		NewSubMenu('~B~ooks', kbNone, hcNoContext,
			NewMenu(
				NewItem('Enter ~E~xpenses', '', 		kbNone, cmNewTransaction, hcEnterExpenses,
				NewLine(
				NewItem('~N~ominal Report', '', 		kbNone, cmNominalReport, 	hcNominalRpt,
				NewItem('~T~rial Balance', '', 			kbNone, cmTrialBalance, 	hcTrialBalance,
				NewLine(
				NewItem('End of Year', '', 					kbNone, cmEndOfYear, 			hcEndOfYear,
				NewItem('End of Period','', 				kbNone, cmEndOfPeriod, 		hcEndOfPeriod,
			nil)))))))),
		nil)
	);

	AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,
		NewItem('~B~ooks', '', kbNone, cmAccountsSetup, hcEditAccountsSetup,
		NewLine(
	nil)));{}
{$ENDIF}


	{======================= INVOICING =============================}

{$IFDEF kQInv}
	AddItemSubMenu(AppMenu, mnSearch,
		NewItem('~Q~uick Invoice','',kbNone, cmFindQuickInvoicebyID, hcFindInvoiceByID,
	nil));
{$ENDIF}

{$IFDEF kinvoice}
	AddItemSubMenu(AppMenu, mnSearch,
		NewItem('~I~nvoice','',kbNone, cmFindInvoicebyID, hcFindInvoiceByID,
	nil));

	AddItemSubMenu(AppMenu, mnTrays,
		NewItem('~I~nvoices Out', '', kbNone, cmStartInvoicesOutTray, hcInvoiceOutTray,
	nil));

	AddItemSubSubMenu(AppMenu, mnReports, '~I~nvoices',
		NewItem('Un~p~aid Accounts Report', '', kbNone, cmAllUnpaidInvoices, hcNoContext,
		NewItem('~O~verdue Accounts Report','', kbNone, cmOverdueUnpaidInvoices, hcNoContext,
		NewItem('Invoices ~W~aiting to go', '', kbNone, cmUnsentInvoices, hcNoContext,
		NewItem('Send Overdue ~L~etters', 				'', kbNone, cmOverdueLtrs, hcNoContext,
		NewItem('~S~tatements',							'', kbNone, cmPrintAllStatements, hcNoContext,
		NewLine(
		NewItem('~A~nalyse', '', kbNone, cmInvoiceAnalysis, hcNoContext,
	nil))))))));

	AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,
		NewLine(
		NewItem('~I~nvoices', '', kbNone, cmEditInvoiceSetup, hcEditInvoiceSetup,
	nil)));{}
{$ENDIF}


{$IFDEF kjob}
	AddItemSubMenu(AppMenu, mnSearch,
		NewItem('~J~ob','',kbNone, cmFindJobbyID, hcFindJobByID,
	nil));
{$ENDIF}

{$IFDEF kmemship}
	AddItemSubMenu(AppMenu, mnReports,
			NewItem('Overdue ~M~embers', '', kbNone, cmOverdueMembers, hcNoContext,
			NewLine(
	nil)));
{$ENDIF}


{$IFDEF ksbs}
	AddItemSubMenu(AppMenu, mnTools,
		NewItem('P~a~ssword Release',  '', kbNone, cmPasswordRelease, hcSBSPasswordRelease,
		NewLine(
	nil)));{}
{$ENDIF}

{$IFDEF kcompsup}
	AddItemSubMenu(AppMenu, mnReports,
		NewSubMenu('~C~omputer Support', kbNone, hcNoContext,
			NewMenu(
				NewItem('Expiring Warranties', '', 	kbNone, cmWarrantyReport, hcNoContext,
			nil)),
		nil)
	);
{$ENDIF}


{$IFDEF kwplink}
	AddItemSubSubMenu(AppMenu, mnOptions, mnSetup,{}
		NewLine(
		NewItem('~W~ordPerfect', '', 	kbNone, cmEditWPSetup, 	hcEditWPSetup,
	nil)));

	AddItemSubMenu(AppMenu, mnTools,
		NewItem('~I~nitialise WP Printer',  '', kbNone, cmInitWPPrinter, 			hcInitWPPrinter,
		NewItem('Reprint Last WP',  '', 				kbNone, cmPrintLastWPReport, 	hcPrintLastWPReport,
	nil)));
{$ENDIF}

	{$IFDEF Knewsfl}
		AddItemSubMenu(AppMenu, mnTools,	NewItem('Show ~N~ews Flash',   '', kbNone, cmShowNewsFlash, hcNoContext, nil));
	{$ENDIF}


	{===== DESKTOP/WINDOWS ======}
	{$IFNDEF Monitor}
	AddItemSubMenu(AppMenu, mnWindow,
		NewItem('~T~ile',   '',kbNone, cmTile, hcTile,
		NewItem('C~a~scade','',kbNone, cmCascade, hcCascade,
		NewItem('C~l~ose all', '', kbNone, cmCloseAll, hcCloseAll,
		NewLine(
		NewItem('~R~esize Window', ksResize, kbResize, cmResize, hcReSize,
		NewItem('~Z~oom Window', ksZoom, kbZoom,      cmZoom, hcZoom,
		NewItem('~N~ext Window', ksNextWin, kbNextWin, cmNext, hcNext,
		NewItem('~P~revious Window', ksPrevWin, kbPrevWin, cmPrev, hcPrev,
		NewItem('Close Window', ksClose, kbClose, cmClose, hcClose,
		NewLine(
	nil)))))))))));
	{$ENDIF}

	{====== EXIT ======}
{	AddItemEnd(AppMenu,
		NewItem('E~x~it', '', kbAltX, cmQuit, hcNoContext,
	nil)); {added in tuiapp, jic this unit isnt' included...!}

	AddItemSubMenu(AppMenu, mnFile,
		NewItem('E~x~it', 'Alt-X', kbAltX, cmQuit, hcNoContext,
	nil));


{$IFDEF fixit}
	{=== FIXIT STUFF ====}
	AddItemEnd(AppMenu,
		NewSubMenu('F~i~xit', kbNone, hcNoContext,
			NewMenu(
				NewItem('~R~eindex jimmys from index', '', kbNone, cmReIndexFile, hcNoContext,
				NewItem('~R~eindex srtype', '', kbNone, cmReIndexsrType, hcNoContext,
				NewItem('~U~pdate jimmys','', kbNone, cmUpdateJimmys, hcNoContext,
				NewItem('~U~pdate jimmys from index','', kbNone, cmUpdateFromIndex, hcNoContext,
				NewItem('Reindex Jimmys', '', kbNone, cmReIndexJimmys, hcNoContext,
				NewItem('~S~ort Index',   '', kbNone, cmSortIndex, hcNoContext,
				NewLine(
				NewSubMenu('~I~D Index Stuff', kbNone, hcNoContext,
					NewMenu(
						NewItem('Make Job ID Index', '', kbNone, cmMakeJobIDIndex, hcNoContext,
						NewItem('List Job ID Index', '', kbNone, cmListJobIDIndex, hcNoCOntext,
						NewItem('Trim Job ID Index', '', kbNone, cmTrimJobIDIndex, hcNoCOntext,
					nil)))),
				NewLine(
				NewItem('Edit ~J~immy',   '', kbNone, cmEditJimmy, hcNoContext,
				NewItem('Edit ~L~etter Item',   '', kbNone, cmEditLetterItem, hcNoContext,
				NewItem('Edit Index Item',   '', kbNone, cmEditIndexItem, hcNoContext,
				NewItem('Edit Hook',   '', kbNone, cmEditHook, hcNoContext,
				NewItem('Edit Table',   '', kbNone, cmEditTable, hcNoContext,

				NewLine(
				NewItem('~C~heck Database',   '', kbNone, cmCheckDBase, hcNoContext,
				NewLine(
				NewItem('Reconstruct!',   '', kbNone, cmReconstructAll, hcNoContext,
			nil))))))))))))))))))),
		nil)
	);
{$ENDIF}


	{$IFNDEF Windows}TidyUp(AppMenu); {$ENDIF}
end;

begin
	{$IFDEF fixit} write('Startup2...'); {$ENDIF}
	MakeKameleonMenu;
	{$IFDEF fixit} writeln('..done'); {$ENDIF}
end.
