예제 #1
0
파일: FontInfo.cs 프로젝트: drme/thw-ui
 /// <summary>
 /// Constructs font object.
 /// </summary>
 /// <param name="engine">ui engine.</param>
 /// <param name="window">window control belongs to.</param>
 /// <param name="settings">control default settings.</param>
 /// <param name="name">default font name.</param>
 /// <param name="size">default font size.</param>
 internal FontInfo(UIEngine engine, Window window, ControlSettings settings, String name, int size)
 {
     this.engine = engine;
     this.window = window;
     this.size = size;
     this.name = name;
 }
예제 #2
0
파일: CheckBox.cs 프로젝트: drme/thw-ui
        /// <summary>
        /// Renders crontol border - check box
        /// </summary>
        /// <param name="graphics">graphics to render to</param>
        /// <param name="X">rendering offset X</param>
        /// <param name="Y">rendering offset Y</param>
        protected override void RenderBorder(Graphics graphics, int x, int y)
        {
            if (null == this.settings)
            {
                this.settings = this.Window.Desktop.Theme.GetControlSettings(TypeName);
            }

            int off = 2;
            int dx = 0;

            int size = this.settings.ControlSize;

            if (size <= 0)
            {
                size = this.Bounds.Height;
                dx = 0;
            }
            else
            {
                dx = (this.Bounds.Height - size) / 2;
            }

            //if (BorderStyle.BorderNone == this.Border)
            {
                off = 0;
            }

            off += dx;

            graphics.SetColor(this.settings.ColorBack);

            graphics.DrawRectangle(off + x + this.Bounds.X, off + y + this.Bounds.Y, size, size);

            graphics.SetColor(Colors.White);

            RenderBorderXYWH(graphics, off + x + this.Bounds.X, off + y + this.Bounds.Y, size, size, this.Border);

            this.TextOffset.X = off + size + 5;
        }