当前位置: 首页>>代码示例>>C++>>正文


C++ ofxUIEventArgs类代码示例

本文整理汇总了C++中ofxUIEventArgs的典型用法代码示例。如果您正苦于以下问题:C++ ofxUIEventArgs类的具体用法?C++ ofxUIEventArgs怎么用?C++ ofxUIEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ofxUIEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mainUiEvent

void ofxUITabBar::mainUiEvent(ofxUIEventArgs &event)
{
    string name = event.getName();
    for (map<ofxUIToggle*, ofxUICanvas*>::iterator it=canvases.begin(); it!=canvases.end(); ++it)
    {
        if(active != NULL && active->getName() == name)
        {
            it->first->setValue(false);
            it->second->disable();
            active = NULL;
        }
        else if(it->second->getName() == name && event.getToggle()->getValue())
        {
            active = it->second;
            it->first->setValue(true);
            it->second->enable();
            it->second->setPosition(rect->getX() + rect->getWidth() + padding*0.5, this->rect->getY());
        }
        else
        {
            it->first->setValue(false);
            it->second->disable();
        }
    }
}
开发者ID:danoli3,项目名称:ofxUI,代码行数:25,代码来源:ofxUITabBar.cpp

示例2: guiEvent

void testApp::guiEvent(ofxUIEventArgs &e) {
  string name = e.widget->getName();
    
  if ( name == "PLAYHEAD" && videoPlayer.isPlaying() )
    videoPlayer.setPosition( e.getSlider()->getValue() );
  else if ( name == "MUTE" )
    videoPlayer.setVolume( e.getToggle()->getValue() ? 0.0 : 1.0 );
  else if ( name == "USE WEBCAM" ) {
    if ( e.getToggle()->getValue() ) {
      if ( videoSource != &videoGrabber ) {
        cout << "switching back to webcam" << endl;
        videoSource = &videoGrabber;
        vfx1.setVideoSource( videoSource );
        videoPlayer.stop();
      }
    }
    else {
      // if there is no video loaded, we stick with webcam
      if ( !videoPlayer.isLoaded() ) {
        cout << "no video loaded... sticking with webcam" << endl;
        e.getToggle()->setValue( true );
      }
      else {
        // make sure the video player is still playing
        if ( !videoPlayer.isPlaying() ) videoPlayer.play();
        videoSource = &videoPlayer;
        vfx1.setVideoSource( videoSource );
        videoPlayer.play();
      }
    }
        
  }
}
开发者ID:HellicarAndLewis,项目名称:ProjectVictory,代码行数:33,代码来源:testApp.cpp

示例3: checkOverlapingDDL

void GUIAxes::checkOverlapingDDL(ofxUIEventArgs & e){

    switch (e.getKind()) {
        case OFX_UI_WIDGET_DROPDOWNLIST:
        {bool hideothers = ((ofxUIDropDownList*)e.widget)->getValue();
            
            if(e.getCanvasParent()!=NULL){
                
                vector<ofxUIWidget*> vv = e.getCanvasParent()->getWidgetsOfType(OFX_UI_WIDGET_DROPDOWNLIST);
                for(vector<ofxUIWidget*>::iterator it = vv.begin() ; it !=vv.end() ; ++it){
                    if(e.widget->getRect()->x ==  (*it)->getRect()->x && e.widget->getRect()->y <  (*it)->getRect()->y &&((ofxUIDropDownList*)*it)!=e.widget){
                        
                        ((ofxUIDropDownList*)*it)->setVisible(!hideothers);
                    }
                }
            }
        }
            break;
            
            
        default:
            break;
    }
    
}
开发者ID:EQ4,项目名称:Viza,代码行数:25,代码来源:GUIAxes.cpp

示例4: guiEvent

void TestScene::guiEvent(ofxUIEventArgs &e)
{
    
    string name = e.getName();
	int kind = e.getKind();
	//cout << "got event from: " << name << endl;
    
}
开发者ID:RecoilPerformanceGroup,项目名称:Tumult,代码行数:8,代码来源:TestScene.cpp

示例5: selectAudioUnit

