Author: krasnov
Date: 2006-07-23 11:50:28 -0400 (Sun, 23 Jul 2006)
New Revision: 62906
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs
Log:
* Wizard.cs: implemented SkipLinkText, TagKey
fixed rendering bugs, fixed templated button bar rendering, fixed side bar
rendering
* WizardStepBase.cs: fixed Name property
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-07-23 15:21:23 UTC (rev 62905)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-07-23 15:50:28 UTC (rev 62906)
@@ -1,3 +1,10 @@
+2006-07-23 Vladimir Krasnov <[EMAIL PROTECTED]>
+
+ * Wizard.cs: implemented SkipLinkText, TagKey
+ fixed rendering bugs, fixed templated button bar rendering
+ fixed side bar rendering
+ * WizardStepBase.cs: fixed Name property
+
2006-07-23 Andrew Skiba <[EMAIL PROTECTED]>
* DetailsView.cs: fix the regressions, caused by the previous commit.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
2006-07-23 15:21:23 UTC (rev 62905)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
2006-07-23 15:50:28 UTC (rev 62906)
@@ -572,11 +572,14 @@
[MonoTODO]
public virtual string SkipLinkText
{
- get {
- throw new NotImplementedException ();
+ get
+ {
+ object v = ViewState ["SkipLinkText"];
+ return v != null ? (string) v : "Skip
Navigation Links.";
}
- set {
- throw new NotImplementedException ();
+ set
+ {
+ ViewState ["SkipLinkText"] = value;
}
}
@@ -788,7 +791,7 @@
protected virtual new HtmlTextWriterTag TagKey
{
get {
- throw new NotImplementedException ();
+ return HtmlTextWriterTag.Table;
}
}
@@ -895,6 +898,7 @@
if (DisplaySideBar && ActiveStep.StepType !=
WizardStepType.Complete) {
Table contentTable = wizardTable;
contentTable.Height = new Unit ("100%");
+ contentTable.Width = new Unit ("100%");
wizardTable = new Table ();
wizardTable.CellPadding = CellPadding;
@@ -908,6 +912,7 @@
TableCell contentCell = new TableCell ();
contentCell.Controls.Add (contentTable);
+ contentCell.Height = new Unit ("100%");
row.Cells.Add (contentCell);
wizardTable.Rows.Add (row);
@@ -952,7 +957,8 @@
switch (stepType) {
case WizardStepType.Start:
if (startNavigationTemplate != null) {
- AddTemplateCell (row,
startNavigationTemplate, StartNextButtonID, CancelButtonID);
+ AddTemplateButtonBar
(buttonBarCell, startNavigationTemplate, StartNextButtonID, CancelButtonID);
+ return;
} else {
if (AllowNavigationToStep
(ActiveStepIndex + 1))
AddButtonCell (row,
CreateButton (StartNextButtonID, MoveNextCommandName, StartNextButtonType,
StartNextButtonText, StartNextButtonImageUrl, StartNextButtonStyle));
@@ -962,7 +968,8 @@
break;
case WizardStepType.Step:
if (stepNavigationTemplate != null) {
- AddTemplateCell (row,
stepNavigationTemplate, StepPreviousButtonID, StepNextButtonID, CancelButtonID);
+ AddTemplateButtonBar
(buttonBarCell, stepNavigationTemplate, StepPreviousButtonID, StepNextButtonID,
CancelButtonID);
+ return;
} else {
if (AllowNavigationToStep
(ActiveStepIndex - 1))
AddButtonCell (row,
CreateButton (StepPreviousButtonID, MovePreviousCommandName,
StepPreviousButtonType, StepPreviousButtonText, StepPreviousButtonImageUrl,
StepPreviousButtonStyle));
@@ -974,7 +981,8 @@
break;
case WizardStepType.Finish:
if (finishNavigationTemplate != null) {
- AddTemplateCell (row,
finishNavigationTemplate, FinishPreviousButtonID, FinishButtonID,
CancelButtonID);
+ AddTemplateButtonBar
(buttonBarCell, finishNavigationTemplate, FinishPreviousButtonID,
FinishButtonID, CancelButtonID);
+ return;
} else {
if (AllowNavigationToStep
(ActiveStepIndex - 1))
AddButtonCell (row,
CreateButton (FinishPreviousButtonID, MovePreviousCommandName,
FinishPreviousButtonType, FinishPreviousButtonText,
FinishPreviousButtonImageUrl, FinishPreviousButtonStyle));
@@ -998,17 +1006,14 @@
return b;
}
- void AddTemplateCell (TableRow row, ITemplate template, params
string[] buttonIds)
+ void AddTemplateButtonBar (TableCell cell, ITemplate template,
params string[] buttonIds)
{
- TableCell cell = new TableCell ();
template.InstantiateIn (cell);
foreach (string id in buttonIds) {
IButtonControl b = cell.FindControl (id) as
IButtonControl;
if (b != null) RegisterCommandEvents (b);
}
-
- row.Cells.Add (cell);
}
void AddButtonCell (TableRow row, Control control)
@@ -1022,7 +1027,22 @@
void CreateSideBar (TableCell sideBarCell)
{
RegisterApplyStyle (sideBarCell, SideBarStyle);
-
+
+ if (SkipLinkText != "") {
+ System.Web.UI.HtmlControls.HtmlAnchor anchor =
new System.Web.UI.HtmlControls.HtmlAnchor ();
+ anchor.HRef = "#" + ClientID + "_SkipLink";
+
+ Image img = new Image ();
+ ClientScriptManager csm = new
ClientScriptManager (null);
+ img.ImageUrl = csm.GetWebResourceUrl (typeof
(SiteMapPath), "transparent.gif");
+ img.Attributes.Add ("height", "0");
+ img.Attributes.Add ("width", "0");
+ img.AlternateText = SkipLinkText;
+
+ anchor.Controls.Add (img);
+ sideBarCell.Controls.Add (anchor);
+ }
+
if (sideBarTemplate != null) {
sideBarTemplate.InstantiateIn (sideBarCell);
stepDatalist = sideBarCell.FindControl
(DataListID) as DataList;
@@ -1035,6 +1055,12 @@
sideBarCell.Controls.Add (stepDatalist);
}
+ if (SkipLinkText != "") {
+ System.Web.UI.HtmlControls.HtmlAnchor anchor =
new System.Web.UI.HtmlControls.HtmlAnchor ();
+ anchor.ID = "SkipLink";
+ sideBarCell.Controls.Add (anchor);
+ }
+
stepDatalist.DataSource = WizardSteps;
stepDatalist.ItemTemplate = SideBarItemTemplate;
stepDatalist.DataBind ();
@@ -1062,7 +1088,10 @@
protected override Style CreateControlStyle ()
{
- return new TableStyle ();
+ TableStyle style = new TableStyle ();
+ style.CellPadding = 0;
+ style.CellSpacing = 0;
+ return style;
}
[MonoTODO]
@@ -1291,16 +1320,16 @@
{
WizardStepBase step = DataBinder.GetDataItem
(s) as WizardStepBase;
if (step != null) {
- Control c = (Control)s;
+ DataListItem c = (DataListItem) s;
LinkButton b = (LinkButton)
c.Controls[0];
b.ID = SideBarButtonID;
b.CommandName =
Wizard.MoveToCommandName;
b.CommandArgument =
wizard.WizardSteps.IndexOf (step).ToString ();
- b.Text = step.Title;
+ b.Text = step.Name;
if (step.StepType ==
WizardStepType.Complete)
b.Enabled = false;
if (step == wizard.ActiveStep)
- b.Font.Bold = true;
+ c.Font.Bold = true;
wizard.RegisterCommandEvents (b);
}
}
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs
2006-07-23 15:21:23 UTC (rev 62905)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs
2006-07-23 15:50:28 UTC (rev 62906)
@@ -58,9 +58,9 @@
[DesignerSerializationVisibilityAttribute
(DesignerSerializationVisibility.Hidden)]
[BrowsableAttribute (false)]
public virtual string Name {
- get {
- if (Title.Length > 0) return Title;
- else if (ID.Length > 0) return ID;
+ get {
+ if (Title != null && Title.Length > 0) return
Title;
+ else if (ID != null && ID.Length > 0) return ID;
else return null;
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches