Exemplo n.º 1
0
        protected override void Initialize()
        {
            Engine.Instance.GetDevice += Instance_GetDevice;
            Engine.Instance.GameRenderEnd += Instance_GameRenderEnd;
            Engine.Instance.GameRenderBegin += Instance_GameRenderBegin;
            Margin = new System.Windows.Forms.Padding(0);
            Padding = new System.Windows.Forms.Padding(0);

            masterSpriteBatch = new SpriteBatch(GraphicsDevice);
            masterRenderingTarget = new RenderTarget2D(GraphicsDevice, Width, Height, false, SurfaceFormat.Bgr565, DepthFormat.None);

            ntsc = snes_ntsc_alloc();
            ntscInit(snes_ntsc_setup_t.snes_ntsc_composite);

            ntscTexture = new Texture2D(GraphicsDevice, 602, 448, false, SurfaceFormat.Bgr565);

            ntscPixelsDimmed = new ushort[ushort.MaxValue+1];
            for (int i = 0; i <= ushort.MaxValue; i++)
            {
                int red = (i & 0xf800);
                int green = (i & 0x7e0);
                int blue = (i & 0x1f);
                red = ((red - (red >> 3)) & 0xf800);
                green = ((green - (green >> 3)) & 0x7e0);
                blue = ((blue - (blue >> 3)) & 0x1f);
                ntscPixelsDimmed[i] = (ushort)(red | green | blue);
            }
        }
        protected override System.Drawing.SizeF ArrangeOverride(System.Drawing.SizeF finalSize)
        {
            RectangleF clientRect = GetClientRectangle(finalSize);

            System.Windows.Forms.Padding border = GetBorderThickness(true);

            int   itemsCount = items.Count;
            float currentY   = clientRect.Top;

            for (int i = 0; i < itemsCount; i++)
            {
                RadItem          currentItem = items[i];
                BackstageTabItem tabItem     = (currentItem as BackstageTabItem);
                if (tabItem != null && tabItem == this.owner.SelectedItem)
                {
                    tabItem.Page.Visible = false;
                }

                currentItem.Arrange(new RectangleF(clientRect.X - border.Left, currentY,
                                                   clientRect.Width + border.Horizontal, currentItem.DesiredSize.Height));

                currentY += currentItem.DesiredSize.Height;
            }

            return(finalSize);
        }
Exemplo n.º 3
0
        public virtual System.Windows.Forms.Padding Parse(Thickness thickness)
        {
            if (thickness == null)
            {
                return(default(System.Windows.Forms.Padding));
            }

            System.Windows.Forms.Padding padding = new System.Windows.Forms.Padding();

            if (thickness.Left.HasValue)
            {
                padding.Left = (int)thickness.Left;
            }
            if (thickness.Top.HasValue)
            {
                padding.Top = (int)thickness.Top;
            }
            if (thickness.Right.HasValue)
            {
                padding.Right = (int)thickness.Right;
            }
            if (thickness.Bottom.HasValue)
            {
                padding.Bottom = (int)thickness.Bottom;
            }

            return(padding);
        }
Exemplo n.º 4
0
        System.Windows.Forms.Padding CalculateCompleteContentPadding(bool user, bool source)
        {
            var padding = new System.Windows.Forms.Padding();

            if (user)
            {
                padding += GameExtraPadding;
            }

            //an experimental feature
            if (source)
            {
                if (Global.Emulator is BizHawk.Emulation.Cores.Sony.PSX.Octoshock)
                {
                    var psx          = Global.Emulator as BizHawk.Emulation.Cores.Sony.PSX.Octoshock;
                    var core_padding = psx.VideoProvider_Padding;
                    padding.Left   += core_padding.Width / 2;
                    padding.Right  += core_padding.Width - core_padding.Width / 2;
                    padding.Top    += core_padding.Height / 2;
                    padding.Bottom += core_padding.Height - core_padding.Height / 2;
                }
            }

            //apply user's crop selections as a negative padding (believe it or not, this largely works)
            //is there an issue with the aspect ratio? I dont know--but if there is, there would be with the padding too
            padding.Left   -= Global.Config.DispCropLeft;
            padding.Right  -= Global.Config.DispCropRight;
            padding.Top    -= Global.Config.DispCropTop;
            padding.Bottom -= Global.Config.DispCropBottom;

            return(padding);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     PlotChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
     ((System.ComponentModel.ISupportInitialize)(PlotChart)).BeginInit();
     SuspendLayout();
     //
     // PlotChart
     //
     PlotChart.Dock     = System.Windows.Forms.DockStyle.Fill;
     PlotChart.Location = new System.Drawing.Point(0, 0);
     PlotChart.Margin   = new System.Windows.Forms.Padding(2);
     PlotChart.Name     = "PlotChart";
     PlotChart.Size     = new System.Drawing.Size(658, 412);
     PlotChart.TabIndex = 0;
     PlotChart.Text     = "chart1";
     //
     // PlotForm
     //
     AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     ClientSize          = new System.Drawing.Size(658, 412);
     Controls.Add(PlotChart);
     Margin = new System.Windows.Forms.Padding(2);
     Name   = "PlotForm";
     Text   = "Plot of Trade Data";
     ((System.ComponentModel.ISupportInitialize)(PlotChart)).EndInit();
     ResumeLayout(false);
 }
Exemplo n.º 6
0
 public ClickableTextButton()
 {
     Font       = Fonts.Default;
     Clickable  = true;
     Background = InterfaceScene.DefaultSlimBorder;
     Padding    = new System.Windows.Forms.Padding(2);
 }
