* Update advanced demo to use utf8

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@670 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-01-24 11:00:47 +00:00
parent 50400d4c00
commit 46955c2cdf
28 changed files with 516 additions and 1187 deletions

View File

@@ -2,10 +2,11 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<Version Value="7"/>
<General>
<Flags>
<AlwaysBuild Value="False"/>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
@@ -48,7 +49,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="WindowsXPStyleDemo.lrs"/>
<UnitName Value="WindowsXPStyleDemo"/>
</Unit1>
<Unit2>
@@ -57,7 +57,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="AlignDemo.lrs"/>
<UnitName Value="AlignDemo"/>
</Unit2>
<Unit3>
@@ -66,7 +65,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="DrawTreeDemo.lrs"/>
<UnitName Value="DrawTreeDemo"/>
</Unit3>
<Unit4>
@@ -80,7 +78,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="GeneralAbilitiesDemo.lrs"/>
<UnitName Value="GeneralAbilitiesDemo"/>
</Unit5>
<Unit6>
@@ -89,7 +86,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="GridDemo.lrs"/>
<UnitName Value="GridDemo"/>
</Unit6>
<Unit7>
@@ -98,7 +94,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="HeaderCustomDrawDemo.lrs"/>
<UnitName Value="HeaderCustomDrawDemo"/>
</Unit7>
<Unit8>
@@ -107,7 +102,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="Main.lrs"/>
<UnitName Value="Main"/>
</Unit8>
<Unit9>
@@ -116,7 +110,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="MultilineDemo.lrs"/>
<UnitName Value="MultilineDemo"/>
</Unit9>
<Unit10>
@@ -125,7 +118,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="PropertiesDemo.lrs"/>
<UnitName Value="PropertiesDemo"/>
</Unit10>
<Unit11>
@@ -134,7 +126,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="SpeedDemo.lrs"/>
<UnitName Value="SpeedDemo"/>
</Unit11>
<Unit12>
@@ -142,7 +133,6 @@
<ComponentName Value="StateForm"/>
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="States.lrs"/>
<UnitName Value="States"/>
</Unit12>
<Unit13>
@@ -151,7 +141,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="VisibilityDemo.lrs"/>
<UnitName Value="VisibilityDemo"/>
</Unit13>
<Unit14>

View File

