本文整理汇总了C#中Ict.Tools.CodeGeneration.TFormWriter.CallControlFunction方法的典型用法代码示例。如果您正苦于以下问题:C# TFormWriter.CallControlFunction方法的具体用法?C# TFormWriter.CallControlFunction怎么用?C# TFormWriter.CallControlFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ict.Tools.CodeGeneration.TFormWriter
的用法示例。
在下文中一共展示了TFormWriter.CallControlFunction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetControlProperties
/// <summary>write the code for the designer file where the properties of the control are written</summary>
public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
{
base.SetControlProperties(writer, ctrl);
if (ctrl.GetAttribute("AutoComplete").EndsWith("History"))
{
writer.SetControlProperty(ctrl, "AcceptNewValues", "true");
writer.SetEventHandlerToControl(ctrl.controlName,
"AcceptNewEntries",
"TAcceptNewEntryEventHandler",
"FPetraUtilsObject.AddComboBoxHistory");
writer.CallControlFunction(ctrl.controlName, "SetDataSourceStringList(\"\")");
writer.Template.AddToCodelet("INITUSERCONTROLS",
"FPetraUtilsObject.LoadComboBoxHistory(" + ctrl.controlName + ");" + Environment.NewLine);
}
return writer.FTemplate;
}
示例2: WriteTableLayout
//.........这里部分代码省略.........
ControlLeftPosition += Convert.ToInt32(values[0]);
ControlTopPosition += Convert.ToInt32(values[1]);
TLogging.LogAtLevel(1, "Removing Padding Property from Control '" + childctrl.controlName + "'!");
writer.ClearControlProperty(childctrl.controlName, "Padding");
}
string margin = writer.GetControlProperty(childctrl.controlName, "Margin");
if (margin.Length > 0)
{
string[] values = margin.Substring(margin.IndexOf("(") + 1).Replace(")", "").Split(new char[] { ',' });
ControlLeftPosition += Convert.ToInt32(values[0]);
ControlTopPosition += Convert.ToInt32(values[1]);
writer.ClearControlProperty(childctrl.controlName, "Margin");
}
if ((childctrl.IsOnHorizontalGridButtonPanel)
&& (columnCounter != 0)
&& !((childctrl.HasAttribute("StartNewButtonGroup"))
&& (childctrl.GetAttribute("StartNewButtonGroup").ToLower() == "true")))
{
TLogging.LogAtLevel(1,
"Adjusted ControlLeftPosition for Control '" + childctrl.controlName +
"' as it is on a horizontal Grid Button Panel.");
ControlLeftPosition -= 8;
}
writer.SetControlProperty(childctrl.controlName,
"Location",
String.Format("new System.Drawing.Point({0},{1})",
ControlLeftPosition.ToString(),
ControlTopPosition.ToString()),
false);
writer.CallControlFunction(LayoutCtrl.controlName,
"Controls.Add(this." + childctrl.controlName + ")");
if (FTabOrder == "Horizontal")
{
writer.SetControlProperty(childctrl.controlName, "TabIndex", FCurrentTabIndex.ToString(), false);
FCurrentTabIndex += 10;
}
}
CurrentTopPosition += RowHeight[rowCounter];
CurrentTopPosition += Convert.ToInt32(LayoutCtrl.GetAttribute("VerticalSpace", VERTICAL_SPACE.ToString()));
if (CurrentTopPosition > Height)
{
Height = CurrentTopPosition;
}
}
CurrentLeftPosition += ColumnWidth[columnCounter];
CurrentLeftPosition += Convert.ToInt32(LayoutCtrl.GetAttribute("HorizontalSpace", HORIZONTAL_SPACE.ToString()));
if (CurrentLeftPosition > Width)
{
Width = CurrentLeftPosition;
}
}
Height +=
Convert.ToInt32(LayoutCtrl.GetAttribute("MarginBottom", MARGIN_BOTTOM.ToString())) -
Convert.ToInt32(LayoutCtrl.GetAttribute("VerticalSpace", VERTICAL_SPACE.ToString()));
示例3: AddChildren
/// <summary>
/// add children to the control
/// </summary>
public override void AddChildren(TFormWriter writer, TControlDef container)
{
if (container.Children.Count > 0)
{
string addChildren = string.Empty;
foreach (TControlDef child in container.Children)
{
if (addChildren.Length > 0)
{
addChildren += "," + Environment.NewLine + " ";
}
if ((addChildren.Length == 0) && child.controlName.StartsWith("tbbSeparator"))
{
// ignore separators at the front of a toolbar, needed for localised winforms
continue;
}
addChildren += child.controlName;
}
writer.CallControlFunction(container.controlName,
"Items.AddRange(new System.Windows.Forms.ToolStripItem[] {" + Environment.NewLine +
" " + addChildren +
"})");
}
}
示例4: AddChildren
/// <summary>
/// add the children
/// </summary>
public override void AddChildren(TFormWriter writer, TControlDef ctrl)
{
if (ctrl.GetAttribute("UseTableLayout") != "true")
{
// first add the control that has Dock=Fill, then the others
foreach (TControlDef ChildControl in ctrl.Children)
{
if (ChildControl.GetAttribute("Dock") == "Fill")
{
writer.CallControlFunction(ctrl.controlName,
"Controls.Add(this." +
ChildControl.controlName + ")");
}
}
List <TControlDef>ControlsReverse = new List <TControlDef>();
foreach (TControlDef ChildControl in ctrl.Children)
{
ControlsReverse.Insert(0, ChildControl);
}
foreach (TControlDef ChildControl in ControlsReverse)
{
if (ChildControl.GetAttribute("Dock") != "Fill")
{
writer.CallControlFunction(ctrl.controlName,
"Controls.Add(this." +
ChildControl.controlName + ")");
}
}
}
}
示例5: SetControlProperties
/// <summary>write the code for the designer file where the properties of the control are written</summary>
public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef container)
{
base.SetControlProperties(writer, container);
if (FCreateControlsAddStatements)
{
foreach (TControlDef child in container.Children)
{
writer.CallControlFunction(container.controlName,
"Controls.Add(this." +
child.controlName + ")");
}
}
return writer.FTemplate;
}