/************************************************** *******************
* *
* 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:
302 Found Support:
support@segger.com *
* *
************************************************** ********************
*/
// USER START (Optionally insert additional includes)
// USER END
#include "DIALOG.h"
#include "red-led-on-hi.c"
#include "red-led-off-hi.c"
/************************************************** *******************
*
* Defines
*
************************************************** ********************
*/
#define ID_WINDOW_0 (GUI_ID_USER + 0x00)
#define ID_BUTTON_0 (GUI_ID_USER + 0x01)
#define ID_BUTTON_1 (GUI_ID_USER + 0x02)
#define ID_BUTTON_2 (GUI_ID_USER + 0x03)
// USER START (Optionally insert additional defines)
// USER END
/************************************************** *******************
*
* Static data
*
************************************************** ********************
*/
// USER START (Optionally insert additional static data)
// USER END
/************************************************** *******************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 800, 480, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button1__ON", ID_BUTTON_0, 55, 36, 99, 47, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Button2__OFF", ID_BUTTON_1, 58, 115, 91, 46, 0, 0x0, 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) {
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button1__ON'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
GUI_DrawBitmap(&bmredledonhi, 400, 80);
// 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;
case ID_BUTTON_1: // Notifications sent by 'Button2__OFF'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
GUI_DrawBitmap(&bmredledoffhi, 400, 80);
// 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;
}
// USER START (Optionally insert additional public code)
void MainTask(void) {
WM_HWIN testWin;
//
// Init GUI
//
GUI_Init();
testWin = CreateWindow();
WM_SelectWindow(testWin);// here we select where to draw \\
while (1) {
GUI_Delay(100);
}
}
// USER END
/*************************** End of file ****************************/