Example #1
0
        protected static ShapeSettingsPanel createDefaultSettingsPanel()
        {
            ShapeSettingsPanel p = new ShapeSettingsPanel();

            Label l = new Label
            {
                Dock      = DockStyle.Fill,
                TextAlign = ContentAlignment.MiddleCenter,
                Text      = "No settings\r\nfor this tool"
            };

            p.Controls.Add(l);
            return(p);
        }
Example #2
0
        private void init(ScreenshotEditor editor, ShapeSettingsPanel panel, Color color, int thickness)
        {
            this.editor   = editor;
            settingsPanel = panel;

            editor.addSettingsChangeListener(this);
            if (panel != null)
            {
                settingsPanel.SettingsChanged += shapeSettingsChanged;
            }

            setColor(color);
            lastColor = color;

            Thickness = lastThickness = thickness;

            handles = new Dictionary <string, PointF>();
        }
Example #3
0
        protected Shape(ScreenshotEditor editor, XPathNavigator element, ShapeSettingsPanel panel)
        {
            int a         = int.Parse(element.GetAttribute("color.a", ""));
            int r         = int.Parse(element.GetAttribute("color.r", ""));
            int g         = int.Parse(element.GetAttribute("color.g", ""));
            int b         = int.Parse(element.GetAttribute("color.b", ""));
            int thickness = int.Parse(element.GetAttribute("thickness", ""));

            init(editor, panel, Color.FromArgb(a, r, g, b), thickness);
            XPathNodeIterator it = element.Clone().Select("handles/handle");

            while (it.MoveNext())
            {
                string name = it.Current.GetAttribute("name", "");
                float  x    = float.Parse(it.Current.GetAttribute("x", ""));
                float  y    = float.Parse(it.Current.GetAttribute("y", ""));
                addHandle(name, new PointF(x, y));
            }
        }
Example #4
0
 protected Shape(ScreenshotEditor editor, Color color, int thickness, ShapeSettingsPanel panel)
 {
     init(editor, panel, color, thickness);
 }