Exemplo n.º 7
0
        System.Windows.Forms.Padding CalculateCompleteContentPadding(bool user, bool source)
        {
            var padding = new System.Windows.Forms.Padding();

            if (user)
            {
                padding += GameExtraPadding;
            }

            //an experimental feature
            if (source)
            {
                if (Global.Emulator is BizHawk.Emulation.Cores.Sony.PSX.Octoshock)
                {
                    var psx          = Global.Emulator as BizHawk.Emulation.Cores.Sony.PSX.Octoshock;
                    var core_padding = psx.VideoProvider_Padding;
                    padding.Left   += core_padding.Width / 2;
                    padding.Right  += core_padding.Width - core_padding.Width / 2;
                    padding.Top    += core_padding.Height / 2;
                    padding.Bottom += core_padding.Height - core_padding.Height / 2;
                }
            }

            return(padding);
        }
Exemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        /// <param name="fontTexture"></param>
        /// <param name="maxCharCount"></param>
        public UIText(
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar, IFontTexture fontTexture = null, int maxCharCount = 100)
            : base(anchor, margin, size, zNear, zFar)
        {
            if (fontTexture == null)
            {
                this.fontTexture = FontTexture.Default;
            }                                          // FontResource.Default; }
            else
            {
                this.fontTexture = fontTexture;
            }

            var shaderCodes = new ShaderCode[2];

            shaderCodes[0] = new ShaderCode(ManifestResourceLoader.LoadTextFile(
                                                @"Resources.TextModel.vert"), ShaderType.VertexShader);
            shaderCodes[1] = new ShaderCode(ManifestResourceLoader.LoadTextFile(
                                                @"Resources.TextModel.frag"), ShaderType.FragmentShader);
            var map = new AttributeMap();

            map.Add("position", TextModel.strPosition);
            map.Add("uv", TextModel.strUV);
            var model    = new TextModel(maxCharCount);
            var renderer = new Renderer(model, shaderCodes, map);

            this.textModel = model;
            this.Renderer  = renderer;
        }
Exemplo n.º 9
0
        protected override void Initialize()
        {
            Engine.Instance.GetDevice       += Instance_GetDevice;
            Engine.Instance.GameRenderEnd   += Instance_GameRenderEnd;
            Engine.Instance.GameRenderBegin += Instance_GameRenderBegin;
            Margin  = new System.Windows.Forms.Padding(0);
            Padding = new System.Windows.Forms.Padding(0);

            masterSpriteBatch     = new SpriteBatch(GraphicsDevice);
            masterRenderingTarget = new RenderTarget2D(GraphicsDevice, Width, Height, false, SurfaceFormat.Bgr565, DepthFormat.None);

            ntsc = snes_ntsc_alloc();
            ntscInit(snes_ntsc_setup_t.snes_ntsc_composite);

            ntscTexture = new Texture2D(GraphicsDevice, 602, 448, false, SurfaceFormat.Bgr565);

            ntscPixelsDimmed = new ushort[ushort.MaxValue + 1];
            for (int i = 0; i <= ushort.MaxValue; i++)
            {
                int red   = (i & 0xf800);
                int green = (i & 0x7e0);
                int blue  = (i & 0x1f);
                red   = ((red - (red >> 3)) & 0xf800);
                green = ((green - (green >> 3)) & 0x7e0);
                blue  = ((blue - (blue >> 3)) & 0x1f);
                ntscPixelsDimmed[i] = (ushort)(red | green | blue);
            }
        }
