added comctrls ttreenode docs from Darius

git-svn-id: trunk@9063 -
This commit is contained in:
mattias 2006-04-02 17:30:45 +00:00
parent 6e2aedbb9a
commit 34318f3f2b
10 changed files with 409 additions and 13 deletions

6
.gitattributes vendored
View File

@ -690,6 +690,7 @@ docs/xml/lcl/clistbox.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/colorbox.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/comctrls.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/comctrls/ttoolbutton.pas svneol=native#text/plain
docs/xml/lcl/comctrls/ttreenode_data.pas svneol=native#text/plain
docs/xml/lcl/commctrl.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/controls.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/customtimer.xml svneol=LF#text/xml eol=lf
@ -1008,6 +1009,11 @@ examples/turbopower_ipro/mainunit.pas svneol=native#text/pascal
examples/turbopower_ipro/simplepage2.html svneol=native#text/html
examples/turbopower_ipro/tpiproexample.lpi svneol=native#text/plain
examples/turbopower_ipro/tpiproexample.lpr svneol=native#text/pascal
examples/xmlstreaming/mainunit.lfm svneol=native#text/plain
examples/xmlstreaming/mainunit.lrs svneol=native#text/plain
examples/xmlstreaming/mainunit.pas svneol=native#text/plain
examples/xmlstreaming/streamasxmldemo.lpi svneol=native#text/plain
examples/xmlstreaming/streamasxmldemo.lpr svneol=native#text/plain
ide/Makefile svneol=native#text/plain
ide/Makefile.fpc svneol=native#text/plain
ide/aboutfrm.lfm svneol=native#text/plain

View File

@ -82,6 +82,7 @@ type
property Modified: Boolean read FModified;
published
property Filename: String read FFilename write SetFilename;
property Document: TXMLDocument read doc;
end;

View File

@ -10240,10 +10240,8 @@ Const
</element>
<!-- object Visibility: default -->
<element name="TTreeNode">
<short/>
<descr/>
<errors/>
<seealso/>
<short>TTreeNode is a single item that holds data in TTreeView</short>
<descr>A TTreeNode is parst of a TTreeView and is used to store data in. This can be done by using the Caption property or for more complex data the Data property can be used. Each node can have sibling or child items associated with it.</descr>
</element>
<!-- variable Visibility: private -->
<element name="TTreeNode.FOwner">
@ -11540,9 +11538,8 @@ Const
</element>
<!-- property Visibility: public -->
<element name="TTreeNode.Data">
<short/>
<descr/>
<seealso/>
<descr>Property of type pointer used to store custom data in a node.</descr>
<example file="comctrls/ttreenode_data.pas"/>
</element>
<!-- property Visibility: public -->
<element name="TTreeNode.Deleting">
@ -14987,10 +14984,8 @@ For the meaning of this options, see the documentation of TTreeView.</descr>
</element>
<!-- object Visibility: default -->
<element name="TTreeView">
<short/>
<descr/>
<errors/>
<seealso/>
<short>TTreeview is a control that displays a hierarchical list of items</short>
<descr>Use a TTreeview to display a hierarchical list of items. Items are shown by their caption and an optional bitmap.</descr>
</element>
<!-- property Visibility: published -->
<element name="TTreeView.Align">

View File

@ -0,0 +1,26 @@
type
TMyClass = class(TObject)
public
Created: string;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Node: TTreeNode;
begin
if Assigned(TreeView1.Selected) then
Node := TreeView1.Selected
else
Node := TreeView1.Items.GetFirstNode;
with TreeView1.Items.AddChild(Node, Format('Node: %d', [TreeView1.Items.Count])) do
begin
Data := TMyClass.Create;
TMyClass(Data).Created := FormatDateTime('hh:nn:ss',Now);
end;
end;
procedure TForm1.TreeView1SelectionChanged(Sender: TObject);
begin
Label1.Caption := 'Node creation time: ' + TMyClass(TreeView1.Selected.Data).Created;
end;

View File

@ -0,0 +1,32 @@
object StreamAsXMLForm: TStreamAsXMLForm
Left = 334
Height = 434
Top = 182
Width = 493
HorzScrollBar.Page = 492
VertScrollBar.Page = 433
Caption = 'StreamAsXMLForm'
ClientHeight = 434
ClientWidth = 493
OnCreate = FormCreate
PixelsPerInch = 95
object GroupBox1: TGroupBox
Left = 16
Height = 105
Top = 16
Width = 185
Caption = 'GroupBox1'
ClientHeight = 88
ClientWidth = 181
TabOrder = 0
object Button1: TButton
Left = 33
Height = 25
Top = 15
Width = 75
BorderSpacing.InnerBorder = 2
Caption = 'Button1'
TabOrder = 0
end
end
end

