Beispiel #1
0
void Region::cursorUp(Cursor* c) {
	if ( c == palette->MostRecentCursorDown() ) {
		palette->SetMostRecentCursorDown(NULL);
	}
	if ( isButton() ) {
		if ( buttonTooDeep(c) ) {
			NosuchDebug("Ignoring button up, too deep!");
		} else if ( palette->isButtonDown(name) != true ) {
			NosuchDebug("Ignoring button up, isButtonDown wasn't true!");
		} else {
			NosuchDebug("REGION::BUTTONUP %s %s",name.c_str(),c->DebugBrief().c_str());
			buttonUp(name);
		}
	} else if ( Palette::selector_check && _graphicBehaviour->isSelectorDown() ) {
		NosuchDebug(1,"REGION::CURSORUP WITH GRAPHIC SELECTOR %s",c->DebugBrief().c_str());
		_graphicBehaviour->cursorUpWithSelector(c);
	} else if ( Palette::selector_check && _musicBehaviour->isSelectorDown() ) {
		NosuchDebug(1,"REGION::CURSORUP WITH MUSIC SELECTOR %s",c->DebugBrief().c_str());
		_musicBehaviour->cursorUpWithSelector(c);
	} else {
		NosuchVector pos = c->curr_pos;
		palette->cursorUp(c);
		NosuchDebug(2,"REGION::CURSORUP %s",c->DebugBrief().c_str());
		_graphicBehaviour->cursorUp(c);
		_musicBehaviour->cursorUp(c);
	}
}
Beispiel #2
0
void Region::cursorDown(Cursor* c) {
	if ( isButton() ) {
		NosuchDebug(1,"Region cursorDown depth=%f",c->curr_depth);
		if ( buttonTooDeep(c) ) {
			NosuchDebug("Ignoring cursor_down for button, too deep! (%.4f)",c->curr_depth);
		} else {
			NosuchDebug("REGION::BUTTONDOWN %s now=%.3f sid=%d/%s area=%.4f",
				name.c_str(),Palette::now/1000.0f,c->sidnum(),c->sidsource().c_str(),c->area());
			if ( c->area() < 0.0 ) {
				NosuchDebug("HEY!!!! area is negative!???");
			}
			buttonDown(name);
		}
	} else if ( Palette::selector_check && _graphicBehaviour->isSelectorDown() ) {
		NosuchDebug(1,"REGION::CURSORDOWN WITH GRAPHIC SELECTOR %s",c->DebugBrief().c_str());
		_graphicBehaviour->cursorDownWithSelector(c);
	} else if ( Palette::selector_check && _musicBehaviour->isSelectorDown() ) {
		NosuchDebug(1,"REGION::CURSORDOWN WITH MUSIC SELECTOR %s",c->DebugBrief().c_str());
		_musicBehaviour->cursorDownWithSelector(c);
	} else {
		NosuchDebug(2,"REGION::CURSORDOWN %s",c->DebugBrief().c_str());
		NosuchVector pos = c->curr_pos;
		palette->cursorDown(c);
		// NosuchDebug("cursorDown checking isSelectorDown() = %d",_graphicBehaviour->isSelectorDown());
		_graphicBehaviour->cursorDown(c);
		_musicBehaviour->cursorDown(c);
		palette->SetMostRecentCursorDown(c);
	}
}
void Region::cursorUp(SpaceCursor* c) {
	if ( c == palette()->MostRecentSpaceCursorDown() ) {
		palette()->SetMostRecentSpaceCursorDown(NULL);
	}
	if ( isButton() ) {
		if ( buttonTooDeep(c) ) {
			NosuchDebug("Ignoring button up, too deep!");
		} else if ( palette()->isButtonDown(name) != true ) {
			NosuchDebug("Ignoring button up, isButtonDown wasn't true!");
		} else {
			buttonUp();
		}
	} else {
		_graphicBehaviour->cursorUp(c);
		_musicBehaviour->cursorUp(c);
	}
}
void Region::cursorDown(SpaceCursor* c) {
	if ( isButton() ) {
		NosuchDebug(1,"Region cursorDown depth=%f",c->depth());
		if ( buttonTooDeep(c) ) {
			NosuchDebug("Ignoring cursor_down for button, too deep! (%.4f)",c->depth());
		} else {
			NosuchDebug("REGION::BUTTONDOWN %s now=%.3f sid=%d/%s area=%.4f",
				name.c_str(),Palette::now/1000.0f,c->sid,c->source.c_str(),c->area);
			if ( c->area < 0.0 ) {
				NosuchDebug("HEY!!!! area is negative!???");
			}
			buttonDown();
		}
	} else {
		_graphicBehaviour->cursorDown(c);
		_musicBehaviour->cursorDown(c);
		palette()->SetMostRecentSpaceCursorDown(c);
	}
}