@@ -3,8 +3,6 @@ object AlignForm: TAlignForm
Height = 497
Top = 299
Width = 785
HorzScrollBar.Page = 784
VertScrollBar.Page = 496
ActiveControl = AlignTree
Caption = 'AlignForm'
ClientHeight = 497
@@ -14,7 +12,7 @@ object AlignForm: TAlignForm
Font.Name = 'Arial'
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object Label8: TLabel
Left = 8
Height = 111
@@ -39,36 +37,36 @@ object AlignForm: TAlignForm
end
object Label2: TLabel
Left = 220
Height = 14
Top = 349
Width = 93
Height = 17
Top = 346
Width = 116
Anchors = [akLeft, akBottom]
Caption = 'English text column'
ParentColor = False
end
object Label3: TLabel
Left = 348
Height = 14
Top = 349
Width = 88
Left = 338
Height = 17
Top = 346
Width = 108
Anchors = [akBottom]
Caption = 'Greek text column'
ParentColor = False
end
object Label4: TLabel
Left = 644
Height = 14
Top = 349
Width = 130
Left = 619
Height = 17
Top = 346
Width = 155
Anchors = [akRight, akBottom]
Caption = 'Hebrew/arabic text column'
ParentColor = False
end
object Label5: TLabel
Left = 8
Height = 14
Top = 281
Width = 104
Height = 17
Top = 278
Width = 121
Anchors = [akLeft, akBottom]
Caption = 'Header button layout'
ParentColor = False
@@ -96,8 +94,38 @@ object AlignForm: TAlignForm
Colors.HotColor = clBlack
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultNodeHeight = 34
DefaultText = 'Node'
EditDelay = 100
Header.Background = clBtnShadow
Header.Columns = <
item
Alignment = taCenter
Hint = 'Text is initially centered and has a left-to-right directionality.'
ImageIndex = 20
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Spacing = 10
Text = 'English text column'
Width = 185
end
item
Hint = 'Text is initially left aligned and has a left-to-right directionality.'
ImageIndex = 35
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 1
Spacing = 10
Text = 'Greek text column'
Width = 155
end
item
BiDiMode = bdRightToLeft
Hint = 'Text is initially left aligned and has a right-to-left directionality.'
ImageIndex = 32
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 2
Spacing = 10
Text = 'Hebrew/arabic text column'
Width = 209
end>
Header.Font.Height = -12
Header.Font.Name = 'Arial'
Header.Font.Style = [fsBold]
@@ -128,50 +156,19 @@ object AlignForm: TAlignForm
OnInitChildren = AlignTreeInitChildren
OnInitNode = AlignTreeInitNode
OnStateChange = AlignTreeStateChange
Columns = <
item
Alignment = taCenter
ImageIndex = 20
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Spacing = 10
Width = 185
WideText = 'English text column'
WideHint = 'Text is initially centered and has a left-to-right directionality.'
end
item
ImageIndex = 35
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 1
Spacing = 10
Width = 155
WideText = 'Greek text column'
WideHint = 'Text is initially left aligned and has a left-to-right directionality.'
end
item
BiDiMode = bdRightToLeft
ImageIndex = 32
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 2
Spacing = 10
Width = 209
WideText = 'Hebrew/arabic text column'
WideHint = 'Text is initially left aligned and has a right-to-left directionality.'
end>
end
object AlignCombo0: TComboBox
Left = 220
Height = 21
Top = 371
Height = 24
Top = 368
Width = 130
Anchors = [akLeft, akBottom]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
ItemHeight = 16
Items.Strings = (
'Left'
'Right'
'Center'
)
MaxLength = 0
OnChange = AlignComboChange
Style = csDropDownList
TabOrder = 1
@@ -179,18 +176,16 @@ object AlignForm: TAlignForm
object AlignCombo1: TComboBox
Tag = 1
Left = 327
Height = 21
Top = 371
Height = 24
Top = 368
Width = 130
Anchors = [akBottom]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
ItemHeight = 16
Items.Strings = (
'Left'
'Right'
'Center'
)
MaxLength = 0
OnChange = AlignComboChange
Style = csDropDownList
TabOrder = 2
@@ -198,18 +193,16 @@ object AlignForm: TAlignForm
object AlignCombo2: TComboBox
Tag = 2
Left = 640
Height = 21
Top = 371
Height = 24
Top = 368
Width = 130
Anchors = [akRight, akBottom]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
ItemHeight = 16
Items.Strings = (
'Left'
'Right'
'Center'
)
MaxLength = 0
OnChange = AlignComboChange
Style = csDropDownList
TabOrder = 3
@@ -303,9 +296,9 @@ object AlignForm: TAlignForm
TabOrder = 7
object ShowGlyphsOptionBox: TCheckBox
Left = 12
Height = 19
Height = 20
Top = 4
Width = 86
Width = 94
Caption = 'Show glyphs'
OnClick = OptionBoxClick
TabOrder = 0
@@ -313,9 +306,9 @@ object AlignForm: TAlignForm
object HotTrackOptionBox: TCheckBox
Tag = 1
Left = 12
Height = 19
Height = 20
Top = 25
Width = 70
Width = 73
Caption = 'Hot track'
OnClick = OptionBoxClick
TabOrder = 1
@@ -323,9 +316,9 @@ object AlignForm: TAlignForm
object ShowTextOptionBox: TCheckBox
Tag = 2
Left = 12
Height = 19
Height = 20
Top = 46
Width = 73
Width = 78
Caption = 'Show text'
OnClick = OptionBoxClick
TabOrder = 2
@@ -333,9 +326,9 @@ object AlignForm: TAlignForm
object VisibleOptionBox: TCheckBox
Tag = 3
Left = 12
Height = 19
Height = 20
Top = 67
Width = 56
Width = 59
Caption = 'Visible'
OnClick = OptionBoxClick
TabOrder = 3
@@ -343,9 +336,9 @@ object AlignForm: TAlignForm
object EnabledOptionBox: TCheckBox
Tag = 4
Left = 12
Height = 19
Height = 20
Top = 88
Width = 65
Width = 67
Caption = 'Enabled'
OnClick = OptionBoxClick
TabOrder = 4
@@ -353,19 +346,17 @@ object AlignForm: TAlignForm
end
object LayoutCombo: TComboBox
Left = 8
Height = 21
Top = 303
Height = 24
Top = 300
Width = 130
Anchors = [akLeft, akBottom]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
ItemHeight = 16
Items.Strings = (
'Glyph left'
'Glyph right'
'Glyph top'
'Glyph bottom'
)
MaxLength = 0
OnChange = LayoutComboChange
Style = csDropDownList
TabOrder = 8

View File

@@ -49,7 +49,7 @@ type
procedure AlignTreeGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var Index: Integer);
procedure AlignTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure AlignTreePaintText(Sender: TBaseVirtualTree; const Canvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType);
procedure AlignTreeGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
@@ -83,7 +83,7 @@ var
implementation
uses
Main, States;
Main, States, vtlogger, ipcchannel;
{.$R *.DFM}
@@ -100,7 +100,7 @@ type
TAlignData = record
MainColumnText,
GreekText,
RTLText: WideString;
RTLText: UTF8String;
ImageIndex: Integer;
end;
@@ -109,9 +109,9 @@ type
// Additionally, some greek text for another column is stored here too just because I like how it looks (the text,
// not the storage ;-)).
var
GreekStrings: array[0..8] of WideString;
ArabicStrings: array[0..3] of WideString;
HebrewStrings: array[0..2] of WideString;
GreekStrings: array[0..8] of UTF8String;
ArabicStrings: array[0..3] of UTF8String;
HebrewStrings: array[0..2] of UTF8String;
//----------------------------------------------------------------------------------------------------------------------
@@ -172,7 +172,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TAlignForm.AlignTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
var
Data: PAlignData;
@@ -277,6 +277,8 @@ var
NewItem: TMenuItem;
begin
Logger.Channels.Add(TIPCChannel.Create);
Logger.ActiveClasses := [lcWarning];
// To display the various texts in a nice manner we use some specialized fonts of the system.
// We could directly assign the font names used here in the OnPaintText event, but since this
// would then be the only reference for the font it would cause the font to be recreated every

View File

@@ -3,8 +3,6 @@ object DrawTreeForm: TDrawTreeForm
Height = 477
Top = 339
Width = 710
HorzScrollBar.Page = 709
VertScrollBar.Page = 476
ActiveControl = VDT1
Caption = 'DrawTreeForm'
ClientHeight = 477
@@ -12,7 +10,7 @@ object DrawTreeForm: TDrawTreeForm
Font.Height = -13
Font.Name = 'Trebuchet MS'
OnCreate = FormCreate
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object Label7: TLabel
Height = 61
Width = 710
@@ -24,18 +22,18 @@ object DrawTreeForm: TDrawTreeForm
end
object Label1: TLabel
Left = 4
Height = 14
Top = 385
Width = 199
Height = 19
Top = 380
Width = 248
Anchors = [akLeft, akBottom]
Caption = 'Adjust vertical image alignment of nodes:'
ParentColor = False
end
object Label3: TLabel
Left = 424
Height = 14
Top = 385
Width = 24
Height = 19
Top = 380
Width = 23
Anchors = [akLeft, akBottom]
Caption = '50%'
ParentColor = False
@@ -58,6 +56,22 @@ object DrawTreeForm: TDrawTreeForm
DefaultNodeHeight = 32
Header.AutoSizeIndex = -1
Header.Background = clBtnHighlight
Header.Columns = <
item
Options = [coAllowClick, coEnabled, coParentColor, coResizable, coShowDropMark, coVisible]
Text = 'Image file name'
Width = 217
end
item
Position = 1
Text = 'Thumbnail'
Width = 200
end
item
Position = 2
Text = 'Properties'
Width = 160
end>
Header.Height = 22
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoRestrictDrag, hoShowSortGlyphs, hoVisible]
Header.ParentFont = True
@@ -88,22 +102,6 @@ object DrawTreeForm: TDrawTreeForm
OnInitChildren = VDT1InitChildren
OnInitNode = VDT1InitNode
OnStateChange = VDT1StateChange
Columns = <
item
Options = [coAllowClick, coEnabled, coParentColor, coResizable, coShowDropMark, coVisible]
Width = 217
WideText = 'Image file name'
end
item
Position = 1
Width = 200
WideText = 'Thumbnail'
end
item
Position = 2
Width = 160
WideText = 'Properties'
end>
end
object TrackBar1: TTrackBar
Left = 264
@@ -113,7 +111,6 @@ object DrawTreeForm: TDrawTreeForm
Max = 100
OnChange = TrackBar1Change
Position = 50
ScalePos = trTop
TickStyle = tsNone
Anchors = [akLeft, akBottom]
TabOrder = 1

View File

@@ -67,7 +67,7 @@ type
FDriveStrings: string;
function CanDisplay(const Name: String): Boolean;
function GetDriveString(Index: Integer): string;
function ReadAttributes(const Name: WideString): Cardinal;
function ReadAttributes(const Name: UTF8String): Cardinal;
procedure RescaleImage(Source, Target: TBitmap);
end;
@@ -89,12 +89,12 @@ type
PShellObjectData = ^TShellObjectData;
TShellObjectData = record
FullPath,
Display: WideString;
Display: UTF8String;
Attributes: Cardinal;
OpenIndex,
CloseIndex: Integer; // image indices into the system image list
Image: TBitmap;
Properties: WideString; // some image properties, preformatted
Properties: UTF8String; // some image properties, preformatted
end;
//----------------------------------------------------------------------------------------------------------------------
@@ -262,7 +262,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
function TDrawTreeForm.ReadAttributes(const Name: WideString): Cardinal;
function TDrawTreeForm.ReadAttributes(const Name: UTF8String): Cardinal;
// Determines the attributes of the given shell object (file, folder).
@@ -432,7 +432,7 @@ procedure TDrawTreeForm.VDT1DrawNode(Sender: TBaseVirtualTree; const PaintInfo:
var
Data: PShellObjectData;
X: Integer;
S: WideString;
S: UTF8String;
R: TRect;
begin
@@ -471,7 +471,7 @@ begin
if (NodeWidth - 2 * Margin) > (Right - Left) then
S := ShortenString(Canvas.Handle, S, Right - Left);
end;
DrawTextW(Canvas.Handle, PWideChar(S), Length(S), R, DT_TOP or DT_LEFT or DT_VCENTER or DT_SINGLELINE);
DrawText(Canvas.Handle, PChar(S), Length(S), R, DT_TOP or DT_LEFT or DT_VCENTER or DT_SINGLELINE);
end;
end;
1:

View File

@@ -34,7 +34,7 @@ type
PPropertyData = ^TPropertyData;
TPropertyData = record
ValueType: TValueType;
Value: WideString; // This value can actually be a date or a number too.
Value: UTF8String; // This value can actually be a date or a number too.
Changed: Boolean;
end;
@@ -275,7 +275,7 @@ function TPropertyEditLink.EndEdit: Boolean;
var
Data: PPropertyData;
Buffer: array[0..1024] of Char;
S: WideString;
S: UTF8String;
begin
Result := True;

View File

@@ -63,6 +63,7 @@ object GeneralForm: TGeneralForm
Colors.HotColor = clBlack
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultNodeHeight = 24
DefaultText = 'Node'
DragCursor = crHelp
DrawSelectionMode = smBlendedRectangle
EditDelay = 200
@@ -70,6 +71,32 @@ object GeneralForm: TGeneralForm
Font.Name = 'Lucida Sans Unicode'
Header.AutoSizeIndex = -1
Header.Background = clBtnShadow
Header.Columns = <
item
Hint = 'Column which initially contains the tree.'
ImageIndex = 10
Position = 1
Spacing = 20
Text = 'Initial main column'
Width = 300
end
item
Color = 14737632
Hint = 'Image only column.'
MaxWidth = 22
Options = [coEnabled, coParentBidiMode, coVisible]
Spacing = 0
Width = 22
end
item
Hint = 'Column with mathematic, greek, japanese and german (nonsense) text.'
ImageIndex = 4
Options = [coAllowClick, coEnabled, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 2
Spacing = 20
Text = 'Language column'
Width = 300
end>
Header.Font.Height = -11
Header.Font.Name = 'Lucida Sans Unicode'
Header.Height = 20
@@ -102,32 +129,6 @@ object GeneralForm: TGeneralForm
OnKeyDown = VST2KeyDown
OnNewText = VST2NewText
OnStateChange = VST2StateChange
Columns = <
item
ImageIndex = 10
Position = 1
Spacing = 20
Width = 300
WideText = 'Initial main column'
WideHint = 'Column which initially contains the tree.'
end
item
Color = 14737632
MaxWidth = 22
Options = [coEnabled, coParentBidiMode, coVisible]
Spacing = 0
Width = 22
WideHint = 'Image only column.'
end
item
ImageIndex = 4
Options = [coAllowClick, coEnabled, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 2
Spacing = 20
Width = 300
WideText = 'Language column'
WideHint = 'Column with mathematic, greek, japanese and german (nonsense) text.'
end>
end
object CheckMarkCombo: TComboBox
Left = 503

View File

@@ -58,9 +58,9 @@ type
procedure VST2InitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
procedure VST2InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
procedure VST2NewText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; Text: WideString);
procedure VST2NewText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; Text: UTF8String);
procedure VST2GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure VST2PaintText(Sender: TBaseVirtualTree; const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType);
procedure VST2GetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
@@ -110,7 +110,7 @@ type
TNodeData2 = record
Caption,
StaticText,
ForeignText: WideString;
ForeignText: UTF8String;
ImageIndex,
Level: Integer;
end;
@@ -189,7 +189,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TGeneralForm.VST2GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
// Returns the text as it is stored in the nodes data record.
@@ -227,7 +227,7 @@ const
var
Data: PNodeData2;
WideStr: WideString;
begin
Data := Sender.GetNodeData(Node);
with Data^ do
@@ -248,25 +248,29 @@ begin
case Data.Level of
1:
begin
ForeignText := WideChar($2200);
ForeignText := ForeignText + WideChar($2202) + WideChar($221C) + WideChar($221E) + WideChar($2230) +
WideStr := WideChar($2200);
WideStr := WideStr + WideChar($2202) + WideChar($221C) + WideChar($221E) + WideChar($2230) +
WideChar($2233) + WideChar($2257) + WideChar($225D) + WideChar($22B6) + WideChar($22BF);
ForeignText := UTF8Encode(WideStr);
end;
2:
begin
ForeignText := WideChar($32E5);
ForeignText := ForeignText + WideChar($32E6) + WideChar($32E7) + WideChar($32E8) + WideChar($32E9);
WideStr := WideChar($32E5);
WideStr := WideStr + WideChar($32E6) + WideChar($32E7) + WideChar($32E8) + WideChar($32E9);
ForeignText := UTF8Encode(WideStr);
end;
3:
begin
ForeignText := WideChar($03B1);
ForeignText := ForeignText + WideChar($03B2) + WideChar($03B3) + WideChar($03B4) + WideChar($03B5) +
WideStr := WideChar($03B1);
WideStr := WideStr + WideChar($03B2) + WideChar($03B3) + WideChar($03B4) + WideChar($03B5) +
WideChar($03B6) + WideChar($03B7) + WideChar($03B8) + WideChar($03B9);
ForeignText := UTF8Encode(WideStr);
end;
4:
begin
ForeignText := WideChar($20AC);
ForeignText := 'nichts ist unm�glich ' + ForeignText;
WideStr := WideChar($20AC);
WideStr := 'nichts ist unm�glich ' + WideStr;
ForeignText := UTF8Encode(WideStr);
end;
5:
begin
@@ -332,7 +336,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TGeneralForm.VST2NewText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
Text: WideString);
Text: UTF8String);
// The caption of a node has been changed, keep this in the node record.
@@ -485,7 +489,7 @@ const
var
S: string;
WS: WideString;
WS: UTF8String;
Data: Pointer;
DataSize: Cardinal;
TargetName: string;

