Exemple #1
0
		internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
		{
			if (backColor.GetBrightness() < 0.5)
				backColor = Color.FromArgb(255 - backColor.R, 255 - backColor.G, 255 - backColor.B);

			IntPtr gc = GetReversibleScreenGC (backColor);

			if (rectangle.Width < 0) {
				rectangle.X += rectangle.Width;
				rectangle.Width = -rectangle.Width;
			}
			if (rectangle.Height < 0) {
				rectangle.Y += rectangle.Height;
				rectangle.Height = -rectangle.Height;
			}

			int line_width = 1;
			GCLineStyle line_style = GCLineStyle.LineSolid;
			GCCapStyle cap_style = GCCapStyle.CapButt;
			GCJoinStyle join_style = GCJoinStyle.JoinMiter;

			switch (style) {
			case FrameStyle.Dashed:
				line_style = GCLineStyle.LineOnOffDash;
				break;
			case FrameStyle.Thick:
				line_width = 2;
				break;
			}

			XSetLineAttributes (DisplayHandle, gc, line_width, line_style, cap_style, join_style);

			XDrawRectangle(DisplayHandle, RootWindow, gc, rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height);

			XFreeGC(DisplayHandle, gc);
		}
Exemple #2
0
		public override void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style) {

		}
 protected override void OnMouseDragBegin(int x, int y)
 {
     Control control = this.Control;
     if (!this.InheritanceAttribute.Equals(InheritanceAttribute.InheritedReadOnly))
     {
         if (this.toolboxService == null)
         {
             this.toolboxService = (IToolboxService) this.GetService(typeof(IToolboxService));
         }
         if (this.toolboxService != null)
         {
             this.mouseDragTool = this.toolboxService.GetSelectedToolboxItem((IDesignerHost) this.GetService(typeof(IDesignerHost)));
         }
     }
     control.Capture = true;
     System.Design.NativeMethods.RECT rect = new System.Design.NativeMethods.RECT();
     System.Design.NativeMethods.GetWindowRect(control.Handle, ref rect);
     Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom);
     this.mouseDragFrame = (this.mouseDragTool == null) ? FrameStyle.Dashed : FrameStyle.Thick;
     this.mouseDragBase = new Point(x, y);
     ISelectionService service = (ISelectionService) this.GetService(typeof(ISelectionService));
     if (service != null)
     {
         service.SetSelectedComponents(new object[] { base.Component }, SelectionTypes.Click);
     }
     IEventHandlerService service2 = (IEventHandlerService) this.GetService(typeof(IEventHandlerService));
     if ((service2 != null) && (this.escapeHandler == null))
     {
         this.escapeHandler = new EscapeHandler(this);
         service2.PushHandler(this.escapeHandler);
     }
     this.adornerWindowToScreenOffset = base.BehaviorService.AdornerWindowToScreen();
 }
	public static void DrawReversibleFrame(System.Drawing.Rectangle rectangle, System.Drawing.Color backColor, FrameStyle style) {}
Exemple #5
0
        public void DrawRectangle(Point start, Size size, Color color, FrameStyle style)
        {
            ValidateCoordinates(ref start, ref size);
            start = SceneControl.PointToScreen(start);

            _drawedObjects.Add(new object[] { start, size, style });
            DrawRectangle(start, size, color, style, null);
        }
		public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style) {
			XplatUI.DrawReversibleFrame (rectangle, backColor, style);
		}
Exemple #7
0
 public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
 {
     XplatUI.DrawReversibleFrame(rectangle, backColor, style);
 }
