Wednesday, December 13th 2017, 3:57pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

rali

Beginner

Date of registration: Aug 27th 2014

Posts: 11

1

Thursday, October 9th 2014, 10:43pm

Blinking an icon/widget

Hi,
Can someone tell me how to blink an icon/wiget with emwin ? :(
I need to have 4 icons on an LCD and depending on the system status, any or all can blink.
Thanks
Rich

This post has been edited 1 times, last edit by "rali" (Oct 9th 2014, 11:24pm)


SEGGER - Adrian

Super Moderator

Date of registration: May 26th 2009

Posts: 994

2

Friday, October 10th 2014, 2:59pm

Hello Rich,

You can connect a timer to a window and regularly react to the WM_TIMER message in the according callback function.

Best regards,
Adrian

rali

Beginner

Date of registration: Aug 27th 2014

Posts: 11

3

Friday, October 10th 2014, 7:57pm

follow up

Hi Adrian,
Maybe I'm not choosing the best graphics and looking for your input.
If you were to put up 4 icons or equivalent graphics (each about 40x40), what type would you use eg image, iconview, etc
and what functions to execute it (only looking for guidance - you are not commited to anything)
Thanks
Rich

This post has been edited 1 times, last edit by "rali" (Oct 10th 2014, 7:58pm)


SEGGER - Adrian

Super Moderator

Date of registration: May 26th 2009

Posts: 994

4

Monday, October 13th 2014, 10:16am

Hello Rich,

I understand you want to achieve the blinking by changing the image. I would recommend using emWin bitmaps (c files) which can be created using the Bitmap Converter. It is up to you if you prefer using the ICONVIEW widget or not. Of course you would use the ICONVIEW API or just call the function GUI_DrawBitmap().

Best regards,
Adrian

rali

Beginner

Date of registration: Aug 27th 2014

Posts: 11

5

Monday, October 13th 2014, 4:41pm

Thanks Adrian,
I have converted a BMP image to a c file and displayed in on my LCD. How do I select which window to display the c file image on?
Thanks
Rich

SEGGER - Adrian

Super Moderator

Date of registration: May 26th 2009

Posts: 994

6

Tuesday, October 14th 2014, 10:32am

Hello Rich,

Drawing operations should be performed only within the callback function of a window. Please find details in the emWin user manual.

Best regards,
Adrian

rali

Beginner

Date of registration: Aug 27th 2014

Posts: 11

7

Tuesday, October 14th 2014, 2:57pm

Hi Adrian,
I have used the call back function for drawing but it always end up on the desktop. How do I switch between the desktop and any other window for drawings and then back to the desktop if need be ?
Thanks
Rich

SEGGER - Adrian

Super Moderator

Date of registration: May 26th 2009

Posts: 994

8

Tuesday, October 14th 2014, 3:57pm

Hello Rich,

Please note that you will have to set the callback function for a certain window by using its handle.

Best regards,
Adrian

rali

Beginner

Date of registration: Aug 27th 2014

Posts: 11

9

Tuesday, October 14th 2014, 5:26pm

Adrian,
Below is the first part of the callback function where a bitmap converted to a c file is being displayed but end up on the desktop.
call to display bitmap is ' DspWorldIcon(100);//this will draw bitmap icon from c file into the 'TestBuffering' window
If the correct window is already selected by emWin before the callback is called,
Where am I going wrong?
Thanks
Rich

static void _cbDialog(WM_MESSAGE * pMsg) {
const void * pData;
WM_HWIN hItem;
U32 FileSize;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END

switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'TestBuffering'
//
hItem = pMsg->hWin;
WINDOW_SetBkColor(hItem, 0x00DEDEA3);
//
// Initialization of 'Image'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);
pData = _GetImageById(ID_IMAGE_0_IMAGE_0, &FileSize);
IMAGE_SetBMP(hItem, pData, FileSize);
//
// Initialization of 'Checkbox'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_0);
CHECKBOX_SetText(hItem, "myCk");
CHECKBOX_SetTextColor(hItem, 0x006538AF);
CHECKBOX_SetFont(hItem, GUI_FONT_16_1);
// USER START (Optionally insert additional code for further widget initialization)
DspWorldIcon(100);//this will draw bitmap icon from c file into the 'TestBuffering' window
// USER END
break;
case WM_NOTIFY_PARENT:
....

SEGGER - Adrian

Super Moderator

Date of registration: May 26th 2009

Posts: 994

10

Wednesday, October 15th 2014, 10:17am

Hello Rich,

I am afraid I just do not understand what you mean with "displayed but end up on the desktop". Please state precisely what happens and what is the problem. Thank you.

Best regards,
Adrian

Similar threads