/// <summary> Redraw the widget. </summary>
        protected override void Redraw()
        {
            if (_assignedSize.Width < 1 || _assignedSize.Height < 1)
            {
                return;
            }

            TRectangle completeArea = new TRectangle(_assignedPosition, _assignedSize);

            // Background.
            // -- (windowless)

            // Outer border.
            if ((int)_borderWidth > 0)
            {
                X11lib.XSetForeground(_display, _gc, _borderColorPixel);
                base.DrawBorder(_display, _window, _gc, completeArea, _borderWidth);
            }

            TRectangle clientArea = ClientArea();

            // Frame.
            if (_frameType != TFrameTypeExt.None)
            {
                base.DrawFrame(_display, _window, _gc, clientArea, _frameType, _darkShadowColorPixel, _lightShadowColorPixel);
            }

            RedrawContent();
        }
        /// <summary> Redraw the widget. </summary>
        protected override void Redraw()
        {
            if (_assignedSize.Width < 1 || _assignedSize.Height < 1)
            {
                return;
            }

            TRectangle completeArea = new TRectangle(_assignedPosition, _assignedSize);

            // Background.
            if (_focused)
            {
                X11lib.XSetForeground(_display, _gc, _focusedColorPixel);
            }
            else
            {
                X11lib.XSetForeground(_display, _gc, _backgroundColorPixel);
            }
            base.DrawBackground(_display, _window, _gc, completeArea);

            // Outer border.
            if ((int)_borderWidth > 0)
            {
                X11lib.XSetForeground(_display, _gc, _borderColorPixel);
                base.DrawBorder(_display, _window, _gc, completeArea, _borderWidth);
            }

            TRectangle clientArea = ClientArea();

            // Frame.
            if (_frameType != TFrameTypeExt.None)
            {
                bool _pressed = false;

                TFrameTypeExt frameType = _frameType;
                if (_pressed == true && frameType == TFrameTypeExt.Raised)
                {
                    frameType = TFrameTypeExt.Sunken;
                }
                else if (_pressed == true && frameType == TFrameTypeExt.Sunken)
                {
                    frameType = TFrameTypeExt.Raised;
                }
                else if (_pressed == true && frameType == TFrameTypeExt.Chiseled)
                {
                    frameType = TFrameTypeExt.Ledged;
                }
                else if (_pressed == true && frameType == TFrameTypeExt.Ledged)
                {
                    frameType = TFrameTypeExt.Chiseled;
                }
                base.DrawFrame(_display, _window, _gc, clientArea, frameType, _darkShadowColorPixel, _lightShadowColorPixel);
            }

            base.RedrawContent();
        }
Exemple #3
0
        /// <summary>
        /// Handles the click event of the "Rectangle" button, opens the dialog.
        /// </summary>
        private void btnRectangle_Click(object sender, EventArgs e)
        {
            var rectangle = TRectangle.FromPointList(this.lstBoundaries.Items.Cast <TPoint>().ToArray());

            using (var rectangleForm = new RectangleBoundaryForm(rectangle))
            {
                rectangleForm.DimensionsSet += this.OnRectangleDimensionsSet;
                rectangleForm.ShowDialog(this);
            }
        }
Exemple #4
0
        /// <summary>
        /// Handles the click event of the "Apply" button. Invokes the DimensionsSet event.
        /// </summary>
        private void btnApply_Click(object sender, EventArgs e)
        {
            var position  = new TPoint(txtPosition.X, txtPosition.Y);
            var size      = new TPoint(txtSize.X, txtSize.Y);
            var rectangle = new TRectangle(position, size);

            this.DimensionsSet?.Invoke(rectangle);

            this.DialogResult = DialogResult.OK;
        }
