# FTE default menus

menu MOpenInMode {
    item "&Plain"      { FileOpenInMode 'PLAIN' }
    item "&Text"       { FileOpenInMode 'TEXT' }
    item "&C"	       { FileOpenInMode 'C' }
    item "&EMail"      { FileOpenInMode 'MSG' }
    item "&HTML"       { FileOpenInMode 'HTML' }
    item "&IPF"        { FileOpenInMode 'IPF' }
    item "&Ada"        { FileOpenInMode 'Ada' }
    item "&REXX"       { FileOpenInMode 'REXX' }
    item "MA&KE"       { FileOpenInMode 'MAKE' }
    item "&FTE"        { FileOpenInMode 'FTE' }
    item "&Win Resource" { FileOpenInMode 'RESOURCE' }
    item "&DIFF"       { FileOpenInMode 'DIFF' }
    item "&MERGE"      { FileOpenInMode 'MERGE' }
    item "&SH"	       { FileOpenInMode 'SH' }
    item "PER&L"       { FileOpenInMode 'PERL' }
    item "PASCAL"      { FileOpenInMode 'PASCAL' }
    item "&JAVA"       { FileOpenInMode 'JAVA' }
    item "TE&X"        { FileOpenInMode 'TEX' }
    item "&BIN"        { FileOpenInMode 'BIN' }
    item "4&GL"        { FileOpenInMode 'GL' }
    item "PHP"	       { FileOpenInMode 'PHP' }
    item "P&ython"     { FileOpenInMode 'PYTHON' }
    item "reST"        { FileOpenInMode 'reST' }
}

menu MChangeMode {
    item "&Plain"      { ChangeMode 'PLAIN' }
    item "&Text"       { ChangeMode 'TEXT' }
    item "&C"	       { ChangeMode 'C' }
    item "&EMail"      { ChangeMode 'MSG' }
    item "&HTML"       { ChangeMode 'HTML' }
    item "&IPF"        { ChangeMode 'IPF' }
    item "&Ada"        { ChangeMode 'Ada' }
    item "&REXX"       { ChangeMode 'REXX' }
    item "MA&KE"        { ChangeMode 'MAKE' }
    item "&FTE"        { ChangeMode 'FTE' }
    item "&Win Resource" { ChangeMode 'RESOURCE' }
    item "&DIFF"       { ChangeMode 'DIFF' }
    item "&MERGE"      { ChangeMode 'MERGE' }
    item "&SH"	       { ChangeMode 'SH' }
    item "PER&L"       { ChangeMode 'PERL' }
    item "PASCAL"      { ChangeMode 'PASCAL' }
    item "&JAVA"       { ChangeMode 'JAVA' }
    item "TE&X"        { ChangeMode 'TEX' }
    item "&BIN"        { ChangeMode 'BIN' }
    item "4&GL"        { ChangeMode 'GL' }
    item "PHP"	       { ChangeMode 'PHP' }
    item "P&ython"     { ChangeMode 'PYTHON' }
    item "reST"        { ChangeMode 'reST' }
}

menu MOpenInModeMore {
    item "ASM"			{ FileOpenInMode 'ASM' }
    item "ASM 370 (.CPY,.MLC)"	{ FileOpenInMode 'ASM370' }
    item "TCL"			{ FileOpenInMode 'TCL' }
    item "Fortran 90"		{ FileOpenInMode 'FORTRAN' }
    item "IPF"			{ FileOpenInMode 'IPF' }
    item "A51"			{ FileOpenInMode 'A51' }
    item "CLARION (.CLW)"	{ FileOpenInMode 'CLARION' }
    item "EBFN"			{ FileOpenInMode 'EBFN' }
    item "SGML"			{ FileOpenInMode 'SGML' }
    item "SIOD (.cscm)"		{ FileOpenInMode 'SIOD' }
    item "S&Lang"		{ FileOpenInMode 'sl' }
    item "Module 3"		{ FileOpenInMode 'MODULA3' }
    item "Tex Info"		{ FileOpenInMode 'TEXINFO' }
    item "Diff"			{ FileOpenInMode 'DIFF' }
    item "Merge"		{ FileOpenInMode 'MERGE' }
    item "Man pages"		{ FileOpenInMode 'CATBS' }
}