View File

@@ -52,12 +52,42 @@ object GridForm: TGridForm
Colors.BorderColor = clWindowText
Colors.HotColor = clBlack
DefaultNodeHeight = 19
DefaultText = 'Node'
DragMode = dmAutomatic
EditDelay = 300
Font.Height = -11
Font.Name = 'Microsoft Sans Serif'
Header.AutoSizeIndex = 2
Header.Background = clBtnShadow
Header.Columns = <
item
Options = [coParentBidiMode, coVisible, coFixed]
Width = 20
end
item
Margin = 0
Position = 1
Text = 'Customer ID'
Width = 100
end
item
Margin = 0
Position = 2
Text = 'First Name'
Width = 120
end
item
Margin = 0
Position = 3
Text = 'Last Name'
Width = 120
end
item
Margin = 0
Position = 4
Text = 'Order date'
Width = 100
end>
Header.Font.Height = -12
Header.Font.Name = 'Microsoft Sans Serif'
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoShowImages, hoVisible]
@@ -84,41 +114,12 @@ object GridForm: TGridForm
OnPaintText = VST5PaintText
OnInitNode = VST5InitNode
OnStateChange = VST5StateChange
Columns = <
item
Options = [coParentBidiMode, coVisible, coFixed]
Width = 20
end
item
Margin = 0
Position = 1
Width = 100
WideText = 'Customer ID'
end
item
Margin = 0
Position = 2
Width = 120
WideText = 'First Name'
end
item
Margin = 0
Position = 3
Width = 120
WideText = 'Last Name'
end
item
Margin = 0
Position = 4
Width = 100
WideText = 'Order date'
end>
end
object GridLineCheckBox: TCheckBox
Left = 556
Height = 22
Top = 364
Width = 127
Left = 562
Height = 20
Top = 366
Width = 121
Anchors = [akRight, akBottom]
Caption = 'Toggle grid lines'
Checked = True

View File