Exemple #5
0
        /// <summary>
        /// Called when the user clicks "Apply" in the rectangle dialog. Sets the new boundaries and invokes the changed event.
        /// </summary>
        private void OnRectangleDimensionsSet(TRectangle rectangle)
        {
            this.lstBoundaries.Items.Clear();
            this.lstBoundaries.Items.Add(rectangle.TopLeft);
            this.lstBoundaries.Items.Add(rectangle.TopRight);
            this.lstBoundaries.Items.Add(rectangle.BottomRight);
            this.lstBoundaries.Items.Add(rectangle.BottomLeft);

            this.currentDefinition =
                this.currentDefinition.ModifyMouse(boundaries: this.lstBoundaries.Items.Cast <TPoint>().ToList());
            this.DefinitionChanged?.Invoke(this.currentDefinition);
        }
        /// <summary> Redraw the widget. </summary>
        protected virtual void RedrawContent()
        {
            if (_assignedSize.Width < 1 || _assignedSize.Height < 1)
            {
                return;
            }

            TRectangle clientArea = ClientArea();

            clientArea.X      += _frameWidth;
            clientArea.Width  -= _frameWidth * 2;
            clientArea.Y      += _frameWidth;
            clientArea.Height -= _frameWidth * 2;

            // Content.
            X11lib.XSetForeground(_display, _gc, _textColorPixel);
            if (_leftBitmap != null)
            {
                int vertAlignOffset = (int)((clientArea.Height - _leftBitmap.Height - _space * 2) * _leftBitmapVertAlign);
                _leftBitmap.Draw(_window, _gc, (TInt)(clientArea.X + _leftMargin), (TInt)(clientArea.Y + _space + vertAlignOffset));

                clientArea.X     += _leftBitmap.Width + _leftMargin + _space;
                clientArea.Width -= _leftBitmap.Width + _leftMargin + _space;
            }
            else
            {
                clientArea.X     += _leftMargin;
                clientArea.Width -= _leftMargin;
            }

            if (_rightBitmap != null)
            {
                int vertAlignOffset = (int)((clientArea.Height - _rightBitmap.Height - _space * 2) * _rightBitmapVertAlign);
                _rightBitmap.Draw(_window, _gc, (TInt)(clientArea.Right - _rightBitmap.Width - _rightMargin), (TInt)(clientArea.Y + _space + vertAlignOffset));

                clientArea.Width -= _rightBitmap.Width + _space + _rightMargin;
            }
            else
            {
                clientArea.Width -= _rightMargin;
            }

            clientArea.Y      += _space;
            clientArea.Height -= _space * 2;

            /* DEBUG START */
            // X11lib.XDrawLine (_display, _window, _gc, (TInt)clientArea.X, (TInt)clientArea.Y, (TInt)clientArea.Right, (TInt)clientArea.Bottom);
            /* DEBUG END */

            clientArea.X += 2;             /* No idea why, but it must be done! */
            base.DrawTextLines(_lines, clientArea, _horzTextAlign, _vertTextAlign);
        }
Exemple #7
0
        public override void ComputeBoundingBox()
        {
            BoundingBox = new TRectangle
            {
                X      = 0.0f,
                Y      = 0.0f,
                Width  = Css.Width.Value != 0.0f ? Css.Width.Value : TScreen.Width,
                Height = Css.Height.Value != 0.0f ? Css.Height.Value : TScreen.Height,
            };

            LeftFloatPosition  = TPoint.Zero;
            RightFloatPosition = new TPoint(BoundingBox.Width, 0.0f);
        }
Exemple #8
0
        public void PopulateAllShape()
        {
            TRectangle rect    = new TRectangle();
            TEllipse   ellipse = new TEllipse();
            TStar      star    = new TStar();
            TLine      line    = new TLine();
            TArrow     arrow   = new TArrow();

            shapes.Add(rect.getShapeName(), rect);
            shapes.Add(ellipse.getShapeName(), ellipse);
            shapes.Add(star.getShapeName(), star);
            shapes.Add(arrow.getShapeName(), arrow);
            shapes.Add(line.getShapeName(), line);
        }
 /// <summary>
 /// Рисование объекта TRectangle по указаной позиции
 /// </summary>
 /// <param name="Location">Центр-Позиция для рисования</param>
 /// <returns></returns>
 public bool DrawRectangle(Point Location)
 {
     try
     {
         TRectangle rectangle = new TRectangle(Location, 50, 20, "t" + unicalLabelId++);
         Shapes.Add(rectangle);
         rectangles.Add(rectangle);
         Graphics g = this.CreateGraphics();
         rectangle.Draw(g);
         g.Dispose();
         return(true);
     }
     catch { return(false); }
 }
