Hi all,
I'm trying to setup a vertical scrolling child window inside its parent window.
This child window Y dimension should be greater than the parent window so it will be partially visible according the current scrolling position.
The child window contains BUTTON and TEXT objects that have to move according to the current scrolling position
At the moment I've managed to create a small child window with an own button and the code looks like that:
Display All
The child window has its own callback and so its own button, the visualization and the touch response is fine.
So my questions are:
- If I make a larger (in terms of Y-axis) child window how can I make it only partially according to the current Y-scrolling?
- How can I make the child window scroll only on the Y-axis without moving all the window? Where do I have to write the WM_MOTION case? In both parent and child window?
(And also if I made some mistake and this is not the proper way to do the trick...)
Thank you!
Mark
I'm trying to setup a vertical scrolling child window inside its parent window.
This child window Y dimension should be greater than the parent window so it will be partially visible according the current scrolling position.
The child window contains BUTTON and TEXT objects that have to move according to the current scrolling position
At the moment I've managed to create a small child window with an own button and the code looks like that:
Source Code
- static const GUI_WIDGET_CREATE_INFO _aGUISWIPELISTTEST_MainWinDialogCreate[] = {
- // Main Window
- { WINDOW_CreateIndirect, "GUISWIPELISTTEST Window", GUISWIPELISTTEST_ID_MAIN_WIN, GUISWIPELISTTEST_WINDOW_XPOS, GUISWIPELISTTEST_WINDOW_YPOS, GUISWIPELISTTEST_WINDOW_XSIZE + 100, GUISWIPELISTTEST_WINDOW_YSIZE + 100, 0, 0, 0 },
- // Texts and Labels
- // USER START (Optionally insert additional widgets)
- // USER END
- };
- //Main dialog creation
- g_GUISwipeListTest.hWin = GUI_CreateDialogBox(_aGUISWIPELISTTEST_MainWinDialogCreate, GUI_COUNTOF(_aGUISWIPELISTTEST_MainWinDialogCreate), _cbDialogGUISWIPELISTTEST_MainWin, WM_GetDesktopWindowEx(0), 0, 0);
- ...
- static void _cbDialogGUISWIPELISTTEST_MainWin(WM_MESSAGE *pMsg)
- {
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- //
- // Initialization of 'Window'
- //
- hItem = pMsg->hWin;
- WINDOW_SetBkColor(hItem,GUI_CUSTOM_MAIN_BACKGROUND_COLOR);
- WM_EnableWindow(hItem);
- //
- // Subwindow initialization
- //
- g_GUISwipeListTest.hChildWin = WM_CreateWindowAsChild(GUISWIPELISTTEST_FOOTER_LINE_XPOS, 20, GUISWIPELISTTEST_FOOTER_LINE_XSIZE, 150, pMsg->hWin, WM_CF_SHOW | WM_CF_HASTRANS | WM_CF_MEMDEV_ON_REDRAW, _cbSUBWINDOW_N0, sizeof(WM_HWIN));
- //Button inside child window
- hItem_Btn =
- BUTTON_CreateEx(0,0,80,20,g_GUISwipeListTest.hChildWin, WM_CF_SHOW, 0, GUISWIPELISTTEST_ID_BTN_SUB_N0);
- WM_SetCallback (hItem_Btn, _cbGUISWIPELISTTEST_Btn_Sub_N0);
- break;
- case WM_MOTION:
- pInfo = (WM_MOTION_INFO *)pMsg->Data.p;
- switch (pInfo->Cmd) {
- case WM_MOTION_INIT:
- pInfo->Flags = WM_CF_MOTION_Y;
- break;
- }
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
The child window has its own callback and so its own button, the visualization and the touch response is fine.
So my questions are:
- If I make a larger (in terms of Y-axis) child window how can I make it only partially according to the current Y-scrolling?
- How can I make the child window scroll only on the Y-axis without moving all the window? Where do I have to write the WM_MOTION case? In both parent and child window?
(And also if I made some mistake and this is not the proper way to do the trick...)
Thank you!
Mark