@@ -35,7 +35,7 @@ type
procedure VST5FocusChanging(Sender: TBaseVirtualTree; OldNode, NewNode: PVirtualNode; OldColumn,
NewColumn: TColumnIndex; var Allowed: Boolean);
procedure VST5GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure VST5InitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
procedure VST5PaintText(Sender: TBaseVirtualTree; const TargetCanvas: TCanvas; Node: PVirtualNode;
@@ -129,7 +129,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TGridForm.VST5GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
var
Data: PGridData;
@@ -138,7 +138,7 @@ begin
if Column > 0 then
begin
Data := Sender.GetNodeData(Node);
CellText := Data.Value[Column - 1];
CellText := String(Data.Value[Column - 1]);
end
else
CellText := '';

View File

@@ -3,8 +3,6 @@ object HeaderOwnerDrawForm: THeaderOwnerDrawForm
Height = 440
Top = 275
Width = 776
HorzScrollBar.Page = 775
VertScrollBar.Page = 439
ActiveControl = HeaderCustomDrawTree
Caption = 'HeaderOwnerDrawForm'
ClientHeight = 440
@@ -13,7 +11,7 @@ object HeaderOwnerDrawForm: THeaderOwnerDrawForm
Font.Name = 'MS Sans Serif'
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object Label8: TLabel
Left = 12
Height = 83
@@ -25,6 +23,7 @@ object HeaderOwnerDrawForm: THeaderOwnerDrawForm
Font.Height = -13
Font.Name = 'MS Sans Serif'
ParentColor = False
ParentFont = False
ShowAccelChar = False
WordWrap = True
end
@@ -51,8 +50,41 @@ object HeaderOwnerDrawForm: THeaderOwnerDrawForm
Colors.HotColor = clBlack
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultNodeHeight = 24
DefaultText = 'Node'
EditDelay = 100
Header.Background = clBtnShadow
Header.Columns = <
item
Hint = 'This column is drawn entirely by the tree.'
ImageIndex = 1
Options = [coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Spacing = -1
Text = 'Default drawing'
Width = 200
end
item
Alignment = taCenter
Hint = 'Only the background is customized.'
ImageIndex = 2
Layout = blGlyphTop
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Position = 1
Spacing = -10
Style = vsOwnerDraw
Text = 'Custom background'
Width = 230
end
item
Alignment = taCenter
Color = clInfoBk
Hint = 'Background and text in this column are customized.'
ImageIndex = 0
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Position = 2
Spacing = -1
Style = vsOwnerDraw
Width = 350
end>
Header.Font.Height = -12
Header.Font.Name = 'Arial'
Header.Font.Style = [fsBold]
@@ -82,38 +114,6 @@ object HeaderOwnerDrawForm: THeaderOwnerDrawForm
OnHeaderMouseDown = HeaderCustomDrawTreeHeaderMouseDown
OnHeaderMouseUp = HeaderCustomDrawTreeHeaderMouseUp
OnStateChange = HeaderCustomDrawTreeStateChange
Columns = <
item
ImageIndex = 1
Options = [coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Spacing = -1
Width = 200
WideText = 'Default drawing'
WideHint = 'This column is drawn entirely by the tree.'
end
item
Alignment = taCenter
ImageIndex = 2
Layout = blGlyphTop
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Position = 1
Spacing = -10
Style = vsOwnerDraw
Width = 230
WideText = 'Custom background'
WideHint = 'Only the background is customized.'
end
item
Alignment = taCenter
Color = clInfoBk
ImageIndex = 0
Options = [coAllowClick, coDraggable, coEnabled, coResizable, coShowDropMark, coVisible]
Position = 2
Spacing = -1
Style = vsOwnerDraw
Width = 350
WideHint = 'Background and text in this column are customized.'
end>
end
object HeaderImages: TImageList
Height = 90

View File

@@ -11,7 +11,7 @@ interface
uses
LCLIntf, Types, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, VirtualTrees, StdCtrls, ExtCtrls, LResources, LCLType;
Dialogs, VirtualTrees, StdCtrls, ExtCtrls, LResources, LCLType, LCLProc;
type
THeaderOwnerDrawForm = class(TForm)
@@ -33,7 +33,7 @@ type
procedure HeaderCustomDrawTreeStateChange(Sender: TBaseVirtualTree; Enter, Leave: TVirtualTreeStates);
procedure HeaderCustomDrawTreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
private
FBackBitmap1,
FBackBitmap2,
@@ -297,7 +297,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure THeaderOwnerDrawForm.HeaderCustomDrawTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
Column: TColumnIndex; TextType: TVSTTextType; var CellText: UTF8String);
begin
CellText := 'Some simple text.';

View File

@@ -48,7 +48,7 @@ type
var
MainForm: TMainForm;
procedure LoadUnicodeStrings(Name: string; var Strings: array of WideString);
procedure LoadUnicodeStrings(Name: string; var Strings: array of UTF8String);
procedure SetStatusbarText(const S: string);
//----------------------------------------------------------------------------------------------------------------------
@@ -63,29 +63,25 @@ uses
//----------------------------------------------------------------------------------------------------------------------
procedure LoadUnicodeStrings(Name: string; var Strings: array of WideString);
procedure LoadUnicodeStrings(Name: string; var Strings: array of UTF8String);
// Loads the Unicode strings from the resource.
var
Res: TLResource;
Head, Tail: PWideChar;
Head, Tail: PChar;
I: Integer;
begin
//Stream := TResourceStream.Create(0, Name, 'Unicode');
Res := LazarusResources.Find(Name);
if (Res <> nil) and (Res.Value <> '') then
begin
//Head := Stream.Memory;
Head := PWideChar(Res.Value);
// Skip byte order mark.
Inc(Head);
Head := PChar(Res.Value);
Tail := Head;
for I := 0 to High(Strings) do
begin
Head := Tail;
while not (Tail^ in [WideChar(#0), WideChar(#13)]) do
while not (Tail^ in [#0, #13]) do
Inc(Tail);
SetString(Strings[I], Head, Tail - Head);
// Skip carriage return and linefeed.

View File

@@ -51,6 +51,14 @@ object NodeForm: TNodeForm
)
Colors.SelectionRectangleBlendColor = 10539203
DefaultNodeHeight = 130
DefaultText = 'Node'
Header.Columns = <
item
Position = 1
Width = 483
end
item
end>
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.Options = [hoAutoResize, hoColumnResize, hoDrag]
@@ -75,20 +83,13 @@ object NodeForm: TNodeForm
OnInitNode = MLTreeInitNode
OnMeasureItem = MLTreeMeasureItem
OnStateChange = MLTreeStateChange
Columns = <
item
Position = 1
Width = 483
end
item
end>
end
end
object AutoAdjustCheckBox: TCheckBox
Left = 12
Height = 22
Top = 399
Width = 292
Height = 20
Top = 401
Width = 286
Anchors = [akLeft, akBottom]
Caption = 'Automatically adjust node height to node text.'
OnClick = AutoAdjustCheckBoxClick

View File

@@ -23,7 +23,7 @@ type
var InitialStates: TVirtualNodeInitStates);
procedure FormCreate(Sender: TObject);
procedure MLTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
procedure MLTreePaintText(Sender: TBaseVirtualTree; const TargetCanvas: TCanvas; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType);
procedure MLTreeEditing(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
@@ -42,7 +42,7 @@ uses
var
DemoText: array[0..29] of WideString;
DemoText: array[0..29] of UTF8String;
//----------------------------------------------------------------------------------------------------------------------
@@ -73,7 +73,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TNodeForm.MLTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
// Returns the text for the given node. This text was loaded at form creation time from the application resource.

View File

@@ -3,8 +3,6 @@ object PropertiesForm: TPropertiesForm
Height = 419
Top = 294
Width = 637
HorzScrollBar.Page = 636
VertScrollBar.Page = 418
ActiveControl = VST3
Caption = 'PropertiesForm'
ClientHeight = 419
@@ -12,7 +10,7 @@ object PropertiesForm: TPropertiesForm
Font.Height = -13
Font.Name = 'MS Sans Serif'
OnCreate = FormCreate
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object Label9: TLabel
Left = 420
Height = 81
@@ -45,7 +43,20 @@ object PropertiesForm: TPropertiesForm
Colors.BorderColor = clWindowText
Colors.HotColor = clBlack
DefaultNodeHeight = 20
DefaultText = 'Node'
Header.AutoSizeIndex = 1
Header.Columns = <
item
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAutoSpring]
Text = 'Properties'
Width = 203
end
item
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 1
Text = 'Values'
Width = 196
end>
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.Height = 18
@@ -76,18 +87,6 @@ object PropertiesForm: TPropertiesForm
OnInitChildren = VST3InitChildren
OnInitNode = VST3InitNode
OnStateChange = VST3StateChange
Columns = <
item
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAutoSpring]
Width = 203
WideText = 'Properties'
end
item
Options = [coAllowClick, coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAutoSpring]
Position = 1
Width = 196
WideText = 'Values'
end>
end
object RadioGroup1: TRadioGroup
Left = 416

View File

@@ -32,17 +32,17 @@ type
procedure VST3CreateEditor(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; out EditLink: IVTEditLink);
procedure VST3Editing(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
procedure VST3GetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: WideString);
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: UTF8String);
procedure VST3GetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var Index: Integer);
procedure VST3GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure VST3InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
procedure VST3InitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
procedure VST3PaintText(Sender: TBaseVirtualTree; const TargetCanvas: TCanvas; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType);
procedure VST3IncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
procedure VST3IncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: UTF8String;
var Result: Integer);
procedure RadioGroup1Click(Sender: TObject);
procedure VST3StateChange(Sender: TBaseVirtualTree; Enter, Leave: TVirtualTreeStates);
@@ -111,7 +111,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TPropertiesForm.VST3GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
var
Data: PPropertyData;
@@ -141,7 +141,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TPropertiesForm.VST3GetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: WideString);
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: UTF8String);
begin
// Add a dummy hint to the normal hint to demonstrate multiline hints.
@@ -248,7 +248,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TPropertiesForm.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
procedure TPropertiesForm.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: UTF8String;
var Result: Integer);
var