Exemple #8
0
		internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
		{
			display.DrawReversibleFrame (rectangle, backColor, style);
		}
        public static void DrawFrame(Graphics g, Region resizeBorder, FrameStyle style, Color backColor)
        {
            Brush brush;
            Color controlDarkDark = SystemColors.ControlDarkDark;
            if ((backColor != Color.Empty) && (backColor.GetBrightness() < 0.5))
            {
                controlDarkDark = SystemColors.ControlLight;
            }
            switch (style)
            {
                case FrameStyle.Dashed:
                    brush = new HatchBrush(HatchStyle.Percent50, controlDarkDark, Color.Transparent);
                    break;

                default:
                    brush = new SolidBrush(controlDarkDark);
                    break;
            }
            g.FillRegion(brush, resizeBorder);
            brush.Dispose();
        }
        public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style) {
            int rop2;
            Color graphicsColor;

            if (backColor.GetBrightness() < .5) {
                rop2 = 0xA; // RasterOp.PEN.Invert().XorWith(RasterOp.TARGET);
                graphicsColor = Color.White;
            }
            else {
                rop2 = 0x7; // RasterOp.PEN.XorWith(RasterOp.TARGET);
                graphicsColor = Color.Black;
            }

            IntPtr dc = UnsafeNativeMethods.GetDCEx(new HandleRef(null, UnsafeNativeMethods.GetDesktopWindow()), NativeMethods.NullHandleRef, NativeMethods.DCX_WINDOW | NativeMethods.DCX_LOCKWINDOWUPDATE | NativeMethods.DCX_CACHE);
            IntPtr pen;

            switch (style) {
                case FrameStyle.Dashed:
                    pen = SafeNativeMethods.CreatePen(NativeMethods.PS_DOT, 1, ColorTranslator.ToWin32(backColor));
                    break;

                case FrameStyle.Thick:
                default:
                    pen = SafeNativeMethods.CreatePen(NativeMethods.PS_SOLID, 2, ColorTranslator.ToWin32(backColor));
                    break;
            }

            int prevRop2 = SafeNativeMethods.SetROP2(new HandleRef(null, dc), rop2);
            IntPtr oldBrush = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, UnsafeNativeMethods.GetStockObject(NativeMethods.HOLLOW_BRUSH)));
            IntPtr oldPen = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, pen));
            SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(graphicsColor));
            SafeNativeMethods.Rectangle(new HandleRef(null, dc), rectangle.X, rectangle.Y, rectangle.Right, rectangle.Bottom);

            SafeNativeMethods.SetROP2(new HandleRef(null, dc), prevRop2);
            SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldBrush));
            SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldPen));

            if (pen != IntPtr.Zero)
            { 
                SafeNativeMethods.DeleteObject(new HandleRef(null, pen));
            }

            UnsafeNativeMethods.ReleaseDC(NativeMethods.NullHandleRef, new HandleRef(null, dc));
        }
Exemple #11
0
 internal static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
 {
     DriverDebug("DrawReversibleFrame ({0}, {1}, {2}): Called", rectangle, backColor, style);
     driver.DrawReversibleFrame(rectangle, backColor, style);
 }
Exemple #12
0
 internal abstract void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style);
