Пример #1
0
        void PreCreateItemDataLayerEvent(ScLayerLayoutViewerItem item)
        {
            item.SuspendLayout();
            ScLayerLayoutViewerHeaderItem headerItem;
            ScLayerLayoutViewerHeaderItem dataItem;

            ScLayerLayoutViewerHeaderItemContainer dataItemContainer = new ScLayerLayoutViewerHeaderItemContainer(item.ScMgr);

            item.AddContent(dataItemContainer);


            dataItemContainer.HeaderOrientation = ScLayerLayoutViewerHeaderOrientation.HORIZONTAL;
            dataItemContainer.CreateHeaderItemDataLayerEvent += DataItemContainer_CreateHeaderItemDataLayerEvent;
            dataItemContainer.ItemMinSize = ItemMinSize - (HeaderControlerSize - RowControlerSize);
            dataItemContainer.CreateHeaderItemFormDataInfo(columnInfos, RowControlerSize, null);
            dataItemContainer.DirectionRect = new RectangleF(0, 0, item.Width, item.Height);

            for (int i = 0; i < header.controls.Count; i++)
            {
                dataItem       = (ScLayerLayoutViewerHeaderItem)dataItemContainer.controls[i];
                headerItem     = (ScLayerLayoutViewerHeaderItem)header.controls[i];
                dataItem.Width = headerItem.Width - (HeaderControlerSize - RowControlerSize);
            }

            item.ResumeLayout(false);
        }
Пример #2
0
        public void CreateHeaderItemFormDataInfo(ScLayerLayoutViewerColumnInfo[] columnInfos)
        {
            this.columnInfos = columnInfos;

            if (ItemMinSize - HeaderControlerSize < HeaderControlerSize)
            {
                ItemMinSize = 2 * HeaderControlerSize;
            }

            header.ItemMinSize = ItemMinSize;


            header.CreateHeaderItemFormDataInfo(columnInfos, HeaderControlerSize, _HeaderItemHitEvent);
        }