Example #1
1
		protected CustomList(string name)
		{
			this.name=name;
			SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.DoubleBuffer|ControlStyles.UserPaint,true);

			collection = new ArrayList();

			vert = new VScrollBar();
			vert.Height=Height;
			vert.Location=new Point(Width-vert.Width,0);
			vert.Minimum=0;
			vert.Maximum=1;
			vert.Scroll+=new ScrollEventHandler(scroll);
			Controls.Add(vert);

			strList = new string[]{"Edit","Delete"};

			border = Border3DStyle.Etched;
			bStyle=BorderStyle.None;

			properties = new StrPropertyList();

			StrProperty.Update+=new NoArgsDelegate(Refresh);
//			allowedChars = new Hashtable();
//			allowedChars[Keys.Space]=' ';
		}
Example #2
0
        public static Texture2D ApplyBorderLabel(this Texture2D texture, BorderStyle style)
        {
            Texture2D newTexture = new Texture2D(texture.GraphicsDevice, texture.Width, texture.Height);
            Color[] data = texture.GetColorData();

            switch (style)
            {
                case (BorderStyle.FixedSingle):
                    for (int y = 0; y < texture.Height; y++)
                    {
                        for (int x = 0; x < texture.Width; x++)
                        {
                            if (y == 0 || x == 0 || y == texture.Height - 1 || x == texture.Width - 1)
                            {
                                data[x + y * texture.Width] = Color.DimGray;
                            }
                        }
                    }
                    newTexture.SetData(data);
                    return newTexture;
                case (BorderStyle.Fixed3D):
                    for (int y = 0; y < texture.Height; y++)
                    {
                        for (int x = 0; x < texture.Width; x++)
                        {
                            if (y == 0 || x == 0) data[x + y * texture.Width] = Color.DarkSlateGray;
                            else if (y == texture.Height - 1 || x == texture.Width - 1) data[x + y * texture.Width] = Color.White;
                        }
                    }
                    newTexture.SetData(data);
                    return newTexture;
                default:
                    return texture;
            }
        }
Example #3
0
        /// <summary>
        /// 创建单元格样式。
        /// </summary>
        /// <param name="workbook">工作表对象</param>
        /// <param name="styleCallback">单元格样式设置回调</param>
        /// <param name="fontCallback">字体设置回调</param>
        /// <param name="borderStyle">边框样式</param>
        /// <returns>单元格样式对象</returns>
        public static ICellStyle NewCellStyle(this IWorkbook workbook,
            Action<ICellStyle> styleCallback = null, Action<IFont> fontCallback = null, BorderStyle borderStyle = BorderStyle.Thin)
        {
            var font = workbook.CreateFont();
            var style = workbook.CreateCellStyle();

            font.FontName = "Courier New";
            font.FontHeightInPoints = 12;

            style.WrapText = false;
            style.Alignment = HorizontalAlignment.Center;
            style.VerticalAlignment = VerticalAlignment.Center;

            style.BorderLeft = borderStyle;
            style.BorderTop = borderStyle;
            style.BorderRight = borderStyle;
            style.BorderBottom = borderStyle;

            fontCallback?.Invoke(font);
            styleCallback?.Invoke(style);

            style.SetFont(font);

            return style;
        }
Example #4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="graphics"></param>
		/// <param name="x"></param>
		/// <param name="y"></param>
		/// <param name="width"></param>
		/// <param name="height"></param>		
		/// <param name="fillStyle"></param>
		/// <param name="backColor"></param>
		/// <param name="fadeColor"></param>
		/// <param name="borderStyle"></param>
		/// <param name="borderColor"></param>
		public static void PaintRectangle(Graphics graphics, int x, int y, int width, int height, 
			FillStyle fillStyle, Color backColor, Color fadeColor, BorderStyle borderStyle, 
			Color borderColor)
		{
			OnPaintBackgroundClassic(x, y, width, height, fillStyle, backColor,
				fadeColor, borderStyle, borderColor, graphics);			
		}
Example #5
0
 public Border(float pmSize, BorderStyle pmStyle, Color pmColor)
 {
     top=	new BorderPiece(pmSize, pmStyle, pmColor);
     right=	new BorderPiece(pmSize, pmStyle, pmColor);
     bot=	new BorderPiece(pmSize, pmStyle, pmColor);
     left=	new BorderPiece(pmSize, pmStyle, pmColor);
 }
Example #6
0
 public Border(BorderStyle tcbs, BorderSize size, int space, Color color)
 {
     this.Tcbs = tcbs;
     this.Size = size;
     this.Space = space;
     this.Color = color;
 }