//-------------
void ofApp::selectAudioUnit(ofxUIEventArgs &e) {
    if (e.getButton()->getValue())  return;
    if (e.getName() == "Aalto") {
        setupAalto();
    }
    else if (e.getName() == "Kaivo") {
        setupKaivo();
    }
}
开发者ID:alessandrostone,项目名称:OF-tools-and-templates,代码行数:10,代码来源:ofApp.cpp

示例6: guiEvent

void ofApp::guiEvent(ofxUIEventArgs &e)
{
	string name = e.getName();
	int kind = e.getKind();
	cout << "got event from: " << name << endl;
    if(kind == OFX_UI_WIDGET_NUMBERDIALER)
    {
        ofxUINumberDialer *n = (ofxUINumberDialer *) e.widget;
        cout << n->getValue() << endl;
    }
	
    if(name == "SAMPLER")
    {
        ofxUIImageSampler *is = (ofxUIImageSampler *) e.widget;
        ofColor clr = is->getColor();
        red = clr.r;
        blue = clr.b;
        green = clr.g;
    }
	else if(name == "BUTTON")
	{
		ofxUIButton *button = (ofxUIButton *) e.getButton();
		bdrawGrid = button->getValue();
	}
	else if(name == "TOGGLE")
	{
		ofxUIToggle *toggle = (ofxUIToggle *) e.getToggle();
		bdrawGrid = toggle->getValue();
        if(textInput != NULL)
        {
            textInput->setFocus(bdrawGrid);
        }
	}
    else if(name == "RADIO VERTICAL")
    {
        ofxUIRadio *radio = (ofxUIRadio *) e.widget;
        cout << radio->getName() << " value: " << radio->getValue() << " active name: " << radio->getActiveName() << endl; 
    }
    else if(name == "TEXT INPUT")
    {
        ofxUITextInput *ti = (ofxUITextInput *) e.widget;
        if(ti->getInputTriggerType() == OFX_UI_TEXTINPUT_ON_ENTER)
        {
            cout << "ON ENTER: ";
        }
        else if(ti->getInputTriggerType() == OFX_UI_TEXTINPUT_ON_FOCUS)
        {
            cout << "ON FOCUS: ";
        }
        else if(ti->getInputTriggerType() == OFX_UI_TEXTINPUT_ON_UNFOCUS)
        {
            cout << "ON BLUR: ";
        }
        string output = ti->getTextString();
        cout << output << endl;
    }
}
开发者ID:Aharobot,项目名称:ofxUI,代码行数:57,代码来源:ofApp.cpp

示例7: guiEvent

//--------------------------------------------------------------
void TestScene::guiEvent(ofxUIEventArgs &e) {
    name = e.getName() ; 
    if ( name == "LOAD SETTINGS" && e.getButton()->getValue() == true )
        loadSettings() ;
    
    if ( name == "SAVE SETTINGS" && e.getButton()->getValue() == true )
        saveSettings() ;
    
}
开发者ID:firmread,项目名称:ofxOpenVJ,代码行数:10,代码来源:TestScene.cpp

示例8: guiEvent

//--------------------------------------------------------------
void AnimationWaves::guiEvent(ofxUIEventArgs &e)
{
	Animation::guiEvent(e);

	string name = e.getName();
	if (name == "nbWavePoints")
	{
		m_nbWavePoints = (int) e.getSlider()->getScaledValue();
		updateNbPointsForWaves();
	}
}
开发者ID:v3ga,项目名称:murmur,代码行数:12,代码来源:animationWaves.cpp

示例9: guiSystemEvent

void CloudsVisualSystemPaintBrush::guiSystemEvent(ofxUIEventArgs &e)
{
    if (e.widget->getKind() == OFX_UI_WIDGET_TOGGLE && e.getToggle()->getValue()) {
		string name = e.getName();
        for (map<string, ofPixels *>::iterator it = colorMapPixelsMap.begin(); it != colorMapPixelsMap.end(); it++) {
			if (it->first == name) {
				colorMap = it->second;
			}
		}
	}
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:CLOUDS,代码行数:11,代码来源:CloudsVisualSystemPaintBrush.cpp

示例10: guiEvent

void ofApp::guiEvent(ofxUIEventArgs &e){
    string name = e.getName();
    int kind = e.getKind();
    
    if (name=="simulate") {
        simulate = ((ofxUIToggle *)e.widget)->getValue();
    } else if (name == "enable actuator 1"){
        enableActuator(1);
    } else if (name == "enable actuator 2"){
        enableActuator(2);
    }
    
}
开发者ID:SEADnetwork,项目名称:BiomoddLondonController,代码行数:13,代码来源:ofApp.cpp

示例11: guiEvent

void ofApp::guiEvent(ofxUIEventArgs &e)
{
    if (e.getName() == "FULLSCREEN")
    {
        ofxUIToggle* toggle = e.getToggle();
        ofSetFullscreen(toggle->getValue());
    }
    else if (e.getName() == "ENABLE FACE TRACKING")
    {
        ofxUIToggle* toggle = e.getToggle();
        trackingEnabled = toggle->getValue();
    }
    else if (e.getName() == "SHOW TRACKER")
    {
        ofxUIToggle* toggle = e.getToggle();
        showTracker = toggle->getValue();
    }
    else if (e.getName() == "SET TRACKER OFFSET") {
        ofxUIButton *button = (ofxUIButton *)e.widget;
        if (button->getValue()) {
            trackerOffset = ofVec2f(cam.getPosition().x - trackerOffset.x,
                    cam.getPosition().y - trackerOffset.y);
        }
    }
    else if (e.getName() == "REMOVE TRACKER OFFSET") {
        ofxUIButton *button = (ofxUIButton *)e.widget;
        if (button->getValue()) {
            trackerOffset = ofVec2f();
        }
    }
}
开发者ID:wiped1,项目名称:vr3d,代码行数:31,代码来源:ofApp.cpp

示例12: guiEvent

void ofApp::guiEvent(ofxUIEventArgs &e)
{
	string name = e.getName();
	cout << "got event from: " << name << endl;
    if(name == "VAR")
    {
		ofxUISlider *sliderValue = (ofxUISlider *) e.getSlider();
		ofxOscMessage m;
		m.setAddress("/var");
		m.addFloatArg(sliderValue->getValue());
		sender.sendMessage(m);
		
	}
}
开发者ID:wasawi,项目名称:my_examples,代码行数:14,代码来源:ofApp.cpp

示例13: guiSystemEvent

void CloudsVisualSystemFlocking::guiSystemEvent(ofxUIEventArgs &e){
    string name = e.getName();
    if(name == "ADD PARTICLE")
    {
        if(e.getButton()->getValue())
        {
            for(int i = 0; i < 100; i++)
            {
                ofxBoidParticle *bp = new ofxBoidParticle(ofVec3f(ofRandom(-debugGridSize, debugGridSize), ofRandom(-debugGridSize, debugGridSize), ofRandom(-debugGridSize, debugGridSize)));
                bp->setParticlesRef(&ps->getParticles());
                ps->addParticle(bp);
            }
        }
    }
    else if(name == "BORDER")
    {
        *(ps->bWidth) = debugGridSize;
        *(ps->bHeight) = debugGridSize;
        *(ps->bDepth) = debugGridSize;
    }
    else if(name == "ZONE RADIUS")
    {
        (*ps->zoneRadiusHalf) = (*ps->zoneRadius)/2.0;
        (*ps->zoneRadiusSqrd) = powf((*ps->zoneRadius), 2.0);
    }
    else if(name == "KILL PARTICLES")
    {
        if(e.getButton()->getValue())
        {
            ps->clear();
        }
    }
    else if(name == "PRINT SETTINGS")
    {
        if(e.getButton()->getValue())
        {
            ps->printSettings();
        }
    }
    else if(name == "RANDOMIZE")
    {
        if(e.getButton()->getValue())
        {
            randomize();
        }
    }
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:Flocking,代码行数:47,代码来源:CloudsVisualSystemFlocking.cpp

示例14: guiEvent

void SuperColliderLoopElement::guiEvent(ofxUIEventArgs &e) {
    if (e.getName() == "Play") {
        setPlaying(isPlay);
    }
    else if (e.getName() == "Rec") {
        setToRecord(toRecord);
    }
    else if (e.getName() == "Solo") {
        setSolo(solo);
        SuperColliderLoopElement *ref = this;
        ofNotifyEvent(soloEvent, ref);
    }
    else if (e.getName() == "Del") {
        SuperColliderLoopElement *ref = this;
        ofNotifyEvent(deleteEvent, ref);
    }
    else if (e.getName() == "Skip") {
        skip = pow((float) 2, (float) ((ofxUIRadio *) gui->getWidget("Skip"))->getValue());
        count = beat % (numBeats * getSkip());
    }
    else if (e.getName() == "BusIn") {
        int channel = ((ofxUIRadio *) gui->getWidget("BusIn"))->getValue();
        bufWriter->set("channel", channel);
    }
    else if (e.getName() == "Volume") {
        cout << "write vol " << volume << endl;
        bufReader->set("volume", volume);
    }
}
开发者ID:genekogan,项目名称:SuperCollider,代码行数:29,代码来源:SuperColliderLooper.cpp

示例15: guiEvent

//--------------------------------------------------------------
void ofApp::guiEvent(ofxUIEventArgs &e)
{
    string name = e.getName();
    string alignment = "alignment";
    if(name == "pixelWidth" || name == "pixelWidthLarge"){
        ((ofxUITextInput*)settingCanvas->getWidget("pixelWidthText"))->setTextString(ofToString(float(desideredPixelWidthLarge)+desideredPixelWidth));
    }else if(name == "pixelWidthText"){
        string val = ((ofxUITextInput*)e.widget)->getTextString();
        float fval = ofToFloat(val);
        desideredPixelWidth = fmodf(fval,1.0);
        desideredPixelWidthLarge = floor(fval);
        
        
    }else if(name == "Calibrate Menu"){
        lastState = state;
        state = Calibratig;
        settingCanvas->setVisible(false);
        calibrateCanvas->setVisible(true);
    }else if(name.substr(0,alignment.size()) == alignment ){
        int start = alignment.size()+1;
        int x = ofToInt(name.substr(start,start+1));
        int y = ofToInt(name.substr(start+2,start+3));
        texAlign.x = x == 0 ? 0 : x == 1 ? 0.5 : 1.0;
        texAlign.y = y == 0 ? 1.0 : y == 1 ? 0.5 : 0.0;

    }else if(name == "Settings Menu"){
        lastState = state;
        state = Settings;
        settingCanvas->setVisible(true);
        calibrateCanvas->setVisible(false);
        
    }else if(name == "Calibration Size"){
        ofxUIRadio* w = ((ofxUIRadio*)e.widget);
        string active = w->getActiveName();
        vector<string> names(calibrationSizeOptionsNames,end(calibrationSizeOptionsNames));
        int pos = find(names.begin(), names.end(), active) - names.begin();
        ((ofxUILabel*)calibrateCanvas->getWidget("selected_calibration"))->setLabel(calibrationSizeOptionsNames[pos]);
        currentCalibratorTolLengthInMM = calibrationSizeOptionsValues[pos];
        
    }else if(name == "Read From Marker"){
        outPixelPerMM = calibratorTool.getLength() / currentCalibratorTolLengthInMM;
        
    }else if(name == "Syphon Servers"){
        ofxUIRadio *syphon_list = (ofxUIRadio*)e.widget;
        string active = syphon_list->getActiveName();
        vector<string> parts = ofSplitString(active, "::");
        syphonServerDesc = ofxSyphonServerDescription(parts[0],parts[1]);
        syphonClient.set(syphonServerDesc);
    }else if(name == "Mode"){
        ofxUIRadio *mode_list = (ofxUIRadio*)e.widget;
        if(mode_list->getActiveName() == "Round"){
            mode = 0;
        }else {
            mode = 1;
        }
    }
}
开发者ID:igierard,项目名称:low-res-preview,代码行数:58,代码来源:ofApp.cpp


注:本文中的ofxUIEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。