Exemplo n.º 10
0
        public GLText(
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar, FontResource fontResource = null, int maxCharCount = 100)
            : base(null, anchor, margin, size, zNear, zFar)
        {
            if (fontResource == null)
            {
                this.fontResource = FontResource.Default;
            }
            else
            {
                this.fontResource = fontResource;
            }

            this.Name = "GLText";
            var shaderCodes = new ShaderCode[2];

            shaderCodes[0] = new ShaderCode(ManifestResourceLoader.LoadTextFile(
                                                @"Resources.GLText.vert"), ShaderType.VertexShader);
            shaderCodes[1] = new ShaderCode(ManifestResourceLoader.LoadTextFile(
                                                @"Resources.GLText.frag"), ShaderType.FragmentShader);
            var map = new PropertyNameMap();

            map.Add("position", "position");
            map.Add("uv", "uv");
            var      model    = new TextModel(maxCharCount);
            Renderer renderer = new Renderer(model, shaderCodes, map);

            this.model    = model;
            this.Renderer = renderer;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Updates the margin of control by an indentation given in inches.
        /// </summary>
        /// <param name="margin">margin to update</param>
        /// <param name="controlInfo">control info to resolve indentation size</param>
        /// <param name="indent">indent</param>
        public static System.Windows.Forms.Padding UpdateMarginByIndent(System.Windows.Forms.Padding margin, ControlInfo controlInfo, int indent)
        {
            int indentSize = controlInfo.ControlSpacingInfo.Indention;

            margin.Left = indent * indentSize;
            return(margin);
        }
Exemplo n.º 12
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     previewControlFR = new PreviewControl();
     SuspendLayout();
     //
     // previewControlFR
     //
     previewControlFR.BackColor      = System.Drawing.SystemColors.AppWorkspace;
     previewControlFR.Dock           = System.Windows.Forms.DockStyle.Fill;
     previewControlFR.FastScrolling  = true;
     previewControlFR.Font           = new System.Drawing.Font("宋体", 9F);
     previewControlFR.Location       = new System.Drawing.Point(0, 0);
     previewControlFR.Name           = "previewControlFR";
     previewControlFR.PageOffset     = new System.Drawing.Point(10, 10);
     previewControlFR.Size           = new System.Drawing.Size(550, 435);
     previewControlFR.TabIndex       = 0;
     previewControlFR.ToolbarVisible = false;
     previewControlFR.UIStyle        = FastReport.Utils.UIStyle.Office2007Black;
     //
     // printlabel
     //
     AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     Controls.Add(this.previewControlFR);
     Margin = new System.Windows.Forms.Padding(0);
     Name   = "printlabel";
     Size   = new System.Drawing.Size(550, 435);
     Load  += new System.EventHandler(this.Form1_Load);
     ResumeLayout(false);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     buttonDismiss             = new System.Windows.Forms.Button();
     listBoxOutput             = new System.Windows.Forms.ListBox();
     progressBarFilesCompleted = new System.Windows.Forms.ProgressBar();
     SuspendLayout();
     //
     // buttonDismiss
     //
     buttonDismiss.Location = new System.Drawing.Point(1016, 619);
     buttonDismiss.Name     = "buttonDismiss";
     buttonDismiss.Size     = new System.Drawing.Size(200, 59);
     buttonDismiss.TabIndex = 2;
     buttonDismiss.Text     = "&Dismiss";
     buttonDismiss.UseVisualStyleBackColor = true;
     buttonDismiss.Click += new System.EventHandler(buttonDismiss_Click);
     //
     // listBoxOutput
     //
     listBoxOutput.FormattingEnabled   = true;
     listBoxOutput.HorizontalScrollbar = true;
     listBoxOutput.ItemHeight          = 31;
     listBoxOutput.Location            = new System.Drawing.Point(16, 16);
     listBoxOutput.Name          = "listBoxOutput";
     listBoxOutput.SelectionMode = System.Windows.Forms.SelectionMode.None;
     listBoxOutput.Size          = new System.Drawing.Size(1200, 593);
     listBoxOutput.TabIndex      = 0;
     //
     // progressBarFilesCompleted
     //
     progressBarFilesCompleted.Location = new System.Drawing.Point(16, 634);
     progressBarFilesCompleted.Name     = "progressBarFilesCompleted";
     progressBarFilesCompleted.Size     = new System.Drawing.Size(977, 23);
     progressBarFilesCompleted.Step     = 1;
     progressBarFilesCompleted.TabIndex = 1;
     //
     // FormResults
     //
     AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F);
     AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     AutoSize            = true;
     AutoSizeMode        = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     ClientSize          = new System.Drawing.Size(1408, 872);
     ControlBox          = false;
     Controls.Add(progressBarFilesCompleted);
     Controls.Add(listBoxOutput);
     Controls.Add(buttonDismiss);
     MaximizeBox   = false;
     Name          = "FormResults";
     Padding       = new System.Windows.Forms.Padding(16);
     ShowInTaskbar = false;
     SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
     Text          = "Conversion results";
     FormClosing  += new System.Windows.Forms.FormClosingEventHandler(
         FormResults_FormClosing);
     Load  += new System.EventHandler(FormResults_Load);
     Shown += new System.EventHandler(FormResults_Shown);
     ResumeLayout(false);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Creates a new button
 /// </summary>
 /// <param name="image">Image of the button (32 x 32 suggested)</param>
 /// <param name="smallImage">Image of the button when in medium of compact mode (16 x 16 suggested)</param>
 /// <param name="style">Style of the button</param>
 /// <param name="text">Text of the button</param>
 public RibbonButton()
 {
     _dropDownItems = new RibbonItemCollection();
     _dropDownArrowSize = new Size(5, 3);
     _dropDownMargin = new System.Windows.Forms.Padding(6);
     Image = CreateImage(32);
     SmallImage = CreateImage(16);
 }
Exemplo n.º 15
0
        /* ----------------------------------------------------------------- */
        ///
        /// GetDrawBounds
        ///
        /// <summary>
        /// 描画領域を表すオブジェクトを取得します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private Rectangle GetDrawBounds(Rectangle client, System.Windows.Forms.Padding padding)
        {
            var x      = client.Left + padding.Left;
            var y      = client.Top + padding.Top;
            var width  = client.Right - padding.Right - x;
            var height = client.Bottom - padding.Bottom - y;

            return(new Rectangle(x, y, width, height));
        }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIRenderer(
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar)
        {
            this.Children = new ChildList <UIRenderer>(this);// new ILayoutList(this);

            this.Anchor = anchor; this.Margin = margin;
            this.Size   = size; this.zNear = zNear; this.zFar = zFar;
        }
Exemplo n.º 17
0
        /// <summary>
        /// opengl UI for Axis
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        /// <param name="partCount">24 as default.</param>
        public UIAxis(
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar, int partCount = 24)
            : base(anchor, margin, size, zNear, zFar)
        {
            AxisRenderer renderer = AxisRenderer.Create(partCount);

            this.Renderer = renderer;
        }
Exemplo n.º 18
0
 /// <summary>
 /// Updates the margin of control by an indentation given in inches.
 /// </summary>
 /// <param name="margin">margin to update</param>
 /// <param name="serviceProvider">provider to create a label</param>
 /// <param name="indent">indent</param>
 public static System.Windows.Forms.Padding UpdateMarginByIndent(System.Windows.Forms.Padding margin, IServiceProvider serviceProvider, int indent)
 {
     using (LabelEx labelControl = new LabelEx(serviceProvider))
     {
         int indentSize = labelControl.ControlInfo.ControlSpacingInfo.Indention;
         margin.Left = indent * indentSize;
     }
     return(margin);
 }
