Пример #1
0
	GWEN_CONTROL_INLINE( PanelListPanel, GUnit )
	{
		m_PLP = new Gwen::Controls::PanelListPanel( this );
		m_PLP->Dock( Pos::Fill );
		m_PLP->SetPadding( Gwen::Padding( 10, 10 ));
		m_PLP->SetVertical();
		m_PLP->SetSizeToChildren( false );

		for ( int i = 0; i < 16; i++)
		{
			Gwen::String testName = "TEST" +  Utility::ToString( i );
			Gwen::Controls::Button* testButton =  new Gwen::Controls::Button( m_PLP );
			testButton->SetText( testName );
		}

		Gwen::Controls::StatusBar* pStatus = new Gwen::Controls::StatusBar( this );
		pStatus->Dock( Pos::Bottom );

		{
			Gwen::Controls::Button* pButton = new Gwen::Controls::Button( pStatus );
			pButton->SetText( "Horizontal" );
			pButton->onPress.Add( this, &PanelListPanel::GoHorizontal );
			pStatus->AddControl( pButton, false );
		}

		{
			Gwen::Controls::Button* pButton = new Gwen::Controls::Button( pStatus );
			pButton->SetText( "Vertical" );
			pButton->onPress.Add( this, &PanelListPanel::GoVertical );
			pStatus->AddControl( pButton, true );
		}
	}
Пример #2
0
		GWEN_CONTROL_INLINE( CrossSplitter, GUnit )
		{
			Dock( Pos::Fill );
			m_bSplittersVisible = false;
			m_iCurZoom = 0;
			m_Splitter = new Gwen::Controls::CrossSplitter( this );
			m_Splitter->SetPos( 0, 0 );
			m_Splitter->Dock( Pos::Fill );
			{
				Gwen::Controls::Button* testButton =  new Gwen::Controls::Button( m_Splitter );
				testButton->SetText( "TOPLEFT" );
				m_Splitter->SetPanel( 0, testButton );
			}
			{
				Gwen::Controls::Button* testButton =  new Gwen::Controls::Button( m_Splitter );
				testButton->SetText( "TOPRIGHT" );
				m_Splitter->SetPanel( 1, testButton );
			}
			{
				Gwen::Controls::Button* testButton =  new Gwen::Controls::Button( m_Splitter );
				testButton->SetText( "BOTTOMRIGHT" );
				m_Splitter->SetPanel( 2, testButton );
			}
			{
				Gwen::Controls::Button* testButton =  new Gwen::Controls::Button( m_Splitter );
				testButton->SetText( "BOTTOMLEFT" );
				m_Splitter->SetPanel( 3, testButton );
			}
			//Status bar to hold unit testing buttons
			Gwen::Controls::StatusBar* pStatus = new Gwen::Controls::StatusBar( this );
			pStatus->Dock( Pos::Bottom );
			{
				Gwen::Controls::Button* pButton = new Gwen::Controls::Button( pStatus );
				pButton->SetText( "Zoom" );
				pButton->onPress.Add( this, &CrossSplitter::ZoomTest );
				pStatus->AddControl( pButton, false );
			}
			{
				Gwen::Controls::Button* pButton = new Gwen::Controls::Button( pStatus );
				pButton->SetText( "UnZoom" );
				pButton->onPress.Add( this, &CrossSplitter::UnZoomTest );
				pStatus->AddControl( pButton, false );
			}
			{
				Gwen::Controls::Button* pButton = new Gwen::Controls::Button( pStatus );
				pButton->SetText( "CenterPanels" );
				pButton->onPress.Add( this, &CrossSplitter::CenterPanels );
				pStatus->AddControl( pButton, true );
			}
		}
Пример #3
0
void	GwenUserInterface::init(int width, int height,Gwen::Renderer::Base* renderer,float retinaScale)
{
	m_data->m_curYposition = 20;
	//m_data->m_primRenderer = new GLPrimitiveRenderer(width,height);
	m_data->pRenderer = renderer;//new GwenOpenGL3CoreRenderer(m_data->m_primRenderer,stash,width,height,retinaScale);

	m_data->skin.SetRender( m_data->pRenderer );
	

	m_data->pCanvas= new Gwen::Controls::Canvas( &m_data->skin );
	m_data->pCanvas->SetSize( width,height);
	m_data->pCanvas->SetDrawBackground( false);
	m_data->pCanvas->SetBackgroundColor( Gwen::Color( 150, 170, 170, 255 ) );
	
	
	
	MyTestMenuBar* menubar = new MyTestMenuBar(m_data->pCanvas);
	m_data->m_viewMenu = menubar->m_viewMenu;
    m_data->m_menuItems = menubar->m_menuItems;
	m_data->m_menubar = menubar;
	
	
    
	Gwen::Controls::StatusBar* bar = new Gwen::Controls::StatusBar(m_data->pCanvas);
	m_data->m_bar = bar;
	

	m_data->m_rightStatusBar = new Gwen::Controls::Label( bar );
	
	m_data->m_rightStatusBar->SetWidth(width/2);
	//m_data->m_rightStatusBar->SetText( L"Label Added to Right" );
	bar->AddControl( m_data->m_rightStatusBar, true );
	
	m_data->m_TextOutput = new Gwen::Controls::ListBox( m_data->pCanvas );
	
	m_data->m_TextOutput->Dock( Gwen::Pos::Bottom );
	m_data->m_TextOutput->SetHeight( 100 );
	
	m_data->m_leftStatusBar = new Gwen::Controls::Label( bar );
	
	//m_data->m_leftStatusBar->SetText( L"Label Added to Left" );
	m_data->m_leftStatusBar->SetWidth(width/2);
	bar->AddControl( m_data->m_leftStatusBar,false);
	
	//Gwen::KeyboardFocus
	/*Gwen::Controls::GroupBox* box = new Gwen::Controls::GroupBox(m_data->pCanvas);
	box->SetText("text");
	box->SetName("name");
	box->SetHeight(500);
	*/
	Gwen::Controls::ScrollControl* windowRight= new Gwen::Controls::ScrollControl(m_data->pCanvas);
	windowRight->Dock(Gwen::Pos::Right);
	windowRight->SetWidth(250);
	windowRight->SetHeight(250);
	windowRight->SetScroll(false,true);
	m_data->m_windowRight = windowRight;


	//windowLeft->SetSkin(
	Gwen::Controls::TabControl* tab = new Gwen::Controls::TabControl(windowRight);
	m_data->m_tab = tab;

	

	//tab->SetHeight(300);
	tab->SetWidth(240);
	tab->SetHeight(1250);
	//tab->Dock(Gwen::Pos::Left);
	tab->Dock( Gwen::Pos::Fill );
	//tab->SetMargin( Gwen::Margin( 2, 2, 2, 2 ) );

	Gwen::UnicodeString str1(L"Params");
	m_data->m_demoPage = tab->AddPage(str1);
	
	



//	Gwen::UnicodeString str2(L"OpenCL");
//	tab->AddPage(str2);
	//Gwen::UnicodeString str3(L"page3");
//	tab->AddPage(str3);



	//but->onPress.Add(handler, &MyHander::onButtonA);



	//box->Dock(Gwen::Pos::Left);

	/*Gwen::Controls::WindowControl* windowBottom = new Gwen::Controls::WindowControl(m_data->pCanvas);
	windowBottom->SetHeight(100);
	windowBottom->Dock(Gwen::Pos::Bottom);
	windowBottom->SetTitle("bottom");
	*/
//	Gwen::Controls::Property::Text* prop = new Gwen::Controls::Property::Text(m_data->pCanvas);
	//prop->Dock(Gwen::Pos::Bottom);
	/*Gwen::Controls::SplitterBar* split = new Gwen::Controls::SplitterBar(m_data->pCanvas);
	split->Dock(Gwen::Pos::Center);
	split->SetHeight(300);
	split->SetWidth(300);
	*/
	/*


	*/

	Gwen::Controls::ScrollControl* windowLeft = new Gwen::Controls::ScrollControl(m_data->pCanvas);
	windowLeft->Dock(Gwen::Pos::Left);
	//	windowLeft->SetTitle("title");
	windowLeft->SetScroll(false, false);
	windowLeft->SetWidth(250);
	windowLeft->SetPos(50, 50);
	windowLeft->SetHeight(500);
	//windowLeft->SetClosable(false);
	//	windowLeft->SetShouldDrawBackground(true);
	windowLeft->SetTabable(true);
	
	Gwen::Controls::TabControl* explorerTab = new Gwen::Controls::TabControl(windowLeft);

	//tab->SetHeight(300);
//	explorerTab->SetWidth(230);
	explorerTab->SetHeight(250);
	//tab->Dock(Gwen::Pos::Left);
	explorerTab->Dock(Gwen::Pos::Fill);

	



	//m_data->m_exampleInfoTextOutput->SetBounds(2, 10, 236, 400);

	//windowRight

	Gwen::UnicodeString explorerStr1(L"Explorer");
	m_data->m_explorerPage = explorerTab->AddPage(explorerStr1);
	Gwen::UnicodeString shapesStr1(L"Test");
	Gwen::Controls::TabButton* shapes = explorerTab->AddPage(shapesStr1);

	///todo(erwincoumans) figure out why the HSV color picker is extremely slow
	//Gwen::Controls::HSVColorPicker* color = new Gwen::Controls::HSVColorPicker(shapes->GetPage());
	Gwen::Controls::ColorPicker* color = new Gwen::Controls::ColorPicker(shapes->GetPage());
	color->SetKeyboardInputEnabled(true);
	
	Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl(m_data->m_explorerPage->GetPage());
	m_data->m_explorerTreeCtrl = ctrl;
	ctrl->SetKeyboardInputEnabled(true);
	ctrl->Focus();
	ctrl->SetBounds(2, 10, 236, 300);

	m_data->m_exampleInfoGroupBox = new Gwen::Controls::Label( m_data->m_explorerPage->GetPage() );
	m_data->m_exampleInfoGroupBox->SetPos(2, 314);
	m_data->m_exampleInfoGroupBox->SetHeight( 15 );
	m_data->m_exampleInfoGroupBox->SetWidth(234);
	m_data->m_exampleInfoGroupBox->SetText("Example Description");

	m_data->m_exampleInfoTextOutput = new Gwen::Controls::ListBox(m_data->m_explorerPage->GetPage());

	//m_data->m_exampleInfoTextOutput->Dock( Gwen::Pos::Bottom );
	m_data->m_exampleInfoTextOutput->SetPos(2, 332);
	m_data->m_exampleInfoTextOutput->SetHeight( 150 );
	m_data->m_exampleInfoTextOutput->SetWidth(233);
	

   
}
Пример #4
0
void	GwenUserInterface::init(int width, int height,struct sth_stash* stash,float retinaScale)
{
	m_data->m_curYposition = 20;
	m_data->m_primRenderer = new GLPrimitiveRenderer(width,height);
	m_data->pRenderer = new GwenOpenGL3CoreRenderer(m_data->m_primRenderer,stash,width,height,retinaScale);

	m_data->skin.SetRender( m_data->pRenderer );

	m_data->pCanvas= new Gwen::Controls::Canvas( &m_data->skin );
	m_data->pCanvas->SetSize( width,height);
	m_data->pCanvas->SetDrawBackground( false);
	m_data->pCanvas->SetBackgroundColor( Gwen::Color( 150, 170, 170, 255 ) );

	MyTestMenuBar* menubar = new MyTestMenuBar(m_data->pCanvas);
	Gwen::Controls::StatusBar* bar = new Gwen::Controls::StatusBar(m_data->pCanvas);
	m_data->m_rightStatusBar = new Gwen::Controls::Label( bar );
	m_data->m_rightStatusBar->SetWidth(width/2);
	//m_data->m_rightStatusBar->SetText( L"Label Added to Right" );
	bar->AddControl( m_data->m_rightStatusBar, true );

	m_data->m_leftStatusBar = new Gwen::Controls::Label( bar );
	//m_data->m_leftStatusBar->SetText( L"Label Added to Left" );
	m_data->m_leftStatusBar->SetWidth(width/2);
	bar->AddControl( m_data->m_leftStatusBar,false);
	//Gwen::KeyboardFocus
	/*Gwen::Controls::GroupBox* box = new Gwen::Controls::GroupBox(m_data->pCanvas);
	box->SetText("text");
	box->SetName("name");
	box->SetHeight(500);
	*/
	Gwen::Controls::ScrollControl* windowRight= new Gwen::Controls::ScrollControl(m_data->pCanvas);
	windowRight->Dock(Gwen::Pos::Right);
	windowRight->SetWidth(150);
	windowRight->SetHeight(250);
	windowRight->SetScroll(false,true);



	//windowLeft->SetSkin(
	Gwen::Controls::TabControl* tab = new Gwen::Controls::TabControl(windowRight);
	
	//tab->SetHeight(300);
	tab->SetWidth(140);
	tab->SetHeight(250);
	//tab->Dock(Gwen::Pos::Left);
	tab->Dock( Gwen::Pos::Fill );
	//tab->SetMargin( Gwen::Margin( 2, 2, 2, 2 ) );

	Gwen::UnicodeString str1(L"Main");
	m_data->m_demoPage = tab->AddPage(str1);

	

	
//	Gwen::UnicodeString str2(L"OpenCL");
//	tab->AddPage(str2);
	//Gwen::UnicodeString str3(L"page3");
//	tab->AddPage(str3);
	
		
	
	//but->onPress.Add(handler, &MyHander::onButtonA);

	
	
	//box->Dock(Gwen::Pos::Left);

	/*Gwen::Controls::WindowControl* windowBottom = new Gwen::Controls::WindowControl(m_data->pCanvas);
	windowBottom->SetHeight(100);
	windowBottom->Dock(Gwen::Pos::Bottom);
	windowBottom->SetTitle("bottom");
	*/
//	Gwen::Controls::Property::Text* prop = new Gwen::Controls::Property::Text(m_data->pCanvas);
	//prop->Dock(Gwen::Pos::Bottom);
	/*Gwen::Controls::SplitterBar* split = new Gwen::Controls::SplitterBar(m_data->pCanvas);
	split->Dock(Gwen::Pos::Center);
	split->SetHeight(300);
	split->SetWidth(300);
	*/
	/*
	
	
	*/

	Gwen::Controls::ScrollControl* windowLeft = new Gwen::Controls::ScrollControl(m_data->pCanvas);
	windowLeft->Dock(Gwen::Pos::Left);
	//	windowLeft->SetTitle("title");
	windowLeft->SetScroll(false, false);
	windowLeft->SetWidth(250);
	windowLeft->SetPos(50, 50);
	windowLeft->SetHeight(500);
	//windowLeft->SetClosable(false);
	//	windowLeft->SetShouldDrawBackground(true);
	windowLeft->SetTabable(true);

	Gwen::Controls::TabControl* explorerTab = new Gwen::Controls::TabControl(windowLeft);

	//tab->SetHeight(300);
//	explorerTab->SetWidth(230);
	explorerTab->SetHeight(250);
	//tab->Dock(Gwen::Pos::Left);
	explorerTab->Dock(Gwen::Pos::Fill);

	Gwen::UnicodeString explorerStr1(L"Explorer");
	m_data->m_explorerPage = explorerTab->AddPage(explorerStr1);
	Gwen::UnicodeString shapesStr1(L"Shapes");
	explorerTab->AddPage(shapesStr1);
	Gwen::UnicodeString testStr1(L"Test");
	explorerTab->AddPage(testStr1);

	Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl(m_data->m_explorerPage->GetPage());
	m_data->m_explorerTreeCtrl = ctrl;
	ctrl->SetKeyboardInputEnabled(true);
	ctrl->Focus();
	ctrl->SetBounds(2, 10, 236, 400);

}
Пример #5
0
void	GwenUserInterface::init(int width, int height,struct sth_stash* stash,float retinaScale)
{
	m_data->m_primRenderer = new GLPrimitiveRenderer(width,height);
	m_data->pRenderer = new GwenOpenGL3CoreRenderer(m_data->m_primRenderer,stash,width,height,retinaScale);

	m_data->skin.SetRender( m_data->pRenderer );

	m_data->pCanvas= new Gwen::Controls::Canvas( &m_data->skin );
	m_data->pCanvas->SetSize( width,height);
	m_data->pCanvas->SetDrawBackground( false);
	m_data->pCanvas->SetBackgroundColor( Gwen::Color( 150, 170, 170, 255 ) );

	MyTestMenuBar* menubar = new MyTestMenuBar(m_data->pCanvas);
	Gwen::Controls::StatusBar* bar = new Gwen::Controls::StatusBar(m_data->pCanvas);
	Gwen::Controls::Label* pRight = new Gwen::Controls::Label( bar );
	pRight->SetWidth(200);
	pRight->SetText( L"Label Added to Right" );
	bar->AddControl( pRight, true );

	Gwen::Controls::Label* pLeft = new Gwen::Controls::Label( bar );
	pLeft->SetText( L"Label Added to Left" );
	pLeft->SetWidth(200);
	bar->AddControl( pLeft,false);

	/*Gwen::Controls::GroupBox* box = new Gwen::Controls::GroupBox(m_data->pCanvas);
	box->SetText("text");
	box->SetName("name");
	box->SetHeight(500);
	*/
	Gwen::Controls::ScrollControl* windowLeft= new Gwen::Controls::ScrollControl(m_data->pCanvas);
	windowLeft->Dock(Gwen::Pos::Right);
	windowLeft->SetWidth(150);
	windowLeft->SetHeight(250);
	windowLeft->SetScroll(false,true);

	/*Gwen::Controls::WindowControl* windowLeft = new Gwen::Controls::WindowControl(m_data->pCanvas);
	windowLeft->Dock(Gwen::Pos::Left);
	windowLeft->SetTitle("title");
	windowLeft->SetWidth(150);
	windowLeft->SetClosable(false);
	windowLeft->SetShouldDrawBackground(true);
	windowLeft->SetTabable(true);
	*/

	//windowLeft->SetSkin(
	Gwen::Controls::TabControl* tab = new Gwen::Controls::TabControl(windowLeft);
	
	//tab->SetHeight(300);
	tab->SetWidth(140);
	tab->SetHeight(250);
	//tab->Dock(Gwen::Pos::Left);
	tab->Dock( Gwen::Pos::Fill );
	//tab->SetMargin( Gwen::Margin( 2, 2, 2, 2 ) );

	Gwen::UnicodeString str1(L"Main");
	m_data->m_demoPage = tab->AddPage(str1);

	

	
	Gwen::UnicodeString str2(L"OpenCL");
	tab->AddPage(str2);
	//Gwen::UnicodeString str3(L"page3");
//	tab->AddPage(str3);
	
		
	
	//but->onPress.Add(handler, &MyHander::onButtonA);

	
	
	//box->Dock(Gwen::Pos::Left);

	/*Gwen::Controls::WindowControl* windowBottom = new Gwen::Controls::WindowControl(m_data->pCanvas);
	windowBottom->SetHeight(100);
	windowBottom->Dock(Gwen::Pos::Bottom);
	windowBottom->SetTitle("bottom");
	*/
//	Gwen::Controls::Property::Text* prop = new Gwen::Controls::Property::Text(m_data->pCanvas);
	//prop->Dock(Gwen::Pos::Bottom);
	/*Gwen::Controls::SplitterBar* split = new Gwen::Controls::SplitterBar(m_data->pCanvas);
	split->Dock(Gwen::Pos::Center);
	split->SetHeight(300);
	split->SetWidth(300);
	*/
	/*
	
	
	*/
}