AddControl() public method

Adds given control to list of controls to be maintained by this class.
public AddControl ( object control, string key, object stateChangeEffect, bool affectedByStateChange = true, bool trueIsEnabledProperty = true ) : bool
control object Control to be added (ToolStripItem or Form Control)
key string Key to identify control. MUST be a unique part of the Control name.
stateChangeEffect object Effect to be run on state change. Bool or Action.
affectedByStateChange bool Optional. If true, this control is affected by state changes.
trueIsEnabledProperty bool Optional. If true, property affected by state changes is the Enabled property, otherwise uses the visible property.
return bool
コード例 #1
0
ファイル: ModMaker.cs プロジェクト: ME3Explorer/ME3Explorer
        private void Initialise(bool changeTree)
        {
            // KFreon: Setup GUI
            gooey = new Gooey(MainListView);
            gooey.AddControl(LoadButton, "Load", true);
            gooey.AddControl(RunAllButton, "RunAll", true);
            gooey.AddControl(ClearAllButton, "ClearAll", true);
            gooey.AddControl(SaveAllButton, "SaveAll", true);
            gooey.AddControl(RunSelectedButton, "RunSelected", true);
            gooey.AddControl(SaveSelectedButton, "SaveSelected", true);
            gooey.AddControl(MoveUpButton, "MoveUp", true);
            gooey.AddControl(MoveDownButton, "MoveDown", true);
            gooey.AddControl(SelectAllButton, "SelectAll", true);
            gooey.AddControl(UpdateJobButton, "UpdateJob", true);
            gooey.AddControl(ResetScriptButton, "ResetScript", true);
            gooey.AddControl(CancelationButton, "Cancel", false, true, false);
            gooey.AddControl(CancelationButton, "cts", new Action(() =>
            {
                if (CancelationButton.Visible)
                    cts = new CancellationTokenSource();
            }));

            DebugOutput.PrintLn();
            DebugOutput.PrintLn("Changing Trees...");

            // KFreon: Start debugger in separate thread
            if (!changeTree)
                DebugOutput.StartDebugger("Mod Maker 2.0");

            // KFreon: Get paths for each game
            CheckGameState();
        }
コード例 #2
0
        /// <summary>
        /// Sets up GUI elements 
        /// </summary>
        private void InitialiseGUI()
        {
            // KFreon: Make preview bigger
            DisappearTextBox(true);
            EnableSecondProgressBar(false);
            FirstHalfInfoState(false);
            SecondHalfInfoState(false);

            // KFreon: Setup gooey
            DebugOutput.PrintLn("Gooeying things");
            gooey = new Gooey(PreviewTabPages);
            gooey.AddControl(LoadButton, "Load", true);
            gooey.AddControl(ExtractTOP, "ExtractTOP", true);
            gooey.AddControl(ClearAllFilesButton, "ClearAll", true);
            gooey.AddControl(BuildTPFTOP, "Rebuild", true);
            gooey.AddControl(RunAutofixButton, "RunAutofix", true);
            //gooey.AddControl(MODtoTPFButton, "MODtoTPF", true);
            gooey.AddControl(AnalyseButton, "Analyse", true);
            gooey.AddControl(InstallButton, "InstallB", true);
            gooey.AddControl(extractInvalidToolStripMenuItem, "extractInvalid", true);
            gooey.AddControl(ChangeButton, "ChangeButton", true);
            gooey.AddControl(AutofixSingleButton, "AutofixSingleButton", false);
            gooey.AddControl(extractValidsToolStripMenuItem, "extractValids", true);

            gooey.ChangeState(false);


            // KFreon: Initialise MainListView



            OverallProgressBar.Value = 0;
            OverallStatusLabel.Text = "Ready.";
        }