mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Paint background of sorted columns light grey. Imitates behaviour of the Windows XP Explorer and adds a clear signal to the user that the list is somehow sorted currently.
This commit is contained in:
@@ -132,6 +132,7 @@ object MDIChild: TMDIChild
|
||||
TreeOptions.MiscOptions = [toToggleOnDblClick]
|
||||
TreeOptions.PaintOptions = [toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
|
||||
OnBeforePaint = vstBeforePaint
|
||||
OnCompareNodes = vstCompareNodes
|
||||
OnFreeNode = vstFreeNode
|
||||
OnGetText = vstGetText
|
||||
@@ -181,6 +182,7 @@ object MDIChild: TMDIChild
|
||||
TreeOptions.MiscOptions = [toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||
TreeOptions.PaintOptions = [toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
|
||||
OnBeforePaint = vstBeforePaint
|
||||
OnCompareNodes = vstCompareNodes
|
||||
OnFreeNode = vstFreeNode
|
||||
OnGetText = vstGetText
|
||||
@@ -264,6 +266,7 @@ object MDIChild: TMDIChild
|
||||
TreeOptions.MiscOptions = [toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect]
|
||||
OnBeforePaint = vstBeforePaint
|
||||
OnCompareNodes = vstCompareNodes
|
||||
OnFreeNode = vstFreeNode
|
||||
OnGetText = vstGetText
|
||||
@@ -376,6 +379,7 @@ object MDIChild: TMDIChild
|
||||
TreeOptions.MiscOptions = [toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||
TreeOptions.PaintOptions = [toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect, toMultiSelect, toRightClickSelect]
|
||||
OnBeforePaint = vstBeforePaint
|
||||
OnChange = ListTablesChange
|
||||
OnCompareNodes = vstCompareNodes
|
||||
OnDblClick = ListTablesDblClick
|
||||
@@ -665,6 +669,7 @@ object MDIChild: TMDIChild
|
||||
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||
TreeOptions.PaintOptions = [toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages]
|
||||
TreeOptions.SelectionOptions = [toFullRowSelect, toMultiSelect, toRightClickSelect]
|
||||
OnBeforePaint = vstBeforePaint
|
||||
OnChange = ListColumnsChange
|
||||
OnCompareNodes = vstCompareNodes
|
||||
OnDblClick = UpdateField
|
||||
|
||||
@@ -502,6 +502,8 @@ type
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
procedure vstCompareNodes(Sender: TBaseVirtualTree; Node1, Node2:
|
||||
PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||
procedure vstBeforePaint(Sender: TBaseVirtualTree; TargetCanvas:
|
||||
TCanvas);
|
||||
|
||||
private
|
||||
strHostRunning : String;
|
||||
@@ -6076,6 +6078,26 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{**
|
||||
VirtualTree gets painted. Adjust background color of sorted column.
|
||||
}
|
||||
procedure TMDIChild.vstBeforePaint(Sender: TBaseVirtualTree;
|
||||
TargetCanvas: TCanvas);
|
||||
var
|
||||
i : Integer;
|
||||
h : TVTHeader;
|
||||
begin
|
||||
h := TVirtualStringTree(Sender).Header;
|
||||
for i := 0 to h.Columns.Count - 1 do
|
||||
begin
|
||||
if h.SortColumn = i then
|
||||
h.Columns[i].Color := COLOR_SORTCOLUMN
|
||||
else
|
||||
h.Columns[i].Color := clWindow;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{**
|
||||
Return the data array which belongs to a VirtualTree component
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ const
|
||||
REGPATH = 'Software\' + APPNAME;
|
||||
STATUS_MSG_READY = 'Ready.';
|
||||
STR_NOTSUPPORTED = 'Not supported by this server';
|
||||
// Used by ListViews
|
||||
COLOR_SORTCOLUMN = $00F7F7F7;
|
||||
|
||||
// Used by maskSQL and fixSQL:
|
||||
SQL_VERSION_ANSI = -1;
|
||||
|
||||
Reference in New Issue
Block a user