Beispiel #1
0
        void Start()
        {
            MakeDefaults.Set();
            this.table = this.GetComponent <Table>();

            this.table.ResetTable();

            this.table.AddInputColumn(this.OnInputFieldChange);
            this.table.AddInputColumn(this.OnInputFieldChange);
            this.table.AddInputColumn(this.OnInputFieldChange);
            this.table.AddInputColumn(this.OnInputFieldChange);
            this.table.AddInputColumn(this.OnInputFieldChange);

            // Initialize Your Table
            this.table.Initialize(this.OnTableSelected);

            // Populate Your Rows (obviously this would be real data here)
            for (int i = 0; i < 100; i++)
            {
                Datum d = Datum.Body(i.ToString());
                d.elements.Add(i.ToString());
                d.elements.Add("Col2:Row" + i.ToString());
                d.elements.Add("Col3:Row" + i.ToString());
                d.elements.Add("Col4:Row" + i.ToString());
                d.elements.Add("Col5:Row" + i.ToString());
                this.table.data.Add(d);
            }

            // Draw Your Table
            this.table.StartRenderEngine();
        }
Beispiel #2
0
        void Start()
        {
            // this instantiates default fonts for ALL tables when not explicitely defined on an individual table
            //  ProTip: You don't need to do this if you just set a font for your table in the editor
            MakeDefaults.Set();

            this.table = this.GetComponent <Table>();

            this.table.ResetTable();

            this.table.AddTextColumn("Column1");
            this.table.AddTextColumn("Column2");
            this.table.AddTextColumn("Column3");

            // Initialize Your Table
            this.table.Initialize(this.OnTableSelected);

            // Populate Your Rows (obviously this would be real data here)
            for (int i = 0; i < Simple.ROWS; i++)
            {
                Datum d = Datum.Body(i.ToString());
                d.elements.Add("Col1:Row" + i.ToString());
                d.elements[0].color           = new Color(0, .5f, 0.8f);
                d.elements[0].backgroundColor = new Color(0.2f, 0, 0);
                d.elements.Add("Col2:Row" + i.ToString());
                d.elements.Add("Col3:Row" + i.ToString());
                this.table.data.Add(d);
            }

            // Draw Your Table
            this.table.StartRenderEngine();
        }
Beispiel #3
0
        void BuildTempKong()
        {
            MakeDefaults.Set();
            table = GetComponent <Table>();
            table.ResetTable();

            float percents = 0f;

            ColumnDataTempDocument.ForEach(x => percents += x.widthPercent);
            float onePeace = width / percents;

            foreach (TableColumnsData data in ColumnDataTempDocument)
            {
                Debug.Log(data.widthPercent);
                table.AddTextColumn(data.name, null, onePeace * data.widthPercent - 5, 1000f);
            }
            table.Initialize();
            for (int i = 0; i < 5; i++)
            {
                Datum d = Datum.Body(i.ToString());
                d.elements.Add("EDAS07F9" + i.ToString());
                d.elements.Add("新建 Microsoft Word 文档.docx");
                d.elements.Add("相关资料");
                d.elements.Add("张三");
                d.elements.Add("2017-11-11 11:11:11");
                d.elements.Add("下载到本地");
                table.data.Add(d);
            }
            table.StartRenderEngine();
        }
Beispiel #4
0
        void Start()
        {
            MakeDefaults.Set();
            this.table = this.GetComponent <Table>();

            this.table.ResetTable();

            this.table.AddTextColumn("h1", "f1");
            this.table.AddTextColumn("h2", "f2");
            this.table.AddTextColumn("h3", "f3");
            this.table.AddTextColumn("h4", "f4");
            this.table.AddTextColumn("h5", "f5");

            this.table.Initialize();

            // Populate Your Rows (obviously this would be real data here)
            for (int i = 0; i < 10; i++)
            {
                this.table.data.Add(this.MakeDatum("INIT"));
            }

            // Draw Your Table
            this.table.StartRenderEngine();

            this.StartCoroutine(this.DoRandomData());
        }
