Пример #1
0
//------------------------------------------------------ SETTINGS
void MSAParticleSystem3D::addSettings( ofxSimpleGuiToo & _gui )
{
    gui_particle_page = &_gui.addPage("Particle System");
    _gui.addTitle( "Particle Settings"); //.setNewColumn(true);
	_gui.addSlider( "gravity", gravity, -5, 5);
    _gui.addButton( "Update Gravity", update_gravity );
    _gui.addSlider( "numberOfParticles", numberOfParticles, 0, 100000 );
    maingroup->addSettings( _gui );
}
Пример #2
0
void ofxSimpleGuiToo::setup() {
	config			= &defaultSimpleGuiConfig;
	
	doSave			= false;
	changePage		= false;
	titleButton		= NULL;
	keyboardShortcutsEnabled = true;
	doDrawPageBoundary = false;
	
	headerPage		= &addPage("Header");
	headerPage->height = config->buttonHeight * 2;
	headerPage->width = 0;
	titleButton = &headerPage->addButton("title", changePage);
	headerPage->addToggle("Auto Save", doAutoSave);
	headerPage->addButton("Save Settings", doSave);
	headerPage->addFPSCounter();
	
	cols = ceilf(ofGetWidth() / config->gridSize.x);
	rows = ceilf(ofGetHeight() / config->gridSize.y);
	
	addPage(); // default settings page
	addFPSCounter();
	
	setAutoSave(true);
	setAlignRight(false);
	setDraw(false);
	
	
	//addToggle("", <#bool value#>)
	
	//addControl(*titleButton);
	
	page(1).addPageShortcut(addPage("Keyboard Shortcuts"));
	page(1).addPageShortcut(addPage("GUI"));
	//setPage("GUI");
	addButton("save settings", doSave);
	addToggle("auto save", doAutoSave);
	//gui.addTitle("gui display");

	gui.addTitle("controls");
	string choices[] = {"simple","advanced","all"};
	gui.addComboBox("display priority", ofxSimpleGuiPage::mainPriority, 3, choices);
	gui.addButton("collapse all", 't', this, &ofxSimpleGuiToo::closeAllTitles);
	gui.addButton("open all", 'T', this, &ofxSimpleGuiToo::openAllTitles);
	
	gui.addTitle("display mode");
	string displayModeChoices[GUI_MODE_COUNT] = {"fixed","floating"};
	addComboBox("display mode", displayMode, GUI_MODE_COUNT, displayModeChoices);
	gui.addTitle("floating parameters");
	gui.addSlider("x", displayRect.x, 0, ofGetWidth());
	gui.addSlider("y", displayRect.y, 0, ofGetHeight());
	gui.addSlider("columns", cols, 1, 10);
	gui.addSlider("rows", rows, 5, 30);
	gui.addButton("reset", this, &ofxSimpleGuiToo::setDefaultDimensions);
	gui.addToggle("draw boundaries", doDrawPageBoundary);
	//gui.addSlider("gui width", displayRect.width, 256, ofGetWidth());
	//gui.addSlider("gui height", displayRect.height, 256, ofGetHeight());

	setPage(1);
	
	//addSlider("advanced gui", ofxSimpleGuiControl::mainPriority, 0, 2);
	ofAddListener(ofEvents.keyPressed, this, &ofxSimpleGuiToo::keyPressed);
}