Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        BorderControl borders = target as BorderControl;

        if (DrawDefaultInspector())
        {
            borders.Generate();
        }

        if (GUILayout.Button("Generate borders"))
        {
            borders.Generate();
        }
    }
Ejemplo n.º 2
0
    //Increase the Circle and also decrease the TextMesh gameobject and increase the TextMesh text when 2 or more circles are joined
    void ManageSizeIfJoined()
    {
        Transform     childrnA, childrnB;
        BorderControl bc = collider1.GetComponent <BorderControl> ();

        GameObject[] OtherCircles = new GameObject[bc.joinedCircle.Length];
        for (int k = 0; k < bc.joinedCircle.Length; k++)
        {
            OtherCircles [k] = bc.joinedCircle [k];

            childrnA = collider1.transform.GetChild(0).transform;
            childrnB = OtherCircles [k].transform.GetChild(0).transform;

            num    = int.Parse(childrnA.GetComponent <TextMesh> ().text);
            num1   = int.Parse(childrnB.GetComponent <TextMesh> ().text);
            temp1 += 0.01f;
            temp2 += 0.01f;

            collider1.transform.localScale        += Vector3.one * mainScale;
            OtherCircles [k].transform.localScale -= Vector3.one * mainScale;

            childrnA.localScale += Vector3.one * textScale;
            childrnB.localScale -= Vector3.one * textScale;

            if (temp1 >= fontThreshold)
            {
                temp1 = 0f;
                childrnA.GetComponent <TextMesh> ().fontSize += 1;
                childrnB.GetComponent <TextMesh> ().fontSize -= 1;
            }
            if (temp2 >= numThreshold)
            {
                temp2 = 0;
                num  += 1;
                num1 -= 1;
                childrnA.GetComponent <TextMesh> ().text = num.ToString();
                childrnB.GetComponent <TextMesh> ().text = num1.ToString();

                if (childrnB.transform.localScale.x <= 0f)
                {
                    OtherCircles [k].GetComponent <Collider2D> ().enabled = false;
                }
            }
        }
    }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            BorderControl borderControl = new BorderControl();

            var command = Console.ReadLine().Split().ToArray();

            while (command[0] != "End")
            {
                if (command.Length == 3)
                {
                    borderControl.Control(command[0], command[1], command[2]);
                }
                else if (command.Length == 2)
                {
                    borderControl.Control(command[0], command[1]);
                }
                command = Console.ReadLine().Split().ToArray();
            }
            borderControl.Detained(Console.ReadLine());
        }
Ejemplo n.º 4
0
        public BlogPostHtmlSourceEditorControl(IBlogPostSpellCheckingContext spellingContext, CommandManager commandManager, IBlogPostImageEditingContext editingContext)
        {
            this.spellingContext = spellingContext;
            this.editingContext  = editingContext;
            InitializeComponent();

            sourceControl = new HtmlSourceEditorControl(spellingContext.SpellingChecker, commandManager, editingContext);
            sourceControl.EditorControl.TextChanged += new EventHandler(EditorControl_TextChanged);
            sourceControl.EditorControl.GotFocus    += new EventHandler(EditorControl_GotFocus);
            BorderControl borderControl = new BorderControl();

            borderControl.SuppressBottomBorder = true;
            borderControl.Control = sourceControl.EditorControl;
            borderControl.Dock    = DockStyle.Fill;
            panelSourceEditor.Controls.Add(borderControl);

            ColorizedResources.Instance.RegisterControlForBackColorUpdates(this);

            textBoxTitle.AccessibleName = Res.Get(StringId.PostEditorTitleRegion);
            sourceControl.EditorControl.AccessibleName = Res.Get(StringId.PostEditorBodyRegion);
        }
Ejemplo n.º 5
0
    void Initialize(Form form, DockStyle ds, Control userControl)
    {
        // Remember the form we are hosted on
        _form = form;

        // Create the resizing bar, gripper handle and border control
        _resize  = new DockingResize(ds);
        _handle  = new DockingHandle(this, ds);
        _wrapper = new BorderControl(userControl);

        // Wrapper should always fill remaining area
        _wrapper.Dock = DockStyle.Fill;

        // Define our own initial docking position for when we are added to host form
        this.Dock = ds;

        // NOTE: Order of array contents is important
        // Controls in the array are positioned from right to left when the
        // form makes size/position calculations for docking controls, so the
        // _wrapper is placed last in calculation (therefore first in array)
        // because we want it to fill the remaining space.
        Controls.AddRange(new Control[] { _wrapper, _handle, _resize });
    }