Exemplo n.º 19
0
        public UIRenderer(Renderer renderer,
                          System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
                          System.Drawing.Size size, int zNear, int zFar)
        {
            this.Controls = new ILayoutCollection(this);

            this.Renderer = renderer;
            this.Anchor   = anchor; this.Margin = margin;
            this.Size     = size; this.zNear = zNear; this.zFar = zFar;
        }
Exemplo n.º 20
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     SuspendLayout();
     //
     // UITitlePanel
     //
     Name    = "UITitlePanel";
     Padding = new System.Windows.Forms.Padding(1, 35, 1, 1);
     ResumeLayout(false);
 }
Exemplo n.º 21
0
        private static void MarginCombo_ValueChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            MarginCombo combo = (MarginCombo)dependencyObject;
            Padding     p     = (Padding)dependencyPropertyChangedEventArgs.NewValue;

            combo.entries[1].Value = p.Left;
            combo.entries[2].Value = p.Top;
            combo.entries[3].Value = p.Right;
            combo.entries[4].Value = p.Bottom;
            combo.entries[0].Value = combo.entries.Skip(1).All(e => e.Value == p.Left) ? p.Left : -1;
        }
Exemplo n.º 22
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     SuspendLayout();
     //
     // UIControlBase
     //
     Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
     Name   = "UIPanel";
     Size   = new System.Drawing.Size(270, 180);
     ResumeLayout(false);
 }
Exemplo n.º 23
0
        /// <summary>
        /// Render scene to an area of canvas.
        /// </summary>
        /// <param name="camera"></param>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        public ViewPort(ICamera camera,
                        System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
                        System.Drawing.Size size)
        {
            this.Children = new ChildList <ViewPort>(this);// new ILayoutList(this);

            this.Camera = camera;
            this.Anchor = anchor;
            this.Margin = margin;
            this.Size   = size;
        }
Exemplo n.º 24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIRenderer(
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar)
        {
            this.Children = new TreeNodeChildren(this);// new ILayoutList(this);

            this.Anchor = anchor; this.Margin = margin;
            this.Size   = size; this.zNear = zNear; this.zFar = zFar;

            this.ClearDepthBuffer = true;
            this.Enabled          = true;
        }
Exemplo n.º 25
0
 public StoneTextBox()
 {
     Background = null;
     Size       = new Vector2(350, 28);
     Padding    = new System.Windows.Forms.Padding(3);
     Font       = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color      = System.Drawing.Color.White,
     };
     ValidInput = TextBoxValidInput.All;
 }
        /// <summary>
        /// 彩色的色标带。
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIColorPaletteBarRenderer(
            CodedColor[] codedColors,
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar)
            : base(anchor, margin, size, zNear, zFar)
        {
            this.codedColors = codedColors;

            var model = new QuadStripModel(1);

            this.Renderer = QuadStripRenderer.Create(model);
        }
Exemplo n.º 27
0
 private System.Drawing.Point GetScreenLocation(System.Windows.Forms.Control c)
 {
     if (c is System.Windows.Forms.Form)
     {
         System.Drawing.Point point1 = c.Location;
         point1.Y += 25;
         return(point1);
     }
     if (c is System.Windows.Forms.SplitterPanel)
     {
         System.Drawing.Point point2 = GetScreenLocation(c.Parent);
         System.Windows.Forms.SplitContainer splitContainer = (System.Windows.Forms.SplitContainer)c.Parent;
         if (splitContainer.Orientation == System.Windows.Forms.Orientation.Vertical)
         {
             if ((splitContainer.Panel2 == c) && !splitContainer.Panel1Collapsed)
             {
                 point2.X += splitContainer.SplitterDistance;
                 point2.X += splitContainer.SplitterWidth;
                 System.Windows.Forms.Padding padding1 = ((System.Windows.Forms.SplitterPanel)c).Padding;
                 point2.X += padding1.Left;
             }
         }
         else if ((splitContainer.Panel2 == c) && !splitContainer.Panel1Collapsed)
         {
             point2.Y += splitContainer.SplitterDistance;
             point2.Y += splitContainer.SplitterWidth;
             System.Windows.Forms.Padding padding2 = ((System.Windows.Forms.SplitterPanel)c).Padding;
             point2.Y += padding2.Top;
         }
         return(point2);
     }
     if (c is Oranikle.Studio.Controls.StyledPanel)
     {
         System.Drawing.Point point3 = GetScreenLocation(c.Parent);
         System.Drawing.Point point5 = c.Location;
         point3.X += point5.X;
         System.Drawing.Point point6 = c.Location;
         point3.Y += point6.Y;
         if (((Oranikle.Studio.Controls.StyledPanel)c).BorderStyle == System.Windows.Forms.BorderStyle.FixedSingle)
         {
             point3.X += ((Oranikle.Studio.Controls.StyledPanel)c).BorderWidth;
             point3.Y += ((Oranikle.Studio.Controls.StyledPanel)c).BorderWidth;
         }
         return(point3);
     }
     System.Drawing.Point point4 = GetScreenLocation(c.Parent);
     System.Drawing.Point point7 = c.Location;
     point4.X += point7.X;
     System.Drawing.Point point8 = c.Location;
     point4.Y += point8.Y;
     return(point4);
 }