View File

@ -0,0 +1,13 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TStreamAsXMLForm','FORMDATA',[
'TPF0'#16'TStreamAsXMLForm'#15'StreamAsXMLForm'#4'Left'#3'N'#1#6'Height'#3#178
+#1#3'Top'#3#182#0#5'Width'#3#237#1#18'HorzScrollBar.Page'#3#236#1#18'VertScr'
+'ollBar.Page'#3#177#1#7'Caption'#6#15'StreamAsXMLForm'#12'ClientHeight'#3#178
+#1#11'ClientWidth'#3#237#1#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2
+'_'#0#9'TGroupBox'#9'GroupBox1'#4'Left'#2#16#6'Height'#2'i'#3'Top'#2#16#5'Wi'
+'dth'#3#185#0#7'Caption'#6#9'GroupBox1'#12'ClientHeight'#2'X'#11'ClientWidth'
+#3#181#0#8'TabOrder'#2#0#0#7'TButton'#7'Button1'#4'Left'#2'!'#6'Height'#2#25
+#3'Top'#2#15#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#7
+'Button1'#8'TabOrder'#2#0#0#0#0#0
]);

View File

@ -0,0 +1,80 @@
unit MainUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
XMLStreaming, DOM, laz_xmlcfg, Buttons;
type
{ TStreamAsXMLForm }
TStreamAsXMLForm = class(TForm)
Button1: TButton;
GroupBox1: TGroupBox;
procedure FormCreate(Sender: TObject);
private
FFilename: string;
procedure SetFilename(const AValue: string);
public
procedure StreamComponents;
property Filename: string read FFilename write SetFilename;
end;
var
StreamAsXMLForm: TStreamAsXMLForm;
function CreateXMLWriter(ADoc: TDOMDocument;
var DestroyDriver: boolean): TWriter;
implementation
function CreateXMLWriter(ADoc: TDOMDocument;
var DestroyDriver: boolean): TWriter;
var
Driver: TAbstractObjectWriter;
begin
Driver:=TXMLObjectWriter.Create(ADoc);
DestroyDriver:=true;
Result:=TWriter.Create(Driver);
end;
{ TStreamAsXMLForm }
procedure TStreamAsXMLForm.FormCreate(Sender: TObject);
begin
Filename:='test.xml';
StreamComponents;
end;
procedure TStreamAsXMLForm.SetFilename(const AValue: string);
begin
if FFilename=AValue then exit;
FFilename:=AValue;
end;
procedure TStreamAsXMLForm.StreamComponents;
var
XMLConfig: TXMLConfig;
Writer: TWriter;
begin
XMLConfig:=TXMLConfig.Create(Filename);
Writer:=nil;
try
Writer:=CreateXMLWriter(XMLConfig.Document);
Writer.WriteRootComponent(GroupBox1);
XMLConfig.Flush;
finally
Writer.Free;
XMLConfig.Free;
end;
end;
initialization
{$I mainunit.lrs}
end.

View File

