Exemple #1
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();
    }
Exemple #2
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
    }