Ejemplo n.º 1
0
		private void createMenu ( IButton menu )
        {
			if (!ToolbarManager.ToolbarAvailable) return; // bail if we don't have a toolbar

			PopupMenuDrawable list = new PopupMenuDrawable ();
			IButton smallMap = list.AddOption ("Small Map");
			IButton bigMap = list.AddOption ("Big Map");
			IButton instrument = list.AddOption ("Instruments");
			IButton settings = list.AddOption ("Settings");
			smallMap.OnClick += (e2) => SCANui.minimode = (SCANui.minimode == 0 ? 2 : -SCANui.minimode);
			bigMap.OnClick += (e2) => SCANui.bigmap_visible = !SCANui.bigmap_visible;
			instrument.OnClick += (e2) => SCANui.instruments_visible = !SCANui.instruments_visible;
			settings.OnClick += (e2) => SCANui.settings_visible = !SCANui.settings_visible;
			list.OnAnyOptionClicked += (  ) => destroyMenu (menu);
			menu.Drawable = list;
        }
Ejemplo n.º 2
0
        private void createMenu(IButton menu)
        {
            if (!ToolbarManager.ToolbarAvailable)
            {
                return;                                               // bail if we don't have a toolbar
            }
            PopupMenuDrawable list       = new PopupMenuDrawable();
            IButton           smallMap   = list.AddOption("Small Map");
            IButton           bigMap     = list.AddOption("Big Map");
            IButton           instrument = list.AddOption("Instruments");
            IButton           settings   = list.AddOption("Settings");

            smallMap.OnClick        += (e2) => SCANui.minimode = (SCANui.minimode == 0 ? 2 : -SCANui.minimode);
            bigMap.OnClick          += (e2) => SCANui.bigmap_visible = !SCANui.bigmap_visible;
            instrument.OnClick      += (e2) => SCANui.instruments_visible = !SCANui.instruments_visible;
            settings.OnClick        += (e2) => SCANui.settings_visible = !SCANui.settings_visible;
            list.OnAnyOptionClicked += () => destroyMenu(menu);
            menu.Drawable            = list;
        }