Example #1
0
    public HatchBrushMenu()
    {
        Text         = "Hatch Brush Menu";
        ResizeRedraw = true;

        Menu = new MainMenu();
        Menu.MenuItems.Add("&Hatch-Style");

        for (HatchStyle hs = (HatchStyle)iMin; hs <= (HatchStyle)iMax; hs++)
        {
            HatchStyleMenuItem hsmi = new HatchStyleMenuItem();

            hsmi.HatchStyle = hs;
            hsmi.Click     += new EventHandler(MenuHatchStyleOnClick);

            if ((int)hs % 8 == 0)
            {
                hsmi.BarBreak = true;
            }

            Menu.MenuItems[0].MenuItems.Add(hsmi);
        }
        hsmiChecked         = (HatchStyleMenuItem)Menu.MenuItems[0].MenuItems[0];
        hsmiChecked.Checked = true;
    }
Example #2
0
    void MenuHatchStyleOnClick(object obj, EventArgs ea)
    {
        hsmiChecked.Checked = false;
        hsmiChecked         = (HatchStyleMenuItem)obj;
        hsmiChecked.Checked = true;

        Invalidate();
    }
Example #3
0
    private void MenuHatchStyleOnClick(object sender, EventArgs e)
    {
        hsmiChecked.Checked = false;
        hsmiChecked         = (HatchStyleMenuItem)sender;
        hsmiChecked.Checked = true;

        Invalidate();
    }