menu MChangeModeMore {
    item "ASM"			{ ChangeMode 'ASM' }
    item "ASM 370 (.CPY,.MLC)"	{ ChangeMode 'ASM370' }
    item "TCL"			{ ChangeMode 'TCL' }
    item "Fortran 90"		{ ChangeMode 'FORTRAN' }
    item "IPF"			{ ChangeMode 'IPF' }
    item "A51"			{ ChangeMode 'A51' }
    item "CLARION (.CLW)"	{ ChangeMode 'CLARION' }
    item "EBFN"			{ ChangeMode 'EBFN' }
    item "SGML"        		{ ChangeMode 'SGML' }
    item "SIOD (.cscm)"		{ ChangeMode 'SIOD' }
    item "S&Lang"		{ ChangeMode 'sl' }
    item "Module 3"		{ ChangeMode 'MODULA3' }
    item "Tex Info"		{ ChangeMode 'TEXINFO' }
    item "Diff"			{ ChangeMode 'DIFF' }
    item "Merge"		{ ChangeMode 'MERGE' }
    item "Man pages"		{ ChangeMode 'CATBS' }
}

menu Object {
    item    "&Open...\tF3"		{ FileOpen }
    submenu "Open in &Mode...\tCtrl+F3", MOpenInMode;
    submenu "Open in Mode more..",	MOpenInModeMore;
    item    "Open &Binary"		{ FileOpenInMode 'BIN' }
    item;
    item    "Open &Directory\tC+M" { DirOpen }
    item;
    item    "&Next\tAlt+Right"	      { FileNext }
    item    "&Previous\tAlt+Left"     { FilePrev }
    item;
    item    "&Close\tAlt+Q"	      { FileClose }
    item;
    item    "E&xit\tAlt+X"	      { ExitEditor }
}

menu MCvs {
    item "CVS C&heck"  { RunCvs "-n update" }
    item "CVS &Update" { RunCvs "update -d" }
    item "CVS &Diff"   { CvsDiff "" }
    item "CVS &Commit" { RunCvsCommit "" }
    item "CVS &Add"    { RunCvs "add" }
    item "CVS &Remove" { RunCvs "remove" }
    item "CVS S&tatus" { RunCvs "status -v" }
    item "CV&S"        { Cvs }
    item;
    item "&View CVS"	  { ViewCvs }
    item "View CVS Di&ff" { ViewCvsDiff }
    item "View CVS &log"  { ViewCvsLog }
    item;
    item "Cl&ear CVS messages" { ClearCvsMessages }
}

menu MSvn {
    item "SVN S&tatus" { RunSvn "status" }
    item "SVN &Update" { RunSvn "update" }
    item "SVN &Diff"   { SvnDiff "" }
    item "SVN &Commit" { RunSvnCommit "" }
    item "SVN &Add"    { RunSvn "add" }
    item "SVN &Remove" { RunSvn "remove" }
    item "SVN Lo&g"    { RunSvn "log" }
    item "SV&N"        { Svn }
    item;
    item "&View SVN"	  { ViewSvn }
    item "View SVN Di&ff" { ViewSvnDiff }
    item "View SVN &log"  { ViewSvnLog }
    item;
    item "Cl&ear SVN messages" { ClearSvnMessages }
}

menu Tools {
    item "&Compile...\tF9" { Compile "make -k " }
    item "&Grep..." { Compile "grep -n " }
    item "&Find and grep..." { Compile "find . -iregex \".*\\.\\(c\\|h\\|cpp\\)\" -exec grep -Hn SEARCH {} \\;" }
    item "Save and &ISpell" { FileSave; RunProgram "ispell " . $FilePath; FileReload }
    item;
    item "&Shell\tAlt+F9" { RunProgram "" }
    item "&Run...\tCtrl+F9" { RunProgram }
    item;
    item "&Previous error\tF11" { CompilePrevError }
    item "&Next error\tF12" { CompileNextError }
    item;
    item "&Messages\tS+F9" { ViewMessages }
    item "C&lear Messages" { ClearMessages }
    item;
    submenu "C&VS\tC+O_C+V", MCvs;
    submenu "SVN\tC+O_C+N", MSvn;
}

menu Window {
    item "New &Frame" { FrameNew }
    item;
    item "Split &Horizontal\tCtrl+F4" { WinHSplit }
    item "&Close view\tShift+Ctrl+F4" { WinClose }
    item "Close &other views\tF5" { WinZoom }
    item "&Next view\tF4" { WinNext }
    item "&Prev view\tShift+F4" { WinPrev }
    item;
    item "Sa&ve Desktop" { DesktopSave }
    item "Save Desktop &As" { DesktopSaveAs }
    item;
    item "&Routines\tCtrl+I" { ListRoutines }
    item "&Buffers\tAlt+0" { ViewBuffers }
    item "&Directory\tC+M" { DirOpen }
}

menu Help {
    item "&Keyboard\tF1" { ViewModeMap }
    item "&Show key" { ShowKey }
    item;
    item "&About..." { ShowVersion }
}

menu Navigate {
    item    "&Reload\tCtrl+R"	      { Rescan }
    item;
    item "Go &< level\tCtrl+PgUp"     { DirGoUp }
    item "Go &> level\tCtrl+PgDn"     { DirGoDown }
    item "Go to &\\\tCtrl+\\"	      { DirGoRoot }
    item "&/ Goto Dir\t/"	      { DirGoto }
    item "&Delete File\tCtrl+D"       { DeleteFile }
#    item;
#    item '&C:\\' { DirGoto 'H:\\' }
}


menu File {
    item    "&Open...\tF3"		{ FileOpen }
    submenu "Open in &Mode...\tCtrl+F3", MOpenInMode;
    submenu "Open in more",		MOpenInModeMore;
    item    "Open &Binary..."		{ FileOpenInMode 'BIN' }
    item    "Open &Directory\tC+M"	{ DirOpen }
    item    "&Reload\tShift+F3" 	{ FileReload }
    item;
    item    "&Save\tF2" 		{ FileSave }
    item    "Save &As...\tShift+F2"	{ FileSaveAs }
    item    "Save Al&l\tCtrl+F2"	{ FileSaveAll }
    item    "Write &To..."		{ FileWriteTo }
    item;
    item    "Prin&t"			{ FilePrint }
    item;
    item    "&Next\tAlt+Right"		{ FileNext }
    item    "&Previous\tAlt+Left"	{ FilePrev }
    item;
    item    "&Close\tAlt+Q"		{ FileClose }
    item;
    item    "E&xit\tAlt+X"		{ ExitEditor }
}

menu Line {
    item "&Insert line\tShift+Enter"	{ LineInsert }
    item "&Add line\tAlt+Enter" 	{ LineAdd }
    item "&Split line\tCtrl+Enter"	{ LineSplit }
    item "&Join line\tCtrl+J"		{ LineJoin }
    item "Dup&licate line\tCtrl+D"	{ LineDuplicate }
    item "&Delete line\tCtrl+Y" 	{ KillLine }
    item "&Center line" 		 { LineCenter }
    item;
    item "Delete to line &end\tAlt+End" { KillToLineEnd }
    item "Delete to li&ne start\tCtrl+Sh+BackSp" { KillToLineStart }
    item;
    item "Comment\tCtrl+Alt+C" {
	MoveLineStart; ?FindReplace /^(\s*)/ /\/\/  \1/ "xnc"; MoveDown
    }
    item "Uncomment\tCtrl+Alt+U" {
	MoveLineStart; ?FindReplace /^[\/][\/]	/ // "xnc"; MoveDown
    }
    item;
    item "&Uppercase"	      { LineCaseUp }
    item "&Lowercase"	      { LineCaseDown }
    item "&Togglecase"	      { LineCaseToggle }
    item "&Rot13"	      { LineTrans 'A-Za-z' 'N-ZA-Mn-za-m' }
    item;
    item "User &specified..." { LineTrans }
}

