Ejemplo n.º 1
0
void TPinterface::initGUI()
{
	// Check CGFinterface.h and GLUI documentation for the types of controls available
	//GLUI_Panel *varPanel= addPanel("Group", 1);
	//addSpinnerToPanel(varPanel, "Val 1(interface)", 2, &testVar, 1);

	// You could also pass a reference to a variable from the scene class, if public
	//addSpinnerToPanel(varPanel, "Val 2(scene)", 2, &(((LightingScene*) scene)->sceneVar), 2);
	//addColumn ();
	GLUI_Panel *varLuz= addPanel("Luzes", 2);
	addCheckboxToPanel(varLuz, "Luz 1",&((LightingScene *) scene)->state1,NULL);
	addCheckboxToPanel(varLuz, "Luz 2",&((LightingScene *) scene)->state2,NULL);
	addCheckboxToPanel(varLuz, "Luz 3",&((LightingScene *) scene)->state3,NULL);
	addCheckboxToPanel(varLuz, "Luz 4",&((LightingScene *) scene)->state4,NULL);
	addColumn ();
	GLUI_Panel *varClock= addPanel("Relogio", 3);
	addStaticText("Relógio");
	addButton ("Pause/Start",1);
	addColumn ();
	GLUI_Panel *vartext= addPanel("Texturas",4);
	GLUI_Listbox *textvar =addListboxToPanel(vartext,"Texturas",&((LightingScene *) scene)->statetext,NULL);
	textvar->add_item (1, "Default");
	textvar->add_item (2, "Sky");
	textvar->add_item (3, "Space");
	textvar->set_int_val (3); 
	addColumn();
	GLUI_Panel *varwire= addPanel("Wireframe",5);
	GLUI_RadioGroup *group=addRadioGroupToPanel(varwire,&((LightingScene *) scene)->wire);
	addRadioButtonToGroup(group,"Normal");
	addRadioButtonToGroup(group,"Wireframe");
	addColumn();
}
Ejemplo n.º 2
0
CodeEdit::CodeEdit(QWidget *parent): QObject(parent), QCodeEdit(parent)
{	
	
	static QFormatFactory *ff;
	static QLanguageFactory *lang;

	static bool doit = true;
	if (doit)
	{
	doit = false;
	ff = new QFormatFactory("qxs/formats.qxf"); //Memory leak, ff se nikdy nedealokuje
	QDocument::setFormatFactory(ff);

	QLineMarksInfoCenter::instance()->loadMarkTypes("qxs/marks.qxm");
	lang = new QLanguageFactory(ff); //Memory leak
	lang->addDefinitionPath("qxs");
	}
	l = lang;
	
	addPanel(new QLineMarkPanel, QCodeEdit::West);
	addPanel(new QLineNumberPanel, QCodeEdit::West);
	addPanel(new QFoldPanel, QCodeEdit::West);
	addPanel(new QStatusPanel, QCodeEdit::South);
	addPanel(new QSearchReplacePanel, QCodeEdit::South);
	
	lang->setLanguage(editor(), QString("x.cpp"));
	
	editor()->document()->setFont(QFont("Courier New", 10));
}
Ejemplo n.º 3
0
void GameInterface::initGUI()
{
	int* option= &((XMLScene*) scene)->option;
	GLUI_Panel* viewPanel= addPanel("View Points",1);
	viewPanel->set_alignment(1);
	GLUI_RadioGroup* group = addRadioGroupToPanel(viewPanel,&((XMLScene*) scene)->viewPoint,16);
	addRadioButtonToGroup(group,"Lateral");
	addRadioButtonToGroup(group,"Upper");
	GLUI_Panel *gameModePanel = addPanel("Game", 1);
	gameModePanel->set_alignment(0);
	GLUI_Listbox* themeListBox =addListboxToPanel(gameModePanel,"Theme: ",option,8);
	themeListBox->add_item (0, "Classic");
	themeListBox->add_item (1, "Minecraft");
	themeListBox->add_item (2, "Dragon Ball");
	GLUI_Button* undo = addButtonToPanel(gameModePanel,"Undo",12);
	addColumnToPanel(gameModePanel);
	GLUI_Listbox* gameModeListbox=addListboxToPanel(gameModePanel,"Game Mode", &((XMLScene*) scene)->data->newGameMode,9);
	gameModeListbox->add_item(1,"PVP");
	gameModeListbox->add_item(2,"Player vs PC");
	gameModeListbox->add_item(3,"PC vs PC");
	GLUI_Button* redo = addButtonToPanel(gameModePanel,"Redo",13);
	addColumnToPanel(gameModePanel);
	GLUI_Panel* difficultiesPanel=addPanelToPanel(gameModePanel,"Difficulties",1);
	difficultiesPanel->set_alignment(0);
	GLUI_Listbox* difficulty1Listbox=addListboxToPanel(difficultiesPanel,"Computer 1", &((XMLScene*) scene)->data->newDifficulties[0],10);
	difficulty1Listbox->add_item(1,"Normal");
	difficulty1Listbox->add_item(2,"Hard");
	GLUI_Button* restart = addButtonToPanel(gameModePanel,"Restart",14);
	GLUI_Listbox* difficulty2Listbox=addListboxToPanel(difficultiesPanel,"Computer 2", &((XMLScene*) scene)->data->newDifficulties[1],11);
	difficulty2Listbox->add_item(1,"Normal");
	difficulty2Listbox->add_item(2,"Hard");
	GLUI_Button* gameMovie = addButtonToPanel(gameModePanel,"Game Movie",15);

}
Ejemplo n.º 4
0
void Interface::initGUI()
{
	Scene * scene = ((Scene *)this->scene);
	std::vector<Light *> sceneLights = scene->getLights();
	lightsState = new int[sceneLights.size()];

	GLUI_Panel * panelLights = addPanel("Lights: ", 1);
	int * lightvalue;
	unsigned i = 0;
	for(std::vector<Light *>::iterator it = sceneLights.begin(); it != sceneLights.end() ;it++,i++){
		lights.push_back(*it);
		lightsState[i] = ((*it)->isEnabled() ? 1 : 0);
		addCheckboxToPanel (panelLights,(char *)((*it)->getIdTitle()).c_str(),&lightsState[i], i + LIGHTS_BASE_ID);
	}

	
	addColumn();

	activeCameraPosition = scene->getActiveCameraPosition();

	GLUI_Panel * cameraPanel = addPanel("Cameras: ", 1);
	GLUI_RadioGroup * rgCameras = addRadioGroupToPanel(cameraPanel,&activeCameraPosition, CAMERAS_ID);
	
	std::vector<Camera *> cameras = scene->getCameras();

	unsigned size = i + cameras.size();
	std::vector<Camera *>::iterator it = cameras.begin();	
	for(; it != cameras.end() ;it++){
		addRadioButtonToGroup (rgCameras, (char *)(*it)->getTitle().c_str());
	}

	addColumn();

	drawingMode = scene->getDrawingMode(); 

	GLUI_Panel * drawingModePanel = addPanel("Drawing mode: ", 1);
	GLUI_RadioGroup * rgDrawingMode = addRadioGroupToPanel(drawingModePanel,&drawingMode, DRAWINGMODE_ID);
	addRadioButtonToGroup (rgDrawingMode, "Fill");
	addRadioButtonToGroup (rgDrawingMode, "Line");
	addRadioButtonToGroup (rgDrawingMode, "Point");
	
	addColumn();

	shaddingMode = scene->getShaddingMode(); 

	GLUI_Panel * shaddingModePanel = addPanel("Shadding mode: ", 1);
	GLUI_RadioGroup * rgShaddingMode = addRadioGroupToPanel(shaddingModePanel,&shaddingMode, SHADDINGMODE_ID);
	addRadioButtonToGroup (rgShaddingMode, "Flat");
	addRadioButtonToGroup (rgShaddingMode, "Gouraud");
	
	addColumn();
	
	GLUI_Panel * axisModePanel = addPanel("Axis: ", 1);
	GLUI_RadioGroup * rgAxisMode = addRadioGroupToPanel(axisModePanel,&scene->showAxis, SHOWAXIS_ID);
	addRadioButtonToGroup (rgAxisMode, "Show");
	addRadioButtonToGroup (rgAxisMode, "Hide");
	
}
Ejemplo n.º 5
0
void CInputDocView::populatePanels()
{
	int iSelectedTab = m_tabCtrl.GetCurSel();
	removePanels();

	CInputDoc* pDoc = (CInputDoc*) GetDocument();

	// add the base file (which will be:
	//		source file for a parsing operation
	//		ana or ptext for a transfer or synthesis operation

	//CResultStream* pBaseStream = pDoc->getBaseStream();
#ifndef rde270
	// the first panel (i.e. the file we're processing), should be synchronously streamed in
	//  (the meaning of the 3rd parameter), since it has to be closed (finished loading into
	//  the control) by the time we try to process it.
	addPanel(m_pBaseStream, kBasePanelID+0, true);
#else
	addPanel(m_pBaseStream, kBasePanelID+0);
#endif
	//delete pBaseStream;


	// add the various result panels
	CProcessStatus* pResults = pDoc->getProcessResults();
	if(pResults)
	{
		CPrefsInputDocDisplay* pPrefs = pDoc->getDisplayPrefs();

		int iPanelCount=1; // one for the input file
		for (int i =0; i< pResults->m_pResultStreams.GetSize(); i++)
		{
			CResultStreamDescriptor* pD =pResults->m_pResultStreams[i]->getDescriptor() ;

			if(	pPrefs->getShowPanel(pD))
			{
				iPanelCount++;
				addPanel(pResults->m_pResultStreams[i], kBasePanelID+i+1/*id 0 is the basestream */);
			}
		}
		// try to reselect the tab the user had before
		// this is simplistic, and could be redone to store the descriptor
		// they had chosen and reselect that.
		if(iPanelCount > iSelectedTab) // iSelectedTab is zero-based
		{
			m_tabCtrl.SetCurSel(iSelectedTab);
			tabSelected(iSelectedTab); // don't know why this isn't triggered
		}
		else
		{
			m_tabCtrl.SetCurSel(0);	// should always at least be the source panel
			tabSelected(0); // don't know why this isn't triggered
		}
	}
}
void ramControlPanel::setup(bool usePresetScenes)
{
	addPanel(presetTab);
	addPanel(preferencesTab);
	mSceneTabs.addSpacer();
	
	presetTab.setup(usePresetScenes);
	
	ofAddListener(ofEvents().update, this, &ramControlPanel::update);
	ofAddListener(mSceneTabs.newGUIEvent, this, &ramControlPanel::guiEvent);
}
Ejemplo n.º 7
0
void TPinterface::initGUI()
{
	GLUI_Panel *lights= addPanel("Luzes", 1);
	addCheckboxToPanel(lights,"Light0", NULL,100)->set_int_val(1);
	addCheckboxToPanel(lights,"Light1", NULL,101)->set_int_val(1);
	addCheckboxToPanel(lights,"Light2", NULL,102)->set_int_val(1);
	addCheckboxToPanel(lights,"Light3", NULL,103)->set_int_val(1);

	GLUI_Panel *clock= addPanel("Clock", 1);
	clockbt=addButtonToPanel(clock,"Stop",104);
	

}
Ejemplo n.º 8
0
void TPinterface::initGUI()
{
	GLUI_Panel *lightPanel= addPanel("Lights",1);
	for(unsigned int i=0;i<((LightingScene*) scene)->lightState.size();i++){
		char name[30]="";
		std::string s = ((LightingScene*) scene)->lights[i]->getID();
		sprintf(name, "%s", s.c_str());
		addCheckboxToPanel(lightPanel,name,&(((LightingScene*) scene)->lightState[i]),0);
	}

	addColumn();

	GLUI_Panel *cameraPanel= addPanel("Cameras",1);
	if(((LightingScene*) scene)->cameras.size()<5){
		GLUI_RadioGroup *radioCameras=addRadioGroupToPanel(cameraPanel,&((LightingScene*) scene)->camera,1);
		for(unsigned int i=0;i<((LightingScene*) scene)->cameras.size();i++){
			char name[30]="";
			std::string s =((LightingScene*) scene)->cameras[i]->getID();
			sprintf(name, "%s", s.c_str());
			addRadioButtonToGroup(radioCameras,name);
		}
	}
	else{
		GLUI_Listbox *listbox = addListboxToPanel(cameraPanel,"Cameras",&((LightingScene*) scene)->camera,2);

		for(unsigned int i=0;i<2;i++){
			char name[30]="";
			std::string s =((LightingScene*) scene)->cameras[i]->getID();
			sprintf(name, "%s", s.c_str());
			listbox->add_item(i,name);
			((LightingScene*) scene)->camera= listbox->get_int_val();
		}
	}

	addColumn();

	GLUI_Panel *drawmodePanel= addPanel("Drawmode",1);
	GLUI_RadioGroup *radioDrawmode=addRadioGroupToPanel(drawmodePanel,&((LightingScene*) scene)->drawmode,3);
	addRadioButtonToGroup(radioDrawmode,"Point");
	addRadioButtonToGroup(radioDrawmode,"Line");
	addRadioButtonToGroup(radioDrawmode,"Fill");

	addColumn();

	GLUI_Panel *themesPanel= addPanel("Themes",1);
	GLUI_Listbox *themeslistbox = addListboxToPanel(themesPanel,"Themes",&((LightingScene*) scene)->app,4);
	themeslistbox->add_item(0, "classic");
	themeslistbox->add_item(1, "mario");
	themeslistbox->add_item(2, "dragon ball");
	themeslistbox->add_item(3, "angry birds");
}
void GuiManager::setup( int fW, int fH )
{
    frameWidth  = fW;
    frameHeight = fH;

    Settings* settings = Settings::getInstance();

    ofxAutoControlPanel::setup(250, 500);

    addPanel("calcOpticalFlowFarneback");
    addSlider("gridSize", 5, 2, 30, true);
    addSlider("pyrScale", .5, 0, 1);
    addSlider("levels", 4, 1, 8, true);
    addSlider("winsize", 8, 4, 64, true);
    addSlider("iterations", 2, 1, 8, true);
    addSlider("polyN", 7, 5, 10, true);
    addSlider("polySigma", 1.5, 1.1, 2);
    addToggle("FARNEBACK_GAUSSIAN", true);

    addPanel("calcOpticalFlowPyrLK");
    addSlider("winSize", 32, 4, 64, true);
    addSlider("maxLevel", 3, 0, 8, true);
    addSlider("maxFeatures", 200, 1, 1000);
    addSlider("qualityLevel", 0.01, 0.001, .02);
    addSlider("minDistance", 4, 1, 16);

    settings->quadWarpOriginal[0].set(0, 0);
    settings->quadWarpOriginal[1].set(frameWidth, 0);
    settings->quadWarpOriginal[2].set(frameWidth, frameHeight);
    settings->quadWarpOriginal[3].set(0, frameHeight);

    settings->quadWarpScaled[0].set(0, 0);
    settings->quadWarpScaled[1].set(frameWidth, 0);
    settings->quadWarpScaled[2].set(frameWidth, frameHeight);
    settings->quadWarpScaled[3].set(0, frameHeight);

    quadGui.setup("undist");
    quadGui.width  = frameWidth;
    quadGui.height = frameHeight;
    quadGui.disableAppEvents();

    ofPoint quadSrc[4];
    quadSrc[0].set(0, 0);
    quadSrc[1].set(frameWidth, 0);
    quadSrc[2].set(frameWidth, frameHeight);
    quadSrc[3].set(0, frameHeight);
    quadGui.setQuadPoints(quadSrc);
    quadGui.bCameraView = true;

}
Ejemplo n.º 10
0
void ProcessPanel::doCreation()
{
	/* create buttons */
	m_buttons.resize(10);
	m_panels.resize(10);

	addPanel(tr("FilterPanel"), Filter, new FilterPanel());
	addPanel(tr("FiltersPanel"), Filters, new FiltersPanel());
	addPanel(tr("TransformPanel"), Transform, new TransformPanel(800, 600));
	addPanel(tr("Point Operator Panel"), PointOperator,
		 new PointOperatorPanel());
	addPanel(tr("Contrast Panel"), Contrast, new ContrastPanel());

	/* create panels */
}
Ejemplo n.º 11
0
void TPinterface::initGUI() {
	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel = addPanel("Lights", 1);

	// You could also pass a reference to a variable from the scene class, if public

	addCheckboxToPanel(varPanel, "light0", &on0, 0);
	addCheckboxToPanel(varPanel, "light1", &on1, 1);
	addCheckboxToPanel(varPanel, "light2", &on2, 2);
	addCheckboxToPanel(varPanel, "light3", &on3, 3);
	addCheckboxToPanel(varPanel, "light4", &on4, 4);

	addButtonToPanel(varPanel, "Clock", 5);


	GLUI_RadioGroup* wireframeGroup = addRadioGroupToPanel(varPanel,&radioStatus, 6);

	addRadioButtonToGroup(wireframeGroup, "Textured");
	addRadioButtonToGroup(wireframeGroup, "Wireframed");



	GLUI_Listbox* listBox = addListboxToPanel(varPanel,"Textures",&listStatus, 7);

	listBox->add_item(0, "Default");
	listBox->add_item(1, "Earth");

}
Ejemplo n.º 12
0
void CtrlrManager::openPanelInternal(const ValueTree &panelTree)
{
	if (panelTree.isValid())
	{
		addPanel(panelTree, true);
	}
}
Ejemplo n.º 13
0
bool GUITabbedPanel::loadXMLSettings(XMLElement *element)
{
  if(!element || element->getName() != "TabbedPanel")
  {
     LOG_PRINT("Need a TabbedPanel node in the xml file");
	 return false;
  }

  XMLElement *child                = 0,
             *subChild             = 0;
  D3DXFROMWINEVECTOR3     bordersColor         = upperPanel->getBordersColor();
  D3DXFROMWINEVECTOR4     bgColor              = upperPanel->getBGColor();
  int         count                = 0;

  if(child = element->getChildByName("hScale"))
    fontScales.y = child->getValuef();

  if(child = element->getChildByName("wScale"))
    fontScales.x = child->getValuef();

  if(child = element->getChildByName("TabButtonsBordersColor"))
    XMLElement::loadRX_GY_BZf(*child, tabButtonsBordersColor);

  if(child = element->getChildByName("TabButtonsColor"))
    XMLElement::loadRX_GY_BZf(*child, tabButtonsColor);

  if(child = element->getChildByName("BordersColor"))
    XMLElement::loadRX_GY_BZf(*child, bordersColor);

  if(child = element->getChildByName("BGColor"))
    XMLElement::loadRX_GY_BZ_AWf(*child, bgColor);

  if(child = element->getChildByName("fontIndex"))
    fontIndex =  clampNS(child->getValuei(), 0, 50);

  setFontScales(fontScales);

  for(size_t i = 0; i < element->getChildrenCount(); i++)
  {
    if(!(child = element->getChild(i)))
      continue;

    const NSString &childName = child->getName();

    if(childName == "Panel")
    {
      GUIPanel *panel = new GUIPanel();
      if(!panel->loadXMLSettings(child) || !addPanel(panel))
        deleteObject(panel);
      continue;
    }
  }

  mainPanel->setBordersColor(bordersColor);
  mainPanel->setBGColor(bgColor);

  return GUIRectangle::loadXMLSettings(element) && lowerPanel->getWidgets().size();
}
Ejemplo n.º 14
0
void kitchenFrame::fillPanels()
{
    int pages = Notebook1->GetPageCount()-1;
    for(int t = pages; t > 0; --t) //deleting unnecessary pages
    {
        Notebook1->RemovePage(t);
    }
    OrderPanels.Clear();

    wxDateTime current = wxDateTime::Now();
    mysqlpp::Query query = conn->query();
    query << "SELECT `id`, `number` FROM `orders` WHERE `time` > '"<< wx2std(current.FormatISODate(), wxConvUI) <<"' AND `status` = 3";
    mysqlpp::StoreQueryResult res = query.store();
    if (res)
    {
        if(res.num_rows() != 0)
        {
            mysqlpp::Row row;
            mysqlpp::StoreQueryResult::size_type i;
            wxString panTitle;
            wxArrayInt orderIds;
            for (i = 0; i < res.num_rows(); ++i)
            {
                row = res[i];

                if(i % 3 == 0 && i != 0)
                {
                    addPanel(panTitle, orderIds);
                    panTitle.Clear();
                    orderIds.Clear();
                    panTitle << std2wx(std::string(row["number"]), wxConvUI);
                    orderIds.Add(int(row["id"]));
                }
                else
                {
                    wxString delim;
                    if(i != 0) delim = _T(" - ");
                    panTitle <<  delim << std2wx(std::string(row["number"]), wxConvUI);
                    orderIds.Add(int(row["id"]));
                }
            }
            addPanel(panTitle, orderIds);
        }
    }
}
Ejemplo n.º 15
0
void GraphSceneUI::initAnimationsPanel() {
	char* text = new char[256];

	strcpy(text, "Animations");
	GLUI_Panel* animationsPanel = addPanel(text);

	strcpy(text, "Restart");
	addButtonToPanel(animationsPanel, text, ANIMATIONS_RESET_BUTTON);
}
Ejemplo n.º 16
0
bool ofxGui::buildFromXml(string file)
{
	if(!mXmlDone)
		return false;
	
	if(!mGlobals->mXml.loadFile(file))
		return false;
	
	int numberOfTags = mGlobals->mXml.getNumTags("UI");
	
	if(numberOfTags != 1)
		return false;
	
	mObjects.clear();
	
	mXmlDone			= false;
	mGlobals->mXmlfile	= file;
	
	mGlobals->mXml.pushTag("UI", 0);

	mIsActive	= mGlobals->mXml.getValue("ISACTIVE", 0);
	mDoUpdate	= mGlobals->mXml.getValue("DOUPDATE", 0);

	mGlobals->buildFromXml();
	
	numberOfTags = mGlobals->mXml.getNumTags("OBJECT");
	
	if(numberOfTags > 0)
	{
		for(int i = 0; i < numberOfTags; i++)
		{
			mGlobals->mXml.pushTag("OBJECT", i);
			
			int		id		= mGlobals->mXml.getValue("ID", 0);
			string	type	= mGlobals->mXml.getValue("TYPE", "");
			string	name	= mGlobals->mXml.getValue("NAME", "");
			int		x		= mGlobals->mXml.getValue("LEFT", 0);
			int		y		= mGlobals->mXml.getValue("TOP", 0);
			int		border	= mGlobals->mXml.getValue("BORDER", 0);
			int		spacing	= mGlobals->mXml.getValue("SPACING", 0);
			
			if(type == "PANEL")
			{
				ofxGuiPanel* panel = addPanel(id, name, x, y, border, spacing);
				panel->buildFromXml();
			}
			
			mGlobals->mXml.popTag();
		}
	}
	
	mGlobals->mXml.popTag();
	
	mXmlDone = true;
	
	return true;
}
Ejemplo n.º 17
0
void GraphSceneUI::initShadersPanel() {
	char* text = new char[256];

	strcpy(text, "Shaders");
	GLUI_Panel* shadersPanel = addPanel(text);

	strcpy(text, "Wind");
	addSpinnerToPanel(shadersPanel, text, 2, &GraphScene::WIND, WIND_SPINNER);
}
Ejemplo n.º 18
0
void DemoInterface::initGUI()
{
	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel= addPanel("Teapot Shader", 1);
	addSpinnerToPanel(varPanel, "normScale", 2,NULL, 1);
	
	addColumn();

	varPanel= addPanel("Display List", 1);
	addCheckboxToPanel(varPanel, "Use", &(((DemoScene*) scene)->myDLObj->usingDL), 2);

	addColumn();
	
	varPanel= addPanel("Animations", 1);
	addButtonToPanel(varPanel, "Reset", 3);

	addColumn();

	addCheckbox( "Wireframe", &(((DemoScene*) scene)->wireframe), 4);
}
Ejemplo n.º 19
0
void TPinterface::initGUI()
{

	pgraph = &(((LightingScene*) scene)->pgraph);

	int* wire = &(((LightingScene*) scene)->wire);

	int* wind = &(((LightingScene*) scene)->wind);

	int * cam = &(((LightingScene*) scene)->activCam);

	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel= addPanel("Settings:", 1);


	GLUI_Panel *modepanel = addPanelToPanel(varPanel, "Mode", 1);
	GLUI_RadioGroup* wireFrameGroup = addRadioGroupToPanel(modepanel,wire);
	addRadioButtonToGroup(wireFrameGroup, "\tFill");
	addRadioButtonToGroup(wireFrameGroup, "\tWire");
	addRadioButtonToGroup(wireFrameGroup, "\tPoint");
	
	addColumnToPanel(varPanel);
	GLUI_Panel *cammodel = addPanelToPanel(varPanel, "Camera", 1);
	GLUI_RadioGroup* camerasGroup = addRadioGroupToPanel(cammodel,cam);
	for(int i = 0; i < cameras.size();i++)
	{

		addRadioButtonToGroup(camerasGroup, (char *)cameras[i].c_str());
	}
	addRadioButtonToGroup(camerasGroup, "Free Camera");
	

	addColumnToPanel(varPanel);
	GLUI_Panel *lightspanel = addPanelToPanel(varPanel, "Lights", 1);
	for(int i = 0; i < pgraph->getLights().size();i++)
	{
		if (pgraph->getLights()[i].enabled)
			addCheckboxToPanel(lightspanel,
			(char*)pgraph->getLights()[i].id.c_str(), NULL, i)->set_int_val(
			1);
		else
			addCheckboxToPanel(lightspanel,
			(char*)pgraph->getLights()[i].id.c_str(), NULL, i)->set_int_val(
			0);
	}

	addColumnToPanel(varPanel);
	GLUI_Panel *windpanel = addPanelToPanel(varPanel, "Wind", 1);
	GLUI_Spinner *spin=   addSpinnerToPanel(windpanel,"wind",GLUI_SPINNER_INT,wind,11);

	spin->set_int_limits(0,11,GLUI_LIMIT_WRAP);	

}
Ejemplo n.º 20
0
void CtrlrManager::restoreState (const ValueTree &savedTree)
{
	if (savedTree.isValid())
	{
		ctrlrManagerRestoring = true;

		restoreProperties (savedTree, managerTree);

		if (owner->getOverrides().isValid())
		{
			for (int i=0; i<owner->getOverrides().getNumProperties(); i++)
			{
				setProperty (owner->getOverrides().getPropertyName(i), owner->getOverrides().getPropertyAsValue(owner->getOverrides().getPropertyName(i), 0));
			}
		}

		managerTree.removeAllChildren (0);
		managerTree.addChild (ctrlrMidiDeviceManager.getManagerTree(), -1, 0);
		managerTree.addChild (ctrlrWindowManager.getManagerTree(), -1, 0);

		if (savedTree.getChildWithName(Ids::midiDeviceManager).isValid())
		{
			ctrlrMidiDeviceManager.restoreState (savedTree.getChildWithName(Ids::midiDeviceManager));
		}

		if (savedTree.getChildWithName(Ids::uiWindowManager).isValid())
		{
			ctrlrWindowManager.restoreState (savedTree.getChildWithName(Ids::uiWindowManager));
		}

		if (getInstanceMode() != InstanceMulti && savedTree.hasType (Ids::panelState))
		{
			restoreInstanceState (savedTree);
			return;
		}

		for (int i=0; i<savedTree.getNumChildren(); i++)
		{
			if (savedTree.getChild(i).hasType (Ids::panel))
			{
				addPanel (savedTree.getChild(i));
			}
		}

		if (ctrlrEditor)
		{
			restoreEditorState();
		}

		ctrlrManagerRestoring = false;
	}
}
Ejemplo n.º 21
0
void TPinterface::initGUI() {

	// Check CGFinterface.h and GLUI documentation for the types of controls available
	GLUI_Panel *varPanel1 = addPanel("LIGHTS", 1);
	addColumn();
	GLUI_Panel *varPanel2 = addPanel("CLOCK", 1);
	addColumn();
	GLUI_Panel *varPanel3 = addPanel("Robot Textures", 1);
	addColumn();
	GLUI_Panel *varPanel4 = addPanel("Robot Mode", 1);

	//light0
	addCheckboxToPanel(varPanel1, "light 0", &l0en, 1); 
	//light1
	addCheckboxToPanel(varPanel1, "light 1", &l1en, 2);
	//light2
	addCheckboxToPanel(varPanel1, "light 2", &l2en, 3);
	//light3
	addCheckboxToPanel(varPanel1, "light 3", &l3en, 4);

/*
	//Clock
	addButtonToPanel(varPanel2, "Pause/Restart", 5); 

	//Textures listbox
	GLUI_Listbox *listbox = addListboxToPanel(varPanel3, "Textures ", &robotText, 6);

	listbox->add_item(0, "Basic");
	listbox->add_item(1, "Serpentine");
	listbox->add_item(2, "Aco");
	listbox->add_item(3, "Robot");

	//Texture and wireframe

	GLUI_RadioGroup *rButton = addRadioGroupToPanel(varPanel4, &robotMode, 7);
	addRadioButtonToGroup(rButton, "Textured");
	addRadioButtonToGroup(rButton, "Wireframe");*/

}
RazorPanelApplication::RazorPanelApplication(int& argc, char** argv, const QString &configFile)
    : RazorApplication(argc, argv)
{
    if (configFile.isEmpty())
        mSettings = new RazorSettings("panel", this);
    else
        mSettings = new RazorSettings(configFile, QSettings::IniFormat, this);

    QStringList panels = mSettings->value("panels").toStringList();

    Q_FOREACH(QString i, panels)
    {
        addPanel(i);
    }
Ejemplo n.º 23
0
void GraphSceneUI::initShadingModePanel() {
	char* text = new char[256];

	strcpy(text, "Shading Mode");
	GLUI_Panel* shadingModePanel = addPanel(text);

	GLUI_RadioGroup* shadingModeGroup = addRadioGroupToPanel(shadingModePanel,
			&shadingModeRadioGroupSelectedItemID, SHADING_MODE_RADIO_GROUP);

	strcpy(text, "Flat");
	addRadioButtonToGroup(shadingModeGroup, text);
	strcpy(text, "Gouraud");
	addRadioButtonToGroup(shadingModeGroup, text);
}
Ejemplo n.º 24
0
void GraphSceneUI::initLightsPanel() {
	char* text = new char[256];

	strcpy(text, "Lights");
	GLUI_Panel* lightsPanel = addPanel(text);

	vector<Light*>* lights = ((GraphScene*) scene)->getLights()->getLights();

	for (unsigned int i = 0; i < lights->size(); i++) {
		Light* light = (*lights)[i];

		strcpy(text, light->getStrID().c_str());
		addCheckboxToPanel(lightsPanel, text, light->getEnabled());
	}
}
Ejemplo n.º 25
0
void GameInterface::initGUI()
{
	int* option= &((XMLScene*) scene)->option;
	/*
	GLUI_Panel *varPanel1 = addPanel("Cameras", 1);
	int* camera = &((XMLScene*) scene)->camera;
	GLUI_Listbox *texturesListbox =addListboxToPanel(varPanel1,"Camera: ",camera,7);
	unsigned int size=((XMLScene*) scene)->file->sceneCameras.size();
	for(unsigned int i = 0;i<size;i++)
	{
	texturesListbox->add_item (i, ((XMLScene*) scene)->file->sceneCameras[i].first);
	}

	//addColumn();
	GLUI_Panel *varPanel2 = addPanel("Draw Mode", 1);
	varPanel2->set_alignment(0);
	GLUI_RadioGroup* radioGroup = addRadioGroupToPanel(varPanel2,&((XMLScene*) scene)->drawmode,3);
	addRadioButtonToGroup(radioGroup,"Fill");
	addRadioButtonToGroup(radioGroup,"Line");
	addRadioButtonToGroup(radioGroup,"Point");

	addColumn();
	*/
	GLUI_Panel *gameModePanel = addPanel("Game", 1);
	gameModePanel->set_alignment(0);
	GLUI_Listbox* themeListBox =addListboxToPanel(gameModePanel,"Theme: ",option,8);
	themeListBox->add_item (0, "Classic");
	themeListBox->add_item (1, "Minecraft");
	GLUI_Button* undo = addButtonToPanel(gameModePanel,"Undo",12);
	addColumnToPanel(gameModePanel);
	GLUI_Listbox* gameModeListbox=addListboxToPanel(gameModePanel,"Game Mode", &((XMLScene*) scene)->data->gameMode,9);
	gameModeListbox->add_item(1,"PVP");
	gameModeListbox->add_item(2,"Player vs PC");
	gameModeListbox->add_item(3,"PC vs PC");
	GLUI_Button* redo = addButtonToPanel(gameModePanel,"Redo",13);
	addColumnToPanel(gameModePanel);
	GLUI_Panel* difficultiesPanel=addPanelToPanel(gameModePanel,"Difficulties",1);;
	difficultiesPanel->set_alignment(0);
	GLUI_Listbox* difficulty1Listbox=addListboxToPanel(difficultiesPanel,"Computer 1", &((XMLScene*) scene)->data->difficulties[0],10);
	difficulty1Listbox->add_item(1,"Normal");
	difficulty1Listbox->add_item(2,"Hard");
	GLUI_Button* restart = addButtonToPanel(gameModePanel,"Restart",14);
	GLUI_Listbox* difficulty2Listbox=addListboxToPanel(difficultiesPanel,"Computer 2", &((XMLScene*) scene)->data->difficulties[1],11);
	difficulty2Listbox->add_item(1,"Normal");
	difficulty2Listbox->add_item(2,"Hard");
	GLUI_Button* gameFilm = addButtonToPanel(gameModePanel,"Game Film",15);

}
Ejemplo n.º 26
0
void GraphSceneUI::initDrawingModePanel() {
	char* text = new char[256];

	strcpy(text, "Drawing Mode");
	GLUI_Panel* drawingModePanel = addPanel(text);

	GLUI_RadioGroup* drawingModeGroup = addRadioGroupToPanel(drawingModePanel,
			&drawingModeRadioGroupSelectedItemID, DRAWING_MODE_RADIO_GROUP);

	strcpy(text, "Point");
	addRadioButtonToGroup(drawingModeGroup, text);
	strcpy(text, "Line");
	addRadioButtonToGroup(drawingModeGroup, text);
	strcpy(text, "Fill");
	addRadioButtonToGroup(drawingModeGroup, text);
}
Ejemplo n.º 27
0
CtrlrPanel *CtrlrManager::addPanel(const ValueTree &savedState, const bool showUI)
{
	CtrlrPanel *panel = new CtrlrPanel(*this, getUniquePanelName("Ctrlr Panel"), ctrlrPanels.size());

	ctrlrPanels.add (panel);
	panel->restoreState (savedState);
	managerTree.addChild (panel->getPanelTree(), -1, 0);

	if (showUI)
	{
		addPanel (panel->getEditor(true));
	}

	organizePanels();

	return (panel);
}
Ejemplo n.º 28
0
void GraphSceneUI::initCamerasPanel() {
	char* text = new char[256];

	strcpy(text, "Cameras");
	GLUI_Panel* camerasPanel = addPanel(text);

	GLUI_RadioGroup* camerasGroup = addRadioGroupToPanel(camerasPanel,
			&activeCameraRadioGroupSelectedItemID, ACTIVE_CAMERA_RADIO_GROUP);

	map<string, Camera*>* cameras =
			((GraphScene*) scene)->getCameras()->getCameras();
	map<string, Camera*>::iterator it;

	for (it = cameras->begin(); it != cameras->end(); it++) {
		strcpy(text, it->second->getId().c_str());
		addRadioButtonToGroup(camerasGroup, text);
	}
}
Ejemplo n.º 29
0
void CtrlrManager::openPanelInternal(const File &fileToOpen)
{
	setProperty(Ids::lastBrowsedPanelDir, fileToOpen.getParentDirectory().getFullPathName());

	ValueTree panelTree;

	if (fileToOpen.getFileExtension().startsWith(".b"))
	{
		panelTree = CtrlrPanel::openBinPanel(fileToOpen);
	}
	else
	{
		panelTree = CtrlrPanel::openXmlPanel(fileToOpen);
	}
	if (panelTree.isValid())
	{
		addPanel(panelTree, true);
	}
}
Ejemplo n.º 30
0
//--------------------------------------------------------------
void MidiController::addPanel(ofxGuiGroup* panel){
    for (int i = 0; i < panel->getNumControls(); i++) {
        ofxBaseGui* control = panel->getControl(i);
        
        bool isGroup = control->getParameter().type() == typeid(ofParameterGroup).name();
        
        if(isGroup){
            ofxGuiGroup& group = panel->getGroup(control->getName());
            addPanel(&group);   // recursion
        }
        else{
            
            if(isMappeable(control->getParameter())){
                // store control (avoid duplicate keys)
                // TODO: we still can have duplicated names when the panels are nested
                // eg: when we have subgroups of parameters
                string uniqueName = ofToString(panels.size()) + "-" + control->getName();
                controls[uniqueName] = control;
            }
        }
    }
    
    panels.push_back(panel);
}