コード例 #1
0
ファイル: KControl.cs プロジェクト: luca-cardelli/KaemikaXM
        // Export menu

        private void ExportMenu()
        {
            guiControls.menuExport.SetImage("icons8_share_384_W_48x48");
            guiControls.menuExport.OnClick((object s, EventArgs e) => { MenuClicked(guiControls.menuExport); });
            guiControls.menuExport.autoClose = true;
            guiControls.menuExport.ClearMenuItems();
            KButton headExportItem = guiControls.menuExport.NewMenuSection(-1); headExportItem.SetText("Share");

            guiControls.menuExport.AddMenuItem(headExportItem);
            guiControls.menuExport.AddSeparator();
            foreach (ExportAction export in Exec.exportActionsList())
            {
                ExportAction menuSelection = export;
                KButton      menuItem      = guiControls.menuExport.NewMenuItemButton();
                menuItem.SetText(export.name);
                menuItem.OnClick((object s, EventArgs e) => {
                    ItemClicked(guiControls.menuExport, menuItem, false);           // handle the selection graphical feedback
                    SelectExport(guiControls.menuExport, menuItem, menuSelection);  // handle storing the menuSelection value
                });
                guiControls.menuExport.AddMenuItem(menuItem);
            }
            guiControls.menuExport.Visible(false);
            guiControls.menuExport.Enabled(true);
        }