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
|
#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");
|