P3Speller: Changing background color of intensified row/col

Forum for software developers to discuss BCI2000 software development
Posts: 3
Joined: 20 Aug 2013, 02:54

P3Speller: Changing background color of intensified row/col

Post by ak22 » 20 Aug 2013, 03:02


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.

Posts: 1172
Joined: 12 Feb 2003, 11:06

Re: P3Speller: Changing background color of intensified row/

Post by mellinger » 12 Sep 2013, 11:58


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


Who is online

Users browsing this forum: No registered users and 3 guests