Exemplo n.º 28
0
        /// <summary>
        /// adjust label's margin in order to get perfect position after Layout().
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void label_beforeLayout(object sender, EventArgs e)
        {
            int   count    = currentMarkersCount - 1;
            var   label    = sender as UIText;
            int   index    = this.labelList.IndexOf(label);
            float distance = marginLeft;

            distance += (float)index / (float)count * (float)(this.Size.Width - marginLeft - marginRight);
            distance -= label.Size.Width / 2;
            System.Windows.Forms.Padding padding = label.Margin;
            padding.Left = (int)distance;
            label.Margin = padding;
        }
Exemplo n.º 29
0
 public Window()
 {
     Size       = new Vector2(0, 200);
     Background = new ImageGraphic
     {
         Texture = new TextureConcretizer {
             TextureDescription =
                 new global::Graphics.Software.Textures.SingleColorTexture(
                     System.Drawing.Color.FromArgb(178, 0, 0, 0))
         }
     };
     Padding = new System.Windows.Forms.Padding(10, 20, 10, 20);
 }
Exemplo n.º 30
0
 public StoneCheckbox()
 {
     Size           = new Vector2(117, 38);
     Background     = null;
     CheckedGraphic = null;
     Margin         = new System.Windows.Forms.Padding(4);
     Font           = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color      = System.Drawing.Color.White,
         Backdrop   = System.Drawing.Color.Black
     };
 }
        /// <summary>
        /// 彩色的色标带。
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIColorPaletteColoredBarRenderer(
            int maxMarkerCount,
            CodedColor[] codedColors,
            System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
            System.Drawing.Size size, int zNear, int zFar)
            : base(anchor, margin, size, zNear, zFar)
        {
            this.codedColors = codedColors;

            var model = new QuadStripColoredModel(maxMarkerCount, codedColors.GetBitmap(1024));

            this.Renderer = QuadStripColoredRenderer.Create(model);
        }
Exemplo n.º 32
0
 private void InitializeComponent()
 {
     SuspendLayout();
     //
     // CharacterControl
     //
     AutoScaleDimensions = new System.Drawing.SizeF(34F, 36F);
     Font   = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
     Margin = new System.Windows.Forms.Padding(17, 8, 17, 8);
     Name   = "CharacterControl";
     Size   = new System.Drawing.Size(1173, 665);
     ResumeLayout(false);
 }
Exemplo n.º 33
0
		public virtual System.Windows.Forms.Padding Parse(Thickness thickness)
		{
			if (thickness == null)
			{
				return default(System.Windows.Forms.Padding);
			}

			System.Windows.Forms.Padding padding = new System.Windows.Forms.Padding();

			if (thickness.Left.HasValue) padding.Left = (int)thickness.Left;
			if (thickness.Top.HasValue) padding.Top = (int)thickness.Top;
			if (thickness.Right.HasValue) padding.Right = (int)thickness.Right;
			if (thickness.Bottom.HasValue) padding.Bottom = (int)thickness.Bottom;

			return padding;
		}
Exemplo n.º 34
0
        public CustomMapControl()
        {
            Background = InterfaceScene.DefaultFormBorder;
            Background.Alpha = 0.2f;
            Size = new Vector2(500, 150);
            Padding = new System.Windows.Forms.Padding(10);

            LargeStoneButton openButton = new LargeStoneButton
            {
                Text = "Open custom map",
                Anchor = Orientation.Center,
                Size = new Vector2(300, 62)
            };
            openButton.Click += new EventHandler(openButton_Click);
            AddChild(openButton);
        }
Exemplo n.º 35
0
        private void CreatePanel()
        {
            BackColor = Color.Black;
            Padding = new System.Windows.Forms.Padding(3,3,0,0);
            puttyPanel = new PuttyPanel();
            SuspendLayout();
            puttyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
            puttyPanel.Location = new System.Drawing.Point(0, 0);
            puttyPanel.Name = "puttyPanel";
            puttyPanel.TabIndex = 0;
            //this.puttyPanel.m_CloseCallback = this.m_ApplicationExit;
            Controls.Add(this.puttyPanel);
            puttyPanel.CreateApplication();
            ResumeLayout();

            TabText = "PuTTY";
        }
Exemplo n.º 36
0
        /// <summary>
        /// Creates a new Ribbon control
        /// </summary>
        public Ribbon()
        {
            SetStyle(System.Windows.Forms.ControlStyles.ResizeRedraw, true);
            SetStyle(System.Windows.Forms.ControlStyles.Selectable, false);
            DoubleBuffered = true;
            Dock = System.Windows.Forms.DockStyle.Top;

            _tabs = new RibbonTabCollection(this);
            _contexts = new RibbonContextCollection(this);

            _tabsMargin = new System.Windows.Forms.Padding(48, 2, 20, 0);
            _tabTextMargin = new System.Windows.Forms.Padding(4, 2, 4, 2);
            _tabsPadding = new System.Windows.Forms.Padding(8, 5, 8, 3);
            _tabContentMargin = new System.Windows.Forms.Padding(1, 0, 1, 2);
            _panelPadding = new System.Windows.Forms.Padding(3);
            _panelMargin = new System.Windows.Forms.Padding(3, 2, 3, 15);
            _panelSpacing = 3;
            _itemPadding = new System.Windows.Forms.Padding(1, 0, 1, 0);
            _itemMargin = new System.Windows.Forms.Padding(4, 2, 4, 2);
            _tabSpacing = 6;
            _dropDownMargin = new System.Windows.Forms.Padding(2);
            _renderer = new RibbonProfessionalRenderer();
        }
