Search code examples
c++listviewtizentizen-native-app

Add controls in a class other than form class in tizen


I need to have two IconListView in same form. I created a second class for displaying the second listview but while using the AddControl() in the second class it shows an 'undeclared identifier error AddControl'. While the same code works if AddControl() is used in Form class, but my application requires me to use AddControl() in the second class itself. What change should be added to make it usable.

 __pIconListView = new IconListView();
 result r=__pIconListView->Construct(Rectangle(0,300, 600, 300),Dimension(200,200),      ICON_LIST_VIEW_STYLE_NORMAL, ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL);
 __pIconListView->SetItemProvider(*this);
 __pIconListView->AddIconListViewItemEventListener(*this);
 r=AddControl(__pIconListView);

Made some changes in the code.

And the above code is given in the second class and the AddControl() is in red color meaning its valid. But soon after executing the code, when the execution reaches the AddControl(__pIconListView) the program crashes. The Log says 'Construct should be called before use'. But the above Construct() doesn't make any errors it works fine, I checked the log. So where is this bug comming from! The GetClientAreaBounds() also hits error.


Solution

  • I found a solution by using AddControl(secondclassObject) in the initial class itself. But with an over head of checking each second whether the required images for the iconlistview has been completely fetched!

    But still not found a way to use AddControl() in the second class.