menu Edit {
    item "&Undo\tAlt+BackSp" { Undo }
    item "&Redo\tAlt+Shift+BackSp" { Redo }
    item;
    item "Cu&t\tShift+Del" { BlockCut }
    item "&Copy\tCtrl+Ins" { BlockCopy }
    item "Cut&-Append" { BlockCutAppend }
    item "Copy-Appe&nd" { BlockCopyAppend }
    item "&Paste Stream\tShift+Ins" { BlockPasteStream }
    item "Paste Colu&mn\tAlt+Ins"   { BlockPasteColumn }
    item "Paste Li&ne"		    { BlockPasteLine }
    item "Cl&ear\tCtrl+Del" { BlockKill }
    item;
    submenu "&Line", Line;
    item;
    item "&Quote Literal...\tCtrl+Q" { InsertChar }
    item "&ASCII Table...\tCtrl+Sh+A" { ASCIITable }
}

menu Translate {
    item "&Uppercase"	      { BlockCaseUp }
    item "&Lowercase"	      { BlockCaseDown }
    item "&Togglecase"	      { BlockCaseToggle }
    item "&Rot13"	      { BlockTrans 'A-Za-z' 'N-ZA-Mn-za-m' }
    item;
    item "User &specified..." { BlockTrans }
}

menu Block {
    item "&Unmark\tEsc" 	 { BlockUnmark }
    item "Mark &Stream\tAlt+A"	 { BlockMarkStream }
    item "Mark &Column\tAlt+K"	 { BlockMarkColumn }
    item "Mark &Line\tAlt+L"	 { BlockMarkLine }
    item;
#    item "Select Wor&d"   { BlockSelectWord }
#    item "Selec&t Line"   { BlockSelectLine }
#    item;
    item "&Write..."		 { BlockWrite }
    item "&Read Stream..."	 { BlockReadStream }
    item "Re&ad Column..."	 { BlockReadColumn }
    item "Rea&d Line..."	 { BlockReadLine }
    item "&Print"		 { BlockPrint }
    item;
    submenu "Translat&e",	 Translate;
    item "&Indent\tAlt+I"	 { BlockIndent }
    item "U&nindent\tAlt+U"	 { BlockUnindent }
    item "E&xpand Tabs" 	 { BlockUnTab }
    item "&Generate Tabs"	 { BlockEnTab }
    item "Sor&t"		 { BlockSort }
    item "Sort Re&verse"	 { BlockSortReverse }
}

menu Tags {
    item "&Find word\tCtrl+]"	       { TagFindWord }
    item "&Search tag...\tCtrl+Sh+]"   { TagFind }
    item "&Go back\tCtrl+["	       { TagPop }
    item "&Next tag\tAlt+]"	       { TagNext }
    item "&Previous tag\tAlt+["        { TagPrev }
    item;
    item "&Load tags..."	       { TagLoad }
    item "&Clear tags"		       { TagClear }
}

menu SearchWords {
    item "Search &Prev\tAlt+," { SearchWordPrev }
    item "Search &Next\tAlt+." { SearchWordNext }
    item "&Highlight\tAlt+/" { HilitWord }
}

menu Search {
    item "&Find...\tCtrl+F" { Find }
    item "Find &Next\tCtrl+G" { FindRepeat }
    item "Find &Prev\tCtrl+H" { FindRepeatReverse }
    item "Find and &Replace...\tCtrl+R" { FindReplace }
    item;
    item "P&lace Bookmark..." { PlaceBookmark }
    item "Goto &Bookmark..." { GotoBookmark }
    item;
    submenu "&Tags", Tags;
    item "&Match Paren\tAlt+-" { MatchBracket }
    item "&Goto Line...\tAlt+J" { MoveToLine }
    item "Goto &Column..." { MoveToColumn }
    submenu "&Words", SearchWords;
}