Exemple #13
0
        public static Page Get(Design design, int pageNumber, FrameStyle frameStyle)
        {
            string subType       = "";
            string subTypeToPass = "";
            string description   = "";

            DesignEntry pagefeed = design.GetPagefeed(pageNumber);

            Page page = new Page(pagefeed.Html, pagefeed.Comment);

            // Look up the title
            // a) NEDERLAND
            // b) BADEN
            // c) REPUBLIK MALUKU SELATAN
            DesignEntry country = design.GetCountry(pageNumber);

            page.Country           = country.Text;
            page.Copyright         = country.Copyright;
            page.FrontPageTitle    = country.FrontPageTitle;
            page.FrontPageSubTitle = country.FrontPageSubTitle;
            page.PageTitle         = country.PageTitle;

            // Loop up the folder
            // a) Frankeerzegels
            // b) Briefmarken
            // c) Cinderellas
            DesignEntry section = design.GetSection(pageNumber);

            page.Section = section.Text;

            page.ImagesPath = string.Format("{0}\\{1}\\{2}\\", App.GetSetting("ImagesFolder"), page.Country, page.Section);

            // Look up the sub title
            // a) 1867-1869. Koning Willem III.
            // b) ALTDEUTSCHLAND
            // c) 1950. U.P.U.
            DesignEntry series = design.GetSeries(pageNumber);

            page.Series = series.Text;

            // Look up the sub sub title
            // a) Type I.
            // b) Portomarken
            // c) Regular.
            DesignEntry mainType = design.FirstOrDefault(entry => entry.Class == Class.Type && entry.PageNumber == pageNumber);

            if (mainType != null)
            {
                page.MainType = mainType.Text;
            }

            // Look up the first entry having this page number
            int first = design.FindIndex(entry => entry.PageNumber == pageNumber);

            int i = first;

            while (design[i].PageNumber == design[first].PageNumber)
            {
                DesignEntry entry = design[i];

                switch (entry.Class)
                {
                case Class.PageFeed:

                    page.OffsetVertical = entry.OffsetVertical;
                    page.AlbumNumber    = entry.AlbumNumber;
                    page.IsSample       = entry.Sample;
                    if (entry.Width != 0)
                    {
                        page.Spacing = entry.Width;
                    }

                    break;

                case Class.Image:
                    page.AddImage(entry.Number, entry.Width, entry.Height, entry.OffsetHorizontal, entry.OffsetVertical, entry.RoundedCorners);
                    break;

                case Class.Type:
                    subType = entry.Text;
                    break;

                case Class.Description:
                    description = entry.Text;
                    break;

                case Class.Varieties:
                case Class.LineFeed:

                    if (subType != page.MainType)
                    {
                        subTypeToPass = subType;
                    }
                    else
                    {
                        subTypeToPass = "";
                    }

                    page.AddVarieties(
                        entry.Text,
                        entry.Comment,
                        subTypeToPass,
                        entry.OffsetHorizontal,
                        entry.OffsetVertical,
                        entry.VerticalMoveRelative,
                        entry.VerticalMoveAbsolute,
                        entry.Combine,
                        entry.Alignment,
                        entry.FontOfType,
                        entry.FontOfDescription,
                        entry.Width,
                        entry.Height,
                        entry.Watermark,
                        entry.Appearance,
                        entry.MaxWidth
                        );

                    subType = "";

                    break;

                case Class.Variety:

                    if (entry.ApplyTo.ToUpper() != "VB" && PassFrameStyle(entry.ApplyToFrameStyle, frameStyle))
                    {
                        page.AddVariety(
                            Variety.GetNumber(entry),
                            Variety.GetValueAndColor(entry),
                            description,
                            entry.FrameColor,
                            entry.Width,
                            entry.Height,
                            entry.OffsetHorizontal,
                            entry.OffsetVertical,
                            entry.Skip,
                            entry.Appearance,
                            string.IsNullOrEmpty(entry.Picture) ? entry.Number : entry.Picture,
                            entry.Overprint,
                            entry.Shape,
                            entry.Alignment,
                            entry.Positions
                            );

                        description = "";
                    }

                    break;
                }

                i++;
            }

            return(page);
        }
Exemple #14
0
 public abstract void CPDrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style);
Exemple #15
0
//		public static void DrawFocus(Graphics g , DesignControl pControl){
//			FocusHandleList focusList = pControl.FocusList;
//			foreach(FocusHandle focus in focusList){
//				g.DrawRectangle(new Pen(Brushes.Black),focus.Rect  );
//			}
//		}
        public static void DrawReversibleRect(Point pFirst, Point pLast, FrameStyle pStyle)
        {
            DrawReversibleRect(new Rectangle(pFirst.X, pFirst.Y, pLast.X, pLast.Y), pStyle);
        }
Exemple #16
0
		internal static void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
		{
			DriverDebug ("DrawReversibleFrame ({0}, {1}, {2}): Called", rectangle, backColor, style);
			driver.DrawReversibleFrame (rectangle, backColor, style);
		}
	// Draw a reversible frame.
	public static void DrawReversibleFrame
				(Rectangle rectangle, Color backColor, FrameStyle style)
			{
				// This is too dangerous: not supported in this implementation.
			}
