* Readd support for hidden nodes and new header click event removed in 4.8 branch
* Update demos git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2789 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
d67d6d0a63
commit
6760f1a5bc
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ object AlignForm: TAlignForm
|
|||||||
Font.Name = 'Arial'
|
Font.Name = 'Arial'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object Label8: TLabel
|
object Label8: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 111
|
Height = 111
|
||||||
@ -26,9 +26,9 @@ object AlignForm: TAlignForm
|
|||||||
end
|
end
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 113
|
Height = 17
|
||||||
Top = 110
|
Top = 110
|
||||||
Width = 203
|
Width = 1213
|
||||||
Caption = 'Note that hints are aligned properly and draw selection takes the alignment into account too. Sort arrows are shown but the tree is not sorted. All I want to demonstrate is how well the layout in the header works.'
|
Caption = 'Note that hints are aligned properly and draw selection takes the alignment into account too. Sort arrows are shown but the tree is not sorted. All I want to demonstrate is how well the layout in the header works.'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
ShowAccelChar = False
|
ShowAccelChar = False
|
||||||
@ -99,6 +99,7 @@ object AlignForm: TAlignForm
|
|||||||
Header.Columns = <
|
Header.Columns = <
|
||||||
item
|
item
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
|
Color = clWindow
|
||||||
Hint = 'Text is initially centered and has a left-to-right directionality.'
|
Hint = 'Text is initially centered and has a left-to-right directionality.'
|
||||||
ImageIndex = 20
|
ImageIndex = 20
|
||||||
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
|
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
|
||||||
@ -108,6 +109,7 @@ object AlignForm: TAlignForm
|
|||||||
Width = 199
|
Width = 199
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
|
Color = clWindow
|
||||||
Hint = 'Text is initially left aligned and has a left-to-right directionality.'
|
Hint = 'Text is initially left aligned and has a left-to-right directionality.'
|
||||||
ImageIndex = 35
|
ImageIndex = 35
|
||||||
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring, coWrapCaption]
|
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring, coWrapCaption]
|
||||||
@ -118,6 +120,7 @@ object AlignForm: TAlignForm
|
|||||||
end
|
end
|
||||||
item
|
item
|
||||||
BiDiMode = bdRightToLeft
|
BiDiMode = bdRightToLeft
|
||||||
|
Color = clWindow
|
||||||
Hint = 'Text is initially left aligned and has a right-to-left directionality.'
|
Hint = 'Text is initially left aligned and has a right-to-left directionality.'
|
||||||
ImageIndex = 32
|
ImageIndex = 32
|
||||||
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
|
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
|
||||||
@ -148,6 +151,7 @@ object AlignForm: TAlignForm
|
|||||||
TreeOptions.MiscOptions = [toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
TreeOptions.MiscOptions = [toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
|
||||||
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware]
|
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware]
|
||||||
TreeOptions.SelectionOptions = [toExtendedFocus, toMultiSelect]
|
TreeOptions.SelectionOptions = [toExtendedFocus, toMultiSelect]
|
||||||
|
OnCompareNodes = AlignTreeCompareNodes
|
||||||
OnFocusChanged = AlignTreeFocusChanged
|
OnFocusChanged = AlignTreeFocusChanged
|
||||||
OnGetText = AlignTreeGetText
|
OnGetText = AlignTreeGetText
|
||||||
OnPaintText = AlignTreePaintText
|
OnPaintText = AlignTreePaintText
|
||||||
|
@ -14,6 +14,9 @@ uses
|
|||||||
StdCtrls, ComCtrls, VirtualTrees, ExtCtrls, Menus, LResources;
|
StdCtrls, ComCtrls, VirtualTrees, ExtCtrls, Menus, LResources;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TAlignForm }
|
||||||
|
|
||||||
TAlignForm = class(TForm)
|
TAlignForm = class(TForm)
|
||||||
AlignTree: TVirtualStringTree;
|
AlignTree: TVirtualStringTree;
|
||||||
Label8: TLabel;
|
Label8: TLabel;
|
||||||
@ -38,10 +41,13 @@ type
|
|||||||
EnabledOptionBox: TCheckBox;
|
EnabledOptionBox: TCheckBox;
|
||||||
Label5: TLabel;
|
Label5: TLabel;
|
||||||
LayoutCombo: TComboBox;
|
LayoutCombo: TComboBox;
|
||||||
|
procedure AlignTreeCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
procedure AlignTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
|
procedure AlignTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
|
||||||
var Ghosted: Boolean; var Index: Integer);
|
var Ghosted: Boolean; var Index: Integer);
|
||||||
procedure AlignTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
|
procedure AlignTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
|
||||||
var CellText: String);
|
var CellText: String);
|
||||||
|
procedure AlignTreeHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
procedure AlignTreePaintText(Sender: TBaseVirtualTree; const Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
procedure AlignTreePaintText(Sender: TBaseVirtualTree; const Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
TextType: TVSTTextType);
|
TextType: TVSTTextType);
|
||||||
procedure AlignTreeGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
|
procedure AlignTreeGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
|
||||||
@ -53,7 +59,7 @@ type
|
|||||||
procedure IconPopupPopup(Sender: TObject);
|
procedure IconPopupPopup(Sender: TObject);
|
||||||
procedure AlignComboChange(Sender: TObject);
|
procedure AlignComboChange(Sender: TObject);
|
||||||
procedure BidiGroupClick(Sender: TObject);
|
procedure BidiGroupClick(Sender: TObject);
|
||||||
procedure AlignTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X,
|
procedure AlignTreeHeaderClickx(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X,
|
||||||
Y: Integer);
|
Y: Integer);
|
||||||
procedure OptionBoxClick(Sender: TObject);
|
procedure OptionBoxClick(Sender: TObject);
|
||||||
procedure LayoutComboChange(Sender: TObject);
|
procedure LayoutComboChange(Sender: TObject);
|
||||||
@ -179,6 +185,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAlignForm.AlignTreeHeaderClick(Sender: TVTHeader;
|
||||||
|
HitInfo: TVTHeaderHitInfo);
|
||||||
|
begin
|
||||||
|
with HitInfo do
|
||||||
|
if Button = mbLeft then
|
||||||
|
begin
|
||||||
|
with Sender do
|
||||||
|
begin
|
||||||
|
if SortColumn <> Column then
|
||||||
|
begin
|
||||||
|
SortColumn := Column;
|
||||||
|
SortDirection := sdAscending;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
case SortDirection of
|
||||||
|
sdAscending:
|
||||||
|
SortDirection := sdDescending;
|
||||||
|
sdDescending:
|
||||||
|
SortColumn := NoColumn;
|
||||||
|
end;
|
||||||
|
AlignTree.SortTree(SortColumn, SortDirection, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TAlignForm.AlignTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
|
procedure TAlignForm.AlignTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
|
||||||
@ -195,6 +226,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAlignForm.AlignTreeCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
|
var
|
||||||
|
Data1, Data2: PAlignData;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Data1 := Sender.GetNodeData(Node1);
|
||||||
|
Data2 := Sender.GetNodeData(Node2);
|
||||||
|
case Column of
|
||||||
|
0: // left alignd column
|
||||||
|
Result := CompareText(Data1.MainColumnText, Data2.MainColumnText);
|
||||||
|
1: // centered column
|
||||||
|
Result := CompareText(Data1.GreekText, Data2.GreekText);
|
||||||
|
2: // right aligned column
|
||||||
|
Result := CompareText(Data1.RTLText, Data2.RTLText);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TAlignForm.AlignTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
procedure TAlignForm.AlignTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
||||||
@ -476,31 +524,14 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TAlignForm.AlignTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
|
procedure TAlignForm.AlignTreeHeaderClickx(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
|
|
||||||
// This method sets sort column and direction on a header click.
|
// This method sets sort column and direction on a header click.
|
||||||
// Note: this is only to show the header layout. There gets nothing really sorted.
|
// Note: this is only to show the header layout. There gets nothing really sorted.
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Button = mbLeft then
|
|
||||||
begin
|
|
||||||
with Sender do
|
|
||||||
begin
|
|
||||||
if SortColumn <> Column then
|
|
||||||
begin
|
|
||||||
SortColumn := Column;
|
|
||||||
SortDirection := sdAscending;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
case SortDirection of
|
|
||||||
sdAscending:
|
|
||||||
SortDirection := sdDescending;
|
|
||||||
sdDescending:
|
|
||||||
SortColumn := NoColumn;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -10,7 +10,7 @@ object DrawTreeForm: TDrawTreeForm
|
|||||||
Font.Height = -13
|
Font.Height = -13
|
||||||
Font.Name = 'Trebuchet MS'
|
Font.Name = 'Trebuchet MS'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object Label7: TLabel
|
object Label7: TLabel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 61
|
Height = 61
|
||||||
|
@ -24,6 +24,9 @@ uses
|
|||||||
VirtualTrees, StdCtrls, shlobjext, LResources, FileUtil;
|
VirtualTrees, StdCtrls, shlobjext, LResources, FileUtil;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TDrawTreeForm }
|
||||||
|
|
||||||
TDrawTreeForm = class(TForm)
|
TDrawTreeForm = class(TForm)
|
||||||
VDT1: TVirtualDrawTree;
|
VDT1: TVirtualDrawTree;
|
||||||
Label7: TLabel;
|
Label7: TLabel;
|
||||||
@ -42,8 +45,7 @@ type
|
|||||||
var Ghosted: Boolean; var Index: Integer);
|
var Ghosted: Boolean; var Index: Integer);
|
||||||
procedure VDT1GetNodeWidth(Sender: TBaseVirtualTree; Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
procedure VDT1GetNodeWidth(Sender: TBaseVirtualTree; Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
var NodeWidth: Integer);
|
var NodeWidth: Integer);
|
||||||
procedure VDT1HeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X,
|
procedure VDT1HeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
Y: Integer);
|
|
||||||
procedure VDT1InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
procedure VDT1InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
||||||
procedure VDT1InitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
procedure VDT1InitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
||||||
var InitialStates: TVirtualNodeInitStates);
|
var InitialStates: TVirtualNodeInitStates);
|
||||||
@ -514,6 +516,34 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDrawTreeForm.VDT1HeaderClick(Sender: TVTHeader;
|
||||||
|
HitInfo: TVTHeaderHitInfo);
|
||||||
|
begin
|
||||||
|
with HitInfo do
|
||||||
|
if Button = mbLeft then
|
||||||
|
begin
|
||||||
|
with Sender do
|
||||||
|
begin
|
||||||
|
if Column <> MainColumn then
|
||||||
|
SortColumn := NoColumn
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if SortColumn = NoColumn then
|
||||||
|
begin
|
||||||
|
SortColumn := Column;
|
||||||
|
SortDirection := sdAscending;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if SortDirection = sdAscending then
|
||||||
|
SortDirection := sdDescending
|
||||||
|
else
|
||||||
|
SortDirection := sdAscending;
|
||||||
|
Treeview.SortTree(SortColumn, SortDirection, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TDrawTreeForm.VDT1InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
procedure TDrawTreeForm.VDT1InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
||||||
@ -674,37 +704,6 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TDrawTreeForm.VDT1HeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
|
|
||||||
X, Y: Integer);
|
|
||||||
|
|
||||||
// Click handler to switch the column on which will be sorted. Since we cannot sort image data sorting is actually
|
|
||||||
// limited to the main column.
|
|
||||||
|
|
||||||
begin
|
|
||||||
if Button = mbLeft then
|
|
||||||
begin
|
|
||||||
with Sender do
|
|
||||||
begin
|
|
||||||
if Column <> MainColumn then
|
|
||||||
SortColumn := NoColumn
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if SortColumn = NoColumn then
|
|
||||||
begin
|
|
||||||
SortColumn := Column;
|
|
||||||
SortDirection := sdAscending;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if SortDirection = sdAscending then
|
|
||||||
SortDirection := sdDescending
|
|
||||||
else
|
|
||||||
SortDirection := sdAscending;
|
|
||||||
Treeview.SortTree(SortColumn, SortDirection, False);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TDrawTreeForm.TrackBar1Change(Sender: TObject);
|
procedure TDrawTreeForm.TrackBar1Change(Sender: TObject);
|
||||||
|
@ -11,22 +11,22 @@ object WindowsXPForm: TWindowsXPForm
|
|||||||
Font.Height = -13
|
Font.Height = -13
|
||||||
Font.Name = 'Microsoft Sans Serif'
|
Font.Name = 'Microsoft Sans Serif'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 564
|
Left = -449
|
||||||
Height = 81
|
Height = 17
|
||||||
Top = 40
|
Top = 40
|
||||||
Width = 273
|
Width = 1286
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'This demo shows a tree with properties which make it look as in the new Windows XP style. Under Windows XP native theme APIs are used to paint the tree. On other system legacy code is used which simulates the look.'
|
Caption = 'This demo shows a tree with properties which make it look as in the new Windows XP style. Under Windows XP native theme APIs are used to paint the tree. On other system legacy code is used which simulates the look.'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 565
|
Left = -291
|
||||||
Height = 81
|
Height = 17
|
||||||
Top = 168
|
Top = 168
|
||||||
Width = 272
|
Width = 1128
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Note that the scrollbars are not drawn in the new style on non-XP systems. It would be far off the goal of the tree to reimplement a full blown scrollbar handling, which would be required otherwise.'
|
Caption = 'Note that the scrollbars are not drawn in the new style on non-XP systems. It would be far off the goal of the tree to reimplement a full blown scrollbar handling, which would be required otherwise.'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
@ -34,10 +34,10 @@ object WindowsXPForm: TWindowsXPForm
|
|||||||
end
|
end
|
||||||
object Label4: TLabel
|
object Label4: TLabel
|
||||||
Cursor = crHandPoint
|
Cursor = crHandPoint
|
||||||
Left = 565
|
Left = -617
|
||||||
Height = 97
|
Height = 17
|
||||||
Top = 290
|
Top = 290
|
||||||
Width = 272
|
Width = 1454
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'If you want to have an explorer treeview with real content then I recommend that you give Jim Kuenemann''s shell tools a try. His shell treeview (based on Virtual Treeview) is the most advanced you will find worldwide. Click here to open Yahoo Group.'
|
Caption = 'If you want to have an explorer treeview with real content then I recommend that you give Jim Kuenemann''s shell tools a try. His shell treeview (based on Virtual Treeview) is the most advanced you will find worldwide. Click here to open Yahoo Group.'
|
||||||
Font.CharSet = ANSI_CHARSET
|
Font.CharSet = ANSI_CHARSET
|
||||||
@ -169,12 +169,12 @@ object WindowsXPForm: TWindowsXPForm
|
|||||||
object ToolButton15: TToolButton
|
object ToolButton15: TToolButton
|
||||||
Left = 241
|
Left = 241
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 8
|
Width = 10
|
||||||
Caption = 'ToolButton15'
|
Caption = 'ToolButton15'
|
||||||
Style = tbsSeparator
|
Style = tbsSeparator
|
||||||
end
|
end
|
||||||
object ToolButton16: TToolButton
|
object ToolButton16: TToolButton
|
||||||
Left = 249
|
Left = 251
|
||||||
Top = 2
|
Top = 2
|
||||||
Caption = 'Click here to print the treeview.'
|
Caption = 'Click here to print the treeview.'
|
||||||
ImageIndex = 24
|
ImageIndex = 24
|
||||||
|
@ -37,12 +37,13 @@ type
|
|||||||
procedure XPTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
|
procedure XPTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
|
||||||
Column: TColumnIndex; var Ghosted: Boolean; var Index: Integer);
|
Column: TColumnIndex; var Ghosted: Boolean; var Index: Integer);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure XPTreeHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
procedure XPTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
procedure XPTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
||||||
var InitialStates: TVirtualNodeInitStates);
|
var InitialStates: TVirtualNodeInitStates);
|
||||||
procedure XPTreeInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
procedure XPTreeInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
|
||||||
procedure XPTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
|
procedure XPTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
TextType: TVSTTextType; var CellText: String);
|
TextType: TVSTTextType; var CellText: String);
|
||||||
procedure XPTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
|
procedure XPTreeHeaderClickx(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
procedure XPTreeCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex;
|
procedure XPTreeCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex;
|
||||||
var Result: Integer);
|
var Result: Integer);
|
||||||
@ -129,6 +130,40 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWindowsXPForm.XPTreeHeaderClick(Sender: TVTHeader;
|
||||||
|
HitInfo: TVTHeaderHitInfo);
|
||||||
|
begin
|
||||||
|
with HitInfo do
|
||||||
|
if Button = mbLeft then
|
||||||
|
begin
|
||||||
|
with Sender, Treeview do
|
||||||
|
begin
|
||||||
|
if SortColumn > NoColumn then
|
||||||
|
Columns[SortColumn].Options := Columns[SortColumn].Options + [coParentColor];
|
||||||
|
|
||||||
|
// Do not sort the last column, it contains nothing to sort.
|
||||||
|
if Column = 2 then
|
||||||
|
SortColumn := NoColumn
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if (SortColumn = NoColumn) or (SortColumn <> Column) then
|
||||||
|
begin
|
||||||
|
SortColumn := Column;
|
||||||
|
SortDirection := sdAscending;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if SortDirection = sdAscending then
|
||||||
|
SortDirection := sdDescending
|
||||||
|
else
|
||||||
|
SortDirection := sdAscending;
|
||||||
|
|
||||||
|
Columns[SortColumn].Color := $F7F7F7;
|
||||||
|
SortTree(SortColumn, SortDirection, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TWindowsXPForm.XPTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
procedure TWindowsXPForm.XPTreeInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
||||||
@ -186,38 +221,11 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TWindowsXPForm.XPTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton;
|
procedure TWindowsXPForm.XPTreeHeaderClickx(Sender: TVTHeader;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X, Y: Integer
|
||||||
|
);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Button = mbLeft then
|
|
||||||
begin
|
|
||||||
with Sender, Treeview do
|
|
||||||
begin
|
|
||||||
if SortColumn > NoColumn then
|
|
||||||
Columns[SortColumn].Options := Columns[SortColumn].Options + [coParentColor];
|
|
||||||
|
|
||||||
// Do not sort the last column, it contains nothing to sort.
|
|
||||||
if Column = 2 then
|
|
||||||
SortColumn := NoColumn
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if (SortColumn = NoColumn) or (SortColumn <> Column) then
|
|
||||||
begin
|
|
||||||
SortColumn := Column;
|
|
||||||
SortDirection := sdAscending;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if SortDirection = sdAscending then
|
|
||||||
SortDirection := sdDescending
|
|
||||||
else
|
|
||||||
SortDirection := sdAscending;
|
|
||||||
|
|
||||||
Columns[SortColumn].Color := $F7F7F7;
|
|
||||||
SortTree(SortColumn, SortDirection, False);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -12,30 +12,30 @@ object Form1: TForm1
|
|||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 224
|
Left = 246
|
||||||
Height = 14
|
Height = 14
|
||||||
Top = 348
|
Top = 348
|
||||||
Width = 174
|
Width = 152
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
Caption = 'Array data of the clicked node:'
|
Caption = 'Array data of the clicked node:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 224
|
Left = 258
|
||||||
Height = 14
|
Height = 14
|
||||||
Top = 382
|
Top = 382
|
||||||
Width = 256
|
Width = 222
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
Caption = 'Find and show the node by specific array index'
|
Caption = 'Find and show the node by specific array index'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
Left = 224
|
Left = 261
|
||||||
Height = 14
|
Height = 14
|
||||||
Top = 398
|
Top = 398
|
||||||
Width = 274
|
Width = 237
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
Caption = 'Type index to get related tree node on the screen:'
|
Caption = 'Type index to get related tree node on the screen:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
@ -66,8 +66,8 @@ object Form1: TForm1
|
|||||||
AnchorSideLeft.Control = Label1
|
AnchorSideLeft.Control = Label1
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 402
|
Left = 402
|
||||||
Height = 23
|
Height = 21
|
||||||
Top = 344
|
Top = 346
|
||||||
Width = 170
|
Width = 170
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
@ -89,8 +89,8 @@ object Form1: TForm1
|
|||||||
AnchorSideLeft.Control = Label3
|
AnchorSideLeft.Control = Label3
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 502
|
Left = 502
|
||||||
Height = 23
|
Height = 21
|
||||||
Top = 394
|
Top = 396
|
||||||
Width = 97
|
Width = 97
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
|
@ -115,8 +115,7 @@ type
|
|||||||
procedure Button1Click(Sender: TObject);
|
procedure Button1Click(Sender: TObject);
|
||||||
procedure MyTreeCompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure MyTreeCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
procedure MyTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
procedure MyTreeHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
procedure btnDeleteClick(Sender: TObject);
|
procedure btnDeleteClick(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure MyTreePaintText(Sender: TBaseVirtualTree;
|
procedure MyTreePaintText(Sender: TBaseVirtualTree;
|
||||||
@ -240,8 +239,7 @@ begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.MyTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
procedure TForm1.MyTreeHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
var
|
var
|
||||||
Direction : TSortDirection;
|
Direction : TSortDirection;
|
||||||
begin
|
begin
|
||||||
@ -251,27 +249,30 @@ begin
|
|||||||
// MyTree.Header.SortDirection and MyTree.Header.SortColumn
|
// MyTree.Header.SortDirection and MyTree.Header.SortColumn
|
||||||
// to get automatically Descending/Ascending sorting
|
// to get automatically Descending/Ascending sorting
|
||||||
// by only clicking on header
|
// by only clicking on header
|
||||||
|
with HitInfo do
|
||||||
if ssShift in Shift
|
|
||||||
then
|
|
||||||
Direction := sdDescending
|
|
||||||
else
|
|
||||||
Direction := sdAscending;
|
|
||||||
|
|
||||||
// Sort all columns except the second
|
|
||||||
if Column<>1 then
|
|
||||||
begin
|
begin
|
||||||
// Set direction image on the sorted column
|
if ssShift in Shift
|
||||||
MyTree.Header.SortColumn := Column;
|
then
|
||||||
|
Direction := sdDescending
|
||||||
|
else
|
||||||
|
Direction := sdAscending;
|
||||||
|
|
||||||
// Set the right direction image
|
// Sort all columns except the second
|
||||||
MyTree.Header.SortDirection := Direction;
|
if Column<>1 then
|
||||||
|
begin
|
||||||
|
// Set direction image on the sorted column
|
||||||
|
MyTree.Header.SortColumn := Column;
|
||||||
|
|
||||||
// Sorting process
|
// Set the right direction image
|
||||||
MyTree.SortTree(Column, Direction);
|
MyTree.Header.SortDirection := Direction;
|
||||||
end
|
|
||||||
|
// Sorting process
|
||||||
|
MyTree.SortTree(Column, Direction);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TForm1.btnDeleteClick(Sender: TObject);
|
procedure TForm1.btnDeleteClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
Timer: cardinal;
|
Timer: cardinal;
|
||||||
|
@ -10,7 +10,7 @@ object Form1: TForm1
|
|||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
Font.Name = 'MS Sans Serif'
|
Font.Name = 'MS Sans Serif'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object VST1: TVirtualStringTree
|
object VST1: TVirtualStringTree
|
||||||
Cursor = 63
|
Cursor = 63
|
||||||
Left = 0
|
Left = 0
|
||||||
|
@ -41,6 +41,7 @@ type
|
|||||||
procedure VST1BeforeCellPaint(Sender: TBaseVirtualTree;
|
procedure VST1BeforeCellPaint(Sender: TBaseVirtualTree;
|
||||||
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
|
CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
|
||||||
|
procedure VST1HeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
procedure VST1InitNode(Sender: TBaseVirtualTree; ParentNode,
|
procedure VST1InitNode(Sender: TBaseVirtualTree; ParentNode,
|
||||||
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
|
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
|
||||||
procedure VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
procedure VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
@ -51,8 +52,6 @@ type
|
|||||||
var Ghosted: Boolean; var ImageIndex: Integer);
|
var Ghosted: Boolean; var ImageIndex: Integer);
|
||||||
procedure VST1Checking(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
procedure VST1Checking(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
var NewState: TCheckState; var Allowed: Boolean);
|
var NewState: TCheckState; var Allowed: Boolean);
|
||||||
procedure VST1HeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
procedure VST1CompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure VST1CompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
private
|
private
|
||||||
@ -151,6 +150,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.VST1HeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
|
begin
|
||||||
|
// Determinate sorting direction
|
||||||
|
if HitInfo.Button=mbLeft then
|
||||||
|
with Sender do
|
||||||
|
begin
|
||||||
|
if SortColumn <> HitInfo.Column then
|
||||||
|
SortColumn := HitInfo.Column
|
||||||
|
else begin
|
||||||
|
if SortDirection = sdAscending then
|
||||||
|
SortDirection := sdDescending
|
||||||
|
else
|
||||||
|
SortDirection := sdAscending
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Initiate sorting
|
||||||
|
VST1.SortTree(HitInfo.Column, Sender.SortDirection, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.VST1InitNode(Sender: TBaseVirtualTree; ParentNode,
|
procedure TForm1.VST1InitNode(Sender: TBaseVirtualTree; ParentNode,
|
||||||
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
|
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
|
||||||
var
|
var
|
||||||
@ -261,28 +280,6 @@ begin
|
|||||||
Allowed:=true
|
Allowed:=true
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.VST1HeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
begin
|
|
||||||
|
|
||||||
// Determinate sorting direction
|
|
||||||
if Button=mbLeft then
|
|
||||||
with Sender do
|
|
||||||
begin
|
|
||||||
if SortColumn <> Column then
|
|
||||||
SortColumn := Column
|
|
||||||
else begin
|
|
||||||
if SortDirection = sdAscending then
|
|
||||||
SortDirection := sdDescending
|
|
||||||
else
|
|
||||||
SortDirection := sdAscending
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Initiate sorting
|
|
||||||
VST1.SortTree(Column, Sender.SortDirection, False);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.VST1CompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure TForm1.VST1CompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
var
|
var
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
|
<Version Value="9"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="7"/>
|
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<AlwaysBuild Value="False"/>
|
|
||||||
<LRSInOutputDirectory Value="False"/>
|
<LRSInOutputDirectory Value="False"/>
|
||||||
</Flags>
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<TargetFileExt Value=".exe"/>
|
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<StringTable ProductVersion=""/>
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
|
<BuildModes Count="1">
|
||||||
|
<Item1 Name="default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
@ -51,8 +52,13 @@
|
|||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="8"/>
|
<Version Value="11"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<UseAnsiStrings Value="False"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Options>
|
<Options>
|
||||||
<Win32>
|
<Win32>
|
||||||
|
@ -13,7 +13,7 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poDefaultPosOnly
|
Position = poDefaultPosOnly
|
||||||
LCLVersion = '0.9.27'
|
LCLVersion = '1.0.8.0'
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 12
|
Left = 12
|
||||||
Height = 14
|
Height = 14
|
||||||
@ -23,7 +23,9 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
Height = 482
|
Height = 482
|
||||||
|
Top = 0
|
||||||
Width = 553
|
Width = 553
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
@ -45,8 +47,10 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
DefaultText = 'Node'
|
DefaultText = 'Node'
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
Font.Name = 'Tahoma'
|
Font.Name = 'Tahoma'
|
||||||
|
Header.AutoSizeIndex = 0
|
||||||
Header.Columns = <
|
Header.Columns = <
|
||||||
item
|
item
|
||||||
|
Color = clWindow
|
||||||
ImageIndex = 3
|
ImageIndex = 3
|
||||||
Layout = blGlyphRight
|
Layout = blGlyphRight
|
||||||
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
||||||
@ -61,9 +65,11 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
end
|
end
|
||||||
item
|
item
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
|
Position = 0
|
||||||
Text = 'Status'
|
Text = 'Status'
|
||||||
Width = 42
|
Width = 42
|
||||||
end>
|
end>
|
||||||
|
Header.DefaultHeight = 17
|
||||||
Header.Font.Height = -11
|
Header.Font.Height = -11
|
||||||
Header.Font.Name = 'MS Sans Serif'
|
Header.Font.Name = 'MS Sans Serif'
|
||||||
Header.Images = imgMaster
|
Header.Images = imgMaster
|
||||||
@ -201,7 +207,7 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
end
|
end
|
||||||
object chkShowIDs: TCheckBox
|
object chkShowIDs: TCheckBox
|
||||||
Left = 244
|
Left = 244
|
||||||
Height = 17
|
Height = 19
|
||||||
Top = 35
|
Top = 35
|
||||||
Width = 60
|
Width = 60
|
||||||
Caption = 'Show ID'
|
Caption = 'Show ID'
|
||||||
@ -220,7 +226,7 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
end
|
end
|
||||||
object chkAllVisible: TCheckBox
|
object chkAllVisible: TCheckBox
|
||||||
Left = 429
|
Left = 429
|
||||||
Height = 17
|
Height = 19
|
||||||
Top = 35
|
Top = 35
|
||||||
Width = 63
|
Width = 63
|
||||||
Caption = 'All Visible'
|
Caption = 'All Visible'
|
||||||
@ -229,7 +235,7 @@ object frmVTDBExample: TfrmVTDBExample
|
|||||||
end
|
end
|
||||||
object chkDynHt: TCheckBox
|
object chkDynHt: TCheckBox
|
||||||
Left = 324
|
Left = 324
|
||||||
Height = 17
|
Height = 19
|
||||||
Top = 35
|
Top = 35
|
||||||
Width = 94
|
Width = 94
|
||||||
Caption = 'Dynamic Height'
|
Caption = 'Dynamic Height'
|
||||||
|
@ -57,6 +57,7 @@ interface
|
|||||||
procedure VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
|
procedure VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
|
||||||
var Text: String);
|
var Text: String);
|
||||||
procedure VTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
procedure VTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||||
|
procedure VTHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
|
||||||
procedure VTInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
procedure VTInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
|
||||||
var InitialStates: TVirtualNodeInitStates);
|
var InitialStates: TVirtualNodeInitStates);
|
||||||
procedure FormActivate(Sender: TObject);
|
procedure FormActivate(Sender: TObject);
|
||||||
@ -67,8 +68,6 @@ interface
|
|||||||
procedure VTPaintText(Sender: TBaseVirtualTree;
|
procedure VTPaintText(Sender: TBaseVirtualTree;
|
||||||
const TargetCanvas: TCanvas; Node: PVirtualNode;
|
const TargetCanvas: TCanvas; Node: PVirtualNode;
|
||||||
Column: TColumnIndex; TextType: TVSTTextType);
|
Column: TColumnIndex; TextType: TVSTTextType);
|
||||||
procedure VTHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
procedure VTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure VTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
procedure VTGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
|
procedure VTGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
|
||||||
@ -213,6 +212,22 @@ implementation
|
|||||||
Data.bnd.Free;
|
Data.bnd.Free;
|
||||||
Finalize( Data^ );
|
Finalize( Data^ );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmVTDBExample.VTHeaderClick(Sender: TVTHeader;
|
||||||
|
HitInfo: TVTHeaderHitInfo);
|
||||||
|
begin
|
||||||
|
with HitInfo do
|
||||||
|
begin
|
||||||
|
if (VT.Header.SortColumn <> Column) then
|
||||||
|
VT.Header.SortColumn := Column
|
||||||
|
else if (VT.Header.SortDirection = sdAscending) then
|
||||||
|
VT.Header.SortDirection := sdDescending
|
||||||
|
else
|
||||||
|
VT.Header.SortDirection := sdAscending;
|
||||||
|
|
||||||
|
VT.SortTree( Column, VT.Header.SortDirection );
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmVTDBExample.VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
procedure TfrmVTDBExample.VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
Column: TColumnIndex; TextType: TVSTTextType; var Text: String);
|
Column: TColumnIndex; TextType: TVSTTextType; var Text: String);
|
||||||
@ -342,19 +357,6 @@ implementation
|
|||||||
VT.Refresh;
|
VT.Refresh;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmVTDBExample.VTHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
|
|
||||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
||||||
begin
|
|
||||||
if (VT.Header.SortColumn <> Column) then
|
|
||||||
VT.Header.SortColumn := Column
|
|
||||||
else if (VT.Header.SortDirection = sdAscending) then
|
|
||||||
VT.Header.SortDirection := sdDescending
|
|
||||||
else
|
|
||||||
VT.Header.SortDirection := sdAscending;
|
|
||||||
|
|
||||||
VT.SortTree( Column, VT.Header.SortDirection );
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrmVTDBExample.VTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure TfrmVTDBExample.VTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
var
|
var
|
||||||
|
@ -14,7 +14,7 @@ object frmVTNoData: TfrmVTNoData
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
Position = poDefaultPosOnly
|
Position = poDefaultPosOnly
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.0.8.0'
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 346
|
Height = 346
|
||||||
@ -67,7 +67,7 @@ object frmVTNoData: TfrmVTNoData
|
|||||||
Left = 9
|
Left = 9
|
||||||
Height = 14
|
Height = 14
|
||||||
Top = 9
|
Top = 9
|
||||||
Width = 82
|
Width = 76
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
Caption = 'VT.TreeOptions'
|
Caption = 'VT.TreeOptions'
|
||||||
Font.Color = clRed
|
Font.Color = clRed
|
||||||
@ -78,27 +78,27 @@ object frmVTNoData: TfrmVTNoData
|
|||||||
end
|
end
|
||||||
object chkCheckBoxes: TCheckBox
|
object chkCheckBoxes: TCheckBox
|
||||||
Left = 180
|
Left = 180
|
||||||
Height = 22
|
Height = 19
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 93
|
Width = 81
|
||||||
Caption = 'Check Boxes'
|
Caption = 'Check Boxes'
|
||||||
OnClick = chkCheckBoxesClick
|
OnClick = chkCheckBoxesClick
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object chkFullExpand: TCheckBox
|
object chkFullExpand: TCheckBox
|
||||||
Left = 100
|
Left = 100
|
||||||
Height = 22
|
Height = 19
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 86
|
Width = 75
|
||||||
Caption = 'Full Expand'
|
Caption = 'Full Expand'
|
||||||
OnClick = chkFullExpandClick
|
OnClick = chkFullExpandClick
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object chkShowLevel: TCheckBox
|
object chkShowLevel: TCheckBox
|
||||||
Left = 271
|
Left = 271
|
||||||
Height = 22
|
Height = 19
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 86
|
Width = 74
|
||||||
Caption = 'Show Level'
|
Caption = 'Show Level'
|
||||||
OnClick = chkShowLevelClick
|
OnClick = chkShowLevelClick
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
|
@ -194,7 +194,9 @@ implementation
|
|||||||
'StaticBackground',
|
'StaticBackground',
|
||||||
'ChildrenAbove',
|
'ChildrenAbove',
|
||||||
'FixedIndent',
|
'FixedIndent',
|
||||||
'UseExplorerTheme'
|
'UseExplorerTheme',
|
||||||
|
'HideTreeLinesIfThemed',
|
||||||
|
'ShowHiddenNodes'
|
||||||
);
|
);
|
||||||
|
|
||||||
aSelOpts : array[0..Ord(High(TVTSelectionOption))] of string[25] =
|
aSelOpts : array[0..Ord(High(TVTSelectionOption))] of string[25] =
|
||||||
|
Loading…
Reference in New Issue
Block a user