Search

'VirtualTree'에 해당되는 글 2건

  1. 2010.12.05 Delphi - TcxVirtualTreeList
  2. 2009.05.31 Delphi - VirtualTree

Delphi - TcxVirtualTreeList

Programming/Delphi 2010.12.05 00:49 Posted by 파란크리스마스
- CustomDataSource 사용시 동적인 Count 사용
OptionsData.SmartLoad := True;

- 트리노드의 초기 + 표시
OptionsData.CheckHasChildren := false;
신고

Delphi - VirtualTree

Programming/Delphi 2009.05.31 15:30 Posted by 파란크리스마스

다운받는곳 : Soft Gems Homepage (http://www.soft-gems.net/)

속성

VT.TreeOptions.SelectionOptions := [toDisableDrawSelection,toExtendedFocus,toMiddleClickSelect,toMultiSelect,toRightClickSelect{,toCenterScrollIntoView}];

이벤트

OnFocusChanged

procedure Xxx.VTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
var
  Data: PAlignData;
begin
  // Data := Sender.GetNodeData(Node);
end;

OnGetImageIndex

procedure Xxx.VTGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
  Column: TColumnIndex; var Ghosted: Boolean; var Index: Integer);
var
  Data: PAlignData;
begin
  if Kind in [ikNormal, ikSelected] then begin
    Data := Sender.GetNodeData(Node);
    Index := Data.ImageIndex;
  end;
end;

OnGetNodeDataSize
OnGetText

Node 찾기

function TTreeWorkspace.FindSubNode(ParentNode : PVirtualNode; name : String): PVirtualNode;
var
  Run: PVirtualNode;
  NodeData : PWorkspaceData;
begin
  Result := nil;

  Run := ParentNode.FirstChild;
  while Assigned(Run) do begin
    NodeData := PWorkspaceData(Self.GetNodeData(Run));
    if (NodeData.Title=name) then begin
      result := Run;
      Exit;
    end;
    Run := Run.NextSibling;
  end;
end;

정렬하기

호출
  Self.Sort(TeamNode, 0, Self.Header.SortDirection, true);

constructor TTreeWorkspace.Create(AOwner: TComponent; aImageList : TImageList);
begin
  inherited Create(AOwner);
  Self.OnCompareNodes := TreeCompareNodes;
end;

procedure TTreeWorkspace.TreeCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex;
    var Result: Integer);
var
  NodeData1 : PWorkspaceData;
  NodeData2 : PWorkspaceData;
begin
  NodeData1 := Sender.GetNodeData(Node1);
  NodeData2 := Sender.GetNodeData(Node2);
  Result := 0;
  if NodeData1.Title > NodeData2.Title then
    Result := 1;
end;


 

신고


 

티스토리 툴바