Example #7
0
 // Sets the given style to all the parts in the border
 public void setStyle(BorderStyle value)
 {
     top.style=	value;
     right.style=	value;
     bottom.style=	value;
     left.style=	value;
 }
Example #8
0
        public static void SetMDIBorderStyle(MdiClient mdiClient, BorderStyle value)
        {
            // Get styles using Win32 calls
            int style = GetWindowLong(mdiClient.Handle, GWL_STYLE);
            int exStyle = GetWindowLong(mdiClient.Handle, GWL_EXSTYLE);

            // Add or remove style flags as necessary.
            switch (value)
            {
                case BorderStyle.Fixed3D:
                    exStyle |= WS_EX_CLIENTEDGE;
                    style &= ~WS_BORDER;
                    break;

                case BorderStyle.FixedSingle:
                    exStyle &= ~WS_EX_CLIENTEDGE;
                    style |= WS_BORDER;
                    break;

                case BorderStyle.None:
                    style &= ~WS_BORDER;
                    exStyle &= ~WS_EX_CLIENTEDGE;
                    break;
            }

            // Set the styles using Win32 calls
            SetWindowLong(mdiClient.Handle, GWL_STYLE, style);
            SetWindowLong(mdiClient.Handle, GWL_EXSTYLE, exStyle);

            // Update the non-client area.
            SetWindowPos(mdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
                SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
                SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
        }
        public static ShapeDescription DrawFullRectangle(Vector3 position, Size size, IGradientShader linearShader, Color4 fillColor, Thickness borderSize, BorderStyle borderStyle, Color4 borderColor)
        {
            Color4[] shadedColors = linearShader.Method(linearShader, 4,Shape.Rectangle);
            Color4[] borderColors;

            switch (borderStyle)
            {
                case BorderStyle.None:
                    borderColors = LinearShader.FillColorArray(new Color4(0), 4);
                    break;
                case BorderStyle.Flat:
                    borderColors = LinearShader.FillColorArray(borderColor, 4);
                    break;
                case BorderStyle.Raised:
                    borderColors = LinearShader.BorderRaised(borderColor, 4);
                    break;
                case BorderStyle.Sunken:
                    borderColors = LinearShader.BorderSunken(borderColor, 4);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("borderStyle");
            }
            ShapeDescription inside = DrawRectangle(position, size, shadedColors);
            ShapeDescription outline = DrawRectangularOutline(position, size, borderSize.All, borderColors, borderStyle, Borders.All);

            ShapeDescription result = ShapeDescription.Join(inside, outline);
            result.Shape = Shape.RectangleWithOutline;
            return result;
        }
Example #10
0
 public static BorderStyle Convert(String value, BorderStyle defaultValue)
 {
     if (value == "None")
     {
         return BorderStyle.None;
     }
     else if (value == "Flat")
     {
         return BorderStyle.Flat;
     }
     else if (value == "Lowered")
     {
         return BorderStyle.Lowered;
     }
     else if (value == "Raised")
     {
         return BorderStyle.BorderRaised;
     }
     else if (value == "FlatDouble")
     {
         return BorderStyle.BorderFlatDouble;
     }
     else if (value == "LoweredDouble")
     {
         return BorderStyle.BorderLoweredDouble;
     }
     else if (value == "RaisedDouble")
     {
         return BorderStyle.BorderRaisedDouble;
     }
     else
     {
         return defaultValue;
     }
 }
Example #11
0
 public BorderLayer(String name, int width, BorderStyle style, Color color)
     : base(name, SolidColours.White)
 {
     borderWidth = width;
     borderStyle = style;
     borderColour = color;
 }
 public CusCtlCurveBorderDrawPanel()
 {
     base.BackColor = Color.Transparent;
     base.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this._BorderColor = Color.Black;
     this._BorderStyle = Liplis.Control.BorderStyle.None;
     this._BorderWidth = 1;
 }
        public static Image DrawBorder(BorderStyle style, Image img, Color color, int size)
        {
            if (style == BorderStyle.Inside)
            {
                return DrawBorderInside(img, color, size);
            }

            return DrawBorderOutside(img, color, size);
        }
Example #14
0
		public ToolStripTextBox () : base (new ToolStripTextBoxControl ())
		{
			ToolStripTextBoxControl text_box = TextBox as ToolStripTextBoxControl;
			text_box.OwnerItem = this;
			text_box.border_style = BorderStyle.None;
			text_box.TopMargin = 3; // need to explicitly set the margin
			text_box.Border = BorderStyle.Fixed3D; // ToolStripTextBoxControl impl, not TextBox
			this.border_style = BorderStyle.Fixed3D;
		}
Example #15
0
 public DgvHelper Properties(string font = "Courier New", int fontSize = 9, Color foreColor = default(Color), Color backColor = default(Color), BorderStyle borderStyle = default(BorderStyle), bool virtualMode = false, bool rowHeaderVisible = false)
 {
     Dgv.VirtualMode = virtualMode;
     Dgv.RowHeadersVisible = rowHeaderVisible;
     Dgv.DefaultCellStyle.Font = new Font(font, fontSize);
     Dgv.DefaultCellStyle.ForeColor = foreColor;
     Dgv.DefaultCellStyle.BackColor = backColor;
     Dgv.BorderStyle = borderStyle;
     return this;
 }
Example #16
0
        /// <summary>
        /// Creates a circle shape with a designated border width. The circle begins and ends at border_origin_radians.
        /// </summary>
        public static Shape CreateBorderedCircle(Vector3 origin, float radius, float border_width, float border_origin_radians, Vector4 uv, BorderStyle style, Color? hue = null)
        {
            float inner_delta = 0f, outer_delta = 0f;
            switch (style)
            {
                case BorderStyle.Centered:
                    inner_delta = outer_delta = border_width / 2f;
                    break;
                case BorderStyle.Inside:
                    inner_delta = border_width;
                    break;
                case BorderStyle.Outside:
                    outer_delta = border_width;
                    break;
            }

            int numSegments = segmentsForSmoothCircle(radius);

            float radiansPerPoint = (Math.PI * 2) / numSegments;
            Vector3[] pointsOutside = new Vector3[numSegments + 1], pointsInside = new Vector3[numSegments + 1];

            // really, we only need to generate numPoints, but generating the final point (which is equal to the first point
            // saves us a mod operation in the next for loop.
            for (int i = 0; i < numSegments + 1; i++)
            {
                pointsOutside[i] = new Vector3(
                    origin.X + Math.Cos(radiansPerPoint * i + border_origin_radians) * (radius + outer_delta),
                    origin.Y + Math.Sin(radiansPerPoint * i + border_origin_radians) * (radius + outer_delta),
                    origin.Z);
                pointsInside[i] = new Vector3(
                    origin.X + Math.Cos(radiansPerPoint * i + border_origin_radians) * (radius - inner_delta),
                    origin.Y + Math.Sin(radiansPerPoint * i + border_origin_radians) * (radius - inner_delta),
                    origin.Z);
            }

            VertexPositionTextureHueExtra[] vertices = new VertexPositionTextureHueExtra[(numSegments) * 4];

            Color color = (hue.HasValue) ? hue.Value : Color.White;

            for (int i = 0; i < numSegments; i++)
            {
                int i4 = i * 4;
                int i6 = i * 6;

                vertices[i4 + 0] = new VertexPositionTextureHueExtra(pointsOutside[i + 0], new Vector2(uv.X, uv.Y), color, Vector4.Zero);
                vertices[i4 + 1] = new VertexPositionTextureHueExtra(pointsOutside[i + 1], new Vector2(uv.Z, uv.Y), color, Vector4.Zero);
                vertices[i4 + 2] = new VertexPositionTextureHueExtra(pointsInside[i + 0], new Vector2(uv.X, uv.W), color, Vector4.Zero);
                vertices[i4 + 3] = new VertexPositionTextureHueExtra(pointsInside[i + 1], new Vector2(uv.Z, uv.W), color, Vector4.Zero);
            }

            Shape shape = new Shape();
            shape.Vertices = vertices;

            return shape;
        }
Example #17
0
        public CrtPanel(CrtControl parent, int column, int row, int width, int height, BorderStyle ABorder, int AForeColour, int backColour, string text, CrtAlignment textAlignment)
            : base(parent, column, row, width, height)
        {
            _Border = ABorder;
            _ForeColour = AForeColour;
            _BackColour = backColour;
            _Text = text;
            _TextAlignment = textAlignment;

            Paint(true);
        }
Example #18
0
        public ProgramSettings(string file, string NiceName)
        {
            Filepath = file;
            FileName = NiceName;

            //Some defaults
            Borderstyle = BorderStyle.SIZABLE;
            WindowState = WinState.NORMAL;
            Style = 382664704;

            Enabled = false;
        }
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Label line = (Label)dialog.Controls[0];
				lineName = line.Name;
				lineLocation = line.Location;
				lineBorder = line.BorderStyle;
				lineSize = line.Size;
			}
		}
	// Get the width of the specified border type
	public virtual int GetBorderWidth(BorderStyle border)
			{
				switch(border)
				{
					case BorderStyle.Fixed3D:
						return 2;
					case BorderStyle.FixedSingle:
						return 1;
					case BorderStyle.None:
						return 0;
					default:
						return 0;
				}
			}
