2020-07-01 01:13 AM
Hi All.
Not work this code:
In HPP file:
class ScreenMainView : public ScreenMainViewBase
{
public:
ScreenMainView();
virtual ~ScreenMainView() {}
virtual void setupScreen();
virtual void tearDownScreen();
void handleTickEvent() override;
protected:
touchgfx::ScrollWheel sw;
touchgfx::DrawableListItems<CustomContainerProc, 3> scrollProcListItems;
private:
/*
* Callback Declarations
*/
touchgfx::Callback<ScreenMainView, touchgfx::DrawableListItemsInterface*, int16_t, int16_t> updateItemCallback1;
/*
* Callback Handler Declarations
*/
void updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex);
};
In CPP file:
ScreenMainView::ScreenMainView() :
updateItemCallback(this, &ScreenMainView::updateItemCallbackHandler)
{
}
void ScreenMainView::setupScreen()
{
ScreenMainViewBase::setupScreen();
sw.setPosition(78, 44, 500, 500);
sw.setHorizontal(true);
sw.setEasingEquation(touchgfx::EasingEquations::expoEaseOut);
sw.setCircular(false);
sw.setSwipeAcceleration(40);
sw.setDragAcceleration(11);
sw.setNumberOfItems(2); // ERROR! Not returned!
sw.setSelectedItemOffset(0);
sw.setDrawableSize(240, 0);
sw.setDrawables(scrollProcListItems1, updateItemCallback1);
sw.animateToItem(0, 0);
add(sw);
}
// The function sw.setNumberOfItems(2); never returned.
2020-07-01 01:27 AM
Addition:
The built-in code for ScrollWheel in the designer works well.
But I need a large array of ScrollWheels.
Doing this in the designer is very bad.
2020-07-01 02:21 AM
It seems a memory issue.
I removed many of ScrollWheels made in the designer.
Now all is well.