* Update minimal demo to use utf8

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@667 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-01-21 00:51:12 +00:00
parent 2b47043b52
commit 0c03cacf37
3 changed files with 11 additions and 11 deletions

View File

@ -3,8 +3,6 @@ object MainForm: TMainForm
Height = 486
Top = 147
Width = 427
HorzScrollBar.Page = 426
VertScrollBar.Page = 485
ActiveControl = VST
Caption = 'Simple Virtual Treeview demo'
ClientHeight = 486
@ -12,11 +10,12 @@ object MainForm: TMainForm
Font.Height = -11
Font.Name = 'MS Sans Serif'
OnCreate = FormCreate
LCLVersion = '0.9.27'
object Label1: TLabel
Left = 10
Height = 17
Height = 14
Top = 8
Width = 171
Width = 112
Caption = 'Last operation duration:'
ParentColor = False
end
@ -28,7 +27,9 @@ object MainForm: TMainForm
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
@ -45,7 +46,6 @@ object MainForm: TMainForm
OnFreeNode = VSTFreeNode
OnGetText = VSTGetText
OnInitNode = VSTInitNode
Columns = <>
end
object ClearButton: TButton
Left = 97

View File

@ -28,7 +28,7 @@ type
procedure ClearButtonClick(Sender: TObject);
procedure AddButtonClick(Sender: TObject);
procedure VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var Text: WideString);
var Text: UTF8String);
procedure VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VSTInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
@ -50,7 +50,7 @@ type
// Extend it to whatever your application needs.
PMyRec = ^TMyRec;
TMyRec = record
Caption: WideString;
Caption: UTF8String;
end;
//----------------------------------------------------------------------------------------------------------------------
@ -126,14 +126,14 @@ end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var Text: WideString);
var Text: UTF8String);
var
Data: PMyRec;
begin
// A handler for the OnGetText event is always needed as it provides the tree with the string data to display.
// Note that we are always using WideString.
// Note that we are always using UTF8String.
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Text := Data.Caption;

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"/>
@ -46,7 +47,6 @@
<HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="Main.lrs"/>
<UnitName Value="Main"/>
</Unit1>
</Units>