383 views
in GUI Development by
Hi Team,

We are using a vertical list were we have a requirenment to show a border around the item when user press UP or DOWN key and Show a filled rectangle On OK Key press.

We are able to show a border around the item on UP or Down Key Press with below code.

super( aState );

// If the component is currently selected, show a border
// around it.
if ( aState.contains( Core::ViewState[ Selected ]))
{
  BorderBox.Visible = true;
}
else
{
  BorderBox.Visible = false;
}

 

But we are not able to do the same for Ok Key Press.

Is there a better way we can achive the above requirement?

 

Regards,

Chaitra S G

1 Answer

0 votes
by

Hello Chaitra,

I suppose your application case addresses two different aspects. The first one is the highlighting of the actually selected item. This is controlled exactly as you did by evaluating the Selected state of the particular item. So far it works.

The other aspect (as far as I understood your explanation) should additionally highlight the actually selected item similarly to a push button being pressed by the user. If this is the case, I would handle the Ok keyboard event directly within the item and highlight it accordingly. When the user has released the Ok key again, the item can notify its owner or perform any other action related to it.

Does it help you further?

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...