예제 #1
0
        private void CreateHeaders(ResultSet resultSet)
        {
            var headerView = new SourceGrid.Cells.Views.ColumnHeader
            {
                ElementText = new DevAge.Drawing.VisualElements.TextRenderer()
            };

            var toolTipController = new ToolTipText();

            _grid.ColumnsCount = _entity.Members.Count;
            _grid.FixedRows    = 1;

            _grid.Rows.Insert(0);

            _columnMap = ApiUtils.BuildColumnMap(resultSet);

            for (int i = 0; i < resultSet.FieldCount; i++)
            {
                var member = _entity.Members[resultSet.GetFieldName(i)];

                _grid[0, _columnMap[i]] = new SourceGrid.Cells.ColumnHeader(HumanText.GetMemberName(member))
                {
                    View                 = headerView,
                    ToolTipText          = HumanText.GetMemberName(member),
                    AutomaticSortEnabled = false
                };

                _grid[0, _columnMap[i]].AddController(toolTipController);
            }
        }
예제 #2
0
        private void SetupCommonGridResources()
        {
            _columnHeaderView             = new SourceGrid.Cells.Views.ColumnHeader();
            _columnHeaderView.ElementText = new RotatedText(-60);
            _columnHeaderView.BackColor   = Color.LightYellow;

            _textRenderer = new DevAge.Drawing.VisualElements.TextRenderer();

            _defaultView = new SourceGrid.Cells.Views.Cell();
            _defaultView.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;

            _defaultViewClearType             = new SourceGrid.Cells.Views.Cell();
            _defaultViewClearType.ElementText = _textRenderer;

            _yellowView             = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
            _yellowView.BackColor   = Color.LightYellow;
            _yellowView.ElementText = _defaultView.ElementText;

            _lightGray             = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
            _lightGray.BackColor   = Color.LightGray;
            _lightGray.ElementText = _defaultView.ElementText;

            _whiteView             = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
            _whiteView.BackColor   = Color.White;
            _whiteView.ElementText = _defaultView.ElementText;

            _lightGreen             = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
            _lightGreen.BackColor   = Color.LightGreen;
            _lightGreen.ElementText = _defaultView.ElementText;

            _darkGreen             = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
            _darkGreen.BackColor   = Color.DarkGreen;
            _darkGreen.ForeColor   = Color.White;
            _darkGreen.ElementText = _defaultView.ElementText;

            _highlightView               = new SourceGrid.Cells.Views.Cell();
            _highlightView.BackColor     = Color.LightPink;
            _highlightView.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
            _highlightView.ElementText   = _defaultView.ElementText;
        }
예제 #3
0
 /// <summary>
 /// Copy constructor.  This method duplicate all the reference field (Image, Font, StringFormat) creating a new instance.
 /// </summary>
 /// <param name="p_Source"></param>
 public ColumnHeader(ColumnHeader p_Source) : base(p_Source)
 {
 }
예제 #4
0
 static ColumnHeader()
 {
     Default = new ColumnHeader();
 }
예제 #5
0
    private void SetupCommonGridResources()
    {
      _columnHeaderView = new SourceGrid.Cells.Views.ColumnHeader();
      _columnHeaderView.ElementText = new RotatedText(-60);
      _columnHeaderView.BackColor = Color.LightYellow;

      _textRenderer = new DevAge.Drawing.VisualElements.TextRenderer();

      _defaultView = new SourceGrid.Cells.Views.Cell();
      _defaultView.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;

      _defaultViewClearType = new SourceGrid.Cells.Views.Cell();
      _defaultViewClearType.ElementText = _textRenderer;

      _yellowView = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
      _yellowView.BackColor = Color.LightYellow;
      _yellowView.ElementText = _defaultView.ElementText;

      _lightGray = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
      _lightGray.BackColor = Color.LightGray;
      _lightGray.ElementText = _defaultView.ElementText;

      _whiteView = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
      _whiteView.BackColor = Color.White;
      _whiteView.ElementText = _defaultView.ElementText;

      _lightGreen = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
      _lightGreen.BackColor = Color.LightGreen;
      _lightGreen.ElementText = _defaultView.ElementText;

      _darkGreen = _defaultView.Clone() as SourceGrid.Cells.Views.Cell;
      _darkGreen.BackColor = Color.DarkGreen;
      _darkGreen.ForeColor = Color.White;
      _darkGreen.ElementText = _defaultView.ElementText;

      _highlightView = new SourceGrid.Cells.Views.Cell();
      _highlightView.BackColor = Color.LightPink;
      _highlightView.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
      _highlightView.ElementText = _defaultView.ElementText;
    }
예제 #6
0
        /// <summary>
        /// TSgrdDataGrid is an extension of SourceGrid.DataGrid that contains several
        /// customisations and helper functions, especially for viewing DataTable data in
        /// a List-like manner.
        /// </summary>
        public TSgrdDataGrid() : base()
        {
            this.Set_DefaultProperties();
            InitializeComponent();

            FColumnHeaderView = new SourceGrid.Cells.Views.ColumnHeader();

            FGridTooltipController = new SourceGrid.Cells.Controllers.ToolTipText();
            FGridTooltipController.IsBalloon = false;
            FGridTooltipController.ToolTipTitle = Catalog.GetString("Column Header:");

            // Hook up our custom DoubleClick Handler
            this.Controller.AddController(new DoubleClickController());
            SpecialKeys = SourceGrid.GridSpecialKeys.Default ^ SourceGrid.GridSpecialKeys.Tab;

            this.MouseDown += new MouseEventHandler(TSgrdDataGrid_MouseDown);
            this.MouseUp += new MouseEventHandler(TSgrdDataGrid_MouseUp);

            TToolTipModel.InitializeUnit();
        }