Exemplo n.º 37
0
 ///  static FromControl Methods (relative to the control)
 public static FloatRect FromClientInfo(FloatPoint ClientSize, Padding pad)
 {
     return new FloatRect(FloatPoint.GetPaddingTopLeft(pad), ClientSize - FloatPoint.GetPaddingOffset(pad));
 }
Exemplo n.º 38
0
 ///  static FromControl Methods (relative to the control)
 public static FloatRect FromControl(Control ctl, Padding pad)
 {
     return new FloatRect(FloatPoint.GetPaddingTopLeft(pad), FloatPoint.GetClientSize(ctl) - FloatPoint.GetPaddingOffset(pad));
 }
Exemplo n.º 39
0
 /// <para>• p.Top,p.Right,p.Bottom,p.Left</para>
 public static FloatRect FromPadding(Padding p)
 {
     return new FloatRect(p.Left, p.Top, p.Right, p.Bottom);
 }
 public ComponentSelectorControl()
 {
     Padding = new Padding(12);
 }
Exemplo n.º 41
0
        public StoneDropDownBar()
        {
            Size = new Vector2(243, 28);
            Padding = new System.Windows.Forms.Padding(1, 1, 25, 1);
            Background = new ImageGraphic
            {
                SizeMode = SizeMode.AutoAdjust
            };

            if (Disabled)
                NormalTexture = new TextureFromFile("Interface/Common/DropdownInactive1.png") { DontScale = true };
            else
                NormalTexture = new TextureFromFile("Interface/Common/Dropdown1.png") { DontScale = true };

            HoverTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png") { DontScale = true };
            ClickTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png") { DontScale = true };
            Font = new Font
            {
                SystemFont = Fonts.MediumSystemFont,
                Color = System.Drawing.Color.White
            };
            DropDownBackground = //InterfaceScene.DefaultSlimBorder;
                new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(
                            System.Drawing.Color.FromArgb(220, 0, 0, 0))
                    }
                };
        }
Exemplo n.º 42
0
        public MapToolTip()
        {
            Background = InterfaceScene.DefaultSlimBorder;
            Padding = new System.Windows.Forms.Padding(5);
            Clickable = false;
            AutoSize = true;
            HorizontalFill = false;
            Newline = false;

            AddChild(title);
            title.Size = new Vector2(width, 0);
            AddChild(new Control { Size = new Vector2(width, 10) });
            AddChild(new Label
            {
                Background = null,
                Text = Locale.Resource.GenObjectives,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.Gold,
                },
                Size = new Vector2(width, 0),
                AutoSize = AutoSizeMode.Vertical,
                Dock = System.Windows.Forms.DockStyle.Top,
                Clickable = false,
            });
            AddChild(objective);
            objective.Size = new Vector2(width, 0);

            AddChild(new Control { Size = new Vector2(width, 10) });

            AddChild(completedTextBox);
            AddChild(silverCoinTextBox);
        }
Exemplo n.º 43
0
 /// <para>• p.Top,p.Right,p.Bottom,p.Left</para>
 public static DoubleRect FromPadding(Padding p)
 {
     return new DoubleRect(p.Left, p.Top, p.Right, p.Bottom);
 }
Exemplo n.º 44
0
 public StoneTextBox()
 {
     Background = null;
     Size = new Vector2(350, 28);
     Padding = new System.Windows.Forms.Padding(3);
     Font = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color = System.Drawing.Color.White,
     };
     ValidInput = TextBoxValidInput.All;
 }
