File: TreeControl.cpp

package info (click to toggle)
bullet 2.87%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,272 kB
  • sloc: cpp: 204,241; ansic: 12,100; lisp: 12,017; python: 593; makefile: 136; sh: 8
file content (61 lines) | stat: -rw-r--r-- 1,545 bytes parent folder | download | duplicates (2)
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
#include "UnitTest.h"
#include "Gwen/Controls/TreeControl.h"

using namespace Gwen;

using namespace Gwen::Controls;


class TreeControl2 : public GUnit
{
	public:

	GWEN_CONTROL_INLINE( TreeControl2, GUnit )
	{
		{
			Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl( this );

			ctrl->SetKeyboardInputEnabled(true);
			ctrl->AddNode( L"Node One" );
			Gwen::Controls::TreeNode* pNode = ctrl->AddNode( L"Node Two" );
			pNode->AddNode( L"Node Two Inside" );
			pNode->AddNode( L"Eyes" );
			pNode->SetSelected(true);

			pNode->AddNode( L"Brown" )->AddNode( L"Node Two Inside" )->AddNode( L"Eyes" )->AddNode( L"Brown" );
			ctrl->AddNode( L"Node Three" );
			ctrl->Focus();
			ctrl->SetKeyboardInputEnabled(true);

			ctrl->SetBounds( 30, 30, 200, 200 );
			ctrl->ExpandAll();
		}

		{
			Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl( this );

			ctrl->AllowMultiSelect( true );

			ctrl->AddNode( L"Node One" );
			Gwen::Controls::TreeNode* pNode = ctrl->AddNode( L"Node Two" );
			pNode->AddNode( L"Node Two Inside" );
			pNode->AddNode( L"Eyes" );
			Gwen::Controls::TreeNode* pNodeTwo = pNode->AddNode( L"Brown" )->AddNode( L"Node Two Inside" )->AddNode( L"Eyes" );
			pNodeTwo->AddNode( L"Brown" );
			pNodeTwo->AddNode( L"Green" );
			pNodeTwo->AddNode( L"Slime" );
			pNodeTwo->AddNode( L"Grass" );
			pNodeTwo->AddNode( L"Pipe" );

			ctrl->AddNode( L"Node Three" );

			ctrl->SetBounds( 240, 30, 200, 200 );
			ctrl->ExpandAll();
		}
	}

};



DEFINE_UNIT_TEST( TreeControl2, L"TreeControl" );