217 views
in GUI Development by
Hi,

I'm implementing a menu using vertical list the implementation is such that from one menu item on an occurrence of an event (NEXT) it will show the respective sub menus under it. The list will show 5 items when loaded initially

The transition from one dialog(Settings) to another dialog (Volume) is done using SwitchTo Dialog API and vice versa (Back)

eg Settings -> volume

   The problem that I'm facing is suppose I have selected 6th element  from 1st list & I want to return back to previous menu using SwitchToDialog() API.

Such that the previously selected item must be highlighted & shown

 I'm able to see the previous menu dialog

But the selected Item is not visible meaning its just loading initial 5 elements present in the list

  eg Item = 6;

I have used all the following possibilities

VerticalList.SelectedItem =  Item;

VerticalList.Item = Item;

VerticalList.invalidateItems(0,LastItem);

VerticalList.EnsureVisible(Item,true,null,null);

its not working I'm only able to see the 1st 5 elements in  the list & not able to see the selected item(6) or item below these 5 elements  

Regards

1 Answer

0 votes
by

Hello Kunal,

you would need to store the selection from the superior menu when entering the sub-menu. Later when you go back to the superior menu, you select the previously stored menu item and ensure that it is visible. So far I see, your code seems to be correct. Why it does not work, is difficult to say.

Another approach would be to use PresentDialog() when you enter a sub-menu and DismissDialog() when you navigate back to the superior menu. In this manner, the superior menu remains in RAM so its state (selection, etc.) are valid when you return to the menu. The methods PresentDialog() and DismissDialog() can be invoked with optional transition objects. These are not only useful for animations but by specifying transition objects in the diverse parameters of the above mentioned methods you can control the appearance of the superior and sub-menu. For example, both can be displayed simultaneously or (what you probably intend) the superior menu disappears automatically while the sub-menu is visible. In such case see the method parameters aOverlayTransition and aRestoreTransition. See also: Perform Dialog transitions with animations.

Does it help you further?

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...