When I use GUI_CreateDialogBox() to create a dialog including a window, I find that the code in WM_CREATE branch of callback function is not excuted. Then I set breakpoint in WM_CREATE branch and find it never arrived. However, if I just use WM_CreateWindow() to create the window with the same callback function, the WM_CREATE branch can be excuted. So my quesiton is does GUI_CreateDialogBox() really can not sent the WM_CREATE message or is there something wrong when I use GUI_CreateDialogBox()?
Here is my code:
Display All
Here is my code:
C Source Code
- #include "DIALOG.h"
- #include "GUI.h"
- #define ID_WINDOW_LOADING (GUI_ID_USER + 0x01)
- static const GUI_WIDGET_CREATE_INFO _aLoadingDiologCreate[] = {
- { WINDOW_CreateIndirect, "Window", ID_WINDOW_LOADING, 0, 0, 480, 800, 0, 0x0, 0 },
- };
- void _cbLoading(WM_MESSAGE * pMsg) {
- switch (pMsg->MsgId) {
- case WM_CREATE:
- GUI_SetBkColor(GUI_BLACK);
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
- void MainTask(void) {
- WM_SetCreateFlags(WM_CF_MEMDEV);
- GUI_Init();
- // This can't trig WM_CREATE
- GUI_CreateDialogBox(_aLoadingDiologCreate, GUI_COUNTOF(_aLoadingDiologCreate), _cbLoading, WM_HBKWIN, 0, 0);
- // This can trig WM_CREATE
- // WM_CreateWindow(0,0,480,800,WM_CF_SHOW,_cbLoading,0);
- while(1)
- {
- GUI_Delay(100);
- }
- }