Exemple #10
0
        /// <summary>
        /// Creates a new instance and fills the input controls with preset values.
        /// </summary>
        public RectangleBoundaryForm(TRectangle rectangle)
        {
            InitializeComponent();

            var position = rectangle.Position;

            this.txtPosition.X = position.X;
            this.txtPosition.Y = position.Y;

            var size = rectangle.Size;

            this.txtSize.X = size.Width;
            this.txtSize.Y = size.Height;
        }
        // ToDo: Clip
        protected void DrawTextLines(Multiline lines, TRectangle clientArea, float horzTextAlign, float vertTextAlign)
        {
            int        FUZZY         = 4;                            // Avoid line hiding on rounding errors.
            int        drawableLines = lines.CompleteDrawableLines(clientArea.Height + FUZZY);
            TSize      textMeasure   = lines.Measure(0, drawableLines - 1);
            int        extraHeight   = (int)((clientArea.Height - textMeasure.Height) * vertTextAlign);
            TRectangle lineArea      = new TRectangle(clientArea.X, clientArea.Y + extraHeight, clientArea.Width, 0);

            for (int cntLines = 0; cntLines < drawableLines; cntLines++)
            {
                DrawTextLine(_display, _window, _gc, lines[cntLines].Text, lineArea, horzTextAlign, 0.0F);
                lineArea.Y += lines[cntLines].HeightInPixel;
            }
        }
