# minimal menu file for testing menu patches

ha:rnd-menu-v1 {
	li:mouse {
		li:left {
			li:press            = { Tool(Press) }
			li:press-shift      = { Tool(Press) }
			li:press-ctrl       = { Tool(Save); Tool(arrow); Tool(Restore); Tool(Press) }
			li:release          = { Tool(Release) }
			li:release-shift    = { Tool(Release) }
			li:release-ctrl     = { Tool(Release) }
		}
		li:middle {
			li:press              = { Pan(1) }
			li:release            = { Pan(0) }
		}
		li:right {
			li:press         = { Tool(Stroke) }
			li:release       = { Tool(Release); Popup(popup-obj, obj-type) }
			li:shift-release = { Popup(popup-obj-misc) }
		}
		li:scroll-up {
			li:press        = { Zoom(0.8) }
			li:press-shift  = { Scroll(up) }
			li:press-ctrl   = { Scroll(left) }
		}
		li:scroll-down {
			li:press       = { Zoom(1.25) }
			li:press-shift = { Scroll(down) }
			li:press-ctrl  = { Scroll(right) }
		}
	}

	li:toolbar_static {
		ha:via       {tip={place a via on the board}}
		ha:line      {tip={draw a line segment (trace) on the board}}
		ha:arc       {tip={draw an arc segment (trace) on the board}}
		ha:text      {tip={draw text on the board}}
		ha:rectangle {tip={draw a rectangular polygon on the board}}
		ha:poly      {tip={draw a polygon on the board}}
		ha:polyhole  {tip={cut out a hole from existing polygons on the board}}
		ha:buffer    {tip={paste the current buffer on the board}}
		ha:remove    {tip={remove an object from the board}}
		ha:rotate    {tip={rotate an object on the board}}
		ha:insert    {tip={insert a point in a trace or polygon contour}}
		ha:thermal   {tip={change thermal connectivity of a pin or via}}
		ha:arrow     {tip={switch to arrow mode}}
		ha:lock      {tip={lock or unlock objects on the board}}
	}

	li:main_menu {

		ha:File {
			li:submenu {
				ha:Start New Layout                  = { li:a={{<key>f;<key>n}; {Ctrl<Key>n};}; action=New() }
				ha:Revert                            = { a={<key>f;<key>r};          action=Load(Revert,none); tip=Revert to the layout stored on disk }
				-
				ha:Load layout...                    = { li:a={{<key>f;<key>o};{<key>f;<key>l};}  action=Load(Layout); tip=Load a layout from a file }
				-
				ha:Save Layout                       = { li:a={{<key>f;<key>s}; {Ctrl<Key>s};};        action=Save(Layout); tip=Saves current layout }
				ha:Save Layout As...                 = { li:a={{<key>f;<key>a}; {Shift Ctrl<Key>s};};  action=Save(LayoutAs); tip=Saves current layout into a new file }
				-
				END
			}
		}

		ha:Stock-Anchors {
			li:submenu {

				ha:layerkeys {
					li:submenu {
						ha:pre {}
						te:@layerkeys
						ha:post {}
					}
				}

				ha:layerpick {
					li:submenu {
						ha:pre {}
						te:@layerpick
						ha:post {}
					}
				}

				ha:layerview {
					li:submenu {
						ha:pre {}
						te:@layerview
						ha:post {}
					}
				}

				ha:grid {
					li:submenu {
						ha:pre {}
						te:@grid
						ha:post {}
					}
				}

				ha:routestyles {
					li:submenu {
						ha:pre {}
						te:@routestyles
						ha:post {}
					}
				}

				ha:import {
					li:submenu {
						ha:pre {}
						te:@import_top
						-
						te:@import_sch
						-
						te:@import_geo
						ha:post {}
					}
				}

				ha:autoroute {
					li:submenu {
						ha:pre {}
						te:@autoroute
						ha:post {}
					}
				}

				ha:scripts {
					li:submenu {
						ha:pre {}
						te:@scripts
						ha:post {}
					}
				}

				ha:feature_plugins {
					li:submenu {
						ha:pre {}
						te:@feature_plugins
						ha:post {}
					}
				}

				ha:indications {
					li:submenu {
						ha:pre {}
						te:@indications
						ha:post {}
					}
				}

				ha:indications {
					li:submenu {
						ha:pre {}
						te:@indications
						ha:post {}
					}
				}
			}
		}


		ha:Test-Anchors {
			li:submenu {
				ha:indications {
					li:submenu {
						ha:PRE {}
						te:@testanchor
						ha:POST {}
					}
				}
			}
		}

	} # main menu

	li:popups {
# context sensitive right click: popup per object type under the cursor

		ha:popup-obj-line {
			li:submenu {
				ha:Edit properties        { action=propedit(object) }
				ha:Edit flags...          { action=FlagEdit() }
				ha:Set Same Style         { action=SetSame() }
				-
				ha:Remove line            { li:action={Tool(Save); Tool(remove); Tool(Press); Tool(Restore)} }
				ha:Copy to buffer         { li:action={Unselect(All); Select(object); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Tool(buffer) } }
				ha:Move to current layer  { action=MoveToCurrentLayer(object) }
			}
		}
	} # popups
} # root