Exemple #18
0
 public void DrawRectangle(Point start, Size size, Color color, FrameStyle style, string temp = null)
 {
     ControlPaint.DrawReversibleFrame(new Rectangle(start, size), color, style);
 }
Exemple #19
0
 public void DrawFocusedArea(Point start, Size size, FrameStyle style)
 {
     DrawFocusLines(start, size);
     DrawRectangle(start, size, style);
 }
		internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style) {
//			throw new NotImplementedException();
		}
Exemple #21
0
 public void DrawFocusedArea(Rectangle rect, FrameStyle style)
 {
     DrawFocusedArea(rect.Location, rect.Size, style);
 }
 private static int FrameWidth(FrameStyle style)
 {
     if (style != FrameStyle.Dashed)
     {
         return 2;
     }
     return 1;
 }
Exemple #23
0
 public void DrawRectangle(Point start, Size size, FrameStyle style)
 {
     _painter.DrawRectangle(start, size, Color.Yellow, style);
 }
		internal abstract void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
Exemple #25
0
 public void DrawRectangle(Rectangle rect, FrameStyle style)
 {
     DrawRectangle(rect.Location, rect.Size, style);
 }
Exemple #26
0
		public virtual void  DrawFrame(IGraphPort aPort, int x, int y, int w, int h, FrameStyle style)
		{
			int n;

			switch (style)
			{
				case FrameStyle.Sunken:
					for (n=0; n<BorderWidth; n++)
					{
						aPort.DrawLine(fHighlightPen, new Point2I(x+n, y+h-n), new Point2I(x+w-n, y+h-n));    // bottom shadow
                        aPort.DrawLine(fHighlightPen, new Point2I(x + w - n, y + n), new Point2I(x + w - n, y + h));	    // right shadow
					}

					for (n=0; n<BorderWidth; n++)
					{
						aPort.DrawLine(fShadowPen, new Point2I(x+n, y+n), new Point2I(x+w-n, y+n));	    // top edge
						aPort.DrawLine(fShadowPen, new Point2I(x+n, y+n), new Point2I(x+n, y+h-n));	    // left edge
					}				
				break;

				case FrameStyle.Raised:	
					for (n=0; n<BorderWidth; n++)
					{
						aPort.DrawLine(fShadowPen, new Point2I(x+n, y+h-n), new Point2I(x+w-n, y+h-n));      // bottom shadow
						aPort.DrawLine(fShadowPen, new Point2I(x+w-n, y+n), new Point2I(x+w-n, y+h));	    // right shadow
					}
	
					if (BorderWidth > 0)
					{
						n = BorderWidth - 1;
/*
						aPort.DrawingColor = fBottomShadowTopLiner;
						aPort.DrawLine(x+n, y+h-n, x+w-n, y+h-n);		// bottom shadow
						aPort.DrawLine(x+w-n, y+n, x+w-n, y+h);			// right shadow
*/						
                        aPort.DrawLine(fBottomShadowBottomLinerPen, new Point2I(x, y + h), new Point2I(x + w, y + h));				// bottom shadow
                        aPort.DrawLine(fBottomShadowBottomLinerPen, new Point2I(x + w, y), new Point2I(x + w, y + h));				// right shadow
					}

					for (n=0; n<BorderWidth; n++)
					{
						aPort.DrawLine(fHighlightPen, new Point2I(x+n,y+n), new Point2I(x+w-n, y+n));	    // top edge
						aPort.DrawLine(fHighlightPen, new Point2I(x+n, y+n), new Point2I(x+n, y+h-n));	    // left edge
					}
				break;
			}

		}
Exemple #27
0
		public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
