Wt examples  4.10.4
FileTreeTable.C
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 
8 #include "FileTreeTable.h"
9 #include "FileTreeTableNode.h"
10 
11 #include <Wt/WText.h>
12 
13 using namespace Wt;
14 
15 FileTreeTable::FileTreeTable(const boost::filesystem::path& path)
16  : WTreeTable()
17 {
18  addColumn("Size", 80);
19  addColumn("Modified", 110);
20 
21  header(1)->setStyleClass("fsize");
22  header(2)->setStyleClass("date");
23 
24  auto tableNode
25  = std::make_unique<FileTreeTableNode>(path);
26  setTreeRoot(std::move(tableNode), "File");
27 
28  //treeRoot()->setImagePack("icons/");
29  treeRoot()->expand();
30 }
FileTreeTable(const boost::filesystem::path &path)
Construct a new FileTreeTable.
Definition: FileTreeTable.C:15
void addColumn(const WString &header, const WLength &width)
WTreeTableNode * treeRoot()
WText * header(int column) const
void setTreeRoot(std::unique_ptr< WTreeTableNode > root, const WString &header)
virtual void setStyleClass(const WString &styleClass) override