diff --git a/source/childwin.dfm b/source/childwin.dfm index 1c5e8b16..9ee661a6 100644 --- a/source/childwin.dfm +++ b/source/childwin.dfm @@ -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 diff --git a/source/childwin.pas b/source/childwin.pas index 7fbc9f86..64b151f4 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -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 } diff --git a/source/const.inc b/source/const.inc index 3a2e6676..aa942c88 100644 --- a/source/const.inc +++ b/source/const.inc @@ -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;