void ofxUITabBar::addCanvas(ofxUIScrollableCanvas *_canvas) { ofxUIToggle* newToggle = addToggle(_canvas->getName(), false); canvases.insert ( pair<ofxUIToggle*, ofxUICanvas*>( newToggle, _canvas) ); _canvas->disable(); autoSizeToFitWidgets(); }
void ofxUITabBar::initTabBar() { kind = OFX_UI_WIDGET_TABBAR; autoSizeToFitWidgets(); ofAddListener(newGUIEvent, this, &ofxUITabBar::mainUiEvent); active = NULL; }
void ofxUISuperCanvas::maximize() { for(vector<ofxUIWidget *>::iterator it = widgets.begin(); it != widgets.end(); ++it) { ofxUIWidget *w = (*it); if(w != NULL) { w->setVisible(true); } } autoSizeToFitWidgets(); }
ramPresetTab::ramPresetTab() :ofxUITab("Presets", false) ,preset_cam_index(1) ,use_node_cam(false) ,cam_position(false) ,cam_look_at(false) { // should probably be a list of named presets instead of a grid addLabelButton("Line", false); addLabelButton("Hasty Chase", false); addLabelButton("HC + Stamp", false); addLabelButton("HC + Stamp + Natto", false); addLabelButton("HC + Future", false); addLabelButton("Line + Future", false); // ignore win32 #ifndef TARGET_WIN32 addLabelButton("Particles + Future", false); addLabelButton("Particles", false); #else addLabelButton("Future", false); // only for windows #endif addSpacer(); vector<string> cameraPresetNames; cameraPresetNames.push_back("Low"); cameraPresetNames.push_back("High"); cameraPresetNames.push_back("Overhead"); preset_cam_radio = addRadio("Camera position", cameraPresetNames); preset_cam_radio->getToggles()[preset_cam_index]->setValue(true); addSpacer(); // nodecam addLabel("NodeCam", OFX_UI_FONT_LARGE); addLabel("1. Click a node on actor", OFX_UI_FONT_SMALL); addLabel("which you want to set as", OFX_UI_FONT_SMALL); addLabel("camera pos or lookAt.", OFX_UI_FONT_SMALL); addLabel("2. Click a button below.", OFX_UI_FONT_SMALL); addLabel("a joint with red circle", OFX_UI_FONT_SMALL); addLabel("will be set as pos or lookAt.", OFX_UI_FONT_SMALL); addButton("Set Camera Position", &cam_position, 15, 15); addButton("Set Camera LookAt", &cam_look_at, 15, 15); addLabel("3. Enable NodeCam.", OFX_UI_FONT_SMALL); addToggle("Enable Node Cam", &use_node_cam, 30, 30); autoSizeToFitWidgets(); ofAddListener(ofEvents().update, this, &ramPresetTab::update); ofAddListener(ofEvents().draw, this, &ramPresetTab::draw); ofAddListener(newGUIEvent, this, &ramPresetTab::guiEvent); }
void PMUICanvasRibbonRenderer::init(int posX, int posY, bool autosize, int width, int height) { PMUICanvasBaseRenderer::init(posX, posY, autosize, width, height); gradientImage.load("./gradients/gradient4x_512x160.png"); numGradients = 4; setGlobalSliderHeight(10); setGlobalButtonDimension(14); { // Brush (basic) addSpacer(); addLabel(STR_BRUSH_BASIC); addIntSlider(STR_BRUSH_BASIC_NUMPAINTERS, 1, 100, &numPainters); addIntSlider(STR_BRUSH_BASIC_WIDTH, 1, 10, &strokeWidth); addSlider(STR_BRUSH_BASIC_SPEED, 1.01f, 100, &speed); addToggle(STR_BRUSH_BASIC_ENABLEBOUNCE, &enableBounce); } { // Brush (advanced) addSpacer(); addLabel(STR_BRUSH_ADVANCED); addSlider(STR_BRUSH_ADVANCED_DIVISIONS, 0.001, 4.5, &divisions); // addSlider(STR_BRUSH_ADVANCED_EASE, -1.0, 10.0, &ease); // addSlider("Ease Randomness",0.0,1.0,&easeRandomness); // addIntSlider(STR_BRUSH_ADVANCED_MAXVERT,3, 4000, &pathMaxVertices); addSlider("Next Position Delta",0.0,1.0,&nextPositionDelta); } { // Color mode addSpacer(); addLabel(STR_BRUSH_COLORMODE); vector<string> colorModesNames; colorModesNames.push_back(STR_BRUSH_COLORMODE_MFIXEDCOLOR); colorModesNames.push_back(STR_BRUSH_COLORMODE_MGRSPEED); colorModesNames.push_back(STR_BRUSH_COLORMODE_MGREDGES); addRadio(STR_BRUSH_COLORMODE_RADIO, colorModesNames, OFX_UI_ORIENTATION_VERTICAL); addImageSampler(STR_BRUSH_COLORMODE_GRIMAGE, &gradientImage); addIntSlider(STR_BRUSH_COLORMODE_GRID, 1, 4, &gradientId); addIntSlider(STR_BRUSH_COLORMODE_GRSPEED, 1, 500, &gradientSpeed); addIntSlider(STR_BRUSH_COLORMODE_R, 0, 255, &colorR); addIntSlider(STR_BRUSH_COLORMODE_G, 0, 255, &colorG); addIntSlider(STR_BRUSH_COLORMODE_B, 0, 255, &colorB); } if (autosize) autoSizeToFitWidgets(); loadPreset(selectedPreset); }
ramPresetTab::ramPresetTab() :ofxUITab("Presets", false) ,cameraPreset(1) { // should probably be a list of named presets instead of a grid matrix = addToggleMatrix("Presets", 4, 4); matrix->setAllowMultiple(false); addSpacer(); vector<string> cameraPresetNames; cameraPresetNames.push_back("Low"); cameraPresetNames.push_back("High"); cameraPresetNames.push_back("Overhead"); cameraPresetRadio = addRadio("Camera position", cameraPresetNames); cameraPresetRadio->getToggles()[cameraPreset]->setValue(true); autoSizeToFitWidgets(); ofAddListener(ofEvents().update, this, &ramPresetTab::setupCamera); ofAddListener(newGUIEvent, this, &ramPresetTab::guiEvent); }