@ -0,0 +1,224 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<LazDoc Paths=""/>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="9">
<Unit0>
<Filename Value="streamasxmldemo.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="StreamAsXMLDemo"/>
<UsageCount Value="20"/>
</Unit0>
<Unit1>
<Filename Value="mainunit.pas"/>
<ComponentName Value="StreamAsXMLForm"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="mainunit.lrs"/>
<UnitName Value="MainUnit"/>
<CursorPos X="42" Y="68"/>
<TopLine Value="35"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../../components/codetools/identcompletiontool.pas"/>
<UnitName Value="IdentCompletionTool"/>
<CursorPos X="20" Y="229"/>
<TopLine Value="208"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<Filename Value="../../../../freepascal/fpc/fcl/xml/xmlstreaming.pp"/>
<UnitName Value="XMLStreaming"/>
<CursorPos X="42" Y="46"/>
<TopLine Value="14"/>
<EditorIndex Value="6"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="../../lcl/lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="23" Y="180"/>
<TopLine Value="142"/>
<EditorIndex Value="5"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="../../components/codetools/laz_xmlcfg.pas"/>
<UnitName Value="Laz_XMLCfg"/>
<CursorPos X="1" Y="84"/>
<TopLine Value="43"/>
<EditorIndex Value="2"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="../../components/codetools/laz_dom.pas"/>
<UnitName Value="Laz_DOM"/>
<CursorPos X="3" Y="392"/>
<TopLine Value="369"/>
<EditorIndex Value="4"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="../../lcl/ldockctrl.pas"/>
<UnitName Value="LDockCtrl"/>
<CursorPos X="1" Y="798"/>
<TopLine Value="755"/>
<EditorIndex Value="3"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="../../../../freepascal/fpc/rtl/objpas/classes/classesh.inc"/>
<CursorPos X="15" Y="1121"/>
<TopLine Value="1098"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit8>
</Units>
<JumpHistory Count="23" HistoryIndex="20">
<Position1>
<Filename Value="mainunit.pas"/>
<Caret Line="24" Column="19" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="mainunit.pas"/>
<Caret Line="9" Column="7" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="mainunit.pas"/>
<Caret Line="17" Column="43" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="mainunit.pas"/>
<Caret Line="39" Column="5" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="mainunit.pas"/>
<Caret Line="37" Column="12" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="../../lcl/lresources.pp"/>
<Caret Line="2380" Column="11" TopLine="2376"/>
</Position6>
<Position7>
<Filename Value="../../lcl/lresources.pp"/>
<Caret Line="261" Column="31" TopLine="238"/>
</Position7>
<Position8>
<Filename Value="mainunit.pas"/>
<Caret Line="34" Column="15" TopLine="1"/>
</Position8>
<Position9>
<Filename Value="mainunit.pas"/>
<Caret Line="50" Column="27" TopLine="9"/>
</Position9>
<Position10>
<Filename Value="mainunit.pas"/>
<Caret Line="20" Column="49" TopLine="2"/>
</Position10>
<Position11>
<Filename Value="mainunit.pas"/>
<Caret Line="61" Column="1" TopLine="22"/>
</Position11>
<Position12>
<Filename Value="mainunit.pas"/>
<Caret Line="64" Column="36" TopLine="26"/>
</Position12>
<Position13>
<Filename Value="mainunit.pas"/>
<Caret Line="60" Column="14" TopLine="31"/>
</Position13>
<Position14>
<Filename Value="../../lcl/ldockctrl.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position14>
<Position15>
<Filename Value="../../lcl/ldockctrl.pas"/>
<Caret Line="799" Column="42" TopLine="756"/>
</Position15>
<Position16>
<Filename Value="mainunit.pas"/>
<Caret Line="64" Column="3" TopLine="31"/>
</Position16>
<Position17>
<Filename Value="mainunit.pas"/>
<Caret Line="62" Column="39" TopLine="22"/>
</Position17>
<Position18>
<Filename Value="mainunit.pas"/>
<Caret Line="64" Column="5" TopLine="31"/>
</Position18>
<Position19>
<Filename Value="mainunit.pas"/>
<Caret Line="61" Column="19" TopLine="31"/>
</Position19>
<Position20>
<Filename Value="mainunit.pas"/>
<Caret Line="67" Column="10" TopLine="31"/>
</Position20>
<Position21>
<Filename Value="mainunit.pas"/>
<Caret Line="49" Column="14" TopLine="9"/>
</Position21>
<Position22>
<Filename Value="mainunit.pas"/>
<Caret Line="68" Column="15" TopLine="35"/>
</Position22>
<Position23>
<Filename Value="../../../../freepascal/fpc/rtl/objpas/classes/classesh.inc"/>
<Caret Line="1121" Column="15" TopLine="1098"/>
</Position23>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<OtherUnitFiles Value="$(LazarusDir)/components/codetools/units/$(TargetCPU)-$(TargetOS)/"/>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View File

@ -0,0 +1,18 @@
program StreamAsXMLDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, MainUnit;
begin
Application.Initialize;
Application.CreateForm(TStreamAsXMLForm, StreamAsXMLForm);
Application.Run;
end.

View File

@ -87,13 +87,14 @@ type
procedure Clear;
function FindByName(const AName: string): TLazDockConfigNode;
public
property TheType: TLDConfigNodeType read FTheType write SetTheType;
property Name: string read FName write SetName;
property Bounds: TRect read FBounds write SetBounds;
property Parent: TLazDockConfigNode read FParent write SetParent;
property Sides[Side: TAnchorKind]: TLazDockConfigNode read GetSides write SetSides;
property ChildCount: Integer read GetChildCount;
property Childs[Index: integer]: TLazDockConfigNode read GetChilds; default;
published
property TheType: TLDConfigNodeType read FTheType write SetTheType;
property Name: string read FName write SetName;
end;
TCustomLazControlDocker = class;