I have build a small application with the gui maker and want to add now my own code.
I have build a callback (line 170) and want there to display text but i don*t get it.
Display All
would be nice to get a hint how to manage it.
regards
Jim
I have build a callback (line 170) and want there to display text but i don*t get it.
Source Code
- /*********************************************************************
- * *
- * SEGGER Microcontroller GmbH & Co. KG *
- * Solutions for real time microcontroller applications *
- * *
- **********************************************************************
- * *
- * C-file generated by: *
- * *
- * GUI_Builder for emWin version 5.22 *
- * Compiled Jul 4 2013, 15:16:01 *
- * (c) 2013 Segger Microcontroller GmbH & Co. KG *
- * *
- **********************************************************************
- * *
- * Internet: www.segger.com Support: support@segger.com *
- * *
- **********************************************************************
- */
- // USER START (Optionally insert additional includes)
- // USER END
- #include "DIALOG.h"
- #include "GUI.h"
- #include "WM.h"
- #include "global_includes.h"
- /*********************************************************************
- *
- * Defines
- *
- **********************************************************************
- */
- #define ID_WINDOW_0 (GUI_ID_USER + 0x08)
- #define ID_BUTTON_0 (GUI_ID_USER + 0x1B)
- #define ID_TEXT_0 (GUI_ID_USER + 0x1C)
- #define ID_TEXT_1 (GUI_ID_USER + 0x1D)
- // USER START (Optionally insert additional defines)
- // USER END
- /*********************************************************************
- *
- * Static data
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static data)
- // USER END
- /*********************************************************************
- *
- * _aDialogCreate
- */
- extern WM_HWIN CreateFramewin(void);
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
- { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 240, 320, 0, 0x0, 0 },
- { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 28, 267, 179, 37, 0, 0x0, 0 },
- { TEXT_CreateIndirect, "Text", ID_TEXT_0, 22, 40, 195, 29, 0, 0x64, 0 },
- { TEXT_CreateIndirect, "Text", ID_TEXT_1, 42, 67, 215, 33, 0, 0x64, 0 },
- // USER START (Optionally insert additional widgets)
- // USER END
- };
- /*********************************************************************
- *
- * Static code
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static code)
- // USER END
- /*********************************************************************
- *
- * _cbDialog
- */
- static void _cbDialog(WM_MESSAGE * pMsg) {
- WM_HWIN hItem;
- int NCode;
- int Id;
- // USER START (Optionally insert additional variables)
- // USER END
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- //
- // Initialization of 'Window'
- //
- hItem = pMsg->hWin;
- WINDOW_SetBkColor(hItem, 0x00000080);
- //
- // Initialization of 'Button'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
- BUTTON_SetText(hItem, "LED");
- BUTTON_SetFont(hItem, GUI_FONT_COMIC24B_ASCII);
- BUTTON_SetBkColor(hItem,BUTTON_CI_UNPRESSED,GUI_WHITE);
- //
- // Initialization of 'Text'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetTextColor(hItem, 0x00FF0000);
- TEXT_SetFont(hItem, GUI_FONT_24_ASCII);
- TEXT_SetText(hItem, "STM32F429I-DISCO");
- //
- // Initialization of 'Text'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
- TEXT_SetFont(hItem, GUI_FONT_24_ASCII);
- TEXT_SetText(hItem, "emWin Demo");
- TEXT_SetTextColor(hItem, 0x00FF0000);
- // USER START (Optionally insert additional code for further widget initialization)
- // USER END
- break;
- case WM_NOTIFY_PARENT:
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- switch(Id) {
- case ID_BUTTON_0: // Notifications sent by 'Button'
- switch(NCode) {
- case WM_NOTIFICATION_CLICKED:
- // USER START (Optionally insert code for reacting on notification message)
- CreateFramewin();
- // USER END
- break;
- case WM_NOTIFICATION_RELEASED:
- // USER START (Optionally insert code for reacting on notification message)
- // USER END
- break;
- // USER START (Optionally insert additional code for further notification handling)
- // USER END
- }
- break;
- // USER START (Optionally insert additional code for further Ids)
- // USER END
- }
- break;
- // USER START (Optionally insert additional message handling)
- // USER END
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
- /*********************************************************************
- *
- * Public code
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * CreateWindow
- */
- WM_HWIN CreateWindow(void);
- WM_HWIN CreateWindow(void) {
- WM_HWIN hWin;
- hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
- return hWin;
- }
- /*******************************************************************
- *
- * _Callback
- */
- void _callback () {
- STM_EVAL_LEDToggle(LED3);
- GUI_SetTextMode(GUI_TM_NORMAL);
- GUI_SetColor(GUI_YELLOW);
- GUI_SetFont(GUI_FONT_16B_ASCII);
- GUI_DispStringAt((char *)"Test", 50, 4);
- }
- // USER START (Optionally insert additional public code)
- // USER END
- /*************************** End of file ****************************/
- void MainTask(void)
- {
- WM_SetCreateFlags(WM_CF_MEMDEV | WM_CF_CONST_OUTLINE);
- GUI_Init();
- WM_MULTIBUF_Enable(1);
- WM_SetCallback(WM_HBKWIN, _callback);
- CreateWindow();
- while(1)
- {
- _callback ();
- GUI_Delay(100);
- }
- }
- // USER START (Optionally insert additional public code)
- // USER END
- /*************************** End of file ****************************/
would be nice to get a hint how to manage it.
regards
Jim