Exemple #12
0
        private void ComputeBoundingBox(TElement element)
        {
            var box = new TRectangle()
            {
                Width  = element.Css.Width.Value,
                Height = element.Css.Height.Value
            };

            var childFloatAttribute = element.GetFloat();

            if (childFloatAttribute == Float.None)
            {
                box.X = BoundingBox.Left;
                box.Y = LeftFloatPosition.Y;

                LeftFloatPosition.X   = BoundingBox.Left;
                LeftFloatPosition.Y  += box.Height;
                RightFloatPosition.Y += box.Height;
            }
            else if (childFloatAttribute == Float.Left)
            {
                box.X = LeftFloatPosition.X;
                box.Y = LeftFloatPosition.Y;

                LeftFloatPosition.X += box.Width;

                if (LeftFloatPosition.X + box.Width > BoundingBox.Width)
                {
                    LeftFloatPosition.X  = BoundingBox.Left;
                    LeftFloatPosition.Y += box.Height;
                }
            }
            else if (childFloatAttribute == Float.Right)
            {
                box.X = RightFloatPosition.X - box.Width;
                box.Y = RightFloatPosition.Y;

                RightFloatPosition.X -= box.Width;

                if (RightFloatPosition.X < BoundingBox.Left)
                {
                    RightFloatPosition.X  = BoundingBox.Width;
                    RightFloatPosition.Y += box.Height;
                }
            }

            element.BoundingBox = box;
        }
        /// <summary> Draw the border. </summary>
        /// <param name="display"> The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        /// <param name="window"> The window to draw on. <see cref="IntPtr"/> </param>
        /// <param name="gc"> The graphics context to use for drawing. <see cref="IntPtr"/> </param>
        /// <param name="borderArea"> The area to draw the border on. <see cref="TRectangle"/> </param>
        /// <param name="borderWidth"> The width of the border. <see cref="System.Int32"/> </param>
        public virtual void DrawBorder(IntPtr display, IntPtr window, IntPtr gc, TRectangle borderArea, int borderWidth)
        {
            if (display == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawOuterBorder () ERROR: Argument null: display");
                return;
            }
            if (window == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawOuterBorder () ERROR: Argument null: window");
                return;
            }
            if (gc == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawOuterBorder () ERROR: Argument null: gc");
                return;
            }

            if (borderWidth <= 0)
            {
                return;
            }

            for (int counter = 0; counter < (int)borderWidth; counter++)
            {
                // Top: L ==> R
                X11lib.XDrawLine(display, window, gc, (X11.TInt)(borderArea.Left + counter), (X11.TInt)(borderArea.Top + counter),
                                 (X11.TInt)((int)borderArea.Right - counter - 1), (X11.TInt)(borderArea.Top + counter));
                // Right: T ==> B
                X11lib.XDrawLine(display, window, gc, (X11.TInt)((int)borderArea.Right - counter - 1), (X11.TInt)(borderArea.Top + counter),
                                 (X11.TInt)((int)borderArea.Right - counter - 1), (X11.TInt)((int)borderArea.Bottom - counter - 1));
                // Bottom: R ==> L
                X11lib.XDrawLine(display, window, gc, (X11.TInt)((int)borderArea.Right - counter - 1), (X11.TInt)((int)borderArea.Bottom - counter - 1),
                                 (X11.TInt)(borderArea.Left + counter), (X11.TInt)((int)borderArea.Bottom - counter - 1));
                // Left: B ==> T
                X11lib.XDrawLine(display, window, gc, (X11.TInt)(borderArea.Left + counter), (X11.TInt)((int)borderArea.Bottom - counter - 1),
                                 (X11.TInt)(borderArea.Left + counter), (X11.TInt)(borderArea.Top + counter));
                // Fix X11lib drawing problems (not drawn pixel at bottom right corner).
                X11lib.XDrawPoint(display, window, gc, (X11.TInt)((int)borderArea.Right - (int)counter - 1), (X11.TInt)(borderArea.Bottom - (int)counter - 1));
            }
        }
        /// <summary> Draw the background. </summary>
        /// <param name="display"> The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        /// <param name="window"> The window to draw on. <see cref="IntPtr"/> </param>
        /// <param name="gc"> The graphics context to use for drawing. <see cref="IntPtr"/> </param>
        /// <param name="backgroundArea"> The area to draw the background on. <see cref="TRectangle"/> </param>
        public virtual void DrawBackground(IntPtr display, IntPtr window, IntPtr gc, TRectangle backgroundArea)
        {
            if (display == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawBackground () ERROR: Argument null: display");
                return;
            }
            if (window == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawBackground () ERROR: Argument null: window");
                return;
            }
            if (gc == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawBackground () ERROR: Argument null: gc");
                return;
            }

            X11lib.XFillRectangle(display, window, gc, (TInt)backgroundArea.X, (TInt)backgroundArea.Y,
                                  (TUint)backgroundArea.Width, (TUint)backgroundArea.Height);
        }
        /// <summary> Redraw the widget. </summary>
        protected virtual void Redraw()
        {
            if (_assignedSize.Width < 1 || _assignedSize.Height < 1)
            {
                return;
            }

            TRectangle completeArea = new TRectangle(_assignedPosition, _assignedSize);

            X11lib.XSetForeground(_display, _gc, _backgroundColorPixel);
            base.DrawBackground(_display, _window, _gc, completeArea);

            if ((int)_borderWidth > 0)
            {
                X11lib.XSetForeground(_display, _gc, _borderColorPixel);
                base.DrawBorder(_display, _window, _gc, new TRectangle(_assignedPosition, _assignedSize), _borderWidth);
            }

            if (_frameType != TFrameTypeExt.None && _frameWidth > 0)
            {
                base.DrawFrame(_display, _window, _gc, this.ClientArea(), _frameType, _darkShadowColorPixel, _lightShadowColorPixel);
            }
        }
Exemple #16
0
 public void DrawRect(TRectangle rect, int border)
 {
     DrawRect(rect.X, rect.Y, rect.Width, rect.Height, border);
 }
