Ejemplo n.º 1
0
        public Place(int id, string name, Point relatLoc, string description)
        {
            _Location = relatLoc;
            _Name = name;
            _Description = description;
            _ID = id;

            ClickLabel = new RelativeLabel(new Point (relatLoc.X - Size.Width/2, relatLoc.Y - Size.Height/2), Size);

            ClickLabel.Size = Size;
            ClickLabel.BackColor = Color.Transparent;
        }
Ejemplo n.º 2
0
        //FIXME: Bug causing empty Lines
        public LogMenu()
        {
            Location = new System.Drawing.Point(MainForm.ClientResolution.Width-Width,0);

            Add(new RelativeLabel(new System.Drawing.Point(0,0),new System.Drawing.Size(Width,Height)),"BackgroundLabel");
            GetControl("BackgroundLabel").BackColor = Color.Lime;

            BufferBox.Multiline  = true;
            BufferBox.ReadOnly = true;
            BufferBox.Cursor = Cursors.Default;
            //			BufferBox.BackColor = SystemColors.Control;
            //			BufferBox.BorderStyle = BorderStyle.None;
            BufferBox.Location = Point.Add(Location, new Size(Offset,Offset));
            BufferBox.Size = new Size(Width-2*Offset-SafetyOffset,Height-2*Offset);
            Add(BufferBox);

            Add(new RelativeLabel(new Point(2*Offset-ScrollLabelSize.Width,Offset-ScrollLabelSize.Height/2), ScrollLabelSize),"ScrollLabel");
            GetControl("ScrollLabel").BackColor = Color.Yellow;

            #region RelativeLable version
            RelativeLabel c = new RelativeLabel (new Point(Offset,Offset), new Size(Width-2*Offset,Height-2*Offset));
            c.BorderStyle = BorderStyle.None;
            c.BackColor = Color.Transparent;
            c.Parent = BufferBox;
            Add(c, "TextLabel");

            c.MouseEnter += delegate(object sender, EventArgs e) { c.Focus(); };
            c.MouseWheel += delegate(object sender, MouseEventArgs e)
            {
                ScrollPos -= 5*e.Delta/120;
            };
            #endregion

            #region Scroll-control
            //			GetControl("ScrollLabel").MouseDown += delegate(object sender, MouseEventArgs e)
            //			{
            //				ScrollDrag = true;
            //			};
            //			GetControl("ScrollLabel").MouseUp += delegate(object sender, MouseEventArgs e)
            //			{
            //				ScrollDrag = false;
            //			};
            //			GetControl("ScrollLabel").MouseMove += delegate(object sender, MouseEventArgs e)
            //			{
            //				if (ScrollDrag && (Location.Y + Offset - SLS.Height/2 < e.Y) && (e.Y < Location.Y + Offset + Height - SLS.Height/2))
            //				{
            //					GetControl("ScrollLabel").Top = e.Y;
            //				}
            //			};
            #endregion

            BringToFront();
        }
Ejemplo n.º 3
0
        public LogMenu()         //FIXME: Bug causing empty Lines
        {
            Location = new System.Drawing.Point(MainForm.ClientResolution.Width - Width, 0);

            Add(new RelativeLabel(new System.Drawing.Point(0, 0), new System.Drawing.Size(Width, Height)), "BackgroundLabel");
            GetControl("BackgroundLabel").BackColor = Color.Lime;

            BufferBox.Multiline = true;
            BufferBox.ReadOnly  = true;
            BufferBox.Cursor    = Cursors.Default;
//			BufferBox.BackColor = SystemColors.Control;
//			BufferBox.BorderStyle = BorderStyle.None;
            BufferBox.Location = Point.Add(Location, new Size(Offset, Offset));
            BufferBox.Size     = new Size(Width - 2 * Offset - SafetyOffset, Height - 2 * Offset);
            Add(BufferBox);

            Add(new RelativeLabel(new Point(2 * Offset - ScrollLabelSize.Width, Offset - ScrollLabelSize.Height / 2), ScrollLabelSize), "ScrollLabel");
            GetControl("ScrollLabel").BackColor = Color.Yellow;

            #region RelativeLable version
            RelativeLabel c = new RelativeLabel(new Point(Offset, Offset), new Size(Width - 2 * Offset, Height - 2 * Offset));
            c.BorderStyle = BorderStyle.None;
            c.BackColor   = Color.Transparent;
            c.Parent      = BufferBox;
            Add(c, "TextLabel");

            c.MouseEnter += delegate(object sender, EventArgs e) { c.Focus(); };
            c.MouseWheel += delegate(object sender, MouseEventArgs e)
            {
                ScrollPos -= 5 * e.Delta / 120;
            };
            #endregion

            #region Scroll-control
//			GetControl("ScrollLabel").MouseDown += delegate(object sender, MouseEventArgs e)
//			{
//				ScrollDrag = true;
//			};
//			GetControl("ScrollLabel").MouseUp += delegate(object sender, MouseEventArgs e)
//			{
//				ScrollDrag = false;
//			};
//			GetControl("ScrollLabel").MouseMove += delegate(object sender, MouseEventArgs e)
//			{
//				if (ScrollDrag && (Location.Y + Offset - SLS.Height/2 < e.Y) && (e.Y < Location.Y + Offset + Height - SLS.Height/2))
//				{
//					GetControl("ScrollLabel").Top = e.Y;
//				}
//			};
            #endregion

            BringToFront();
        }
Ejemplo n.º 4
0
        public static Size Size = new Size(100, 100);           //Adjustable

        public Place(int id, string name, Point relatLoc, string description)
        {
            _Location    = relatLoc;
            _Name        = name;
            _Description = description;
            _ID          = id;

            ClickLabel = new RelativeLabel(new Point(relatLoc.X - Size.Width / 2, relatLoc.Y - Size.Height / 2), Size);

            ClickLabel.Size      = Size;
            ClickLabel.BackColor = Color.Transparent;
        }