765 views
in Getting started by

Hi,

 

I have a VerticalList, and when i click an item i called another view that is visible on the verticalList but while i am on this view i want to disable the VerticalList.. I have tried to instance the list like i did when i called the component (verticaList) at first time but it does not work.

 

1 Answer

+1 vote
by
Hi,

If I understand exactly, whenever you click on an list item, a popup appears and you want to disable the vertical list, when a popup is displaying?

If so, there are several options, see two of them:
a) VerticalList.Enabled = false; <- disables the list and also its behaviour to touches, while a popup is showing
b) create an simple touch handler on top of the vertical list, which eats every touch (as long as it is enabled), which could deflect the touch event to the vertical list, if no popup is showing

HTH.
Chris
by
Yes that is it. and sorry for my english...

i could do what i want but in some cases i need to instance another class from another one.

There is any example or a guide where i can see how is conformed the instance sentence?

Like this:

var Application::Listitem itemView = (Application::Listitem)VerticalList.View;
by

If you want to instance a component you need to create it and "Add" it to the current screen. 

Take a look into the first EmWi example (Project -> Open examples): "QuickTour".
In the example "QuickTour" open the "Example::Application". Here you can see a slot called "onShowMenu". In this slot we create the Menu-component, whenever a user clicks on the settings-button.

Slot-Code:

// Create a new menu instance
menu = new Example::Menu;

// Ensure, the menu appears in the center of the screen
menu.MoveView( Bounds.orect.center - menu.Bounds.center, false );

// Connect the onExitMenu slot method to the menu. This method is
// invoked, when the user has decided to close the menu.
menu.OnExitMenu = onExitMenu;

// Make the menu visible and modal. Modal GUI components grab all 
// user inputs.
Add( menu, 0 );
BeginModal( menu );


Please check follwing article about the root access.

by
Yes but this is when you want to create a new one. But when you have created for example a view and you want to call from another class to make it visible or use its objects. How i do that?
by

In your screenshot, I can see, that you want to disable one of the ITEMS in the list. You just need to disable the ENTIRE list, not every single item.

So instead of doing itemView.Enabled = false;
Do something like VerticalList.Enabled = false; The object name of the vertical list can be found in the inspector.

When the VerticalList is located inside another class, you could also access via OtherClass.VerticalList.Enabled = false; However it is a better approach to define in the OtherClass a bool Property called e.g. "EnableList" that setter changes the Enabled of the VerticalList. Then you can do it via OtherClass.EnableList = false;

If you really want to modify single items of the list, you need to iterate through all list items. In this case check also this article.

You can also provide a test project here, if it is too hard to discribe.

Hope this helps.

Chris

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

...