Esempio n. 1
0
        // Output menu

        private void OutputMenu()
        {
            guiControls.menuOutput.SetImage("Computation_48x48");
            guiControls.menuOutput.OnClick((object s, EventArgs e) => { MenuClicked(guiControls.menuOutput); });
            guiControls.menuOutput.autoClose = true;
            guiControls.menuOutput.ClearMenuItems();
            KButton headOutputItem = guiControls.menuOutput.NewMenuSection(-1); headOutputItem.SetText("Computed Output");

            guiControls.menuOutput.AddMenuItem(headOutputItem);
            guiControls.menuOutput.AddSeparator();
            foreach (ExportAction output in Exec.outputActionsList())
            {
                ExportAction menuSelection = output;
                KButton      menuItem      = guiControls.menuOutput.NewMenuItemButton();
                menuItem.SetText(output.name);
                menuItem.OnClick((object s, EventArgs e) => {
                    ItemClicked(guiControls.menuOutput, menuItem, true);           // handle the selection graphical feedback
                    ExecOutputAction(menuSelection);                               // handle storing the menuSelection value
                });
                guiControls.menuOutput.AddMenuItem(menuItem, name: output.name);
            }
            guiControls.menuOutput.Visible(true);
            guiControls.menuOutput.Enabled(true);
        }