Skip to main content
Karan 123
Senior
May 5, 2020
Solved

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

  • May 5, 2020
  • 23 replies
  • 6876 views

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.
Best answer by Alexandre RENOUX

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
July 16, 2020

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
July 16, 2020

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

ChintanParmar
Associate II
July 17, 2020

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.