Example #21
0
 /// <summary>
 /// A class designed to allow easy rotation to change the angle
 /// </summary>
 public AnglePicker()
 {
     _knobVisible = true;
     _knobRadius = 5;
     _circleBorderStyle = BorderStyle.Fixed3D;
     _circleBorderColor = Color.LightGray;
     _circleFillColor = Color.LightGray;
     _pieFillColor = Color.SteelBlue;
     _knobColor = Color.Green;
     _textAlignment = ContentAlignment.BottomCenter;
     Width = 50;
     Height = 50;
     InitializeComponent();
 }
        public void Create(
            byte[] color,
            int line,
            int beginLongeurCadre,
            int endLongeurCadre,
            string[] values,
            bool isMerged,
            BorderStyle tailleBorder,
            bool withCadre = true,
            byte[] fontColor = null)
        {
            if(fontColor == null)
            {
                fontColor = new byte[3] { 0, 0, 0 };
            }

            _tailleBorder = tailleBorder;

            var merged = new CellRangeAddress(line, line, beginLongeurCadre, endLongeurCadre);

            var longeur = beginLongeurCadre;

            foreach (var value in values)
            {
                var cell = _sheet.GetRow(line).GetCell(longeur);

                var style = CreateStyle(color, fontColor);

                if (withCadre)
                {
                    SetStyleWithCadre(longeur, beginLongeurCadre, endLongeurCadre, style);
                }
                else
                {
                    SetStyleWithoutCadre(longeur, beginLongeurCadre, endLongeurCadre, style);
                }

                cell.CellStyle = style;

                if (isMerged)
                {
                    _sheet.AddMergedRegion(merged);
                }

                cell.SetCellValue(value);

                longeur++;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Slusser.Components.MdiClientController"/> class
        /// for the given MDI form.
        /// </summary>
        /// <param name="parentForm">The MDI form.</param>
        public MdiClientController(Form parentForm)
        {
            // Initialize the variables.
            this.site = null;
            this.parentForm = null;
            this.mdiClient = null;
            this.backColor = SystemColors.AppWorkspace;
            this.borderStyle = BorderStyle.Fixed3D;
            this.autoScroll = true;
            this.image = null;
            this.imageAlign = ContentAlignment.MiddleCenter;
            this.stretchImage = false;

            // Set the ParentForm property.
            this.ParentForm = parentForm;
        }
Example #24
0
        public void Create(
            int beginHauteurCadre,
            int beginLongeurCadre,
            int endHauteurCadre,
            int endLongeurCadre,
            byte[] color,
            BorderStyle tailleBorder,
            CellRangeAddress merge = null,
            bool wrapText = false,
            bool center = false,
            bool forcedRightBorder = false)
        {
            _tailleBorder = tailleBorder;

            if (merge != null)
            {
                _sheet.AddMergedRegion(merge);
            }

            for (var hauteur = beginHauteurCadre; hauteur <= endHauteurCadre; hauteur++)
            {
                var row = _sheet.GetRow(hauteur);

                if (row == null)
                {
                    row = _sheet.CreateRow(hauteur);
                }

                for (var longeur = beginLongeurCadre; longeur <= endLongeurCadre; longeur++)
                {
                    var cell = row.CreateCell(longeur);

                    var style = CreateStyle(color);
                    SetStyle(hauteur, longeur, beginHauteurCadre, beginLongeurCadre, endHauteurCadre, endLongeurCadre, style, forcedRightBorder);

                    style.WrapText = wrapText;

                    if (center)
                    {
                        style.VerticalAlignment = VerticalAlignment.Center;
                        style.Alignment = HorizontalAlignment.Center;
                    }

                    cell.CellStyle = style;
                }
            }
        }
Example #25
0
		public ListView()
		{
			items = new ListViewItemCollection(this);
			columns = new ColumnHeaderCollection(this);
			listItems = new ArrayList();
			autoArrange = true;
			hideSelection = true;
			labelWrap = true;
			multiSelect = true;
			scrollable = true;
			activation = ItemActivation.Standard;
			alignStyle = ListViewAlignment.Top;
			borderStyle = BorderStyle.Fixed3D;
			headerStyle = ColumnHeaderStyle.Clickable;
			sorting = SortOrder.None;
			viewStyle = View.LargeIcon;
		}
        public TweetTextField()
        {
            InitializeComponent();

            //default border color
            m_pnBorderPen = new Pen(Color.FromArgb(180, 180, 180));
            m_fntFont = new Font("Arial", 9);
            m_bsBorderStyle = BorderStyle.None;
            base.BorderStyle = System.Windows.Forms.BorderStyle.None;
            m_bConstrictHeight = true;
            m_bAlreadyUpdating = false;
            m_iControlMargin = 1;

            rtbTextBox.Click += new EventHandler(rtbTextBox_Click);
            rtbTextBox.TextChanged += new EventHandler(rtbTextBox_TextChanged);
            this.GotFocus += new EventHandler(TweetTextField_GotFocus);
            rtbTextBox.GotFocus += new EventHandler(rtbTextBox_GotFocus);
        }
        public static ShapeDescription DrawRectangularOutline(Vector3 position, Size size, int borderSize, Color4[] colors, BorderStyle borderStyle, Borders borders)
        {
            ShapeDescription vBorderTop = default(ShapeDescription);
            ShapeDescription vBorderSideL = default(ShapeDescription);
            ShapeDescription vBorderSideR = default(ShapeDescription);
            ShapeDescription vBorderBottom = default(ShapeDescription);

            Vector3 innerPositionTopLeft = new Vector3(
                position.X + borderSize, position.Y - borderSize, position.Z);

            Vector3 borderPositionTopRight = new Vector3(
                position.X + size.Width - borderSize, position.Y, position.Z);

            Vector3 borderPositionBottomLeft = new Vector3(
                position.X, position.Y - size.Height + borderSize, position.Z);

            Size borderTop = new Size(size.Width, borderSize);
            Size borderSide = new Size(borderSize, size.Height);

            Color4 cLeft = colors[0];
            Color4 cTop = colors[1];
            Color4 cBottom = colors[2];
            Color4 cRight = colors[3];

            if ((borders & Borders.Top) != 0)
                vBorderTop = DrawRectangle(position, borderTop, cTop);
            if ((borders & Borders.Left) != 0)
                vBorderSideL = DrawRectangle(position, borderSide, cLeft);
            if ((borders & Borders.Right) != 0)
                vBorderSideR = DrawRectangle(borderPositionTopRight, borderSide, cRight);
            if ((borders & Borders.Bottom) != 0)
                vBorderBottom = DrawRectangle(borderPositionBottomLeft, borderTop, cBottom);

            switch (borderStyle)
            {
                case BorderStyle.Flat:
                case BorderStyle.Raised:
                    return ShapeDescription.Join(vBorderSideL, vBorderTop, vBorderSideR, vBorderBottom);
                case BorderStyle.Sunken:
                    return ShapeDescription.Join(vBorderSideL, vBorderSideR, vBorderTop, vBorderBottom);
                default:
                    throw Error.WrongCase("borderStyle", "DrawRectangularOutline", borderStyle);
            }
        }
 static public void ApplyBorderStyle(this IHTMLElement e, BorderStyle value)
 {
     if (value == BorderStyle.None)
     {
         e.style.border = "";
     }
     else if (value == BorderStyle.FixedSingle)
     {
         e.style.borderStyle = "solid";
         e.style.borderWidth = "1px";
         e.style.borderColor = Shared.Drawing.Color.System.ActiveBorder;
     }
     else
     {
         e.style.borderStyle = "inset";
         e.style.borderWidth = "1px";
         e.style.borderColor = Shared.Drawing.Color.System.ActiveBorder;
     }
 }
Example #29
0
 public Border()
 {
     bounds=	Rectangle.EMPTY;
     colors=	new GUIColorPacket
     (
         new Color(0, 0, 0),
         new Color(0, 0, 0),
         new Color(0, 0, 0),
         new Color(0, 0, 0)
     );
     secondSetColors=	new GUIColorPacket
     (
         new Color(255, 255, 255),
         new Color(255, 255, 255),
         new Color(255, 255, 255),
         new Color(255, 255, 255)
     );
     borderSize=	1f;
     style=	BorderStyle.SOLID;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PdfBorderStyle"/> class.
 /// </summary>
 /// <param name="width">The border width.</param>
 /// <param name="style">The border style.</param>
 public PdfBorderStyle(int width, BorderStyle style)
 {
     Elements.SetInteger("/W", width);
     switch (style)
     {
         case BorderStyle.Solid:
             Elements.SetName("/S", "/S");
             break;
         case BorderStyle.Dashed:
             Elements.SetName("/S", "/D");
             break;
         case BorderStyle.Beveled:
             Elements.SetName("/S", "/B");
             break;
         case BorderStyle.Inset:
             Elements.SetName("/S", "/I");
             break;
         case BorderStyle.Underline:
             Elements.SetName("/S", "/U");
             break;
     }
 }