本文整理汇总了C++中TextInput::hitTest方法的典型用法代码示例。如果您正苦于以下问题:C++ TextInput::hitTest方法的具体用法?C++ TextInput::hitTest怎么用?C++ TextInput::hitTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextInput
的用法示例。
在下文中一共展示了TextInput::hitTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processTap
void DeviceTestApp::processTap( ivec2 pos )
{
// TextInput *selectedInput = false;
if( mPlayButton.hitTest( pos ) )
audio::master()->setEnabled( ! audio::master()->isEnabled() );
else if( mRecordButton.hitTest( pos ) )
startRecording();
else if( mSamplerateInput.hitTest( pos ) ) {
}
else if( mFramesPerBlockInput.hitTest( pos ) ) {
}
else if( mNumInChannelsInput.hitTest( pos ) ) {
}
else if( mNumOutChannelsInput.hitTest( pos ) ) {
}
else if( mSendChannelInput.hitTest( pos ) ) {
}
#if defined( CINDER_COCOA_TOUCH )
TextInput *currentSelected = TextInput::getCurrentSelected();
if( currentSelected )
showKeyboard( KeyboardOptions().type( KeyboardType::NUMERICAL ).initialString( currentSelected->mInputString ) );
#endif
size_t currentTestIndex = mTestSelector.mCurrentSectionIndex;
if( mTestSelector.hitTest( pos ) && currentTestIndex != mTestSelector.mCurrentSectionIndex ) {
string currentTest = mTestSelector.currentSection();
CI_LOG_V( "selected: " << currentTest );
setupTest( currentTest );
return;
}
size_t currentOutputIndex = mOutputSelector.mCurrentSectionIndex;
if( mOutputSelector.hitTest( pos ) && currentOutputIndex != mOutputSelector.mCurrentSectionIndex ) {
auto dev = audio::Device::findDeviceByName( mOutputSelector.mSegments[mOutputSelector.mCurrentSectionIndex] );
CI_LOG_V( "selected output device named: " << dev->getName() << ", key: " << dev->getKey() );
setOutputDevice( dev );
return;
}
size_t currentInputIndex = mInputSelector.mCurrentSectionIndex;
if( mInputSelector.hitTest( pos ) && currentInputIndex != mInputSelector.mCurrentSectionIndex ) {
auto dev = audio::Device::findDeviceByName( mInputSelector.mSegments[mInputSelector.mCurrentSectionIndex] );
CI_LOG_V( "selected input named: " << dev->getName() << ", key: " << dev->getKey() );
setInputDevice( dev );
return;
}
}