Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » TreeGrid Control - Update 6
TreeGrid Control - Update 6 [message #45512] |
Thu, 26 November 2015 12:53  |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
Hope someone will find the attached control useful.
The control seems fairly stable & release-ready...(feedback please)
If you check it out, please let me know what you think, and also any bugs, improvements, etc ...
Update 6:
Improved control: Show/Hide treelines & header
Small changes to Demo (added options to R-click menu)
Bug fixes and improved useability of the simple file manager (Linux-only)
The 'TG6.zip' file contains all three projects.
Usage Example
1. Add the TreeGrid package to your project.
2. Add: #include <TreeGrid/treegrid.h> to your source-file.
3. Example:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#include <TreeGrid/treegrid.h>
struct MyClass : public TopWindow
{
typedef MyClass CLASSNAME;
TreeGrid TG;
MyClass();
virtual ~MyClass() {}
};
MyClass::MyClass()
{
Title("MyClass");
SetRect(0,0,600,600);
Sizeable();
Add(TG.HSizePos().VSizePos());
TG.AddColumn("Column 1", 200).Sorting();
TG.AddColumn("Column 2", 200);
TG.AddColumn("Column 3", 200);
//indentation is just for readability..
//AddNode can fail in two cases: a supplied key is already used, and when out-of-memory
Node N=TG.AddNode(0, "tree-label (column 1-cell)", /*0 => at root of tree */
"key (if you want one)",
"column2-cell",
"column3-cell");
TG.AddNode(N, "tree sub-node label", /*N => parent of new node*/
"", /*empty user-key - keys are auto-generated if empty*/
"col2-cell",
"col3-cell");
TG.AddNode(N, "sub label1",
"",
"col2-cell",
"col3-cell");
TG.AddNode(N, "sub label2"); /*no key and you can have blank values*/
//must give key (even empty string) if you want values
//empty cells corresponding to the columns will be silently created
N=TG.AddNode(0, "another tree-label",
"",
"cell2",
"cell3",
"cell4 - you can have extra cells for private data");
TG.AddNode(N, "tree sub-node label", "", "col2-cell", "col3-cell");
Node N1=TG.AddNode(N, "tree sub-node label", "", "col2-cell", "col3-cell");
TG.AddNode(N1, "node n1", "", "value", "value");
TG.AddNode(N, "A Label", "", "col2-cell", "col3-cell");
TG.RefreshTreeGrid();
}
GUI_APP_MAIN
{
MyClass().Run();
}
-
Attachment: TG6.zip
(Size: 63.49KB, Downloaded 329 times)
[Updated on: Tue, 29 December 2015 08:10] Report message to a moderator
|
|
|
 |
|
TreeGrid Control - Update 6
By: slashupp on Thu, 26 November 2015 12:53
|
 |
|
Re: Tree-Grid-Widget
|
 |
|
Re: Tree-Grid-Widget
By: koldo on Thu, 26 November 2015 14:13
|
 |
|
Re: Tree-Grid-Widget
By: slashupp on Thu, 26 November 2015 14:49
|
 |
|
Re: Tree-Grid-Widget
|
 |
|
Re: Tree-Grid-Widget
By: slashupp on Sat, 12 December 2015 15:09
|
 |
|
Re: Tree-Grid-Widget - Update 3
By: slashupp on Mon, 21 December 2015 09:03
|
 |
|
Re: Tree-Grid-Widget - Update 4
By: slashupp on Tue, 22 December 2015 14:46
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Tue, 29 December 2015 08:16
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Thu, 31 December 2015 15:20
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Fri, 01 January 2016 22:56
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Sat, 02 January 2016 11:30
|
 |
|
Re: TreeGrid Control - Update 6
By: Novo on Sat, 02 January 2016 16:58
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Sun, 03 January 2016 10:48
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Thu, 07 January 2016 07:14
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Thu, 07 January 2016 19:04
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Mon, 11 January 2016 10:10
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Mon, 11 January 2016 15:08
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Tue, 12 January 2016 07:58
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Tue, 12 January 2016 08:41
|
 |
|
Re: TreeGrid Control - Update 6
By: omari on Tue, 12 January 2016 10:48
|
 |
|
Re: TreeGrid Control - Update 6
By: Novo on Fri, 08 January 2016 04:28
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Sun, 10 January 2016 07:03
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Fri, 08 January 2016 09:07
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Sun, 10 January 2016 07:19
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Tue, 12 January 2016 16:48
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Wed, 13 January 2016 08:52
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Wed, 13 January 2016 13:23
|
 |
|
Re: TreeGrid Control - Update 6
By: koldo on Thu, 14 January 2016 08:30
|
 |
|
Re: TreeGrid Control - Update 6
By: slashupp on Tue, 16 August 2016 09:30
|
Goto Forum:
Current Time: Mon Apr 28 06:33:58 CEST 2025
Total time taken to generate the page: 0.00631 seconds
|