- int indexAccel = -1;
- for ( const wxChar *pc = label; *pc != wxT('\0'); pc++ )
- {
- if ( *pc == MNEMONIC_PREFIX )
- {
- pc++; // skip it
- if ( *pc != MNEMONIC_PREFIX )
- {
- if ( indexAccel == -1 )
- {
- // remember it (-1 is for MNEMONIC_PREFIX itself
- indexAccel = pc - label.c_str() - 1;
- }
- else
- {
- wxFAIL_MSG(_T("duplicate accel char in control label"));
- }
- }
- }
-
- if ( labelOnly )
- {
- *labelOnly += *pc;
- }
- }
-
- return indexAccel;