[Fat-develop] FAT/src/FAT.Web FixtureSpecifierControl.cs,1.1,1.2
Brought to you by:
exortech
|
From: <dmc...@us...> - 2004-02-29 19:14:05
|
Update of /cvsroot/fat/FAT/src/FAT.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv305/src/FAT.Web Modified Files: FixtureSpecifierControl.cs Log Message: Added NewFixtureTextBox to FixtureSpecifierControl so that user is able to enter the name of a new (as yet unimplemented) test fixture. Index: FixtureSpecifierControl.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/FixtureSpecifierControl.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FixtureSpecifierControl.cs 29 Feb 2004 14:59:52 -0000 1.1 --- FixtureSpecifierControl.cs 29 Feb 2004 19:03:38 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- ITestFixtureLoader loader; private DropDownList implementedFixturesDropDownList; + private TextBox newFixtureTextBox; public FixtureSpecifierControl() : this (ConfigurationFactory.Create()) {} *************** *** 34,50 **** protected override void CreateChildControls() { implementedFixturesDropDownList = new DropDownList(); implementedFixturesDropDownList.ID = "implementedFixturesDropDownList"; ! implementedFixturesDropDownList.Width = 500; ! Controls.Add(implementedFixturesDropDownList); } public string SelectedFixture { ! get {return ImplementedFixturesDropDownList.SelectedItem.Value;} } ! public DropDownList ImplementedFixturesDropDownList { get --- 35,101 ---- protected override void CreateChildControls() { + Table table = CreateTable(); + + TableRow row = new TableRow(); + table.Rows.Add(row); + + AddLabelToRow(row, "Existing Fixture: "); + implementedFixturesDropDownList = new DropDownList(); implementedFixturesDropDownList.ID = "implementedFixturesDropDownList"; ! row.Cells.Add(CreateTableCell(implementedFixturesDropDownList)); ! AddLabelToRow(row, " or New Fixture: "); ! ! newFixtureTextBox = new TextBox(); ! newFixtureTextBox.ID = "newFixtureTextBox"; ! newFixtureTextBox.Width = new Unit(100, UnitType.Percentage); ! TableCell cell = CreateTableCell(newFixtureTextBox); ! cell.Width = new Unit(100, UnitType.Percentage); ! row.Cells.Add(cell); ! ! Controls.Add(table); ! } ! ! private Table CreateTable() ! { ! Table table = new Table(); ! table.CellPadding = table.CellSpacing = 0; ! table.BorderWidth = new Unit(0, UnitType.Pixel); ! table.Width = new Unit(100, UnitType.Percentage); ! return table; ! } ! ! private void AddLabelToRow(TableRow row, string text) ! { ! Label label = new Label(); ! label.Text = text; ! row.Cells.Add(CreateTableCell(label)); ! } ! ! private TableCell CreateTableCell(Control control) ! { ! TableCell cell = new TableCell(); ! cell.Wrap = false; ! cell.Controls.Add(control); ! return cell; } public string SelectedFixture { ! get ! { ! if (NewFixtureTextBox.Text == "") ! { ! return ImplementedFixturesDropDownList.SelectedItem.Value; ! } ! else ! { ! return NewFixtureTextBox.Text; ! } ! } } ! protected DropDownList ImplementedFixturesDropDownList { get *************** *** 55,58 **** --- 106,118 ---- } + protected TextBox NewFixtureTextBox + { + get + { + EnsureChildControls(); + return newFixtureTextBox; + } + } + protected new virtual IPage Page { |