I'm trying to make a semitransparent listbox using this code
static void _cbTool2(WM_MESSAGE* pMsg) {
char acBuffer[32];
int Sel;
int NCode, Id;
static LISTBOX_Handle hListbox, hText;
static GUI_MEMDEV_Handle hMem;
int i;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_CREATE:
GUI_SetAlpha(50);
hListbox = LISTBOX_CreateEx(60, 60, 210, 137, hTool2, WM_CF_SHOW, 0, ID_LISTBOX_0, _acContent);
//WM_ClrHasTrans(hListbox);
WM_SetHasTrans(hListbox);
WIDGET_SetFocusable(hListbox, 1);
LISTBOX_SetFont(hListbox, &GUI_Font8x18);
LISTBOX_SetBkColor(hListbox, LISTBOX_CI_SELFOCUS, GUI_DARKGRAY);
LISTBOX_SetBkColor(hListbox, LISTBOX_CI_UNSEL, GUI_LIGHTGRAY);
LISTBOX_SetTextColor(hListbox, LISTBOX_CI_UNSEL, GUI_BLACK);
LISTBOX_SetItemSpacing(hListbox, 4);
LISTBOX_SetSel(hListbox, 1);
LISTBOX_SetAutoScrollV(hListbox, 1);
hText = TEXT_CreateEx(120, 40, 80, 20, pMsg->hWin, WM_CF_SHOW, TEXT_CF_HCENTER, ID_TEXT_2, "Main Menu");
TEXT_SetFont(hText, &GUI_Font8x18);
TEXT_SetTextColor(hText, GUI_BLACK);
break;
case WM_PAINT:
//GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
break;
WM_HWIN CreateChild2(void);
WM_HWIN CreateChild2(void) {
hTool2 = WM_CreateWindowAsChild(43, 35, 240, 180, hParent, WM_CF_HASTRANS, _cbTool2, 0);
return hTool2;
}
Every thins seems fine until i move down then the widget overwrites the selected line with the text from the previous line and become darker
static void _cbTool2(WM_MESSAGE* pMsg) {
char acBuffer[32];
int Sel;
int NCode, Id;
static LISTBOX_Handle hListbox, hText;
static GUI_MEMDEV_Handle hMem;
int i;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_CREATE:
GUI_SetAlpha(50);
hListbox = LISTBOX_CreateEx(60, 60, 210, 137, hTool2, WM_CF_SHOW, 0, ID_LISTBOX_0, _acContent);
//WM_ClrHasTrans(hListbox);
WM_SetHasTrans(hListbox);
WIDGET_SetFocusable(hListbox, 1);
LISTBOX_SetFont(hListbox, &GUI_Font8x18);
LISTBOX_SetBkColor(hListbox, LISTBOX_CI_SELFOCUS, GUI_DARKGRAY);
LISTBOX_SetBkColor(hListbox, LISTBOX_CI_UNSEL, GUI_LIGHTGRAY);
LISTBOX_SetTextColor(hListbox, LISTBOX_CI_UNSEL, GUI_BLACK);
LISTBOX_SetItemSpacing(hListbox, 4);
LISTBOX_SetSel(hListbox, 1);
LISTBOX_SetAutoScrollV(hListbox, 1);
hText = TEXT_CreateEx(120, 40, 80, 20, pMsg->hWin, WM_CF_SHOW, TEXT_CF_HCENTER, ID_TEXT_2, "Main Menu");
TEXT_SetFont(hText, &GUI_Font8x18);
TEXT_SetTextColor(hText, GUI_BLACK);
break;
case WM_PAINT:
//GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
break;
WM_HWIN CreateChild2(void);
WM_HWIN CreateChild2(void) {
hTool2 = WM_CreateWindowAsChild(43, 35, 240, 180, hParent, WM_CF_HASTRANS, _cbTool2, 0);
return hTool2;
}
Every thins seems fine until i move down then the widget overwrites the selected line with the text from the previous line and become darker