Page 1 of 1

P3Speller: Changing background color of intensified row/col

Posted: 20 Aug 2013, 03:02
by ak22

I am trying to modify the P3Speller application so that after a row or column is intensified, the background color of the row/column changes in the speller display. I was wondering how I can find the row/column that was just flashed and iterate over the TextStimulus objects in that row/column to change the background colors.

Thank You.

Re: P3Speller: Changing background color of intensified row/

Posted: 12 Sep 2013, 11:58
by mellinger

if you have the current stimulus code, you can use Associations()[stimulusCode].Stimuli() in order to access the current set of stimuli, which contains pointers of type Stimulus*. Iterating over all entries in that set, you can use dynamic_cast<>() to test whether the stimulus is a text stimulus, and manipulate it then. The cast is used as follows:

Code: Select all

Stimulus* pStimulus = ...
TextStimulus* pTextStimulus = dynamic_cast<TextStimulus*>( pStimulus );
if( pTextStimulus )
  ... // manipulate TextStimulus properties