EDIT_Handle EDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* pCallback) { EDIT_Handle hEdit; GUI_USE_PARA(pCallback); hEdit = EDIT_CreateAsChild( pCreateInfo->x0 + x0, pCreateInfo->y0 + y0, pCreateInfo->xSize, pCreateInfo->ySize, hWinParent, pCreateInfo->Id, pCreateInfo->Flags, pCreateInfo->Para); return hEdit; }
egx_wnd_t egx_edit_create_(int res_id,char *name,egx_uint32_t style,int x,int y,int width,int height,egx_wnd_t parent) { EDIT_Handle hEdit; if(parent){ hEdit = EDIT_CreateAsChild(x, y, width,height,GUIWND_TO_HWND(parent), res_id,WM_CF_SHOW,256); }else{ hEdit = EDIT_Create(x, y, width,height, res_id, 256, WM_CF_SHOW ); } EDIT_SetInsertMode(hEdit, 0); return HWND_TO_GUIWND(hEdit); }
static void CreateCalculator(WM_HWIN hWin) { int y0 = 55; int XSize = LCD_GetXSize(); int YSize = LCD_GetYSize(); int XStep = XSize / 5; int YStep = (YSize - y0 - 25) / 4; char ac[2]; char *s=NULL; int XPos,YPos; int i = 0; for (i = 0; i < 19; i++) { if (i == 14) i = 15; XPos = (i % 5) * XStep + 3; YPos = (i / 5) * YStep + 3 + y0; memset(&ac, 0, sizeof(char)* 2); s = ac; ac[0] = _acText[i]; if (i == 18) { hButton[i] = BUTTON_CreateAsChild(XPos, YPos, XStep * 2 - 5, YStep - 5, hWin, _acText[i], WM_CF_SHOW); } else if (i == 9) hButton[i] = BUTTON_CreateAsChild(XPos, YPos, XStep - 5, YStep * 2 - 5, hWin, _acText[i], WM_CF_SHOW); else hButton[i] = BUTTON_CreateAsChild(XPos, YPos, XStep - 5, YStep - 5, hWin, _acText[i], WM_CF_SHOW); BUTTON_SetBkColor(hButton[i], BUTTON_CI_UNPRESSED, 0x50A0FF); BUTTON_SetBkColor(hButton[i], BUTTON_CI_PRESSED, 0x004080); BUTTON_SetTextColor(hButton[i], BUTTON_CI_UNPRESSED, GUI_WHITE); BUTTON_SetTextColor(hButton[i], BUTTON_CI_PRESSED, GUI_WHITE); BUTTON_SetFont(hButton[i], &GUI_Font24B_ASCII); if (i == 18) { BUTTON_SetText(hButton[i], "EXIT"); } else BUTTON_SetText(hButton[i], s); } hEdit = EDIT_CreateAsChild(0, 0, 320, 50, hWin, 0, WM_CF_SHOW, 80); EDIT_SetTextColor(hEdit, 0, 0x0080FF); EDIT_SetFont(hEdit, &GUI_Font24B_ASCII); EDIT_SetBkColor(hEdit, 0, GUI_RED); }
/******************************************************************* * * _DemoScrollbarMove This function creates the window and his child objects. Then it runs into a idle-loop, so that the window manager can handle the objects. */ static void _DemoScrollbarMove(void) { int x, y; WM_HWIN hWindow; SCROLLBAR_Handle hScroll; /* Clear display and display headline */ GUI_SetBkColor(GUI_BLUE); GUI_Clear(); GUI_SetColor(GUI_WHITE); GUI_SetFont(&GUI_Font24_ASCII); GUI_SetTextAlign(GUI_TA_HCENTER); GUI_DispStringAt("SCROLLBAR_Move - Sample", 160, 5); GUI_SetTextAlign(GUI_TA_LEFT); GUI_SetColor(0xFFFFFF); GUI_SetFont(&GUI_Font8x16); /* Create the window */ hWindow = WM_CreateWindow(50, 90, 220, 79, WM_CF_SHOW, &_cbWindow, 0); /* Create the scrollbar */ hScroll = SCROLLBAR_CreateAttached(hWindow, 0); SCROLLBAR_SetNumItems(hScroll, 48 * EDIT_MAX_X); SCROLLBAR_SetPageSize(hScroll, 220); /* Create the edit-fields */ for (y = 0; y < EDIT_MAX_Y; y++) { for (x = 0; x < EDIT_MAX_X; x++) { _aahEdit[y][x] = EDIT_CreateAsChild(x * 48, y * 22, 48, 22, hWindow, 13, WM_CF_SHOW, 5); EDIT_SetTextAlign(_aahEdit[y][x], GUI_TA_RIGHT | GUI_TA_VCENTER); EDIT_SetFont(_aahEdit[y][x], &GUI_Font8x16); EDIT_SetDecMode(_aahEdit[y][x], ((y * EDIT_MAX_X) + x) * 100, -99999, +99999, 2, 0); } } /* idle-loop */ while (1) { GUI_Exec(); GUI_Delay(20); } /* delete window and clear display */ WM_DeleteWindow(hWindow); GUI_Clear(); }
EDIT_Handle EDIT_Create(int x0, int y0, int xsize, int ysize, int Id, int MaxLen, int Flags) { return EDIT_CreateAsChild(x0, y0, xsize, ysize, WM_HMEM_NULL, Id, Flags, MaxLen); }