Exemplo n.º 1
0
        protected override MouseHandleResult HandleMouseDown(JetListViewNode node, int x, int y)
        {
            IResource     res = (IResource)node.Data;
            ICustomColumn col = GetCustomColumn(res);

            if (col != null)
            {
                col.MouseClicked(res, new Point(x, y));
            }
            return(MouseHandleResult.FocusOnMouseDown);
        }
Exemplo n.º 2
0
        public override string GetToolTip(JetListViewNode node, Rectangle rc, ref bool needPlace)
        {
            IResource     res = (IResource)node.Data;
            ICustomColumn col = GetCustomColumn(res);

            if (col != null)
            {
                needPlace = false;
                return(col.GetTooltip(res));
            }
            return(null);
        }
Exemplo n.º 3
0
 public ResourceListViewCustomColumn(int[] propIds, ICustomColumn[] customColumns)
     : base(propIds)
 {
     _customColumns = customColumns;
     for (int i = 0; i < _customColumns.Length; i++)
     {
         if (_customColumns [i] != null)
         {
             _defaultCustomColumn = _customColumns [i];
             break;
         }
     }
 }
Exemplo n.º 4
0
 protected override bool HandleContextMenu(JetListViewNode node, int x, int y)
 {
     if (_contextProvider != null)
     {
         IResource      res     = (IResource)node.Data;
         ICustomColumn  col     = GetCustomColumn(res);
         IActionContext context = _contextProvider.GetContext(ActionContextKind.ContextMenu);
         if (col.ShowContextMenu(context, OwnerControl, new Point(x, y)))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 5
0
 private ICustomColumn[] BuildCustomColumns(int[] propIds)
 {
     ICustomColumn[] result = null;
     for (int i = 0; i < propIds.Length; i++)
     {
         int           propId       = propIds [i];
         ICustomColumn customColumn = (ICustomColumn)_customColumns [propId];
         if (customColumn != null)
         {
             if (result == null)
             {
                 result = new ICustomColumn[propIds.Length];
             }
             result [i] = customColumn;
         }
     }
     return(result);
 }
Exemplo n.º 6
0
        protected override void DrawItem(Graphics g, Rectangle rc, object item, RowState state, string highlightText)
        {
            if (Core.State == CoreState.ShuttingDown)
            {
                return;
            }

            if (HasNonfixedColumnBefore())
            {
                DrawItemBackground(g, rc, rc, item, state, null);
            }
            IResource     res = (IResource)item;
            ICustomColumn col = GetCustomColumn(res);

            if (col != null)
            {
                col.Draw(res, g, rc);
            }
        }
Exemplo n.º 7
0
        /**
         * Register a custom draw handler for a property column.
         */

        public void RegisterCustomColumn(int propId, ICustomColumn customColumn)
        {
            _customColumns [propId] = customColumn;
        }