You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have own column with checkboxes and it has to be the first one all the time, but user can easily drag another one to the first position.
code below is working for me but I don't want to have such hacks in sources
procedureTVTHeader.DragTo(P: TPoint);
// Moves the drag image to a new position, which is determined from the passed point P and the previous// mouse position.var
I,
NewTarget: Integer;
// optimized drag image move support
ClientP: TPoint;
Left,
Right: Integer;
NeedRepaint: Boolean; // True if the screen needs an update (changed drop target or drop side)begin// Determine new drop target and which side of it is prefered.
ClientP := Treeview.ScreenToClient(P);
// Make coordinates relative to (0, 0) of the non-client area.
Inc(ClientP.Y, FHeight);
NewTarget := FColumns.ColumnFromPosition(ClientP);
if NewTarget = 0then// change
Exit; //change
I see two possible options #1 allow DragTo to be overridable. #2 introduce new Column Option like TVTColumnOption.coNotDropable #3 introduce some kind of event/function that can modify NewTarget
which would you prefer?
The text was updated successfully, but these errors were encountered:
For now If prefer option 1, which I just committed.
introduce new Column Option like TVTColumnOption.coNotDropable
See this article. But I think that something like this could make sense and wondered if TColumnOption.coFixed should include the requested behavior. What sense could it make to allow dragging a non-Fixed column left of a Fixed column?
thx for changes, I understand that not all can be configurable ... to your question, I can't try it right now but I think that i saw some code that changes non fixed column to fixed when it's moved to left of fixed column (or between fixed columns) and vice versa.
I have own column with checkboxes and it has to be the first one all the time, but user can easily drag another one to the first position.
code below is working for me but I don't want to have such hacks in sources
I see two possible options
#1
allow DragTo to be overridable.#2
introduce new Column Option likeTVTColumnOption.coNotDropable
#3
introduce some kind of event/function that can modify NewTargetwhich would you prefer?
The text was updated successfully, but these errors were encountered: