Example #1
0
        protected override void Initialize()
        {
            collection = new CollectionHandler {
                Handler = this
            };
            var col = new NSTableColumn();

            col.ResizingMask = NSTableColumnResizing.Autoresizing;
            col.Editable     = false;
            cell             = new MacImageListItemCell();
            cell.Wraps       = false;
            col.DataCell     = cell;
            Control.AddColumn(col);

            Control.DoubleClick += HandleDoubleClick;
            Control.DataSource   = new EtoDataSource {
                Handler = this
            };
            Control.Delegate = new EtoDelegate {
                Handler = this
            };

            scroll = new EtoScrollView {
                Handler = this
            };
            scroll.AutoresizesSubviews   = true;
            scroll.DocumentView          = Control;
            scroll.HasVerticalScroller   = true;
            scroll.HasHorizontalScroller = true;
            scroll.AutohidesScrollers    = true;
            scroll.BorderType            = NSBorderType.BezelBorder;

            base.Initialize();
            HandleEvent(Eto.Forms.Control.KeyDownEvent);
        }
Example #2
0
        protected override void Initialize()
        {
            Control.Delegate = new EtoOutlineDelegate {
                Handler = this
            };
            Control.DataSource = new EtoDataSource {
                Handler = this
            };

            column = new NSTableColumn
            {
                DataCell = new MacImageListItemCell {
                    UsesSingleLineMode = true,
                    Editable           = true
                },
                Editable = false
            };


            Control.AddColumn(column);
            Control.OutlineTableColumn = column;

            Scroll = new EtoScrollView
            {
                Handler               = this,
                HasVerticalScroller   = true,
                HasHorizontalScroller = true,
                AutohidesScrollers    = true,
                BorderType            = NSBorderType.BezelBorder,
                DocumentView          = Control
            };

            base.Initialize();
        }
Example #3
0
        private void UpdateEntireTable()
        {
            Control.Clear();

            if (Data.Items.Count == 0)
            {
                Control.AddColumn("Inventory Empty");
            }
            else
            {
                // setup the columns
                Control.AddColumns(new string[] { "Item", "Amount", "Status" });
                Control.Columns[2].ToolTip = new ToolTip(Manager)
                {
                    Text = "Is the item available for use by other\nbuildings or reserved for this building?"
                };

                foreach (InventoryData item in Data.Items.Values)
                {
                    TableRow currentRow = Control.AddRow();
                    currentRow.Tag = item;

                    string name = ((Item)World.Prototypes[item.Item]).Name;
                    Control.AddAt(0, Control.RowsCount - 1, name);
                    Control.AddAt(1, Control.RowsCount - 1, item.Amount.ToString());

                    string status = (item.Output) ? "Available" : (item.Input) ? "Reserved" : "";

                    Control.AddAt(2, Control.RowsCount - 1, status);
                }
            }
        }