Hello to everybody,
likely my question is a silly one but I have not been able to find out an answer looking at the documentation.
I have one Window with one widget, an IMAGE one. My need is that of implementing a simple slide show
application.
So I wrote this main routine
static void _Main(void)
{
U8 i = 0;
WM_HWIN hWin_focussed;
WM_SelectWindow(WM_HBKWIN);
GUI_Clear();
hWin_0 = CreateWindow_0();
WM_ShowWindow(hWin_0);
WM_SetFocus(hWin_0);
hWin_focussed = WM_GetFocussedWindow();
GUI_Exec();
while (1)
{
for (i=0; i<NUM_OF_PICTURES; i++)
{
pData_slide_show = (void *) _GetImageById(Id_array, &FileSize_slide_show);
IMAGE_SetDTA(hItem_slide_show, pData_slide_show, FileSize_slide_show);
GUI_Delay(5000);
}
}
//
// Cleanup (to do some WM_DeleteWindow())
//
}
And the slide show mechanism works displaying the images sequence with 5s interval between two consecutive images.
Since I have some mechanical buttons on my board I would like to make the slide show interactive, with up and down actions,
so I have written a routine that detects the key press events and sends the event information through the
GUI_SendKeyMsg (Key, 1);
function.
The problem is that in the cbdialog callback function of window_0 the WM_KEY events are never detected, only the
WM_INIT_DIALOG, WM_PRE_PAINT, WM_PAINT, and so on, are detected.
As if window_0 had not received the focus.
And actually the
WM_SetFocus(hWin_0);
returns 1 meaning that the window cannot get the focus
and
WM_GetFocussedWindow();
returns 0 meaning that no window has the input focus.
How can I change this behaviour?
Thanks in advance,
Ezio
likely my question is a silly one but I have not been able to find out an answer looking at the documentation.
I have one Window with one widget, an IMAGE one. My need is that of implementing a simple slide show
application.
So I wrote this main routine
static void _Main(void)
{
U8 i = 0;
WM_HWIN hWin_focussed;
WM_SelectWindow(WM_HBKWIN);
GUI_Clear();
hWin_0 = CreateWindow_0();
WM_ShowWindow(hWin_0);
WM_SetFocus(hWin_0);
hWin_focussed = WM_GetFocussedWindow();
GUI_Exec();
while (1)
{
for (i=0; i<NUM_OF_PICTURES; i++)
{
pData_slide_show = (void *) _GetImageById(Id_array, &FileSize_slide_show);
IMAGE_SetDTA(hItem_slide_show, pData_slide_show, FileSize_slide_show);
GUI_Delay(5000);
}
}
//
// Cleanup (to do some WM_DeleteWindow())
//
}
And the slide show mechanism works displaying the images sequence with 5s interval between two consecutive images.
Since I have some mechanical buttons on my board I would like to make the slide show interactive, with up and down actions,
so I have written a routine that detects the key press events and sends the event information through the
GUI_SendKeyMsg (Key, 1);
function.
The problem is that in the cbdialog callback function of window_0 the WM_KEY events are never detected, only the
WM_INIT_DIALOG, WM_PRE_PAINT, WM_PAINT, and so on, are detected.
As if window_0 had not received the focus.
And actually the
WM_SetFocus(hWin_0);
returns 1 meaning that the window cannot get the focus
and
WM_GetFocussedWindow();
returns 0 meaning that no window has the input focus.
How can I change this behaviour?
Thanks in advance,
Ezio