示例#1
0
 public void Render(GlideGraphics bitmap, int Ay)
 {
     Width = Parent.Rect.Width;
     //Bitmaps.DT_AlignmentCenter
     bitmap.DrawTextInRect(Label, X, Ay + (Height - _font.Height) / 2, Width, _font.Height, new StringFormat()
     {
         Alignment = StringAlignment.Center
     }, Glide.Ext.Colors.Black, _font);
     bitmap.DrawLine(System.Drawing.Color.Gray, 1, 0, Ay + Height, Width, Ay + Height);
 }
示例#2
0
        private void RenderItem(int index, object[] data, System.Drawing.Color backColor, System.Drawing.Color fontColor)
        {
            int x = 0;
            int y = index * RowHeight;

            _items.DrawRectangle(new Glide.Geom.Rectangle(x, y, Width, RowHeight), backColor, 255);

            //_items.DrawRectangle(0, 0, x, y, Width, RowHeight, 0, 0, backColor.ToNativeColor(), 0, 0, 0, 0, 0, 255);

            DataGridColumn dataGridColumn;

            for (int i = 0; i < _columns.Count; i++)
            {
                dataGridColumn = (DataGridColumn)_columns[i];

                //0
                _items.DrawTextInRect(data[i].ToString(), x + 5, y + (RowHeight - Font.Height) / 2, dataGridColumn.Width, RowHeight, new StringFormat(), fontColor, Font);
                _items.DrawLine(GridColor, 1, x, y, x, y + RowHeight);

                x += dataGridColumn.Width;
            }
        }
示例#3
0
        private void RenderHeaders()
        {
            int x = 0;

            _headers.DrawRectangle(new Glide.Geom.Rectangle(x, 0, Width, _headers.GetBitmap().Height), HeadersBackColor, 255);

            //_headers.DrawRectangle(0, 0, x, 0, Width, _headers.Height, 0, 0, HeadersBackColor.ToNativeColor(), 0, 0, 0, 0, 0, 255);

            DataGridColumn dataGridColumn;

            for (int j = 0; j < _columns.Count; j++)
            {
                dataGridColumn = (DataGridColumn)_columns[j];

                // Draw text
                //0
                _headers.DrawTextInRect(dataGridColumn.Label, x + 5, (_headers.GetBitmap().Height - Font.Height) / 2, dataGridColumn.Width, _headers.GetBitmap().Height, new StringFormat(), HeadersFontColor, Font);

                // If we're on the selected column draw the icon.
                if (j == _selectedDataGridColumnIndex)
                {
                    int width = 0, height = 0;
                    //Font.ComputeExtent(dataGridColumn.Label, out width, out height);
                    var size = _headers.GetGraphic().MeasureString(dataGridColumn.Label, Font);
                    width  = (int)size.Width;
                    height = (int)size.Height;
                    if (dataGridColumn.Order == Order.ASC)
                    {
                        _headers.DrawImage(x + 10 + width, 5, _DataGridIcon_Asc, 0, 0, _DataGridIcon_Asc.Width, _DataGridIcon_Asc.Height, 0xff);
                    }
                    else
                    {
                        _headers.DrawImage(x + 10 + width, 5, _DataGridIcon_Desc, 0, 0, _DataGridIcon_Desc.Width, _DataGridIcon_Desc.Height, 0xff);
                    }
                }

                x += dataGridColumn.Width;
            }
        }