コード例 #1
0
        public TabularContainerField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(1, 1, false)
        {
            // arg ought to be a string[] containing the names of child properties. Here we turn it into a list and
            // use ConvertAll() to obtain the list of actual PropertyInfos.
            children     = Array.ConvertAll((object[])attribute.arg, (str) => (string)str);
            this.context = context;

            ColumnSpacing = 5;
            RowSpacing    = 2;

            Label label = new Label(UIFactory.ToReadable(property.Name) + ": ");

            if (attribute.tooltipText != "")
            {
                label.HasTooltip    = true;
                label.TooltipMarkup = attribute.tooltipText;
            }

            Attach(label, 0, 1, 0, (uint)(2 * children.Length - 1), AttachOptions.Shrink, AttachOptions.Fill, 0, 0);
            Attach(new VSeparator(), 1, 2, 0, (uint)(2 * children.Length - 1), AttachOptions.Shrink, AttachOptions.Fill, 0, 0);

            for (int i = 0; i < children.Length; i++)
            {
                Widget childWidget = UIFactory.Fabricate(obj, children[i], context);
                Attach(childWidget, 2, 3, 2 * (uint)i, 2 * (uint)i + 1);
                if (i != children.Length - 1)
                {
                    Attach(new HSeparator(), 2, 3, 2 * (uint)i + 1, 2 * (uint)i + 2);
                }
            }
        }
コード例 #2
0
ファイル: Trait.cs プロジェクト: jeffechua/parahumanstbs
        public virtual Widget GetCellContents(Context context)
        {
            DialogTextEditableField field = (DialogTextEditableField)UIFactory.Fabricate(this, "effect", context.butCompact);

            field.BorderWidth = 5;
            return(field);
        }
コード例 #3
0
 public BasicHContainerField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(true, 10)
 {
     string[] children = Array.ConvertAll((object[])attribute.arg, (str) => (string)str);
     for (int i = 0; i < children.Length; i++)
     {
         Widget childWidget = UIFactory.Fabricate(obj, children[i], context.butCompact);
         PackStart(childWidget, true, true, 0);
     }
     BorderWidth = 10;
 }
コード例 #4
0
        public SlashDelimitedContainerField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute)
        {
            string[] children = Array.ConvertAll((object[])attribute.arg, (str) => (string)str);
            Label    label    = new Label(UIFactory.ToReadable(property.Name) + ": ");

            if (attribute.tooltipText != "")
            {
                label.HasTooltip    = true;
                label.TooltipMarkup = attribute.tooltipText;
            }
            PackStart(label, false, false, 0);
            for (int i = 0; i < children.Length; i++)
            {
                Widget childWidget = UIFactory.Fabricate(obj, children[i], context.butCompact);
                PackStart(childWidget, false, false, 0);
                if (i != children.Length - 1)
                {
                    PackStart(new Label("/"), false, false, 0);
                }
            }
        }