Exemple #17
0
 public void FillRect(TRectangle rect)
 {
     FillRect(rect.X, rect.Y, rect.Width, rect.Height);
 }
        /// <summary> Draw the frame ( 3D effect). </summary>
        /// <param name="display"> The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        /// <param name="window"> The window to draw on. <see cref="IntPtr"/> </param>
        /// <param name="gc"> The graphics context to use for drawing. <see cref="IntPtr"/> </param>
        /// <param name="clientArea"> The area to draw the shadow on. <see cref="TRectangle"/> </param>
        /// <param name="frameType"> The frame type to draw. <see cref="TFrameTypeExt"/> </param>
        /// <param name="darkShadow"> The X11 border pixel do use for dark shadow drawing. <see cref="TPixel"/> </param>
        /// <param name="lightShadow"> The X11 border pixel do use for light shadow drawing.<see cref="TPixel"/> </param>
        internal virtual void DrawFrame(IntPtr display, IntPtr window, IntPtr gc, TRectangle clientArea, TFrameTypeExt frameType, TPixel darkShadow, TPixel lightShadow)
        {
            if (display == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawFrame () ERROR: Argument null: display");
                return;
            }
            if (window == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawFrame () ERROR: Argument null: window");
                return;
            }
            if (gc == IntPtr.Zero)
            {
                Console.WriteLine(CLASS_NAME + "::DrawFrame () ERROR: Argument null: gc");
                return;
            }

            if (frameType == TFrameTypeExt.None)
            {
                return;
            }

            X11lib.XGCValues xgcValues = new X11lib.XGCValues();
            xgcValues.line_width = (X11.TInt) 1;
            TUint xgcMask = (TUint)(X11lib.GCattributemask.GCLineWidth);

            X11lib.XChangeGC(display, gc, xgcMask, ref xgcValues);

            if (frameType == TFrameTypeExt.Raised || frameType == TFrameTypeExt.Sunken ||
                frameType == TFrameTypeExt.RaisedTopTab || frameType == TFrameTypeExt.RaisedLeftTab ||
                frameType == TFrameTypeExt.RaisedRightTab || frameType == TFrameTypeExt.RaisedBottomTab ||
                frameType == TFrameTypeExt.RaisedTopTabTail || frameType == TFrameTypeExt.SunkenTopTabTail ||
                frameType == TFrameTypeExt.UnraisedTopTab || frameType == TFrameTypeExt.UnraisedLeftTab ||
                frameType == TFrameTypeExt.UnraisedRightTab || frameType == TFrameTypeExt.UnraisedBottomTab ||
                frameType == TFrameTypeExt.UnraisedTopTabTail || frameType == TFrameTypeExt.UnsunkenTopTabTail ||
                frameType == TFrameTypeExt.SunkenTopTab || frameType == TFrameTypeExt.SunkenLeftTab ||
                frameType == TFrameTypeExt.SunkenRightTab || frameType == TFrameTypeExt.SunkenBottomTab ||
                frameType == TFrameTypeExt.UnsunkenTopTab || frameType == TFrameTypeExt.UnsunkenLeftTab ||
                frameType == TFrameTypeExt.UnsunkenRightTab || frameType == TFrameTypeExt.UnsunkenBottomTab)
            {
                bool raised = true;

                if (frameType == TFrameTypeExt.Sunken ||
                    frameType == TFrameTypeExt.SunkenTopTab || frameType == TFrameTypeExt.SunkenTopTabTail ||
                    frameType == TFrameTypeExt.SunkenLeftTab || frameType == TFrameTypeExt.SunkenRightTab ||
                    frameType == TFrameTypeExt.SunkenBottomTab ||
                    frameType == TFrameTypeExt.UnsunkenTopTab || frameType == TFrameTypeExt.UnsunkenTopTabTail ||
                    frameType == TFrameTypeExt.UnsunkenLeftTab || frameType == TFrameTypeExt.UnsunkenRightTab ||
                    frameType == TFrameTypeExt.UnsunkenBottomTab)
                {
                    raised = false;
                }

                // Right and bottom edge.
                X11lib.XSetForeground(display, gc, (raised ? darkShadow : lightShadow));
                for (int width = 0; width < _frameWidth; width++)
                {
                    // Right.
                    if (frameType != TFrameTypeExt.RaisedLeftTab && frameType != TFrameTypeExt.SunkenLeftTab &&
                        frameType != TFrameTypeExt.UnraisedRightTab && frameType != TFrameTypeExt.UnraisedTopTab &&
                        frameType != TFrameTypeExt.UnraisedTopTabTail && frameType != TFrameTypeExt.UnraisedBottomTab &&
                        frameType != TFrameTypeExt.UnsunkenRightTab && frameType != TFrameTypeExt.UnsunkenTopTab &&
                        frameType != TFrameTypeExt.UnsunkenTopTabTail && frameType != TFrameTypeExt.UnsunkenBottomTab)
                    {
                        if (frameType == TFrameTypeExt.UnraisedLeftTab || frameType == TFrameTypeExt.UnsunkenLeftTab)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top - 1,
                                             (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom + 1);
                        }
                        else if (frameType == TFrameTypeExt.RaisedTopTab || frameType == TFrameTypeExt.SunkenTopTab ||
                                 frameType == TFrameTypeExt.RaisedTopTabTail || frameType == TFrameTypeExt.SunkenTopTabTail)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top,
                                             (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom);
                        }
                        else if (frameType == TFrameTypeExt.RaisedBottomTab || frameType == TFrameTypeExt.SunkenBottomTab)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top - 1,
                                             (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom);
                        }
                        else
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top + width,
                                             (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - width);
                        }
                    }
                    // Bottom.
                    if (frameType != TFrameTypeExt.RaisedTopTab && frameType != TFrameTypeExt.RaisedTopTabTail &&
                        frameType != TFrameTypeExt.SunkenTopTab && frameType != TFrameTypeExt.SunkenTopTabTail &&
                        frameType != TFrameTypeExt.UnraisedBottomTab && frameType != TFrameTypeExt.UnraisedLeftTab && frameType != TFrameTypeExt.UnraisedRightTab &&
                        frameType != TFrameTypeExt.UnsunkenBottomTab && frameType != TFrameTypeExt.UnsunkenLeftTab && frameType != TFrameTypeExt.UnsunkenRightTab)
                    {
                        if (frameType == TFrameTypeExt.UnraisedTopTab || frameType == TFrameTypeExt.UnraisedTopTabTail ||
                            frameType == TFrameTypeExt.UnsunkenTopTab || frameType == TFrameTypeExt.UnsunkenTopTabTail)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left - 1, (TInt)clientArea.Bottom - 1 - width,
                                             (TInt)clientArea.Right - 1 + 1, (TInt)clientArea.Bottom - 1 - width);
                        }
                        else
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Bottom - 1 - width,
                                             (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - 1 - width);
                        }
                    }
                }

                // Top and Left edge.
                X11lib.XSetForeground(display, gc, (raised ? lightShadow : darkShadow));
                for (int width = 0; width < _frameWidth; width++)
                {
                    // Top.
                    if (frameType != TFrameTypeExt.RaisedBottomTab && frameType != TFrameTypeExt.SunkenBottomTab &&
                        frameType != TFrameTypeExt.UnraisedTopTab && frameType != TFrameTypeExt.UnraisedTopTabTail &&
                        frameType != TFrameTypeExt.UnraisedLeftTab && frameType != TFrameTypeExt.UnraisedRightTab &&
                        frameType != TFrameTypeExt.UnsunkenTopTab && frameType != TFrameTypeExt.UnsunkenTopTabTail &&
                        frameType != TFrameTypeExt.UnsunkenLeftTab && frameType != TFrameTypeExt.UnsunkenRightTab)
                    {
                        if (frameType == TFrameTypeExt.UnraisedBottomTab || frameType == TFrameTypeExt.UnsunkenBottomTab)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left - 1, (TInt)clientArea.Top + width,
                                             (TInt)clientArea.Right + 1, (TInt)clientArea.Top + width);
                        }
                        else
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                             (TInt)clientArea.Right - width, (TInt)clientArea.Top + width);
                        }
                    }
                    // Left.
                    if (frameType != TFrameTypeExt.RaisedRightTab && frameType != TFrameTypeExt.SunkenRightTab &&
                        frameType != TFrameTypeExt.UnraisedLeftTab && frameType != TFrameTypeExt.UnraisedTopTab &&
                        frameType != TFrameTypeExt.UnraisedTopTabTail && frameType != TFrameTypeExt.UnraisedBottomTab &&
                        frameType != TFrameTypeExt.UnsunkenLeftTab && frameType != TFrameTypeExt.UnsunkenTopTab &&
                        frameType != TFrameTypeExt.UnsunkenTopTabTail && frameType != TFrameTypeExt.UnsunkenBottomTab)
                    {
                        if (frameType == TFrameTypeExt.UnraisedRightTab || frameType == TFrameTypeExt.UnsunkenRightTab)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top - 1,
                                             (TInt)clientArea.Left + width, (TInt)clientArea.Bottom + 1);
                        }
                        else if (frameType == TFrameTypeExt.RaisedTopTab || frameType == TFrameTypeExt.SunkenTopTab ||
                                 frameType == TFrameTypeExt.RaisedTopTabTail || frameType == TFrameTypeExt.SunkenTopTabTail)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top,
                                             (TInt)clientArea.Left + width, (TInt)clientArea.Bottom + 1);
                        }
                        else if (frameType == TFrameTypeExt.RaisedBottomTab || frameType == TFrameTypeExt.SunkenBottomTab)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top - 1,
                                             (TInt)clientArea.Left + width, (TInt)clientArea.Bottom - width);
                        }
                        else
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                             (TInt)clientArea.Left + width, (TInt)clientArea.Bottom - width);
                        }
                    }
                }
                // Finish right bottom edge.
                if (frameType == TFrameTypeExt.RaisedTopTab || frameType == TFrameTypeExt.SunkenTopTab)
                {
                    X11lib.XSetForeground(display, gc, (raised ? lightShadow : darkShadow));
                    for (int width = 0; width < _frameWidth; width++)
                    {
                        if (width >= 1)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - _frameWidth + width, (TInt)clientArea.Bottom - width,
                                             (TInt)clientArea.Right - _frameWidth + width, (TInt)clientArea.Bottom);
                        }
                    }
                }
                if (frameType == TFrameTypeExt.UnraisedTopTabTail || frameType == TFrameTypeExt.UnsunkenTopTabTail)
                {
                    X11lib.XSetForeground(display, gc, (raised ? lightShadow : darkShadow));
                    for (int width = 0; width < _frameWidth; width++)
                    {
                        if (width >= 1)
                        {
                            X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - _frameWidth + width, (TInt)clientArea.Bottom - width,
                                             (TInt)clientArea.Right - _frameWidth + width, (TInt)clientArea.Bottom);
                        }
                    }
                }
                // Finish top left edge.
                // else if (frameType == TFrameTypeExt.RaisedBottomTab     || frameType == TFrameTypeExt.SunkenBottomTab)
            }
            else if (frameType == TFrameTypeExt.Chiseled || frameType == TFrameTypeExt.Ledged)
            {
                int halfWidth = _frameWidth / 2;

                // Bottom and right edge.
                X11lib.XSetForeground(display, gc, (frameType == TFrameTypeExt.Chiseled ? lightShadow : darkShadow));
                for (int width = 0; width < halfWidth; width++)
                {
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - width);
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Bottom - 1 - width,
                                     (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - 1 - width);
                }
                X11lib.XSetForeground(display, gc, (frameType == TFrameTypeExt.Chiseled ? darkShadow : lightShadow));
                for (int width = halfWidth; width < _frameWidth; width++)
                {
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - width);
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Bottom - 1 - width,
                                     (TInt)clientArea.Right - 1 - width, (TInt)clientArea.Bottom - 1 - width);
                }

                // Top and left edge.
                X11lib.XSetForeground(display, gc, (frameType == TFrameTypeExt.Chiseled ? darkShadow : lightShadow));
                for (int width = 0; width < halfWidth; width++)
                {
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.X + width, (TInt)clientArea.Bottom - width);
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.Right - width, (TInt)clientArea.Top + width);
                }
                X11lib.XSetForeground(display, gc, (frameType == TFrameTypeExt.Chiseled ? lightShadow : darkShadow));
                for (int width = halfWidth; width < _frameWidth; width++)
                {
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.X + width, (TInt)clientArea.Bottom - width);
                    X11lib.XDrawLine(display, window, gc, (TInt)clientArea.Left + width, (TInt)clientArea.Top + width,
                                     (TInt)clientArea.Right - width, (TInt)clientArea.Top + width);
                }
            }
        }