I need to add functionality to copy a rectangular selection of nodes and columns, but I really have no choice The method can not be found in several columns in a virtual treeview (next to FullRelect).
Am I missing something? And if not, then what kind of grid have any race with multicolumn selection?
Then after some testing I came up with the following, thanks for the additional push DIG DrawSelection this solution Will not work with, so it needs to be disabled. Since I do not think I will need to do it again, I have not written a line.
Set Disable Droubles, Choose Extented Focus and Tourism Really
Declare the following variables / somewhere useful properties:
initially selected column: integer; First selected column: integer; Last selected column: integer; Selection: Boolean;
Update the following event:
OnKeyDown
If (not selected) and (key = VK_SHIFT) then select from the selected column Start: = vtMain.FocusedColumn; First column selected: = Started column selected; Last selected column: = Started column selected; Selection: = true; End;
OnKeyUp
if key = VK_SHIFT then select: = Incorrect;
Onfox Change
If selection begins, column will be & lt; StartSelectedColumn then starts with the selected column: = Column; Last selected column: = Started column selected; Last & if Column & gt; StartSelectedColumn then the first selected column: = StartSelectedColumn; LastSelectedColumn: = column end and start with the selected column: = Column; Last selected column: = column; End; End Star Start Selection Columns: = Columns; First Selected Column: = Columns; Last selected column: = column; End;
OnBeforeCellPaint
If vtMain.Selected [node] and InRange (Columns, FirstSlotted Columns, LastSlotted Columns) starts when vtMain.focused TargetCanvas. Brush.Color: = VtMain.Colors.FocusedSelectionColor elseTargetCanvas.Brush.Color: = vtMain.Colors.UnfocusedSelectionColor; TargetCanvas.Brush.Style: = Bisolid; TargetCanvas.FillRect (CellRect); End;
OnPaintText
If vtMain.Selected [node] and InRange (Columns, FirstSlotted Columns, LastSlotted Column) starts when vtMain.focused TargetCanvas. Font.Color: = ClHighlightText and TargetCanvas.Font.Color: = vtMain.Font.Color; End;
Comments
Post a Comment