Exemple #28
0
		// XXX this doesn't work at all for FrameStyle.Dashed - it draws like Thick, and in the Thick case
		// the corners are drawn incorrectly.
		internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style) {
			IntPtr		hdc;
			IntPtr		pen;
			IntPtr		oldpen;
			COLORREF        clrRef = new COLORREF();

			// If we want the standard hatch pattern we would
			// need to create a brush

			clrRef.R = backColor.R;
			clrRef.G = backColor.G;
			clrRef.B = backColor.B;

			// Grab a pen
			pen = Win32CreatePen (style == FrameStyle.Thick ? PenStyle.PS_SOLID : PenStyle.PS_DASH,
					      style == FrameStyle.Thick ? 4 : 2, ref clrRef);

			hdc = Win32GetDC(IntPtr.Zero);
			Win32SetROP2(hdc, ROP2DrawMode.R2_NOT);
			oldpen = Win32SelectObject(hdc, pen);

			Win32MoveToEx(hdc, rectangle.Left, rectangle.Top, IntPtr.Zero);
			if ((rectangle.Width > 0) && (rectangle.Height > 0)) {
				Win32LineTo(hdc, rectangle.Right, rectangle.Top);
				Win32LineTo(hdc, rectangle.Right, rectangle.Bottom);
				Win32LineTo(hdc, rectangle.Left, rectangle.Bottom);
				Win32LineTo(hdc, rectangle.Left, rectangle.Top);
			} else {
				if (rectangle.Width > 0) {
					Win32LineTo(hdc, rectangle.Right, rectangle.Top);
				} else {
					Win32LineTo(hdc, rectangle.Left, rectangle.Bottom);
				}
			}

			Win32SelectObject(hdc, oldpen);
			Win32DeleteObject(pen);

			Win32ReleaseDC(IntPtr.Zero, hdc);
		}
Exemple #29
0
		internal static void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
		{
			#if DriverDebug
				Console.WriteLine("DrawReversibleFrame({0}, {1}, {2}): Called", rectangle, backColor, style);
			#endif
			driver.DrawReversibleFrame (rectangle, backColor, style);
		}
        public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
        {
            int num;
            Color white;
            IntPtr ptr2;
            if (backColor.GetBrightness() < 0.5)
            {
                num = 10;
                white = Color.White;
            }
            else
            {
                num = 7;
                white = Color.Black;
            }
            IntPtr handle = System.Windows.Forms.UnsafeNativeMethods.GetDCEx(new HandleRef(null, System.Windows.Forms.UnsafeNativeMethods.GetDesktopWindow()), System.Windows.Forms.NativeMethods.NullHandleRef, 0x403);
            switch (style)
            {
                case FrameStyle.Dashed:
                    ptr2 = System.Windows.Forms.SafeNativeMethods.CreatePen(2, 1, ColorTranslator.ToWin32(backColor));
                    break;

                default:
                    ptr2 = System.Windows.Forms.SafeNativeMethods.CreatePen(0, 2, ColorTranslator.ToWin32(backColor));
                    break;
            }
            int nDrawMode = System.Windows.Forms.SafeNativeMethods.SetROP2(new HandleRef(null, handle), num);
            IntPtr ptr3 = System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(null, handle), new HandleRef(null, System.Windows.Forms.UnsafeNativeMethods.GetStockObject(5)));
            IntPtr ptr4 = System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(null, handle), new HandleRef(null, ptr2));
            System.Windows.Forms.SafeNativeMethods.SetBkColor(new HandleRef(null, handle), ColorTranslator.ToWin32(white));
            System.Windows.Forms.SafeNativeMethods.Rectangle(new HandleRef(null, handle), rectangle.X, rectangle.Y, rectangle.Right, rectangle.Bottom);
            System.Windows.Forms.SafeNativeMethods.SetROP2(new HandleRef(null, handle), nDrawMode);
            System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(null, handle), new HandleRef(null, ptr3));
            System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(null, handle), new HandleRef(null, ptr4));
            if (ptr2 != IntPtr.Zero)
            {
                System.Windows.Forms.SafeNativeMethods.DeleteObject(new HandleRef(null, ptr2));
            }
            System.Windows.Forms.UnsafeNativeMethods.ReleaseDC(System.Windows.Forms.NativeMethods.NullHandleRef, new HandleRef(null, handle));
        }
Exemple #31
0
 internal override void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
 {
     display.DrawReversibleFrame(rectangle, backColor, style);
 }