menu Fold {
    item "&Open fold\tCtrl+Gr+" { FoldOpen }
    item "Open &nested folds\tCtrl+Gr*" { FoldOpenNested }
    item "Open &all folds\tAlt+Gr*" { FoldOpenAll }
    item;
    item "C&lose fold\tCtrl+Gr-" { FoldClose }
    #item "Close &nested folds\tCtrl+Gray+/" { FoldCloseNested }
    item "Close all &folds\tAlt+Gr/" { FoldCloseAll }
    item;
    item "&Create fold\tAlt+Gr+" { FoldCreate }
    item "Create folds by &regexp..." { FoldCreateByRegexp }
    item "Create folds at routine&s" { FoldCreateAtRoutines }
    item;
    item "&Destroy fold\tAlt+Gr-" { FoldDestroy }
    item "Destro&y all folds" { FoldDestroyAll }
    item;
    item "&Promote\tSh+Gr-" { FoldPromote }
    item "De&mote\tSh+Gr+" { FoldDemote }
    item;
    item "&Toggle\tCtrl+Gr/" { FoldToggleOpenClose }
}

eventmap PLAIN: MODEL {
    key     [A+\`]	{ CharCaseToggle ; MoveRight }
}

menu Toggle {
    item "Charac&ter case\tA+`"		{ CharCaseToggle }
    item "&Auto indent\tC+O C+A"	{ ToggleAutoIndent }
    item "&Case sensitive\tC+O C+C"	{ ToggleMatchCase }
    item "Trim &EOL spaces\tC+O C+E"	{ ToggleTrim }
    item "&Undo/Redo\tC+O C+U"		{ ToggleUndo }
    item "&Read only\tC+O C+R"		{ ToggleReadOnly }
    item "&Keep backups"		{ ToggleKeepBackups }
    item "&Make backups"		{ ToggleMakeBackups }
    item "&Backspace Unindents"		{ ToggleBackSpUnindents }
    item;
    item "I&ndent with tabs\tC+O Space"	{ ToggleIndentWithTabs }
    item "S&pace tabs"			{ ToggleSpaceTabs }
    item "Backspace k&ill tab\tC+O BackSp" { ToggleBackSpKillTab }
    item "&Delete kill tab\tC+O G+Del"  { ToggleDeleteKillTab }
}
menu Options {
    submenu "Change &mode\tC+O C+M",  MChangeMode;
    submenu "Change mode more",	      MChangeModeMore;
    submenu "Change C in&dent style", MChangeCIndentStyle;
    item;
    submenu "&Toggle", Toggle;
    item "&Insert mode\tC+O C+I"	{ ToggleInsert }
    item "&Word wrap\tC+O C+W"		{ ToggleWordWrap }
    item;
    item "&Left margin...\tC+O A+["	{ ChangeLeftMargin }
    item "Ri&ght margin...\tC+O A+]"	{ ChangeRightMargin }
    item;
    item "&Show markers\tC+O C+."	{ ToggleShowMarkers; WinRefresh }
    item "Highlight tags"		{ ToggleHilitTags; WinRefresh }
    item "Show &bookmarks"		{ ToggleShowBookmarks; WinRefresh }
    item "S&how tabs\tC+O Tab"		{ ToggleShowTabs; WinRefresh }
    item "&Tab size...\tC+O C+T"	{ ChangeTabSize; WinRefresh }
    item "E&xpand tabs\tC+O C+Tab"	{ ToggleExpandTabs; WinRefresh }
    item "&Insert tabulator\tS+Tab"	{ InsertTab }
    item "File Trim &EOL"		{ FileTrim; WinRefresh }
    item "I&ndent block\tAlt+\\"	{ BlockReIndent; FileTrim; WinRefresh }
    item "&Print to..."			{ SetPrintDevice }
    item;
    item "Rec&ompile Configuration" { ConfigRecompile }
}

menu Main {
    submenu "&File",	File;
    submenu "&Edit",	Edit;
    submenu "&Block",	Block;
    submenu "&Search",	Search;
    submenu "Fol&d",	Fold;
    submenu "&Tools",	Tools;
    submenu "&Window",	Window;
    submenu "&Options", Options;
    submenu "&Help",	Help;
}

menu Local {
    item "&Unmark\tEsc"   { BlockUnmark }
    item "Cu&t\tShift+Del" { BlockCut }
    item "&Copy\tCtrl+Ins" { BlockCopy }
    item "&Paste\tShift+Ins" { BlockPasteStream }
    item "P&aste Column\tAlt+Ins" { BlockPasteColumn }
    item;
    item "Delete &line\tCtrl+Y"   { KillLine }
    item "Delete to &EOL\tAlt+End" { KillToLineEnd }
    item;
    item "I&ndent block\tAlt+\\"   { BlockReIndent; FileTrim; WinRefresh }
    item;
    item "&Save\tF2"	{ FileSave }
    item "Cl&ose\tAlt+Q" { FileClose }
}

menu DirectoryFile {
    item    "&Selected\tEnter" { Activate }
    item;
    item    "&Open...\tF3"		{ FileOpen }
    submenu "Open in &Mode...\tCtrl+F3", MOpenInMode;
    item    "Open &Binary"		{ FileOpenInMode 'BIN' }
    item;
    item    "&Next\tAlt+Right"	      { FileNext }
    item    "&Previous\tAlt+Left"     { FilePrev }
    item;
    item    "&Close\tAlt+Q"	      { FileClose }
    item;
    item    "E&xit\tAlt+X"	      { ExitEditor }
}

menu DirectoryMain {
    submenu "&File", DirectoryFile;
    submenu "&Navigate", Navigate;
    submenu "&Tools", Tools;
    submenu "&Window",	Window;
    submenu "&Help",	Help;
}

menu MessagesMain {
    submenu "&File", Object;
    submenu "&Tools", Tools;
    submenu "&Window", Window;
    submenu "&Help",	Help;
}

menu RoutinesMain {
    submenu "&File", Object;
    submenu "&Tools", Tools;
    submenu "&Window", Window;
    submenu "&Help",	Help;
}

menu BufferListMain {
    submenu "&File", Object;
    submenu "&Tools", Tools;
    submenu "&Window", Window;
    submenu "&Help",	Help;
}

menu EventMapViewMain {
    submenu "&File", Object;
    submenu "&Tools", Tools;
    submenu "&Window", Window;
    submenu "&Help", Help;
}

menu DirectoryLocal {
    item "&Open" { Activate }
    item;
    item "&Reload\tCtrl+R"	   { Rescan }
    item;
    item "Go &< level\tCtrl+PgUp"     { DirGoUp }
    item "Go &> level\tCtrl+PgDn"     { DirGoDown }
    item "Go to &\\\tCtrl+\\"	      { DirGoRoot }
    item "&/ Goto Dir\t/"	      { DirGoto }
    item "&Delete File\tCtrl+D"       { DeleteFile }
}

menu BufferListLocal {
    item "&View\tEnter" { Activate }
    item;
    item "&Save\tCtrl+S" { BufListFileSave }
    item "&Close\tCtrl+C" { BufListFileClose }
}

menu RoutinesLocal {
    item "&View\tEnter" { Activate }
}

menu EventMapViewLocal {
    item "&Close view\tAlt+Q" { FileClose }
}

menu MessagesLocal {
    item "&View error\tEnter" { Activate }
    item;
    item "&Previous error\tF11" { CompilePrevError }
    item "&Next error\tF12" { CompileNextError }
}
