Example #1
0
		public GUIStyle()
		{
			fBorderWidth = 2;

			fBaseColor = (Colorref)Colorrefs.LtGray;
            fHighlightColor = GUIStyle.brighter(fBaseColor);
            fShadowColor = GUIStyle.darker(fBaseColor);
            fBackground = GUIStyle.brighter(fHighlightColor);
            fForeground = (Colorref)Colorrefs.LtGray;
            fTextBackground = fBaseColor;
            fBottomShadow = GUIStyle.darker(fForeground); // 0x00616161;
            fBottomShadowTopLiner = GUIStyle.brighter(fBottomShadow); //fForeground;
            fTopShadow = GUIStyle.brighter(fForeground);  // 0x00cbcbcb;

            fBackground = GUIStyle.brighter((Colorref)Colorrefs.DarkGray); //0x009e9e9e;


            fBasePen = new GDIPen(fBaseColor);
            fHighlightPen = new GDIPen(fHighlightColor);
            fShadowPen = new GDIPen(fShadowColor);
            fBottomShadowBottomLinerPen = new GDIPen(fBottomShadowBottomLiner);

            fBaseColorBrush = new GDIBrush(fBaseColor);

			GUIStyle.Default = this;
		}
Example #2
0
 public GBrush(BrushStyle aStyle, HatchStyle hatchStyle, Colorref aColor, Guid uniqueID)
 {
     BrushStyle = aStyle;
     HatchStyle = hatchStyle;
     Color = aColor;
     UniqueID = uniqueID;
 }
Example #3
0
        public GDIPen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
            : base(true,uniqueID)
        {
            TypeOfPen = aType;
            Style = aStyle;
            JoinStyle = aJoinStyle;
            EndCap = aEndCap;
            Width = width;
            Color = colorref;


            int combinedStyle = (int)aStyle | (int)aType | (int)aJoinStyle | (int)aEndCap;
            fLogBrush = new LOGBRUSH();
            fLogBrush.lbColor = colorref;
            fLogBrush.lbHatch = IntPtr.Zero;
            fLogBrush.lbStyle = (int)BrushStyle.Solid;

            if (PenType.Cosmetic == aType)
            {
                // If it's cosmetic, the width must be 1
                width = 1;

                // The color must be in the brush structure
                // Must mask off the alpha, or we'll get black
                fLogBrush.lbColor = colorref & 0x00ffffff;

                // The brush style must be solid
                fLogBrush.lbStyle = (int)BrushStyle.Solid;
            }


            IntPtr penHandle = GDI32.ExtCreatePen((uint)combinedStyle, (uint)width, ref fLogBrush, 0, IntPtr.Zero);

            SetHandle(penHandle);
        }
Example #4
0
        public GradientRect(int left, int top, int width, int height, Colorref startColor, Colorref endColor, GradientRectDirection style)
        {
            fRect = new RECT(left, top, width, height);

            fVertices = new TRIVERTEX[2];
            fGradientRect = new GRADIENT_RECT[1];

            fGradientRect[0] = new GRADIENT_RECT();

            SetVertices(left, top, width, height);

            // Set Colors for left/top
            fVertices[0].Red = startColor.Red16;
            fVertices[0].Green = startColor.Green16;
            fVertices[0].Blue = startColor.Blue16;
            fVertices[0].Alpha = 0x0000;

            // Set Colors for right/bottom
            fVertices[1].Red = endColor.Red16;
            fVertices[1].Green = endColor.Green16;
            fVertices[1].Blue = endColor.Blue16;
            fVertices[1].Alpha = 0x0000;

            fGradientRect[0].UpperLeft = 0;
            fGradientRect[0].LowerRight = 1;

            fGradientDirection = style;
        }
Example #5
0
        public GDIBrush(BrushStyle aStyle, HatchStyle hatchStyle, Colorref colorref, Guid uniqueID)
            : base(true, uniqueID)
        {
            fBrushStyle = aStyle;
            fHatchStyle = hatchStyle;
            fColor = colorref;

            fLogBrush = new LOGBRUSH32();

            // Make sure to mask off the high order byte
            // or GDI will draw in black
            fLogBrush.lbColor = colorref & 0x00ffffff;
            fLogBrush.lbHatch = (int)hatchStyle;
            fLogBrush.lbStyle = (int)aStyle;

            IntPtr brushHandle = GDI32.CreateBrushIndirect(ref fLogBrush);

            SetHandle(brushHandle);
        }
