Inheritance: BaseControl
コード例 #1
0
ファイル: DemoWindow.cs プロジェクト: tpb3d/TPB3D
		public override void InitializeControls ()
		{
			base.InitializeControls();
			
			Texture texture = TextureManager.Instance.Find(ResourceLocator.GetFullPath("Planets/Earth/earth.dds"), TextureMagFilter.Nearest, TextureMinFilter.Nearest, TextureWrapMode.Clamp, TextureWrapMode.Clamp);
			
			this.progressBar = new ProgressBar(this.frameMgr, this);
			this.progressBar.Location = new Point(10, 10);
			this.progressBar.Size = new Size(200, 20);
			this.progressBar.Value = 75;
			this.progressBar.BorderSize = 1;
			AddChildControl(this.progressBar);
			
			this.button = new Button(this.frameMgr, this);
			this.button.Location = new Point(10, 40);
			this.button.Size = new Size(100,25);
			this.button.BorderSize = 1;
			AddChildControl(this.button);
						
			this.picture = new Picture(this.frameMgr, this);
			this.picture.Location = new Point(10, 70);
			this.picture.Size = new Size(200, 200);
			this.picture.BorderSize = 1;
			this.picture.Texture = texture;			
			AddChildControl(this.picture);
			
			this.vScrollBar = new VScrollBar(this.frameMgr, this);
			this.vScrollBar.Location = new Point(220, 10);
			this.vScrollBar.Size = new Size(40, 260);
			AddChildControl(this.vScrollBar);			
		}
コード例 #2
0
ファイル: RadarWindow.cs プロジェクト: tpb3d/TPB3D
        public override void InitializeControls()
        {
            base.InitializeControls();

			Texture texture = TextureManager.Instance.Find(ResourceLocator.GetFullPath("Textures/Radar.dds"), TextureMagFilter.Nearest, TextureMinFilter.Nearest, TextureWrapMode.Clamp, TextureWrapMode.Clamp); 

            this.radar = new Picture(frameMgr, this);
            this.radar.BorderSize = 2;
            this.radar.Texture = texture;
            AddChildControl(this.radar);

            int checkBoxWidth = 60;

            this.shortRange = new CheckBox(frameMgr, this);
            this.shortRange.ControlRectangle = new Rectangle(0 * (checkBoxWidth + 1), 1, checkBoxWidth, 20);
            this.shortRange.Text = "Short";
            this.shortRange.BorderSize = 1;
            this.shortRange.Value = true;
            this.shortRange.ValueChanged += new EventHandler(shortRange_ValueChanged);
            AddChildControl(this.shortRange);

            this.mediumRange = new CheckBox(frameMgr, this);
            this.mediumRange.ControlRectangle = new Rectangle(1 * (checkBoxWidth + 1), 1, checkBoxWidth, 20);
            this.mediumRange.Text = "Medium";
            this.mediumRange.BorderSize = 1;
            this.mediumRange.ValueChanged += new EventHandler(mediumRange_ValueChanged);
            AddChildControl(this.mediumRange);

            this.longRange = new CheckBox(frameMgr, this);
            this.longRange.ControlRectangle = new Rectangle(2 * (checkBoxWidth + 1), 1, checkBoxWidth, 20);
            this.longRange.Text = "Long";
            this.longRange.BorderSize = 1;
            this.longRange.ValueChanged += new EventHandler(longRange_ValueChanged);
            AddChildControl(this.longRange);

            this.comboBox = new ComboBox(frameMgr, this);
            this.comboBox.ControlRectangle = new Rectangle(3 * (checkBoxWidth + 1), 1, checkBoxWidth * 2, 20);
            this.comboBox.Text = "ComboBox";
            this.comboBox.BorderSize = 1;
            this.comboBox.Items = new string[] { "Test1", "Test2", "Test3" };
            this.comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged);
            AddChildControl(this.comboBox);

        }