cancel
Showing results for 
Search instead for 
Did you mean: 

stemwin icon bitmap change

himanshusharma
Associate II
Posted on June 14, 2017 at 09:24

I had created a image icon menu and want to change bitmap when some one make a click on any icon.

Which function should i use for this, below is the code for reference.

void vGeneralFunction_StartTest(void){

WM_HWIN       hWin;

MenuFlag = StartTest;

LCD_Clear(LCD_COLOR_WHITE);

hProg = PROGBAR_CreateEx(0, 480, 725+4, 19, WM_HBKWIN, WM_CF_SHOW, PROGBAR_CF_HORIZONTAL, 0);

PROGBAR_SetMinMax(hProg, Min, Max);

PROGBAR_SetBarColor(hProg, 0, GUI_YELLOW);

PROGBAR_SetText(hProg, ' ');

/*

* Create iconview widget

*/

hWin = ICONVIEW_CreateEx(LCD_X_SIZE-350+10, LCD_Y_SIZE-85, 1000, 400, 

WM_HBKWIN, WM_CF_SHOW | GUI_WRAPMODE_NONE, 

ICONVIEW_SF_AUTOSCROLLBAR_V, GUI_ID_ICONVIEW0, 80, 80);

/*

* Add icons to the widget

*/

for (lp=0; lp<GUI_COUNTOF(_aBitmapItemStartMenu); lp++) {

ICONVIEW_AddBitmapItem(hWin, _aBitmapItemStartMenu[lp].pBitmap, _aBitmapItemStartMenu[lp].pText);

 }

ICONVIEW_SetBkColor(hWin, ICONVIEW_CI_SEL, GUI_LIGHTGRAY);

ICONVIEW_SetFont(hWin, &GUI_Font20_ASCII);

ICONVIEW_SetTextColor(hWin, ICONVIEW_CI_SEL, GUI_GRAY);

ICONVIEW_SetTextColor(hWin, ICONVIEW_CI_UNSEL, GUI_GRAY);

WM_HasFocus(hWin);

GUI_Exec();

while (1){

if (ts_event.key_status == touch_key_down){

}

GUI_Delay(5);

}

}

#iconview #stemwin #icon #bitmap-change
2 REPLIES 2
himanshusharma
Associate II
Posted on June 17, 2017 at 10:26

anyone on this??

Imen.D
ST Employee
Posted on June 19, 2017 at 11:38

Hi, 

T

ried calling ICONVIEW_SetBitmapItem() and y

ou should make sure to enable the CRC before calling GUI library, if not STemWin will be not function. This is mentioned in the page 6 of AN4323 : 'The CRC module (in RCC peripheral clock enable register) should be enabled before using the library.' 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen