void SettingsPanel::setup(Gwen::Controls::DockBase *parent){ bIldaFrameSet = false; bLaserControllerSet = false; mLaserCatElements.clear(); //// Gwen::Controls::DockBase* dock = new Gwen::Controls::DockBase( mCanvas ); // this->Dock( Gwen::Pos::Fill ); // Gwen::Controls::CollapsibleList* pList = new Gwen::Controls::CollapsibleList( this ); // pList->SetHeight(300); //// // mCanvas-> // Gwen::Controls::TabControl* tabControl = this->GetLeft()->GetTabControl(); // tabControl->AddPage( "Settings", pList ); // this->GetLeft()->SetWidth( 250 ); Gwen::Controls::TabControl* tabControl = parent->GetLeft()->GetTabControl(); Gwen::Controls::CollapsibleList* pList = new Gwen::Controls::CollapsibleList( parent ); tabControl->AddPage( "Settings", pList ); tabControl->SetAllowReorder(false); parent->GetLeft()->SetWidth( 250 ); Gwen::Controls::CollapsibleCategory* cat0 = pList->Add( "Laser Button!" ); Gwen::Controls::CollapsibleCategory* cat1 = pList->Add( "Laser Stats" ); Gwen::Controls::CollapsibleCategory* cat2 = pList->Add( "Laser Output Settings" ); Gwen::Controls::CollapsibleCategory* cat3 = pList->Add( "Laser Preview Settings" ); Gwen::Controls::CollapsibleCategory* cat4 = pList->Add( "Laser Colour Correction" ); mLaserButton = new Gwen::Controls::Button( cat0 ); mLaserButton->SetText(" DISABLE LASER "); mLaserButton->Dock( Gwen::Pos::Top ); mLaserButton->SetHeight(40); mLaserButton->SetMargin( Gwen::Margin(5,7,5,7) ); mLaserButton->onPress.Add( this, &SettingsPanel::onLaserButtonClick ); Gwen::Padding padding = Gwen::Padding( 10, 0, 10, 20 ); cat1->SetPadding( padding ); cat2->SetPadding( padding ); cat3->SetPadding( padding ); cat4->SetPadding( padding ); mLaserStatsCat = cat1; mLaserCat = cat2; mLaserPreviewCat = cat3; mLaserColourCorCat = cat4; }
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); }
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); }
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); */ /* */ }