Autor Beitrag
jerilynn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Mo 26.02.07 21:52 
Hallo,

ich bin zur Zeit dabei einen Dateimanager zu programmieren. Dieser Dateimanager ist vom Aufbau her wie der Servant Salamander bzw. Total Commander (also ein Norton Commander Clone). Zur Anzeige der Dateien un Ordner benutze ich den VirtualTreeview. Nun habe ich die Dateinamen hineingeladen und wollte sie mehrspaltig anzeigen (so wie das halt immer dort aussieht). Habe auch schon rumprobiert und geschaut aber irgendwie nicht das das passende gefunden.

Kennst jemand eine Möglichkeit die Liste über mehrere Spalten verteilt anzuzeigen?

greez
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mo 26.02.07 22:19 
Guck mal in den Demos.
Gibt auch noch welche auf der Page zum runterladen.

MfG
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mo 26.02.07 22:41 
user profile iconjerilynn hat folgendes geschrieben:
[...] wollte sie mehrspaltig anzeigen [...]
Meinst du mehrzeilig oder was meinst du genau?

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Mo 26.02.07 22:45 
Du musst einfach nur in den Headeroptions die Spalten aktivieren :)


gruss, rob

_________________
erare humanum est
jerilynn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Mo 26.02.07 23:00 
Wo genau kann ich das aktivieren? In dieser Komponente gibt es so viele Optionen da fällt es mir echt schwer durchzusehen :)
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mo 26.02.07 23:09 
  • Header->Columns: Columns erstellen
  • Header->Options: hoVisible aktivieren
  • OnGetText-Ereignis belegen
Gruß Hape!
jerilynn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Di 27.02.07 10:22 
Wenn ich das so mache habe ich in jeder Spalte das gleiche zu stehen. Ich habe nochmal ein Bild angehängt um zu zeigen wie genau ich das meine. Vielleicht macht das mein Anliegen verständlicher :) Deutsche Sprache schöne Sprache^^

greez
Einloggen, um Attachments anzusehen!
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Di 27.02.07 12:59 
Ohne Quelltext keine Hilfe ;)

_________________
erare humanum est
jerilynn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Di 27.02.07 21:09 
Naja viel ist das nicht, der Rest ist in Bibliotheken ausgelagert, die natürlich nichts mit der Anzeige zu tun haben. Das was da in der Timerprozedur ist kommt noch ins FormCreate Ereignis. Ist zur Zeit nur zu Test da.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
unit saFormMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, gtcl_FileManager, Menus, ExtCtrls, VirtualTrees, StdCtrls,
  ImgList;

type
  PMyRec = ^RFileInformation;

type
  TFormMain = class(TForm)
    MainMenu: TMainMenu;
    Links1: TMenuItem;
    Datei1: TMenuItem;
    Bearbeiten1: TMenuItem;
    Befehle1: TMenuItem;
    Konfiguration1: TMenuItem;
    Rechts1: TMenuItem;
    PanelMain: TPanel;
    PanelLeft: TPanel;
    PanelRight: TPanel;
    Splitter1: TSplitter;
    PanelLeftTopLine: TPanel;
    PanelRightTopLine: TPanel;
    PanelLeftBottomLine: TPanel;
    PanelRightBottomLine: TPanel;
    PanelLeftFileView: TVirtualStringTree;
    PanelRightFileView: TVirtualStringTree;
    Panel1: TPanel;
    Edit1: TEdit;
    Timer1: TTimer;
    ilTreeviewPictures: TImageList;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure PanelLeftFileViewGetText(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
      var CellText: WideString);
    procedure PanelLeftFileViewGetImageIndex(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
      var Ghosted: Boolean; var ImageIndex: Integer);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  FormMain: TFormMain;
  FileManagerLeft: gtFileManager;
  FileManagerRight: gtFileManager;

implementation

{$R *.dfm}

procedure TFormMain.FormCreate(Sender: TObject);
begin
  PanelLeftFileView.NodeDataSize := SizeOf(RFileInformation);
  PanelRightFileView.NodeDataSize := SizeOf(RFileInformation);

  PanelLeft.Width := ( (FormMain.Width - 12div 2) ;
end;

procedure TFormMain.Timer1Timer(Sender: TObject);
var node: PVirtualNode;
    NodeData: PMyRec;
    i: Integer;
begin
  //testtimer

  FormMain.Caption := IntToStr(PanelLeft.Width) + '/' + IntToStr(PanelRight.Width);
  FormMain.Caption := FileManagerleft.CurrentFileList[0].FileName;

  PanelLeftFileView.BeginUpdate;
  PanelLeftFileView.Clear;

  for i:=0 to FileManagerleft.Count-1 do
  begin
    node := PanelLeftFileView.AddChild(nil); //Globaler Node
     NodeData := PanelLeftFileView.GetNodeData(node);
     NodeData^ := FileManagerleft.CurrentFileList[i];
  end;

  PanelLeftFileView.EndUpdate;

  FormMain.Caption := IntToStr(i);

  Timer1.Enabled := false;  
end;

procedure TFormMain.PanelLeftFileViewGetText(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
  var CellText: WideString);
  var NodeData: PMyRec;
begin
  NodeData := Sender.GetNodeData(Node);
  CellText := NodeData.FileName;
end;

procedure TFormMain.PanelLeftFileViewGetImageIndex(
  Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
  Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer);
  var NodeData: PMyRec;
begin
  NodeData := Sender.GetNodeData(Node);

  if(NodeData.FileType and faDirectory  ) <> 0 then ImageIndex := 0;
end;

initialization
  { initialization-Abschnitt }
  FileManagerLeft := gtFileManager.Create('C:\Test\');
  FileManagerRight := gtFileManager.Create('C:\Test\');

finalization
  { finalization-Abschnitt }
  FileManagerLeft.Free;
  FileManagerRight.Free;

end.