Beispiel #5
0
        public void BuildStandingBook(List <TableClassEquipmentStandingBook> datas, Action <Datum, Column> clickDelegate)
        {
            if (datas == null)
            {
                datas = TableClassEquipmentStandingBook.TestData;
            }

            MakeDefaults.Set();
            table = GetComponent <Table>();
            table.ResetTable();

            float percents = 0f;

            ColumnDataStandingBook.ForEach(x => percents += x.widthPercent);
            float onePeace = width / percents;

            foreach (TableColumnsData data in ColumnDataStandingBook)
            {
                table.AddTextColumn(data.name, null, onePeace * data.widthPercent - 5, 200f).horAlignment = Column.HorAlignment.CENTER;
            }

            if (clickDelegate != null)
            {
                table.Initialize(clickDelegate);
            }
            else
            {
                table.Initialize();
            }

            foreach (TableClassEquipmentStandingBook data in datas)
            {
                Datum d = Datum.Body(data.No);
                d.elements.Add(data.No);
                d.elements.Add(data.equipmentType);
                d.elements.Add(data.type);
                d.elements.Add(data.technical);
                d.elements.Add(data.brand);
                d.elements.Add(data.supplier);
                d.elements.Add(data.enterTime);
                d.elements.Add(data.enterResponsePerson);
                d.elements.Add(data.debugStatus);
                d.elements.Add(data.checkTime);
                d.elements.Add(data.checkResponsePerson);
                d.elements.Add(data.setupLocation);
                d.elements.Add(data.guaranteePeriod);
                d.elements.Add(data.transferTime);
                d.elements.Add("选择文件");
                d.elements.Add("查看");
                d.elements.Add("定位");

                table.data.Add(d);
            }
            table.StartRenderEngine();
        }
Beispiel #6
0
        void Start()
        {
            MakeDefaults.Set();
            this.spriteDict = new Dictionary <string, Sprite>();
            this.spriteDict.Add("1", this.sprite1);
            this.spriteDict.Add("2", this.sprite2);
            this.spriteDict.Add("3", this.sprite3);
            this.spriteDict.Add("4", this.sprite4);
            this.spriteDict.Add("5", this.sprite5);

            this.DoTable(30, 1000, true);
        }
Beispiel #7
0
        void BuildMaintenance(List <TableClassEquipmentMaintenance> datas)
        {
            if (datas == null)
            {
                datas = TableClassEquipmentMaintenance.RandomClassData(30);
            }

            MakeDefaults.Set();
            table = GetComponent <Table>();
            table.ResetTable();

            float percents = 0f;

            ColumnDataMaintenance.ForEach(x => percents += x.widthPercent);
            float onePeace = width / percents;

            foreach (TableColumnsData data in ColumnDataStandingBook)
            {
                table.AddTextColumn(data.name, null, onePeace * data.widthPercent - 5, 200f);
            }
            table.Initialize();

            foreach (TableClassEquipmentMaintenance data in datas)
            {
                Datum d = Datum.Body(data.No);
                d.elements.Add(data.No);
                d.elements.Add(data.name);
                d.elements.Add(data.type);
                d.elements.Add(data.technical);
                d.elements.Add(data.useLocation);
                d.elements.Add(data.supplier);
                d.elements.Add(data.beginTime);
                d.elements.Add(data.intervalMonth);
                d.elements.Add(data.checkPerson);
                d.elements.Add(data.checkTime);
                d.elements.Add(data.maintenanceRecord);
                d.elements.Add(data.maintenanceTime);
                d.elements.Add(data.maintenanceContent);
                d.elements.Add(data.maintenanceLevel);
                d.elements.Add(data.maintenancePrice);
                d.elements.Add("查看");
                table.data.Add(d);
            }
            table.StartRenderEngine();
        }
Beispiel #8
0
        void Start()
        {
            MakeDefaults.Set();
            this.spriteDict = new Dictionary <string, Sprite>();
            this.spriteDict.Add("1", this.sprite1);
            this.spriteDict.Add("2", this.sprite2);
            this.spriteDict.Add("3", this.sprite3);
            this.spriteDict.Add("4", this.sprite4);
            this.spriteDict.Add("5", this.sprite5);

            this.spriteNames = new List <string>(this.spriteDict.Keys);

            this.table.ResetTable();

            this.table.AddImageColumn("h0", "f0", 32, 32);
            this.table.AddTextColumn("h1", "f1");
            this.table.AddTextColumn("h2", "f2");
            this.table.AddImageColumn("Wide Column Name", "f3", 32, 32);
            this.table.AddTextColumn("h4", "f4");
            this.table.AddTextColumn("h5", "f5");
            this.table.AddImageColumn("h6", "f6", 32, 32);
            this.table.AddTextColumn("h7", "f7", -1, 400);

            this.table.Initialize(this.OnRowSelected, this.spriteDict);

            // Populate Your Rows (obviously this would be real data here)
            for (int i = 0; i < 5; i++)
            {
                Datum d = this.MakeDatum("INIT_" + i.ToString());
                d.uid = i.ToString();
                this.table.data.Add(d);
            }

            // Draw Your Table
            this.table.StartRenderEngine();
        }
Beispiel #9
0
 void Start()
 {
     MakeDefaults.Set();
     this.DrawTable();
 }