Ejemplo n.º 6
0
        public void UpdateCameraBorderBounds(int index, Rectangle rect)
        {
            if (!CameraBorders.ContainsKey(index))
            {
                var border = new BorderControl(BlankTexture, 2, Color.LightGray)
                {
                    Bounds = new UniRectangle(10, 36, MinimapTexture.Width, MinimapTexture.Height)
                };
                CameraBorders.Add(index, border);
                Children.Insert(0, border);
            }

            var minimap = Minimap.GetAbsoluteBounds();

            float x = Minimap.Bounds.Left.Offset + rect.X - minimap.X,
                  y = Minimap.Bounds.Top.Offset + rect.Y - minimap.Y;

            CameraBorders[index].Bounds = new UniRectangle(x, y, rect.Width, rect.Height);

            // Set border color
            CameraBorders[index].BorderColor = (index == _world.ActiveCameraIndex)
                                                   ? ActiveBorderColor
                                                   : InactiveBorderColor;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.videoCode     = new OpenLiveWriter.Controls.TextBoxWithPaste();
     this.previewButton = new System.Windows.Forms.Button();
     this.previewBox    = new System.Windows.Forms.WebBrowser();
     this.pictureBorder = new OpenLiveWriter.ApplicationFramework.BorderControl();
     this.lblSize       = new System.Windows.Forms.Label();
     this.lblService    = new System.Windows.Forms.Label();
     this.lblVideoCode  = new System.Windows.Forms.Label();
     this.SuspendLayout();
     //
     // videoCode
     //
     this.videoCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.videoCode.Location     = new System.Drawing.Point(8, 26);
     this.videoCode.Name         = "videoCode";
     this.videoCode.Size         = new System.Drawing.Size(185, 20);
     this.videoCode.TabIndex     = 15;
     this.videoCode.DoubleClick += new System.EventHandler(this.VideoCode_Enter);
     this.videoCode.TextChanged += new System.EventHandler(this.videoCode_TextChanged);
     this.videoCode.Enter       += new System.EventHandler(this.VideoCode_Enter);
     //
     // previewButton
     //
     this.previewButton.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.previewButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.previewButton.Location  = new System.Drawing.Point(197, 26);
     this.previewButton.Name      = "previewButton";
     this.previewButton.Size      = new System.Drawing.Size(75, 23);
     this.previewButton.TabIndex  = 16;
     this.previewButton.Text      = "&Preview";
     this.previewButton.Click    += new System.EventHandler(this._previewButton_Click);
     //
     // previewBox
     //
     this.previewBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                    | System.Windows.Forms.AnchorStyles.Right)));
     this.previewBox.Location = new System.Drawing.Point(0, 0);
     this.previewBox.Name     = "previewBox";
     this.previewBox.Size     = new System.Drawing.Size(259, 204);
     this.previewBox.TabIndex = 0;
     this.previewBox.TabStop  = false;
     //
     // pictureBorder
     //
     this.pictureBorder.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                        | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.pictureBorder.AutoHeight           = false;
     this.pictureBorder.BottomInset          = 0;
     this.pictureBorder.Control              = this.previewBox;
     this.pictureBorder.LeftInset            = 0;
     this.pictureBorder.Location             = new System.Drawing.Point(8, 50);
     this.pictureBorder.Name                 = "pictureBorder";
     this.pictureBorder.RightInset           = 0;
     this.pictureBorder.Size                 = new System.Drawing.Size(263, 208);
     this.pictureBorder.SuppressBottomBorder = false;
     this.pictureBorder.TabIndex             = 18;
     this.pictureBorder.TabStop              = false;
     this.pictureBorder.ThemeBorder          = false;
     this.pictureBorder.TopInset             = 0;
     //
     // lblSize
     //
     this.lblSize.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.lblSize.AutoSize  = true;
     this.lblSize.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.lblSize.Location  = new System.Drawing.Point(8, 262);
     this.lblSize.Name      = "lblSize";
     this.lblSize.Size      = new System.Drawing.Size(30, 13);
     this.lblSize.TabIndex  = 2;
     this.lblSize.Text      = "Size:";
     //
     // lblService
     //
     this.lblService.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.lblService.AutoSize  = true;
     this.lblService.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.lblService.Location  = new System.Drawing.Point(112, 262);
     this.lblService.Name      = "lblService";
     this.lblService.Size      = new System.Drawing.Size(46, 13);
     this.lblService.TabIndex  = 1;
     this.lblService.Text      = "Service:";
     //
     // lblVideoCode
     //
     this.lblVideoCode.Location = new System.Drawing.Point(8, 8);
     this.lblVideoCode.Name     = "lblVideoCode";
     this.lblVideoCode.Size     = new System.Drawing.Size(349, 15);
     this.lblVideoCode.TabIndex = 0;
     this.lblVideoCode.Text     = "&Video URL or Embed:";
     //
     // WebVideoSource
     //
     this.Controls.Add(this.lblVideoCode);
     this.Controls.Add(this.lblService);
     this.Controls.Add(this.lblSize);
     this.Controls.Add(this.videoCode);
     this.Controls.Add(this.previewButton);
     this.Controls.Add(this.pictureBorder);
     this.Name = "WebVideoSource";
     this.Size = new System.Drawing.Size(279, 279);
     this.ResumeLayout(false);
     this.PerformLayout();
 }