Exemplo n.º 45
0
        protected override void OnConstruct()
        {
            Size = new Vector2(1000, 600);
            Padding = new System.Windows.Forms.Padding(20);
            Anchor = global::Graphics.Orientation.Center;
            Clickable = true;
            ControlBox = false;
            ClearChildren();

            var topBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 70),
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Padding = new System.Windows.Forms.Padding(0, 0, 0, 5)
            };
            AddChild(topBar);

            Control topLeftBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(500, 0)
            };
            topBar.AddChild(topLeftBar);
            var winLoseTextBox = new Label
            {
                Font = new Graphics.Content.Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color = System.Drawing.Color.Green,
                },
                AutoSize = AutoSizeMode.Full,
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock = System.Windows.Forms.DockStyle.Top,
                Background = null,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            topLeftBar.AddChild(winLoseTextBox);

            if (GameState == GameState.Won)
            {
                winLoseTextBox.Text = Locale.Resource.ScoreVictory;
                winLoseTextBox.Font.Color = System.Drawing.Color.Green;
            }
            else
            {
                winLoseTextBox.Text = Locale.Resource.ScoreDefeat;
                winLoseTextBox.Font.Color = System.Drawing.Color.Red;
                topLeftBar.AddChild(new Label
                {
                    Font = new Font
                    {
                        SystemFont = Fonts.MediumSystemFont,
                        Color = System.Drawing.Color.White
                    },
                    Background = null,
                    Dock = System.Windows.Forms.DockStyle.Fill,
                    Text = LostGameReason,
                    TextAnchor = global::Graphics.Orientation.TopLeft,
                });
            }

            Control trPanel = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Right,
                Size = new Vector2(200, 40)
            };
            topBar.AddChild(trPanel);

            var gt = new DateTime(TimeSpan.FromSeconds(GameTime).Ticks);

            var timeLeftTextBox = new Label
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Background = null,
                Size = new Vector2(120, 20),
                TextAnchor = global::Graphics.Orientation.BottomRight,
            };
            timeLeftTextBox.Text = Locale.Resource.GenTime + ": " + gt.ToString("mm:ss");

            trPanel.AddChild(timeLeftTextBox);
            if (SilverEnabled)
            {
                Control silverTextContainer = new Control
                {
                    Dock = System.Windows.Forms.DockStyle.Bottom,
                    Size = new Vector2(0, 30),
                };
                trPanel.AddChild(silverTextContainer);
                silverTextContainer.AddChild(new SilverText
                {
                    Anchor = Orientation.BottomRight,
                    Size = new Vector2(120, 30),
                    Background = null,
                    SilverYield = SilverYield
                });
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 1)
            });

            Control bottomBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 50)
            };
            AddChild(bottomBar);

            FlowLayout leftBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomLeft
            };
            bottomBar.AddChild(leftBottomFlow);

            FlowLayout rightBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomRight,
                Origin = FlowOrigin.BottomRight,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            bottomBar.AddChild(rightBottomFlow);

            ButtonBase mainMenuButton = new StoneButton
            {
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            if (FirstTimeCompletedMap)
                mainMenuButton.Text = Locale.Resource.GenContinue;
            else
                mainMenuButton.Text = Locale.Resource.GenMainMenu;
            rightBottomFlow.AddChild(mainMenuButton);
            mainMenuButton.Click += new EventHandler(mainMenuButton_Click);

            ButtonBase playAgainButton = new StoneButton
            {
                Text = Locale.Resource.GenPlayAgain,
                Visible = EarnedGoldCoins == 0,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            rightBottomFlow.AddChild(playAgainButton);
            playAgainButton.Click += new EventHandler(playAgainButton_Click);

            if (FirstTimeCompletedMap && Program.Settings.DisplayMapRatingDialog == MapRatingDialogSetup.Optional)
            {
                ButtonBase rateMapButton = new StoneButton
                {
                    Text = Locale.Resource.GenRateMap,
                    AutoSize = AutoSizeMode.Horizontal,
                    Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
                };
                rightBottomFlow.AddChild(rateMapButton);
                rateMapButton.Click += new EventHandler(rateMapButton_Click);
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 1)
            });

            Control main = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            AddChild(main);

            //////////////////////////
            // STATS /////////////////
            //////////////////////////

            StatsControl stats = new StatsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                Visible = false
            };
            stats.GameState = GameState;
            stats.LostGameReason = LostGameReason;
            stats.Statistics = Statistics;
            stats.Map = Map;
            main.AddChild(stats);

            //////////////////////////
            // REWARDS ///////////////
            //////////////////////////

            ResultsAndRewardsControl rewards = new ResultsAndRewardsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Anchor = global::Graphics.Orientation.TopRight
            };
            rewards.GameState = GameState;
            rewards.EarnedGoldCoins = EarnedGoldCoins;
            rewards.NPlaythroughs = NPlaythroughs;
            rewards.AchievementsEarned = AchievementsEarned;
            rewards.SilverYield = SilverYield;
            rewards.PreviousMaxSilverYield = PreviousMaxSilverYield;
            rewards.FirstTimeCompletedMap = FirstTimeCompletedMap;
            rewards.CurrentStages = CurrentStages;
            rewards.BestStages = BestStages;
            rewards.Map = Map;
            main.AddChild(rewards);

            /////////////////////
            // Switch buttons
            /////////////////////

            CheckboxBase rnrButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreRewardsAndResults,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = true,
                AutoCheck = false,
                Size = new Vector2(200, 38),
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(rnrButton);

            CheckboxBase statsButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreStats,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = false,
                AutoCheck = false,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(statsButton);

            if (HideStats)
            {
                leftBottomFlow.Visible = false;
                stats.Visible = false;
            }
            else
            {
                statsButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = false;
                    statsButton.Checked = stats.Visible = true;
                });
                rnrButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = true;
                    statsButton.Checked = stats.Visible = false;
                });
            }

            base.OnConstruct();
        }
Exemplo n.º 46
0
 public StoneCheckbox()
 {
     Size = new Vector2(117, 38);
     Background = null;
     CheckedGraphic = null;
     Margin = new System.Windows.Forms.Padding(4);
     Font = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color = System.Drawing.Color.White,
         Backdrop = System.Drawing.Color.Black
     };
 }
Exemplo n.º 47
0
 public Window()
 {
     Size = new Vector2(0, 200);
     Background = new ImageGraphic
     {
         Texture = new TextureConcretizer { TextureDescription =
         new global::Graphics.Software.Textures.SingleColorTexture(
             System.Drawing.Color.FromArgb(178, 0, 0, 0))
         }
     };
     Padding = new System.Windows.Forms.Padding(10, 20, 10, 20);
 }
Exemplo n.º 48
0
 public ClickableTextButton()
 {
     Font = Fonts.Default;
     Clickable = true;
     Background = InterfaceScene.DefaultSlimBorder;
     Padding = new System.Windows.Forms.Padding(2);
 }
 public PaddingWrapper(System.Windows.Forms.Padding padding)
 {
     this.Padding = padding;
 }
Exemplo n.º 50
0
        public InGameMenuScreen()
        {
            Anchor = global::Graphics.Orientation.Center;
            ControlBox = false;
            LargeWindow = true;
            Padding = new System.Windows.Forms.Padding(20, 20, 20, 20);
            Localization = new Common.StringLocalizationStorage();

            AddChild(topBar);
            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust,
                },
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 1)
            });
            AddChild(bottomBar);
            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust,
                },
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 1)
            });
            AddChild(innerControl);

            topBar.AddChild(nameTextBox);

            innerControl.AddChild(objectives);
            objectives.AddChild(objectivesTextBox);
            objectives.AddChild(infoTextBox);
        }
