Esempio n. 1
0
    void ToolbarExample_Notepad(TriggerArgs ta = null)
    {
        var t = new toolbar();

        if (t.FirstTime)
        {
            //Here you can set some initial properties of the toolbar. Later users can change them: move/resize the toolbar, use the right-click menu.
        }

        t["A"]         = o => { };
        t["B|Tooltip"] = o => { };
        t["|Tooltip", image : "*Modern.TreeLeaf #73BF00"] = o => { };
        t.Menu("C", m => {         //drop-down menu
            m["X"] = o => { };
            m["Y"] = o => { };
        });
        t.Separator();
        t["Script"] = o => script.run("Script example1.cs");

        ////auto-hide. Above is the auto-hide part. Below is the visible part.
        //t = t.AutoHide();
        //if(t.FirstTime) {

        //}

        t.Show(ta);
    }
Esempio n. 2
0
    //Examples of toolbars. Each toolbar is in a separate function.

    void ToolbarExample_Startup1()
    {
        var t = new toolbar();

        //settings
        if (t.FirstTime)
        {
            //Here you can set some initial properties of the toolbar. Later users can change them: move/resize the toolbar, use the right-click menu.
        }
        t.BorderColor = System.Drawing.Color.BlueViolet;

        //buttons
        t["A"]         = o => { };
        t["B|Tooltip"] = o => { };
        t["|Tooltip", image : "*WeatherIcons.RainMix #2F33D0"] = o => { };
        t.Menu("C", m => {         //drop-down menu
            m["X"] = o => { };
            m["Y"] = o => { };
        });
        t.Group("Examples");         //horizontal separator, optionally with text
        t.DisplayText    = false;
        t["Run program"] = o => run.it(folders.System + @"notepad.exe");
        t["Script"]      = o => script.run("Script example1.cs");
        t["Copy-paste"]  = o => {
            string s = clipboard.copy();             //note: to test it, at first select some text somewhere, else it will fail
            s = s.Upper();
            clipboard.paste(s);
        };
        //	t["Close", ""] = o => { t.Close(); };

        t.Show();
    }
Esempio n. 3
0
    void ToolbarExample_ScreenEdge(MouseTriggerArgs ta)
    {
        var t = new toolbar();

        t[""] = o => { };
        t[""] = o => { };
        t.Separator();
        t[""] = o => { };
        t[""] = o => { };
        t.Group();
        t.Menu("", m => {
            m[""] = o => { };
            m[""] = o => { };
        });
        t[""] = o => { };
        t[""] = o => { };

        //auto-hide at the screen edge of the mouse trigger. Above is the auto-hide part. Below is the always-visible part.
        t             = t.AutoHideScreenEdge(ta, 5, ^ 5, 2);
        t.BorderColor = System.Drawing.Color.Orange;

        t.Show();
        ta.DisableTriggerUntilClosed(t);         //single instance
    }