bullet3/test/GwenOpenGLTest/Checkbox.cpp
erwin coumans 27227e5e4a add SoftDemo examples
add example description for all examples (with word-wrap)
add the VoronoiFractureDemo, note that the collision are disabled after breaking constraints.
add optional GwenOpenGLTest, to make it easier to see Gwen user interface features.
2015-04-27 18:35:07 -07:00

48 lines
1.3 KiB
C++

#include "UnitTest.h"
#include "Gwen/Controls/CheckBox.h"
using namespace Gwen;
class Checkbox : public GUnit
{
public:
GWEN_CONTROL_INLINE( Checkbox, GUnit )
{
Gwen::Controls::CheckBox* check = new Gwen::Controls::CheckBox( this );
check->SetPos( 10, 10 );
check->onChecked.Add( this, &Checkbox::OnChecked );
check->onUnChecked.Add( this, &Checkbox::OnUnchecked );
check->onCheckChanged.Add( this, &Checkbox::OnCheckChanged );
Gwen::Controls::CheckBoxWithLabel* labeled = new Gwen::Controls::CheckBoxWithLabel( this );
labeled->SetPos( 10, 10 );
labeled->Label()->SetText( "Labeled CheckBox" );
labeled->Checkbox()->onChecked.Add( this, &Checkbox::OnChecked );
labeled->Checkbox()->onUnChecked.Add( this, &Checkbox::OnUnchecked );
labeled->Checkbox()->onCheckChanged.Add( this, &Checkbox::OnCheckChanged );
Gwen::Align::PlaceBelow( labeled, check, 10 );
}
void OnChecked( Controls::Base* pControl )
{
UnitPrint( L"Checkbox Checked (using 'OnChecked' event)" );
}
void OnUnchecked( Controls::Base* pControl )
{
UnitPrint( L"Checkbox Unchecked (using 'OnUnchecked' event)" );
}
void OnCheckChanged( Controls::Base* pControl )
{
UnitPrint( L"Checkbox CheckChanged (using 'OnCheckChanged' event)" );
}
};
DEFINE_UNIT_TEST( Checkbox, L"Checkbox" );