Example #6
0
        public GPen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
        {
            TypeOfPen = aType;
            Style = aStyle;
            JoinStyle = aJoinStyle;
            EndCap = aEndCap;
            Width = width;
            Color = colorref;

            this.UniqueID = uniqueID;

            //int combinedStyle = (int)aStyle | (int)aType | (int)aJoinStyle | (int)aEndCap;

            if (PenType.Cosmetic == aType)
            {
                // If it's cosmetic, the width must be 1
                width = 1;
            }
        }
Example #7
0
        public StringLabel(string aString, string aFontName, int pointSize, int x, int y, FontStyle style)
            : base("StringLabel",x,y,0,0)
        {
			fNeedsCalculation = true;
			fStyle = style;
			fFont = null;
            fString = aString;
            fFontName = aFontName;
			fPointSize = pointSize;
			fStartPoint = new Point3D(x,y);
            fBasePoint = new Point3D(x, y);
 
			fTextColor = (Colorref)Colorrefs.Black;
            fBackColor = (Colorref)Colorref.TRANSPARENT;
            fBrush = new GDISolidBrush(fTextColor);

            fFont = new GDIFont(fFontName, fPointSize);

			Recalculate();
        }
Example #8
0
 public GBrush(Colorref color)
     :this (new ColorRGBA(color))
 {
 }
Example #9
0
 public GDIBrush(Colorref color)
     : this(BrushStyle.Solid, HatchStyle.Vertical, color, Guid.NewGuid())
 {
 }
Example #10
0
 public GDICosmeticPen(Colorref colorref)
     : this(PenStyle.Solid, colorref, Guid.NewGuid())
 {
 }
Example #11
0
 public GDIPen(Colorref colorref)
     : this(PenType.Cosmetic, PenStyle.Solid, PenJoinStyle.Round, PenEndCap.Round, colorref, 1, Guid.NewGuid())
 {
 }
Example #12
0
         public ColorRGB(Colorref colorref)
 {
     r = (float)colorref.Red / 255f;
     g = (float)colorref.Green / 255f;
     b = (float)colorref.Blue / 255f;
 }
Example #13
0
 public GDICosmeticPen(PenStyle penStyle, Colorref colorref, Guid uniqueID)
     : base(PenType.Cosmetic, penStyle, PenJoinStyle.Round, PenEndCap.Round, colorref, 1, uniqueID)
 {
 }
Example #14
0
		public static Colorref brighter(Colorref color)
		{
			byte red = (byte)(Math.Min(color.Red *(1/0.80), 255));
			byte green = (byte)(Math.Min(color.Green * (1.0/0.85), 255));
			byte blue = (byte)(Math.Min(color.Blue * (1.0/0.80), 255));

			return new Colorref(red, green, blue);
		}
Example #15
0
		public static Colorref darker(Colorref color)
		{
			byte red = (byte)(color.Red *0.60);
			byte green = (byte)(color.Green * 0.60);
			byte blue = (byte)(color.Blue * 0.60);
		
			return new Colorref(red, green, blue);
		}
Example #16
0
 public Colorref(Colorref color)
 {
     colorref = color.colorref;
 }
Example #17
0
 public GDISolidBrush(Colorref color)
     : base(color)
 {
 }
Example #18
0
 public virtual GDIBrush CreateBrush(BrushStyle aStyle, HatchStyle hatch, Colorref colorref, Guid uniqueID)
 {
     GDIBrush aBrush = new GDIBrush(aStyle, hatch, colorref, uniqueID);
     return aBrush;
 }
Example #19
0
 public virtual GDIPen CreatePen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
 {
     GDIPen aPen = new GDIPen(aType, aStyle, aJoinStyle, aEndCap, colorref, width, uniqueID);
     return aPen;
 }