Exemplo n.º 1
0
 public void Clear(Color color)
 {
     SetColor(color);
     CContext.Operator = Operator.Source;
     CContext.Paint();
     CContext.Operator = Operator.Over;
 }
Exemplo n.º 2
0
 void SetButtonColor(DrawingArea area, Color color)
 {
     Gdk.Color gcolor = Misc.ToGdkColor(color);
     area.ModifyBg(StateType.Normal, gcolor);
     area.ModifyBg(StateType.Active, gcolor);
     area.ModifyBg(StateType.Insensitive, gcolor);
     area.ModifyBg(StateType.Prelight, gcolor);
     area.ModifyBg(StateType.Selected, gcolor);
 }
Exemplo n.º 3
0
        void HandleDrawableChangedEvent(IBlackboardObject drawable)
        {
            selectedDrawable = drawable as Drawable;

            colorbutton.Sensitive = !(drawable is Text);

            ignoreChanges = true;
            if (selectedDrawable == null)
            {
                colorbutton.Color           = Misc.ToGdkColor(blackboard.Color);
                textcolorbutton.Color       = Misc.ToGdkColor(blackboard.TextColor);
                backgroundcolorbutton.Color = Misc.ToGdkColor(blackboard.TextBackgroundColor);
                backgroundcolorbutton.Alpha = Color.ByteToUShort(blackboard.TextBackgroundColor.A);
                linesizespinbutton.Value    = OriginalSize(blackboard.LineWidth);
                if (blackboard.LineStyle == LineStyle.Normal)
                {
                    stylecombobox.Active = 0;
                }
                else
                {
                    stylecombobox.Active = 1;
                }
                typecombobox.Active = (int)blackboard.LineType;
            }
            else
            {
                if (drawable is Text)
                {
                    textcolorbutton.Color       = Misc.ToGdkColor((selectedDrawable as Text).TextColor);
                    backgroundcolorbutton.Color = Misc.ToGdkColor(selectedDrawable.FillColor);
                    backgroundcolorbutton.Alpha = Color.ByteToUShort(selectedDrawable.FillColor.A);
                    textspinbutton.Value        = OriginalSize((selectedDrawable as Text).TextSize);
                }
                else
                {
                    colorbutton.Color = Misc.ToGdkColor(selectedDrawable.StrokeColor);
                }
                if (drawable is Line)
                {
                    typecombobox.Active = (int)(drawable as Line).Type;
                }
                linesizespinbutton.Value = OriginalSize(selectedDrawable.LineWidth);
                if (selectedDrawable.Style == LineStyle.Normal)
                {
                    stylecombobox.Active = 0;
                }
                else
                {
                    stylecombobox.Active = 1;
                }
            }
            ignoreChanges = false;
        }
Exemplo n.º 4
0
 void SetColor(Color color)
 {
     if (color != null)
     {
         CContext.SetSourceRGBA((double)color.R / byte.MaxValue,
                                (double)color.G / byte.MaxValue,
                                (double)color.B / byte.MaxValue,
                                (double)color.A / byte.MaxValue);
     }
     else
     {
         CContext.SetSourceRGBA(0, 0, 0, 0);
     }
 }
Exemplo n.º 5
0
 public void Begin()
 {
     savedStrokeColor = StrokeColor;
     savedFillColor   = FillColor;
     savedFSlant      = fSlant;
     savedFWeight     = fWeight;
     savedAlignment   = fAlignment;
     savedLineWidth   = LineWidth;
     savedFontSize    = FontSize;
     savedFontFamily  = FontFamily;
     savedLineStyle   = LineStyle;
     savedClear       = ClearOperation;
     CContext.Save();
 }
Exemplo n.º 6
0
        void HandleColorSet(object sender, EventArgs e)
        {
            if (ignore)
            {
                return;
            }

            LongoMatch.Core.Common.Color c = Helpers.Misc.ToLgmColor((sender as ColorButton).Color);
            if (sender == colorbutton1)
            {
                button.BackgroundColor = c;
            }
            else
            {
                button.TextColor = c;
            }
            Edited = true;
        }
Exemplo n.º 7
0
        void HandleColorSet(object sender, EventArgs e)
        {
            if (ignoreChanges)
            {
                return;
            }

            if (selectedDrawable != null)
            {
                selectedDrawable.StrokeColor = Misc.ToLgmColor(colorbutton.Color);
                if (selectedDrawable.FillColor != null)
                {
                    Color c = Misc.ToLgmColor(colorbutton.Color);
                    c.A = selectedDrawable.FillColor.A;
                    selectedDrawable.FillColor = c;
                }
                QueueDraw();
            }
            else
            {
                blackboard.Color = Misc.ToLgmColor(colorbutton.Color);
            }
        }
Exemplo n.º 8
0
 void SetButtonColor(DrawingArea area, Color color)
 {
     Gdk.Color gcolor = Misc.ToGdkColor (color);
     area.ModifyBg (StateType.Normal, gcolor);
     area.ModifyBg (StateType.Active, gcolor);
     area.ModifyBg (StateType.Insensitive, gcolor);
     area.ModifyBg (StateType.Prelight, gcolor);
     area.ModifyBg (StateType.Selected, gcolor);
 }
Exemplo n.º 9
0
 public static global::Cairo.Color RGBToCairoColor(Color c)
 {
     return(new global::Cairo.Color(ByteToDouble(c.R),
                                    ByteToDouble(c.G),
                                    ByteToDouble(c.B)));
 }
Exemplo n.º 10
0
 public static Color ToGdkColor(LColor color)
 {
     return new Color (color.R, color.G, color.B);
 }
Exemplo n.º 11
0
 public static LColor ToLgmColor(Color color, ushort alpha = ushort.MaxValue)
 {
     return(LColor.ColorFromUShort(color.Red, color.Green, color.Blue, alpha));
 }
Exemplo n.º 12
0
 public static Color ToGdkColor(LColor color)
 {
     return(new Color(color.R, color.G, color.B));
 }