Click here to Skip to main content
15,896,063 members
Articles / Programming Languages / C#

The theory of moveable objects

Rate me:
Please Sign up or sign in to vote.
5.00/5 (126 votes)
24 Jan 2010CPOL97 min read 120.4K   3.2K   230  
This article describes an algorithm by which an object of an arbitrary shape can be made moveable and resizable.
namespace TheoryOfMoveableObjects
{
    partial class Form_NnodeCovers
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System .ComponentModel .IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose (bool disposing)
        {
            if (disposing && (components != null))
            {
                components .Dispose ();
            }
            base .Dispose (disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent ()
        {
            this .components = new System .ComponentModel .Container ();
            this .btnAddCircle = new System .Windows .Forms .Button ();
            this .btnAddRing = new System .Windows .Forms .Button ();
            this .btnAddStrip = new System .Windows .Forms .Button ();
            this .menuOnFigures = new System .Windows .Forms .ContextMenuStrip (this .components);
            this .miColor = new System .Windows .Forms .ToolStripMenuItem ();
            this .miDuplicate = new System .Windows .Forms .ToolStripMenuItem ();
            this .miDelete = new System .Windows .Forms .ToolStripMenuItem ();
            this .toolStripSeparator1 = new System .Windows .Forms .ToolStripSeparator ();
            this .miDeleteAll = new System .Windows .Forms .ToolStripMenuItem ();
            this .btnCovers = new System .Windows .Forms .Button ();
            this .btnPolyWithHole = new System .Windows .Forms .Button ();
            this .miPutOnTop = new System .Windows .Forms .ToolStripMenuItem ();
            this .miOneLevelUp = new System .Windows .Forms .ToolStripMenuItem ();
            this .miOneLevelDown = new System .Windows .Forms .ToolStripMenuItem ();
            this .miPutUnderneath = new System .Windows .Forms .ToolStripMenuItem ();
            this .toolStripSeparator2 = new System .Windows .Forms .ToolStripSeparator ();
            this .menuOnFigures .SuspendLayout ();
            this .SuspendLayout ();
            // 
            // btnAddCircle
            // 
            this .btnAddCircle .Location = new System .Drawing .Point (23, 78);
            this .btnAddCircle .MaximumSize = new System .Drawing .Size (180, 80);
            this .btnAddCircle .MinimumSize = new System .Drawing .Size (40, 28);
            this .btnAddCircle .Name = "btnAddCircle";
            this .btnAddCircle .Size = new System .Drawing .Size (100, 28);
            this .btnAddCircle .TabIndex = 4;
            this .btnAddCircle .Text = "Circle";
            this .btnAddCircle .UseVisualStyleBackColor = true;
            this .btnAddCircle .Click += new System .EventHandler (this .Click_btnAddCircle);
            // 
            // btnAddRing
            // 
            this .btnAddRing .Location = new System .Drawing .Point (23, 112);
            this .btnAddRing .MaximumSize = new System .Drawing .Size (180, 80);
            this .btnAddRing .MinimumSize = new System .Drawing .Size (40, 28);
            this .btnAddRing .Name = "btnAddRing";
            this .btnAddRing .Size = new System .Drawing .Size (100, 28);
            this .btnAddRing .TabIndex = 5;
            this .btnAddRing .Text = "Ring";
            this .btnAddRing .UseVisualStyleBackColor = true;
            this .btnAddRing .Click += new System .EventHandler (this .Click_btnAddRing);
            // 
            // btnAddStrip
            // 
            this .btnAddStrip .Location = new System .Drawing .Point (23, 146);
            this .btnAddStrip .MaximumSize = new System .Drawing .Size (180, 80);
            this .btnAddStrip .MinimumSize = new System .Drawing .Size (40, 28);
            this .btnAddStrip .Name = "btnAddStrip";
            this .btnAddStrip .Size = new System .Drawing .Size (100, 28);
            this .btnAddStrip .TabIndex = 6;
            this .btnAddStrip .Text = "Strip";
            this .btnAddStrip .UseVisualStyleBackColor = true;
            this .btnAddStrip .Click += new System .EventHandler (this .Click_btnAddStrip);
            // 
            // menuOnFigures
            // 
            this .menuOnFigures .Items .AddRange (new System .Windows .Forms .ToolStripItem [] {
            this.miPutOnTop,
            this.miOneLevelUp,
            this.miOneLevelDown,
            this.miPutUnderneath,
            this.toolStripSeparator1,
            this.miColor,
            this.miDuplicate,
            this.miDelete,
            this.toolStripSeparator2,
            this.miDeleteAll});
            this .menuOnFigures .Name = "menuOnFigures";
            this .menuOnFigures .ShowImageMargin = false;
            this .menuOnFigures .Size = new System .Drawing .Size (204, 214);
            this .menuOnFigures .Opening += new System .ComponentModel .CancelEventHandler (this .OnOpening_menuOnFigures);
            // 
            // miColor
            // 
            this .miColor .Name = "miColor";
            this .miColor .Size = new System .Drawing .Size (203, 22);
            this .miColor .Text = "Color...";
            this .miColor .Click += new System .EventHandler (this .Click_miColor);
            // 
            // miDuplicate
            // 
            this .miDuplicate .Name = "miDuplicate";
            this .miDuplicate .Size = new System .Drawing .Size (203, 22);
            this .miDuplicate .Text = "Duplicate";
            this .miDuplicate .Click += new System .EventHandler (this .Click_miDuplicate);
            // 
            // miDelete
            // 
            this .miDelete .Name = "miDelete";
            this .miDelete .Size = new System .Drawing .Size (203, 22);
            this .miDelete .Text = "Delete";
            this .miDelete .Click += new System .EventHandler (this .Click_miDelete);
            // 
            // toolStripSeparator1
            // 
            this .toolStripSeparator1 .Name = "toolStripSeparator1";
            this .toolStripSeparator1 .Size = new System .Drawing .Size (200, 6);
            // 
            // miDeleteAll
            // 
            this .miDeleteAll .Name = "miDeleteAll";
            this .miDeleteAll .Size = new System .Drawing .Size (203, 22);
            this .miDeleteAll .Text = "Delete all figures";
            this .miDeleteAll .Click += new System .EventHandler (this .Click_miDeleteAll);
            // 
            // btnCovers
            // 
            this .btnCovers .Image = global::TheoryOfMoveableObjects .Properties .Resources .Covers;
            this .btnCovers .Location = new System .Drawing .Point (12, 12);
            this .btnCovers .Name = "btnCovers";
            this .btnCovers .Size = new System .Drawing .Size (28, 28);
            this .btnCovers .TabIndex = 3;
            this .btnCovers .UseVisualStyleBackColor = true;
            this .btnCovers .Click += new System .EventHandler (this .Click_btnCovers);
            // 
            // btnPolyWithHole
            // 
            this .btnPolyWithHole .Location = new System .Drawing .Point (23, 180);
            this .btnPolyWithHole .MaximumSize = new System .Drawing .Size (180, 80);
            this .btnPolyWithHole .MinimumSize = new System .Drawing .Size (40, 28);
            this .btnPolyWithHole .Name = "btnPolyWithHole";
            this .btnPolyWithHole .Size = new System .Drawing .Size (100, 46);
            this .btnPolyWithHole .TabIndex = 7;
            this .btnPolyWithHole .Text = "Polygon with hole";
            this .btnPolyWithHole .UseVisualStyleBackColor = true;
            this .btnPolyWithHole .Click += new System .EventHandler (this .Click_btnPolygonWithHole);
            // 
            // miPutOnTop
            // 
            this .miPutOnTop .Name = "miPutOnTop";
            this .miPutOnTop .Size = new System .Drawing .Size (203, 22);
            this .miPutOnTop .Text = "Put on top";
            this .miPutOnTop .Click += new System .EventHandler (this .Click_miPutOnTop);
            // 
            // miOneLevelUp
            // 
            this .miOneLevelUp .Name = "miOneLevelUp";
            this .miOneLevelUp .Size = new System .Drawing .Size (203, 22);
            this .miOneLevelUp .Text = "Move one level up";
            this .miOneLevelUp .Click += new System .EventHandler (this .Click_miOneLevelUp);
            // 
            // miOneLevelDown
            // 
            this .miOneLevelDown .Name = "miOneLevelDown";
            this .miOneLevelDown .Size = new System .Drawing .Size (203, 22);
            this .miOneLevelDown .Text = "Move one level down";
            this .miOneLevelDown .Click += new System .EventHandler (this .Click_miOneLevelDown);
            // 
            // miPutUnderneath
            // 
            this .miPutUnderneath .Name = "miPutUnderneath";
            this .miPutUnderneath .Size = new System .Drawing .Size (203, 22);
            this .miPutUnderneath .Text = "Put underneath";
            this .miPutUnderneath .Click += new System .EventHandler (this .Click_miPutUnderneath);
            // 
            // toolStripSeparator2
            // 
            this .toolStripSeparator2 .Name = "toolStripSeparator2";
            this .toolStripSeparator2 .Size = new System .Drawing .Size (200, 6);
            // 
            // Form_NnodeCovers
            // 
            this .AutoScaleDimensions = new System .Drawing .SizeF (8F, 16F);
            this .AutoScaleMode = System .Windows .Forms .AutoScaleMode .Font;
            this .ClientSize = new System .Drawing .Size (744, 509);
            this .Controls .Add (this .btnCovers);
            this .Controls .Add (this .btnPolyWithHole);
            this .Controls .Add (this .btnAddCircle);
            this .Controls .Add (this .btnAddRing);
            this .Controls .Add (this .btnAddStrip);
            this .DoubleBuffered = true;
            this .MaximizeBox = false;
            this .MinimizeBox = false;
            this .Name = "Form_NnodeCovers";
            this .ShowIcon = false;
            this .Text = "N-node covers";
            this .MouseUp += new System .Windows .Forms .MouseEventHandler (this .OnMouseUp);
            this .Paint += new System .Windows .Forms .PaintEventHandler (this .OnPaint);
            this .ContextMenuStripChanged += new System .EventHandler (this .OnContextMenuChanged);
            this .MouseDown += new System .Windows .Forms .MouseEventHandler (this .OnMouseDown);
            this .MouseMove += new System .Windows .Forms .MouseEventHandler (this .OnMouseMove);
            this .menuOnFigures .ResumeLayout (false);
            this .ResumeLayout (false);

        }

        #endregion

        private System .Windows .Forms .Button btnCovers;
        private System .Windows .Forms .Button btnAddCircle;
        private System .Windows .Forms .Button btnAddRing;
        private System .Windows .Forms .Button btnAddStrip;
        private System .Windows .Forms .ContextMenuStrip menuOnFigures;
        private System .Windows .Forms .ToolStripMenuItem miDuplicate;
        private System .Windows .Forms .ToolStripMenuItem miDelete;
        private System .Windows .Forms .ToolStripSeparator toolStripSeparator1;
        private System .Windows .Forms .ToolStripMenuItem miColor;
        private System .Windows .Forms .ToolStripMenuItem miDeleteAll;
        private System .Windows .Forms .Button btnPolyWithHole;
        private System .Windows .Forms .ToolStripMenuItem miPutOnTop;
        private System .Windows .Forms .ToolStripMenuItem miOneLevelUp;
        private System .Windows .Forms .ToolStripMenuItem miOneLevelDown;
        private System .Windows .Forms .ToolStripMenuItem miPutUnderneath;
        private System .Windows .Forms .ToolStripSeparator toolStripSeparator2;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions