Exemple #1
0
bool ofxPanel::setValue(float mx, float my, bool bCheck){

	if( !isGuiDrawing() ){
		bGrabbed = false;
		bGuiActive = false;
		return false;
	}
	if( bCheck ){
		if( b.inside(mx, my) ){
			bGuiActive = true;

			if( my > b.y && my <= b.y + header ){
				bGrabbed = true;
				grabPt.set(mx-b.x, my-b.y);
			} else{
				bGrabbed = false;
			}

			if(loadBox.inside(mx, my)) {
				loadFromFile(filename);
				ofNotifyEvent(loadPressedE,this);
				return true;
			}
			if(saveBox.inside(mx, my)) {
				saveToFile(filename);
				ofNotifyEvent(savePressedE,this);
				return true;
			}
		}
	} else if( bGrabbed ){
		setPosition(mx - grabPt.x,my - grabPt.y);
		return true;
	}
	return false;
}
Exemple #2
0
bool ofxGuiGroup::setValue(float mx, float my, bool bCheck){
    
	if( !isGuiDrawing() ){
		bGuiActive = false;
		return false;
	}


	if( bCheck ){
		if( b.inside(mx, my) ){
			bGuiActive = true;

			ofRectangle minButton(b.x+b.width-textPadding*3,b.y,textPadding*3,header);
			if(minButton.inside(mx,my)){
				minimized = !minimized;
				if(minimized){
					minimize();
				}else{
					maximize();
				}
				return true;
			}
        }
	}

	return false;
}
Exemple #3
0
bool ofxSlider<Type>::mouseMoved(ofMouseEventArgs & args){
	if(isGuiDrawing() && b.inside(ofPoint(args.x,args.y))){
		return true;
	}else{
		return false;
	}
}
bool ofxColorPicker_<ColorType>::mouseReleased(ofMouseEventArgs & mouse){
	if(!isGuiDrawing()){
		return false;
	}
	bool bReturn = mouseUpdate(mouse);
	state = Waiting;
	return bReturn;
}
Exemple #5
0
bool ofxPanel::mouseReleased(ofMouseEventArgs & args){
    this->bGrabbed = false;
    if(ofxGuiGroup::mouseReleased(args)) return true;
    if(isGuiDrawing() && b.inside(ofPoint(args.x,args.y))){
    	return true;
    }else{
    	return false;
    }
}
Exemple #6
0
bool ofxGuiGroup::mouseMoved(ofMouseEventArgs & args){
	ofMouseEventArgs a = args;
	for(int i = 0; i < (int)collection.size(); i++){
		if(collection[i]->mouseMoved(a)) return true;
	}
	if(isGuiDrawing() && b.inside(ofPoint(args.x,args.y))){
		return true;
	}else{
		return false;
	}
}
Exemple #7
0
bool ofxGuiGroup::mouseReleased(ofMouseEventArgs & args){
	bGuiActive = false;
	for(int k = 0; k < (int)collection.size(); k++){
		ofMouseEventArgs a = args;
		if(collection[k]->mouseReleased(a)) return true;
	}
	if(isGuiDrawing() && b.inside(ofPoint(args.x,args.y))){
		return true;
	}else{
		return false;
	}
}
bool ofxColorPicker_<ColorType>::mousePressed(ofMouseEventArgs & mouse){
	if(!isGuiDrawing()){
		return false;
	}

	if(rectColorScaleBar.inside(mouse)){
		state = ChangingScale;
	}else if(rectColorWheel.inside(mouse)){
		state = ChangingWheel;
	}

	return mouseUpdate(mouse);
}
Exemple #9
0
bool ofxSlider<Type>::setValue(float mx, float my, bool bCheck){
    
	if( !isGuiDrawing() ){
		bGuiActive = false;
		return false;
	}
	if( bCheck ){
		if( b.inside(mx, my) ){
			bGuiActive = true;
		}else{
			bGuiActive = false;
		}
	}
	if( bGuiActive ){
		value = ofMap(mx, b.x, b.x + b.width, value.getMin(), value.getMax(), true);
		return true;
	}
	return false;
}
bool ofxColorPicker_<ColorType>::mouseDragged(ofMouseEventArgs & mouse){
	if(!isGuiDrawing()){
        return false;
	}
	return mouseUpdate(mouse);
}