Skip to content

Commit 0257867

Browse files
committed
fix: do not edit grid cell on right-click, and set HotCursor on DBtree
1 parent 0563b4d commit 0257867

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

source/main.lfm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ object MainForm: TMainForm
945945
Constraints.MinHeight = 40
946946
Constraints.MinWidth = 40
947947
DefaultText = 'Node'
948+
DragMode = dmAutomatic
948949
Header.AutoSizeIndex = 0
949950
Header.Columns = <
950951
item
@@ -959,13 +960,15 @@ object MainForm: TMainForm
959960
end>
960961
Header.Options = [hoAutoResize, hoColumnResize, hoDrag]
961962
HintMode = hmTooltip
963+
HotCursor = crHandPoint
962964
Images = ImageListMain
963965
IncrementalSearch = isInitializedOnly
964966
ParentShowHint = False
965967
PopupMenu = popupDB
966968
ShowHint = True
967969
TabOrder = 3
968-
TreeOptions.PaintOptions = [toHotTrack, toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware, toUseBlendedImages, toGhostedIfUnfocused, toUseExplorerTheme]
970+
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoSort, toAutoTristateTracking, toAutoHideButtons, toAutoDeleteMovedNodes, toAutoChangeScale]
971+
TreeOptions.PaintOptions = [toHotTrack, toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware, toGhostedIfUnfocused, toUseExplorerTheme]
969972
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
970973
OnAfterCellPaint = DBtreeAfterCellPaint
971974
OnBeforeCellPaint = DBtreeBeforeCellPaint

source/main.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ TMainForm = class(TExtForm)
12161216
FLastMouseUpOnPageControl: Cardinal;
12171217
FLastTabNumberOnMouseUp: Integer;
12181218
FLastMouseDownCloseButton: TObject;
1219+
FLastMouseButtonUpOnGrid: TMouseButton;
12191220
//FJumpList: TJumpList;
12201221
// Filter text per tab for filter panel
12211222
FFilterTextDatabases,
@@ -2133,6 +2134,7 @@ procedure TMainForm.FormCreate(Sender: TObject);
21332134
// Set noderoot for query helpers box
21342135
treeQueryHelpers.RootNodeCount := 7;
21352136

2137+
FLastMouseButtonUpOnGrid := mbLeft;
21362138
FLastCaptionChange := 0;
21372139
FLastPortableSettingsSave := 0;
21382140
FLastAppSettingsWrites := 0;
@@ -10784,6 +10786,9 @@ procedure TMainForm.AnyGridEditing(Sender: TBaseVirtualTree; Node:
1078410786
PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
1078510787
begin
1078610788
Allowed := False;
10789+
// Do not edit on right-click
10790+
if FLastMouseButtonUpOnGrid = mbRight then
10791+
Exit;
1078710792
try
1078810793
if not AnyGridEnsureFullRow(Sender as TVirtualStringTree, Node) then
1078910794
ErrorDialog(_('Could not load full row data.'))
@@ -11315,6 +11320,7 @@ procedure TMainForm.AnyGridMouseUp(Sender: TObject; Button: TMouseButton;
1131511320
Hit: THitInfo;
1131611321
Results: TDBQuery;
1131711322
begin
11323+
FLastMouseButtonUpOnGrid := Button;
1131811324
// Detect mouse hit in grid whitespace and apply changes.
1131911325
Grid := Sender as TVirtualStringTree;
1132011326
if not Assigned(Grid.FocusedNode) then

0 commit comments

Comments
 (0)