Skip to main content
Karan 123
Senior
May 5, 2020 5:48 PM UTC
Solved

Scroll List :Select (Highlight) on Click , Remove and Add Elements How to?

Hi,

I am working on STM32746-DISC Board . I am working with "container" feature of TouchGFX with Scroll List . I have successfully update array elements (Hard Coded) as List Elements as per below link.

https://support.touchgfx.com/docs/tutorials/tutorial-04

// In Screen1View.hpp
void Screen1View::scrollList1UpdateItem(MenuElement& item, int16_t itemIndex)
{
	touchgfx_printf("Update Item = %d\n" ,itemIndex ) ;
 	item.setNumber(itemIndex);
}

// In MenuElement.hpp
const char Rx_Buffer1[11][20] = { "LIST.txt", "HELLO.png", "TouchGFX.gif", "STM32F7.doc", "SCROLL.bmp","NEW.xlsx", "TRY.jpg", "GOOD.bmp", "ABC.png", "XYZ.bmp"								};
  void setNumber(int no)
 {
 		touchgfx_printf("setNumber = %d\n" ,no) ;
 Unicode::itoa(no, textArea3Buffer, TEXTAREA3_SIZE , 10);
 	Unicode::strncpy(textArea3Buffer ,( const char *) Rx_Buffer1[no] , TEXTAREA3_SIZE -1 );
 }

0693W000000WwmCQAS.png

0693W000000WwlEQAS.png

I want to know:

1) Is the right method ?

2) How to Select/Highlight File Name once item is clicked .

and send Selected item (File name) to touchgfx_print windows?

3) How to add/remove the Element (File Name) from List from some other button ?

Please see short video..

--

Karan

This topic has been closed for replies.
Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
May 12, 2020 9:31 AM UTC

Hello,

I made a small scrollList example to show how to set the color of the item that you selected.

Hope it will be of help.

/Alexandre

23 replies

ChintanParmar
Associate II
Jul 16, 2020 11:37 AM UTC

In my case,

This callback function is not called. scrollList1ItemSelectedHandler()

And due to that currentIndex value is not getting updated. Its default value is 100. And I think that due to that onlt selection logic is not working.

Karan 123
Karan 123Author
Senior
Jul 16, 2020 7:01 PM UTC

Can you debug your output with UART ​on PC software Like TeraTerm and Send me results?

ChintanParmar
Associate II
Jul 17, 2020 8:39 AM UTC

I am not able to configure ITM Trace console so I cannot send you debug results.

However, I just want to say that my scrollListItemSelectedHandler() function is not called. I think this is callback function. I don't know why callback function is not called.