Friday, September 22nd 2017, 7:03pm UTC+2

You are not logged in.

  • Login
  • Register

rochi2211

Beginner

Date of registration: Jun 7th 2017

Posts: 9

1

Wednesday, June 7th 2017, 12:12pm

SWIPELIST and Iconview problem

Hello everyone, I'm using stemwin on a stm32f746ng disco board to develop a motorcycle computer. So I started coding the MenĂ¹ using the function SWIPELIST.
the structure is the following:
SPLASHSCREEN-->SPEEDOMETER INTERFACE--> MENU LEVEL 1-->2-->3
Now the problem is relative to swipelist menu. I used as template the menustruct example. If in speedometer interface i press a butto gui ends and starts menu. In menu I have an iconview that stops gui and bring me back to speedo and this works. Pressing the menu voice that stops menu level 1 to bring me to menu level 2 completely crashes the whole program, the board hangs itself. I'm attaching the code so maybe someone better than me at coding can help me out. By the way I'm using this function to change from a menu to the other in swipe list

//case WM_NOTIFICATION_RELEASED:
//hItem = WM_GetDialogItem(pMsg->hWin, ID_SWIPELIST_0);
//ItemIndex = SWIPELIST_GetReleasedItem(hItem);
//if (ItemIndex == 0){
// GUI_EndDialog(pMsg->hWin, 0);
// GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), _cbDialog2, WM_HBKWIN, 0, 0);
// }
Is there something wrong with the use of this code? I'm just asking for the number of object in the list that has been pressed and released and than i assign a function to that number.
Another problem is that if the toch screen is touched with 2 fingers the program hangs totally the same as described before. How can I avoid that??


Looking further for some help, thank you
rochi2211 has attached the following file:
  • menunew.zip (2.1 kB - 38 times downloaded - Last download: Sep 6th 2017, 3:44am)

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 356

2

Wednesday, June 7th 2017, 3:15pm

Hi,

I'm not sure if I really understood the problem.

But I changed your code a little bit which makes it possible to navigate through some menus.

Now you can click on the first SWIPELIST entry and can navigate to the menu where all entries are named 'c'. On a click on the back 'Button' you get back to the previous screen.

Some things I have discovered which might be not a good idea or lead to unpredictable behavior.

1.
Make sure your handles are valid. At one point you have used an uninitialized handle, most compiler should throw a warning.

2.
Avoid using a GUI_WIDGET_CREATE_INFO structure which doesn't fit to the callback (like below). This might work but can lead to unpredictable behavior.
GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate2), _cbDialog2, WM_HBKWIN, 0, 0);

Regards,
Sven
SEGGER - Schoenen has attached the following file:
  • CreateMenu.zip (2.09 kB - 38 times downloaded - Last download: Sep 4th 2017, 1:43am)

rochi2211

Beginner

Date of registration: Jun 7th 2017

Posts: 9

3

Wednesday, June 7th 2017, 5:13pm

Thank you for the fast response. I compiled everything and flashed i have still the same problem as before because it hangs after touching the first element of swipelist. Can you point me at the changes you made? What would you use to switch screen the way my program is structured? Thank you.

This post has been edited 1 times, last edit by "rochi2211" (Jun 7th 2017, 5:18pm)


rochi2211

Beginner

Date of registration: Jun 7th 2017

Posts: 9

4

Friday, June 9th 2017, 11:13am

I'm really struggling to get this working... is there any prticoular function , routine or way to go from a screen to another in swipelist?
Hi,

I'm not sure if I really understood the problem.

But I changed your code a little bit which makes it possible to navigate through some menus.

Now you can click on the first SWIPELIST entry and can navigate to the menu where all entries are named 'c'. On a click on the back 'Button' you get back to the previous screen.

Some things I have discovered which might be not a good idea or lead to unpredictable behavior.

1.
Make sure your handles are valid. At one point you have used an uninitialized handle, most compiler should throw a warning.

2.
Avoid using a GUI_WIDGET_CREATE_INFO structure which doesn't fit to the callback (like below). This might work but can lead to unpredictable behavior.
GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate2), _cbDialog2, WM_HBKWIN, 0, 0);

Regards,
Sven

rochi2211

Beginner

Date of registration: Jun 7th 2017

Posts: 9

5

Sunday, June 11th 2017, 4:18pm

I've not been able to succed in my purpouse, the only thing that makes this work is commenting out GUI_EndDialog(hWin, 0); in

case WM_NOTIFICATION_RELEASED:
hItem = WM_GetDialogItem(pMsg->hWin, ID_SWIPELIST_0);
ItemIndex = SWIPELIST_GetReleasedItem(hItem);
if (ItemIndex == 1) {
//GUI_EndDialog(hWin, 0);
//GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), _cbDialog2, WM_HBKWIN, 0, 0);
CreateSplash();
}
Will I run out of memory?

rochi2211

Beginner

Date of registration: Jun 7th 2017

Posts: 9

6

Sunday, June 11th 2017, 5:43pm

I've not been able to succed in my purpouse, the only thing that makes this work is commenting out GUI_EndDialog(hWin, 0); in

case WM_NOTIFICATION_RELEASED:
hItem = WM_GetDialogItem(pMsg->hWin, ID_SWIPELIST_0);
ItemIndex = SWIPELIST_GetReleasedItem(hItem);
if (ItemIndex == 1) {
//GUI_EndDialog(hWin, 0);
//GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), _cbDialog2, WM_HBKWIN, 0, 0);
CreateSplash();
}
Will I run out of memory?

Attached the rearranged code.
The first problem is that I suspect that memory is totally eaten and that I can use Gui_enddialog only on the first level. I can't use iconview button with that function in menu level 2 and 3. The other problem is that I will associate programs for settings with every menu voice so for sure i will get out of memory. Is there any solution to execute every menu level as single program? Thank you
rochi2211 has attached the following file:
  • menunew.zip (2.36 kB - 32 times downloaded - Last download: Sep 6th 2017, 11:26am)

Similar threads