2015-04-28 01:35:07 +00:00
|
|
|
#include "UnitTest.h"
|
|
|
|
#include "Gwen/Controls/PanelListPanel.h"
|
|
|
|
#include "Gwen/Controls/StatusBar.h"
|
|
|
|
#include "Gwen/Utility.h"
|
|
|
|
|
|
|
|
using namespace Gwen;
|
|
|
|
|
|
|
|
class PanelListPanel : public GUnit
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
public:
|
|
|
|
GWEN_CONTROL_INLINE(PanelListPanel, GUnit)
|
2015-04-28 01:35:07 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
m_PLP = new Gwen::Controls::PanelListPanel(this);
|
|
|
|
m_PLP->Dock(Pos::Fill);
|
|
|
|
m_PLP->SetPadding(Gwen::Padding(10, 10));
|
2015-04-28 01:35:07 +00:00
|
|
|
m_PLP->SetVertical();
|
2018-09-23 21:17:31 +00:00
|
|
|
m_PLP->SetSizeToChildren(false);
|
2015-04-28 01:35:07 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
for (int i = 0; i < 16; i++)
|
2015-04-28 01:35:07 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
Gwen::String testName = "TEST" + Utility::ToString(i);
|
|
|
|
Gwen::Controls::Button* testButton = new Gwen::Controls::Button(m_PLP);
|
|
|
|
testButton->SetText(testName);
|
2015-04-28 01:35:07 +00:00
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
Gwen::Controls::StatusBar* pStatus = new Gwen::Controls::StatusBar(this);
|
|
|
|
pStatus->Dock(Pos::Bottom);
|
2015-04-28 01:35:07 +00:00
|
|
|
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
Gwen::Controls::Button* pButton = new Gwen::Controls::Button(pStatus);
|
|
|
|
pButton->SetText("Horizontal");
|
|
|
|
pButton->onPress.Add(this, &PanelListPanel::GoHorizontal);
|
|
|
|
pStatus->AddControl(pButton, false);
|
2015-04-28 01:35:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
Gwen::Controls::Button* pButton = new Gwen::Controls::Button(pStatus);
|
|
|
|
pButton->SetText("Vertical");
|
|
|
|
pButton->onPress.Add(this, &PanelListPanel::GoVertical);
|
|
|
|
pStatus->AddControl(pButton, true);
|
2015-04-28 01:35:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void GoVertical(Gwen::Controls::Base* pFromPanel)
|
2015-04-28 01:35:07 +00:00
|
|
|
{
|
|
|
|
m_PLP->SetVertical();
|
|
|
|
}
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void GoHorizontal(Gwen::Controls::Base* pFromPanel)
|
2015-04-28 01:35:07 +00:00
|
|
|
{
|
|
|
|
m_PLP->SetHorizontal();
|
|
|
|
}
|
|
|
|
|
|
|
|
Gwen::Controls::PanelListPanel* m_PLP;
|
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
DEFINE_UNIT_TEST(PanelListPanel, L"PanelListPanel");
|