Hello.
I found the issue of MULTIPAGE-widget.
If some page does not contain any focusable element (for example only TEXT or disabled all widgets) there is a coloring issue:
if to return from this page to other page which contains the focusable element(s) then this focusable widget will not have a "focusable" color.
A simple example demonstrates this issue.
If you select page 1, then select page 2 and then select page 1 again you will see that no one button is colored as focused.
This issue is present even in ver. 5.50.
Question: What API-function or message informs that a page of MULTIPAGE was selected?
Display All
I found the issue of MULTIPAGE-widget.
If some page does not contain any focusable element (for example only TEXT or disabled all widgets) there is a coloring issue:
if to return from this page to other page which contains the focusable element(s) then this focusable widget will not have a "focusable" color.
A simple example demonstrates this issue.
If you select page 1, then select page 2 and then select page 1 again you will see that no one button is colored as focused.
This issue is present even in ver. 5.50.
Question: What API-function or message informs that a page of MULTIPAGE was selected?
C Source Code
- #include "GUI.h"
- #include "MULTIPAGE.h"
- /*********************************************************************
- * Defines
- **********************************************************************
- */
- // Recommended memory to run the sample with adequate performance
- //
- #define RECOMMENDED_MEMORY (1024L * 20)
- /*********************************************************************
- * Dialog resource
- *
- * These tables contain the information required to create the dialogs.
- * It has been created manually, but could also be created by the GUIBuilder.
- */
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate1[] = {
- { WINDOW_CreateIndirect, NULL, 0, 0, 0, 260, 100, FRAMEWIN_CF_MOVEABLE },
- { TEXT_CreateIndirect, "Dialog 1", 0, 5, 10, 50, 20, TEXT_CF_LEFT },
- { BUTTON_CreateIndirect, "Button 1", GUI_ID_BUTTON0, 5, 30, 80, 20, 0},
- { BUTTON_CreateIndirect, "Button 1", GUI_ID_BUTTON1, 5, 60, 80, 20, 0},
- };
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate2[] = {
- { WINDOW_CreateIndirect, NULL, 0, 0, 0, 260, 100, FRAMEWIN_CF_MOVEABLE },
- { TEXT_CreateIndirect, "Dialog 2", 0, 5, 10, 50, 20, TEXT_CF_LEFT },
- { TEXT_CreateIndirect, "Text 1", GUI_ID_TEXT0, 25, 30, 50, 15, TEXT_CF_LEFT },
- { TEXT_CreateIndirect, "Text 2", GUI_ID_TEXT1, 25, 50, 50, 15, TEXT_CF_LEFT },
- };
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate3[] = {
- { WINDOW_CreateIndirect, NULL, 0, 0, 0, 260, 100, FRAMEWIN_CF_MOVEABLE },
- { TEXT_CreateIndirect, "Dialog 3", 0, 5, 10, 50, 20, TEXT_CF_LEFT },
- { RADIO_CreateIndirect, "", GUI_ID_RADIO0, 5, 30, 0, 0, 0, 3},
- { TEXT_CreateIndirect, "Option 1", GUI_ID_TEXT0, 25, 30, 50, 15, TEXT_CF_LEFT },
- { TEXT_CreateIndirect, "Option 2", GUI_ID_TEXT1, 25, 50, 50, 15, TEXT_CF_LEFT },
- { TEXT_CreateIndirect, "Option 3", GUI_ID_TEXT2, 25, 70, 50, 15, TEXT_CF_LEFT },
- };
- /*********************************************************************
- * Public code
- **********************************************************************
- */
- /*********************************************************************
- * MainTask
- */
- void MainTask(void) {
- WM_HWIN hMultiPage;
- WM_HWIN hFrameWin;
- WM_HWIN hDialog;
- //
- // Enable use of memory devices
- //
- WM_SetCreateFlags(WM_CF_MEMDEV);
- GUI_Init();
- //
- // Check if recommended memory for the sample is available
- //
- if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
- GUI_ErrorOut("Not enough memory available.");
- return;
- }
- //
- // Create the frame window
- //
- hFrameWin = FRAMEWIN_Create("FrameWindow", NULL, WM_CF_SHOW, 40, 44, 240, 152);
- FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN);
- FRAMEWIN_SetActive(hFrameWin, 1);
- FRAMEWIN_SetMoveable(hFrameWin, 1);
- //
- // Create the MULTIPAGE widget
- //
- hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0);
- //
- // Create and attach the MULTIPAGE dialog windows
- //
- hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL, WM_UNATTACHED, 0, 0);
- MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1");
- hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL, WM_UNATTACHED, 0, 0);
- MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2");
- hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL, WM_UNATTACHED, 0, 0);
- MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3");
- while (1) {
- GUI_Delay(100);
- }
- }
- /*************************** End of file ****************************/
Best regards,
Volodymyr.
Volodymyr.
The post was edited 1 time, last by volodymyr ().