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; }
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; }