View File

@@ -1544,7 +1544,9 @@ object SpeedForm: TSpeedForm
BorderStyle = bsSingle
Colors.BorderColor = clWindowText
Colors.HotColor = clBlack
DefaultText = 'Node'
Header.AutoSizeIndex = -1
Header.Columns = <>
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.MainColumn = -1
@@ -1562,7 +1564,6 @@ object SpeedForm: TSpeedForm
OnGetText = VST1GetText
OnStateChange = VST1StateChange
OnStructureChange = VST1StructureChange
Columns = <>
end
object GroupBox2: TGroupBox
Left = 268
@@ -1577,9 +1578,9 @@ object SpeedForm: TSpeedForm
TabOrder = 1
object SBCheckBox: TCheckBox
Left = 24
Height = 22
Height = 20
Top = 10
Width = 132
Width = 126
Caption = 'show background'
OnClick = SBCheckBoxClick
TabOrder = 0

View File

@@ -39,7 +39,7 @@ type
procedure ClearButtonClick(Sender: TObject);
procedure AddButtonClick(Sender: TObject);
procedure VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure VST1Change(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VST1StructureChange(Sender: TBaseVirtualTree; Node: PVirtualNode; Reason: TChangeReason);
procedure DeleteSelectionButtonClick(Sender: TObject);
@@ -143,7 +143,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TSpeedForm.VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
begin
CellText := Format('Level %d, Index %d', [Sender.GetNodeLevel(Node), Node.Index]);

View File

@@ -4125,9 +4125,15 @@ object VisibilityForm: TVisibilityForm
Colors.UnfocusedSelectionColor = clHighlight
Colors.UnfocusedSelectionBorderColor = clHighlight
DefaultNodeHeight = 24
DefaultText = 'Node'
Font.Color = clNavy
Font.Height = -11
Font.Name = 'Verdana'
Header.Columns = <
item
Text = 'Main column'
Width = 204
end>
Header.Font.Color = clNavy
Header.Font.Height = -13
Header.Font.Name = 'Verdana'
@@ -4157,12 +4163,6 @@ object VisibilityForm: TVisibilityForm
OnInitChildren = VST2InitChildren
OnInitNode = VST1InitNode
OnScroll = VST2Scroll
Columns = <
item
Width = 204
WideText = 'Main column'
end>
WideDefaultText = ''
end
object VST3: TVirtualStringTree
Left = 207
@@ -8174,14 +8174,17 @@ object VisibilityForm: TVisibilityForm
Colors.UnfocusedSelectionColor = clHighlight
Colors.UnfocusedSelectionBorderColor = clHighlight
DefaultNodeHeight = 24
DefaultText = 'Node'
Font.Color = clNavy
Font.Height = -11
Font.Name = 'Verdana'
Header.Columns = <>
Header.Font.Color = clNavy
Header.Font.Height = -13
Header.Font.Name = 'Verdana'
Header.Font.Style = [fsBold]
Header.Height = 24
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDrag, hoVisible]
Header.Style = hsFlatButtons
HintAnimation = hatNone
@@ -8205,33 +8208,6 @@ object VisibilityForm: TVisibilityForm
OnInitChildren = VST2InitChildren
OnInitNode = VST1InitNode
OnScroll = VST3Scroll
Columns = <
item
Options = [coAllowClick, coEnabled, coParentBidiMode, coResizable, coShowDropMark]
Width = 100
WideText = 'Column 0'
end
item
Position = 1
Width = 100
WideText = 'Column 1'
end
item
Position = 2
Width = 100
WideText = 'Column 2'
end
item
Position = 3
Width = 100
WideText = 'Column 3'
end
item
Position = 4
Width = 100
WideText = 'Column 4'
end>
WideDefaultText = ''
end
end
object VST1: TVirtualStringTree
@@ -8244,6 +8220,8 @@ object VisibilityForm: TVisibilityForm
Colors.BorderColor = clWindowText
Colors.HotColor = clBlack
DefaultNodeHeight = 24
DefaultText = 'Node'
Header.Columns = <>
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.MainColumn = -1
@@ -8260,7 +8238,5 @@ object VisibilityForm: TVisibilityForm
OnGetText = VST1GetText
OnInitChildren = VST1InitChildren
OnInitNode = VST1InitNode
Columns = <>
WideDefaultText = ''
end
end