Exemplo n.º 51
0
		System.Windows.Forms.Padding CalculateCompleteContentPadding(bool user, bool source)
		{
			var padding = new System.Windows.Forms.Padding();
			
			if(user)
				padding += GameExtraPadding;

			//an experimental feature
			if(source)
				if (Global.Emulator is BizHawk.Emulation.Cores.Sony.PSX.Octoshock)
				{
					var psx = Global.Emulator as BizHawk.Emulation.Cores.Sony.PSX.Octoshock;
					var core_padding = psx.VideoProvider_Padding;
					padding.Left += core_padding.Width / 2;
					padding.Right += core_padding.Width - core_padding.Width / 2;
					padding.Top += core_padding.Height / 2;
					padding.Bottom += core_padding.Height - core_padding.Height / 2;
				}

			return padding;
		}
Exemplo n.º 52
0
 ///  static FromControl Methods (relative to the control)
 public static DoubleRect FromControl(Control ctl, Padding pad)
 {
     return new DoubleRect(DoublePoint.GetPaddingTopLeft(pad), DoublePoint.GetClientSize(ctl) - DoublePoint.GetPaddingOffset(pad));
 }
Exemplo n.º 53
0
        public SelectProfileControl()
        {
            Background = InterfaceScene.DefaultFormBorder;
            Size = new Vector2(500, 200);
            Padding = new System.Windows.Forms.Padding(20);
            Background.Alpha = 0.2f;

            Control right = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            Control left = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(140, 0)
            };

            Control profileContainer = new Control
            {
                Size = new Vector2(243, 70),
                Anchor = Orientation.Top
            };
            profileContainer.AddChild(new Label
            {
                Text = Locale.Resource.GenProfile,
                AutoSize = AutoSizeMode.Full,
                Font = Fonts.Default,
                Anchor = Orientation.TopLeft,
                Background = null,
            });
            profiles = new StoneDropDownBar
            {
                Position = new Vector2(0, 15),
                Anchor = Orientation.TopLeft
            };
            profileContainer.AddChild(profiles);
            PopuplateProfiles();

            Control newRemoveFlow = new FlowLayout
            {
                HorizontalFill = true,
                Newline = false,
                AutoSize = true,
                Position = new Vector2(0, 45),
                Anchor = Orientation.TopRight,
            };
            profileContainer.AddChild(newRemoveFlow);

            var newProfile = new ClickableTextButton
            {
                Text = Locale.Resource.GenNew,
                AutoSize = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };
            newProfile.Click += new EventHandler(newProfile_Click);
            newRemoveFlow.AddChild(newProfile);

            var removeProfile = new ClickableTextButton
            {
                Text = Locale.Resource.GenRemove,
                AutoSize = AutoSizeMode.Full,
                TextAnchor = Orientation.Center,
                Margin = new System.Windows.Forms.Padding(3, 0, 3, 0)
            };
            removeProfile.Click += new EventHandler(removeProfile_Click);
            newRemoveFlow.AddChild(removeProfile);

            var start = new LargeStoneButton
            {
                Text = Locale.Resource.GenLogin,
                Position = new Vector2(0, 90),
                Anchor = Orientation.Top,
                Size = new Vector2(230, 62)
            };
            start.Click += new EventHandler(start_Click);
            right.AddChild(start);

            FlowLayout leftFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = false,
                Newline = false,
                Anchor = Orientation.Center
            };
            left.AddChild(leftFlow);

            var support = new StoneButton
            {
                Text = Locale.Resource.GenSupport,
                Margin = new System.Windows.Forms.Padding(5)
            };
            support.Click += new EventHandler(support_Click);
            leftFlow.AddChild(support);

            var options = new StoneButton
            {
                Text = Locale.Resource.GenOptions,
                Margin = new System.Windows.Forms.Padding(5)
            };
            options.Click += new EventHandler(options_Click);
            leftFlow.AddChild(options);

            var quit = new StoneButton
            {
                Text = Locale.Resource.GenQuit,
                Margin = new System.Windows.Forms.Padding(5)
            };
            quit.Click += new EventHandler(quit_Click);
            leftFlow.AddChild(quit);

            right.AddChild(profileContainer);
            AddChild(left);

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(1, 1)
            });

            AddChild(right);
        }
Exemplo n.º 54
0
 ///  static FromControl Methods (relative to the control)
 public static DoubleRect FromClientInfo(DoublePoint ClientSize, Padding pad)
 {
     return new DoubleRect(DoublePoint.GetPaddingTopLeft(pad), ClientSize - DoublePoint.GetPaddingOffset(pad));
 }
Exemplo n.º 55
0
 public StoneButton()
 {
     Size = new Vector2(117, 38);
     Background = null;
     Font = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color = System.Drawing.Color.White,
         Backdrop = System.Drawing.Color.Black
     };
     DisabledFont = new Font
     {
         SystemFont = Fonts.MediumSystemFont,
         Color = System.Drawing.Color.Gray,
         Backdrop = System.Drawing.Color.Black
     };
     Margin = new System.Windows.Forms.Padding(4);
     backgroundLeftSize = 52;
     backgroundRightSize = 30;
     backgroundHeight = 49;
     backgroundRightPadding = 5;
     backgroundOffset = new Vector3(-7, -7, 0);
 }