I have a lot of custom widgets in my project. All of them created with WM_CreateWindowAsChild and returning a handle to the main window. Something like this:
Display All
As you can see, in this example I have a main child window, that is going to be child of the window passed as parameter on the method create. And I have 3 windows that are children of this so called 'main child window'.
My question is. Is it possible to receive a message via callback (in my example the callback is called cbMain) when I use a WM_DisableWindow and WM_EnableWindow?
My focus here is try to develop a custom widget with the same interface as the emWin Widgets.
C Source Code
- SPIN_TEXT_BOX_HD SPIN_TEXT_BOX_create(int x, int y, int w, int h, WM_HWIN hWinParent, U32 style)
- {
- SPIN_TEXT_BOX_HD mainHd;
- WM_HWIN widgetHd;
- spin_text_box_t dft_data = {0, 0, 0, {NULL} };
- btn_data_t btn_data = {0, FALSE};
- // Edit dimensions
- int ew;
- mainHd = WM_CreateWindowAsChild(x, y, w, h, hWinParent, style, cbMain, sizeof(spin_text_box_t));
- WM_SetUserData(mainHd, &dft_data, sizeof(spin_text_box_t));
- widgetHd = BUTTON_CreateEx( 0, 0, 50, 50, mainHd, style, 0, WDG_BTN_DEC);
- WM_SetCallback(widgetHd, cbButton);
- WM_SetUserData(widgetHd, &btn_data, sizeof(btn_data_t));
- // Edit width
- ew = w - 2*50;
- widgetHd = EDIT_CreateEx ( 50, 0, ew, 50, mainHd, style, 0, WDG_LABEL_TXT, 24);
- WM_SetCallback(widgetHd, cbEdit);
- btn_data.arrow_right = TRUE;
- widgetHd = BUTTON_CreateEx( 50+ew, 0, 50, 50, mainHd, style, 0, WDG_BTN_INC);
- WM_SetCallback(widgetHd, cbButton);
- WM_SetUserData(widgetHd, &btn_data, sizeof(btn_data_t));
- return mainHd;
- }
As you can see, in this example I have a main child window, that is going to be child of the window passed as parameter on the method create. And I have 3 windows that are children of this so called 'main child window'.
My question is. Is it possible to receive a message via callback (in my example the callback is called cbMain) when I use a WM_DisableWindow and WM_EnableWindow?
My focus here is try to develop a custom widget with the same interface as the emWin Widgets.
The post was edited 2 times, last by RodolfoDias ().