Beispiel #1
0
        public void SetControl(List <PropertyItem> list)
        {
            foreach (Widget child in this.ThirdTable.Children)
            {
                this.ThirdTable.Remove(child);
            }
            if (list.FirstOrDefault <PropertyItem>((Func <PropertyItem, bool>)(w => w.DiaplayName == "Display_Name")) != null)
            {
                ContentLabel contentLabel = new ContentLabel(68);
                contentLabel.SetLabelText(LanguageOption.GetValueBykey(list[0].DiaplayName));
                this.ThirdTable.Attach((Widget)contentLabel, 0U, 1U, 0U, 1U, AttachOptions.Shrink, AttachOptions.Fill, 0U, 0U);
                this.contentEM.GetEditor(list[0]);
                Widget widgetDate = list[0].WidgetDate;
                widgetDate.WidthRequest = 162;
                this.ThirdTable.Attach(widgetDate, 1U, 2U, 0U, 1U, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0U, 0U);
            }
            PropertyItem propertyItem = list.FirstOrDefault <PropertyItem>((Func <PropertyItem, bool>)(w => w.DiaplayName == "Display_Target"));

            if (propertyItem != null)
            {
                ContentLabel contentLabel = new ContentLabel(68);
                contentLabel.SetLabelText(LanguageOption.GetValueBykey(list[1].DiaplayName));
                this.ThirdTable.Attach((Widget)contentLabel, 0U, 1U, 1U, 2U, AttachOptions.Fill, AttachOptions.Fill, 0U, 0U);
                UndoEntryIntEx undoEntryIntEx = this.contentEM.GetEditor(list[1]).ResolveEditor(propertyItem) as UndoEntryIntEx;
                undoEntryIntEx.SetEntryPRoperty(true, 0, 1.0);
                undoEntryIntEx.WidthRequest = 162;
                this.ThirdTable.Attach((Widget)undoEntryIntEx, 1U, 2U, 1U, 2U, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0U, 0U);
            }
            this.ThirdTable.ShowAll();
        }
Beispiel #2
0
        private EventBox CreateTable(string calegory, List <PropertyItem> propertyItem)
        {
            EventBox eventBox = new EventBox();
            Table    table    = new Table((uint)(propertyItem.Count + 1), 2u, false);
            Label    label    = new Label();

            label.HeightRequest = 16;
            table.Attach(label, 1u, 2u, 0u, 1u, AttachOptions.Expand, AttachOptions.Fill, 0u, 0u);
            label.Show();
            uint num = 1u;

            foreach (PropertyItem current in propertyItem)
            {
                ITypeEditor editor = this.em.GetEditor(current);
                Widget      widget;
                if (editor == null)
                {
                    widget = current.WidgetDate;
                }
                else
                {
                    current.TypeEditor = editor;
                    widget             = editor.ResolveEditor(current);
                }
                if (current.DiaplayName == "grid_sudoku_size" || current.DiaplayName == "Fill_color")
                {
                    if (widget == null)
                    {
                        num += 1u;
                    }
                    else
                    {
                        if (widget is Entry)
                        {
                            Entry entry = widget as Entry;
                            table.Add(entry);
                            entry.Show();
                        }
                        else
                        {
                            table.Add(widget);
                        }
                        widget.Show();
                        Table.TableChild tableChild = (Table.TableChild)table[widget];
                        tableChild.LeftAttach   = 0u;
                        tableChild.RightAttach  = 2u;
                        tableChild.TopAttach    = num;
                        tableChild.BottomAttach = num + 1u;
                        tableChild.XOptions     = (AttachOptions.Expand | AttachOptions.Fill);
                        tableChild.YOptions     = AttachOptions.Fill;
                        num += 1u;
                    }
                }
                else
                {
                    ContentLabel contentLabel = new ContentLabel(90);
                    contentLabel.SetLabelText(LanguageOption.GetValueBykey(current.DiaplayName));
                    table.Add(contentLabel);
                    contentLabel.Show();
                    Table.TableChild tableChild2 = (Table.TableChild)table[contentLabel];
                    tableChild2.TopAttach    = num;
                    tableChild2.BottomAttach = num + 1u;
                    tableChild2.XOptions     = AttachOptions.Fill;
                    tableChild2.YOptions     = AttachOptions.Fill;
                    if (widget == null)
                    {
                        num += 1u;
                    }
                    else
                    {
                        Alignment alignment = new Alignment(0.5f, 0.5f, 1f, 1f);
                        if (widget is Entry)
                        {
                            Entry entry = widget as Entry;
                            alignment.BottomPadding = 16u;
                            alignment.Add(entry);
                            entry.Show();
                            alignment.Show();
                            table.Add(alignment);
                        }
                        else
                        {
                            if (widget is INumberEntry)
                            {
                                if ((widget as INumberEntry).GetMenuVisble())
                                {
                                    alignment.BottomPadding = 8u;
                                }
                                else
                                {
                                    alignment.BottomPadding = 16u;
                                }
                            }
                            else
                            {
                                alignment.BottomPadding = 16u;
                            }
                            alignment.Add(widget);
                            widget.Show();
                            alignment.Show();
                            table.Add(alignment);
                        }
                        Table.TableChild tableChild = (Table.TableChild)table[alignment];
                        tableChild.LeftAttach   = 1u;
                        tableChild.RightAttach  = 2u;
                        tableChild.TopAttach    = num;
                        tableChild.BottomAttach = num + 1u;
                        tableChild.XOptions     = (AttachOptions.Expand | AttachOptions.Fill);
                        tableChild.YOptions     = AttachOptions.Fill;
                        num += 1u;
                    }
                }
            }
            table.ColumnSpacing = 10u;
            eventBox.Add(table);
            table.Show();
            eventBox.CanFocus = false;
            return(eventBox);
        }