当前位置: 首页>>代码示例>>C#>>正文


C# TFormWriter.CallControlFunction方法代码示例

本文整理汇总了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;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:ControlGeneratorComboboxes.cs

示例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()));
开发者ID:Davincier,项目名称:openpetra,代码行数:67,代码来源:ControlGeneratorLayout.cs

示例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 +
                    "})");
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:31,代码来源:ControlGeneratorBars.cs

示例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 + ")");
                    }
                }
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:36,代码来源:ControlGeneratorContainer.cs

示例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;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:17,代码来源:ControlGeneratorContainer.cs


注:本文中的Ict.Tools.CodeGeneration.TFormWriter.CallControlFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。