View File

@@ -34,7 +34,7 @@ type
procedure FormCreate(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure VST2GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure VST3Scroll(Sender: TBaseVirtualTree; DeltaX, DeltaY: Integer);
procedure VST2InitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
procedure VST2Scroll(Sender: TBaseVirtualTree; DeltaX, DeltaY: Integer);
@@ -44,7 +44,7 @@ type
var Accept: Boolean);
procedure Splitter2Paint(Sender: TObject);
procedure VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
var CellText: UTF8String);
procedure FormShow(Sender: TObject);
procedure FormHide(Sender: TObject);
private
@@ -65,7 +65,7 @@ uses States;
type
PLinkData = ^TLinkData;
TLinkData = record
Caption: WideString;
Caption: UTF8String;
OtherNode: PVirtualNode;
end;
@@ -167,7 +167,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVisibilityForm.VST2GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
var
Data: PLinkData;
@@ -314,7 +314,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVisibilityForm.VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
begin
CellText := Format('Node Level %d, Index %d', [Sender.GetNodeLevel(Node), Node.Index]);

View File

@@ -72,9 +72,28 @@ object WindowsXPForm: TWindowsXPForm
Colors.GridLineColor = clBtnShadow
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultNodeHeight = 34
DefaultText = 'Node'
DragMode = dmAutomatic
DrawSelectionMode = smBlendedRectangle
Header.AutoSizeIndex = -1
Header.Columns = <
item
Color = 16250871
Options = [coAllowClick, coEnabled, coParentBidiMode, coResizable, coShowDropMark, coVisible]
Text = 'Name'
Width = 200
end
item
Alignment = taRightJustify
Position = 1
Text = 'Size'
Width = 100
end
item
Position = 2
Text = 'Type'
Width = 100
end>
Header.Font.CharSet = ANSI_CHARSET
Header.Font.Height = -12
Header.Font.Name = 'Microsoft Sans Serif'
@@ -102,24 +121,6 @@ object WindowsXPForm: TWindowsXPForm
OnInitChildren = XPTreeInitChildren
OnInitNode = XPTreeInitNode
OnStateChange = XPTreeStateChange
Columns = <
item
Color = 16250871
Options = [coAllowClick, coEnabled, coParentBidiMode, coResizable, coShowDropMark, coVisible]
Width = 200
WideText = 'Name'
end
item
Alignment = taRightJustify
Position = 1
Width = 100
WideText = 'Size'
end
item
Position = 2
Width = 100
WideText = 'Type'
end>
end
object ToolBar2: TToolBar
Height = 34

View File

@@ -51,13 +51,13 @@ type
var InitialStates: TVirtualNodeInitStates);
procedure XPTreeInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var ChildCount: Cardinal);
procedure XPTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
procedure XPTreeHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
procedure XPTreeCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex;
var Result: Integer);
procedure XPTreeGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: WideString);
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: UTF8String);
procedure Label4Click(Sender: TObject);
procedure ToolButton9Click(Sender: TObject);
procedure XPTreeStateChange(Sender: TBaseVirtualTree; Enter, Leave: TVirtualTreeStates);
@@ -80,7 +80,7 @@ uses
type
PEntry = ^TEntry;
TEntry = record
Caption: WideString;
Caption: UTF8String;
Image: Integer;
Size: Int64;
end;
@@ -171,7 +171,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TWindowsXPForm.XPTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: WideString);
TextType: TVSTTextType; var CellText: UTF8String);
var
Data: PEntry;
@@ -251,7 +251,7 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TWindowsXPForm.XPTreeGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: WideString);
var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: UTF8String);
begin
// Show only a dummy hint. It is just to demonstrate how to do it.

File diff suppressed because it is too large Load Diff