Example that shows how to use emWin. This example is based on NXP's POS demo available at lpcware.com

Dependencies:   EALib ewgui mbed

Committer:
embeddedartists
Date:
Mon Apr 14 08:40:59 2014 +0000
Revision:
2:cbf00ac63f35
Parent:
0:2052561807c5
Updated to use latest ewgui

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:2052561807c5 1 /*********************************************************************
embeddedartists 0:2052561807c5 2 * *
embeddedartists 0:2052561807c5 3 * SEGGER Microcontroller GmbH & Co. KG *
embeddedartists 0:2052561807c5 4 * Solutions for real time microcontroller applications *
embeddedartists 0:2052561807c5 5 * *
embeddedartists 0:2052561807c5 6 **********************************************************************
embeddedartists 0:2052561807c5 7 * *
embeddedartists 0:2052561807c5 8 * C-file generated by: *
embeddedartists 0:2052561807c5 9 * *
embeddedartists 0:2052561807c5 10 * GUI_Builder for emWin version 5.14 *
embeddedartists 0:2052561807c5 11 * Compiled Jan 12 2012, 10:28:50 *
embeddedartists 0:2052561807c5 12 * (c) 2011 Segger Microcontroller GmbH & Co. KG *
embeddedartists 0:2052561807c5 13 * *
embeddedartists 0:2052561807c5 14 **********************************************************************
embeddedartists 0:2052561807c5 15 * *
embeddedartists 0:2052561807c5 16 * Internet: www.segger.com Support: support@segger.com *
embeddedartists 0:2052561807c5 17 * *
embeddedartists 0:2052561807c5 18 **********************************************************************
embeddedartists 0:2052561807c5 19 */
embeddedartists 0:2052561807c5 20
embeddedartists 0:2052561807c5 21 // USER START (Optionally insert additional includes)
embeddedartists 0:2052561807c5 22 #include <stdio.h>
embeddedartists 0:2052561807c5 23 #include <string.h>
embeddedartists 0:2052561807c5 24 #include "DIALOG.h"
embeddedartists 0:2052561807c5 25 #include "BlueboardPOS.h"
embeddedartists 0:2052561807c5 26 //AR #include "CLRC663.h"
embeddedartists 0:2052561807c5 27 // USER END
embeddedartists 0:2052561807c5 28
embeddedartists 0:2052561807c5 29
embeddedartists 0:2052561807c5 30
embeddedartists 0:2052561807c5 31 /*********************************************************************
embeddedartists 0:2052561807c5 32 *
embeddedartists 0:2052561807c5 33 * Defines
embeddedartists 0:2052561807c5 34 *
embeddedartists 0:2052561807c5 35 **********************************************************************
embeddedartists 0:2052561807c5 36 */
embeddedartists 0:2052561807c5 37
embeddedartists 0:2052561807c5 38 #define ID_WINDOW_0 (GUI_ID_USER + 0x01)
embeddedartists 0:2052561807c5 39 #define ID_BUTTON_0 (GUI_ID_USER + 0x02)
embeddedartists 0:2052561807c5 40 #define ID_BUTTON_1 (GUI_ID_USER + 0x03)
embeddedartists 0:2052561807c5 41 #define ID_BUTTON_2 (GUI_ID_USER + 0x04)
embeddedartists 0:2052561807c5 42 #define ID_BUTTON_3 (GUI_ID_USER + 0x05)
embeddedartists 0:2052561807c5 43 #define ID_BUTTON_4 (GUI_ID_USER + 0x06)
embeddedartists 0:2052561807c5 44 #define ID_BUTTON_5 (GUI_ID_USER + 0x07)
embeddedartists 0:2052561807c5 45 #define ID_BUTTON_6 (GUI_ID_USER + 0x08)
embeddedartists 0:2052561807c5 46 #define ID_BUTTON_7 (GUI_ID_USER + 0x09)
embeddedartists 0:2052561807c5 47 #define ID_BUTTON_8 (GUI_ID_USER + 0x0A)
embeddedartists 0:2052561807c5 48 #define ID_LISTVIEW_0 (GUI_ID_USER + 0x0E)
embeddedartists 0:2052561807c5 49 #define ID_BUTTON_9 (GUI_ID_USER + 0x0B)
embeddedartists 0:2052561807c5 50 #define ID_BUTTON_10 (GUI_ID_USER + 0x0C)
embeddedartists 0:2052561807c5 51 #define ID_TEXT_0 (GUI_ID_USER + 0x0F)
embeddedartists 0:2052561807c5 52 #define ID_BUTTON_11 (GUI_ID_USER + 0x0D)
embeddedartists 0:2052561807c5 53
embeddedartists 0:2052561807c5 54 // USER START (Optionally insert additional defines)
embeddedartists 0:2052561807c5 55 #define ID_IMAGE_0 (GUI_ID_USER + 0x20)
embeddedartists 0:2052561807c5 56 #define ID_IMAGE_1 (GUI_ID_USER + 0x21)
embeddedartists 0:2052561807c5 57
embeddedartists 0:2052561807c5 58 #define BUTTON_BitmapSkin DrawCustomSkin
embeddedartists 0:2052561807c5 59 // USER END
embeddedartists 0:2052561807c5 60
embeddedartists 0:2052561807c5 61 /*********************************************************************
embeddedartists 0:2052561807c5 62 *
embeddedartists 0:2052561807c5 63 * Static data
embeddedartists 0:2052561807c5 64 *
embeddedartists 0:2052561807c5 65 **********************************************************************
embeddedartists 0:2052561807c5 66 */
embeddedartists 0:2052561807c5 67
embeddedartists 0:2052561807c5 68 // USER START (Optionally insert additional static data)
embeddedartists 0:2052561807c5 69 /*
embeddedartists 0:2052561807c5 70 extern const uint8_t _acImage_0[385078];
embeddedartists 0:2052561807c5 71 extern GUI_CONST_STORAGE GUI_BITMAP bmnxplogo_small;
embeddedartists 0:2052561807c5 72 extern GUI_CONST_STORAGE GUI_BITMAP bmblack_coffee;
embeddedartists 0:2052561807c5 73 extern GUI_CONST_STORAGE GUI_BITMAP bmchocolate_doughnut;
embeddedartists 0:2052561807c5 74 extern GUI_CONST_STORAGE GUI_BITMAP bmmilk;
embeddedartists 0:2052561807c5 75 extern GUI_CONST_STORAGE GUI_BITMAP bmlatte_coffee;
embeddedartists 0:2052561807c5 76 extern GUI_CONST_STORAGE GUI_BITMAP bmglazed_doughnut;
embeddedartists 0:2052561807c5 77 extern GUI_CONST_STORAGE GUI_BITMAP bmorangejuice;
embeddedartists 0:2052561807c5 78 extern GUI_CONST_STORAGE GUI_BITMAP bmnewspaper;
embeddedartists 0:2052561807c5 79 extern GUI_CONST_STORAGE GUI_BITMAP bmdanish;
embeddedartists 0:2052561807c5 80 extern GUI_CONST_STORAGE GUI_BITMAP bmbottledwater;
embeddedartists 0:2052561807c5 81 */
embeddedartists 0:2052561807c5 82 //#include "Background.cpp"
embeddedartists 0:2052561807c5 83 #include "nxplogo_small.cpp"
embeddedartists 0:2052561807c5 84 #include "black_coffee.cpp"
embeddedartists 0:2052561807c5 85 #include "chocolate_doughnut.cpp"
embeddedartists 0:2052561807c5 86 #include "milk.cpp"
embeddedartists 0:2052561807c5 87 #include "latte_coffee.cpp"
embeddedartists 0:2052561807c5 88 #include "glazed_doughnut.cpp"
embeddedartists 0:2052561807c5 89 #include "orangejuice.cpp"
embeddedartists 0:2052561807c5 90 #include "newspaper.cpp"
embeddedartists 0:2052561807c5 91 #include "danish.cpp"
embeddedartists 0:2052561807c5 92 #include "bottledwater.cpp"
embeddedartists 0:2052561807c5 93 // USER END
embeddedartists 0:2052561807c5 94
embeddedartists 0:2052561807c5 95 /*********************************************************************
embeddedartists 0:2052561807c5 96 *
embeddedartists 0:2052561807c5 97 * _aDialogCreate
embeddedartists 0:2052561807c5 98 */
embeddedartists 0:2052561807c5 99 static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
embeddedartists 0:2052561807c5 100 { WINDOW_CreateIndirect, "OrderEntry", ID_WINDOW_0, 0, 0, 800, 480, 0, 0, 0 },
embeddedartists 0:2052561807c5 101 { BUTTON_CreateIndirect, "Button3", ID_BUTTON_0, 30, 15, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 102 { BUTTON_CreateIndirect, "Button4", ID_BUTTON_1, 150, 15, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 103 { BUTTON_CreateIndirect, "Button5", ID_BUTTON_2, 270, 15, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 104 { BUTTON_CreateIndirect, "Button6", ID_BUTTON_3, 30, 135, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 105 { BUTTON_CreateIndirect, "Button7", ID_BUTTON_4, 150, 135, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 106 { BUTTON_CreateIndirect, "Button8", ID_BUTTON_5, 270, 135, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 107 { BUTTON_CreateIndirect, "Button9", ID_BUTTON_6, 30, 255, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 108 { BUTTON_CreateIndirect, "Button10", ID_BUTTON_7, 150, 255, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 109 { BUTTON_CreateIndirect, "Button11", ID_BUTTON_8, 270, 255, 110, 110, 0, 0, 0 },
embeddedartists 0:2052561807c5 110 { LISTVIEW_CreateIndirect, "Listview", ID_LISTVIEW_0, 422, 133, 363, 231, 0, 0, 0 },
embeddedartists 0:2052561807c5 111 { BUTTON_CreateIndirect, "Checkout", ID_BUTTON_9, 430, 400, 216, 65, 0, 0, 0 },
embeddedartists 0:2052561807c5 112 { BUTTON_CreateIndirect, "Clear", ID_BUTTON_10, 664, 400, 112, 65, 0, 0, 0 },
embeddedartists 0:2052561807c5 113 { TEXT_CreateIndirect, "Total", ID_TEXT_0, 597, 365, 182, 32, 0, 100, 0 },
embeddedartists 0:2052561807c5 114 { BUTTON_CreateIndirect, "QueryCard", ID_BUTTON_11, 78, 400, 250, 65, 0, 0, 0 },
embeddedartists 0:2052561807c5 115 // USER START (Optionally insert additional widgets)
embeddedartists 0:2052561807c5 116 { IMAGE_CreateIndirect, "Image", ID_IMAGE_0, 508, 7, 193, 112, WM_CF_BGND, IMAGE_CF_AUTOSIZE, 0 },
embeddedartists 0:2052561807c5 117 { IMAGE_CreateIndirect, "Image", ID_IMAGE_1, 0, 0, 800, 480, WM_CF_BGND, IMAGE_CF_AUTOSIZE, 0 },
embeddedartists 0:2052561807c5 118 // USER END
embeddedartists 0:2052561807c5 119 };
embeddedartists 0:2052561807c5 120
embeddedartists 0:2052561807c5 121 /*********************************************************************
embeddedartists 0:2052561807c5 122 *
embeddedartists 0:2052561807c5 123 * Static code
embeddedartists 0:2052561807c5 124 *
embeddedartists 0:2052561807c5 125 **********************************************************************
embeddedartists 0:2052561807c5 126 */
embeddedartists 0:2052561807c5 127
embeddedartists 0:2052561807c5 128 // USER START (Optionally insert additional static code)
embeddedartists 0:2052561807c5 129 void displayTotal(WM_HWIN hWin)
embeddedartists 0:2052561807c5 130 {
embeddedartists 0:2052561807c5 131 WM_HWIN hItem;
embeddedartists 0:2052561807c5 132 char Total[64], SubTotal[16];
embeddedartists 0:2052561807c5 133 int total = 0, row, subtotal100, subtotal;
embeddedartists 0:2052561807c5 134
embeddedartists 0:2052561807c5 135 hItem = WM_GetDialogItem(hWin, ID_LISTVIEW_0);
embeddedartists 0:2052561807c5 136
embeddedartists 0:2052561807c5 137 for(row = 0; row < (LISTVIEW_GetNumRows(hItem)); row++)
embeddedartists 0:2052561807c5 138 {
embeddedartists 0:2052561807c5 139 LISTVIEW_GetItemText(hItem, 3, row, SubTotal, sizeof(SubTotal));
embeddedartists 0:2052561807c5 140 sscanf(SubTotal, "%d.%02d", &subtotal100, &subtotal);
embeddedartists 0:2052561807c5 141 total = total + subtotal100 * 100 + subtotal;
embeddedartists 0:2052561807c5 142 }
embeddedartists 0:2052561807c5 143
embeddedartists 0:2052561807c5 144 sprintf(Total, "Total $%d.%02d", total / 100, total - total / 100 * 100);
embeddedartists 0:2052561807c5 145 hItem = WM_GetDialogItem(hWin, ID_TEXT_0);
embeddedartists 0:2052561807c5 146 TEXT_SetText(hItem, Total);
embeddedartists 0:2052561807c5 147 }
embeddedartists 0:2052561807c5 148
embeddedartists 0:2052561807c5 149 void clearItems(WM_HWIN hWin)
embeddedartists 0:2052561807c5 150 {
embeddedartists 0:2052561807c5 151 WM_HWIN hItem;
embeddedartists 0:2052561807c5 152
embeddedartists 0:2052561807c5 153 // add the button text to a new line in the item list
embeddedartists 0:2052561807c5 154 hItem = WM_GetDialogItem(hWin, ID_LISTVIEW_0);
embeddedartists 0:2052561807c5 155 LISTVIEW_DeleteAllRows(hItem);
embeddedartists 0:2052561807c5 156 displayTotal(hWin);
embeddedartists 0:2052561807c5 157 }
embeddedartists 0:2052561807c5 158
embeddedartists 0:2052561807c5 159 void addItem(WM_HWIN hWin, int Id, int price)
embeddedartists 0:2052561807c5 160 {
embeddedartists 0:2052561807c5 161 WM_HWIN hItem;
embeddedartists 0:2052561807c5 162 char ButtonText[64], Quantity[16], Price[16], SubTotal[16];
embeddedartists 0:2052561807c5 163 int row, qnty, subtotal;
embeddedartists 0:2052561807c5 164
embeddedartists 0:2052561807c5 165 // get the text on the button
embeddedartists 0:2052561807c5 166 hItem = WM_GetDialogItem(hWin, Id);
embeddedartists 0:2052561807c5 167 BUTTON_GetText(hItem, ButtonText, sizeof(ButtonText));
embeddedartists 0:2052561807c5 168
embeddedartists 0:2052561807c5 169 // add the button text to a new line in the item list
embeddedartists 0:2052561807c5 170 hItem = WM_GetDialogItem(hWin, ID_LISTVIEW_0);
embeddedartists 0:2052561807c5 171 LISTVIEW_AddRow(hItem, NULL);
embeddedartists 0:2052561807c5 172 row = LISTVIEW_GetNumRows(hItem) - 1;
embeddedartists 0:2052561807c5 173 qnty = 1;
embeddedartists 0:2052561807c5 174
embeddedartists 0:2052561807c5 175 subtotal = qnty * price;
embeddedartists 0:2052561807c5 176 sprintf(Quantity, "%d", qnty);
embeddedartists 0:2052561807c5 177 sprintf(Price, "%d.%02d", price / 100, price - price / 100 * 100);
embeddedartists 0:2052561807c5 178 sprintf(SubTotal, "%d.%02d", subtotal / 100, subtotal - subtotal / 100 * 100);
embeddedartists 0:2052561807c5 179 LISTVIEW_SetItemText(hItem, 0, row, Quantity);
embeddedartists 0:2052561807c5 180 LISTVIEW_SetItemText(hItem, 1, row, ButtonText);
embeddedartists 0:2052561807c5 181 LISTVIEW_SetItemText(hItem, 2, row, Price);
embeddedartists 0:2052561807c5 182 LISTVIEW_SetItemText(hItem, 3, row, SubTotal);
embeddedartists 0:2052561807c5 183
embeddedartists 0:2052561807c5 184 displayTotal(hWin);
embeddedartists 0:2052561807c5 185 }
embeddedartists 0:2052561807c5 186
embeddedartists 0:2052561807c5 187 // USER END
embeddedartists 0:2052561807c5 188
embeddedartists 0:2052561807c5 189 /*********************************************************************
embeddedartists 0:2052561807c5 190 *
embeddedartists 0:2052561807c5 191 * _cbDialog
embeddedartists 0:2052561807c5 192 */
embeddedartists 0:2052561807c5 193 static void _cbDialog(WM_MESSAGE * pMsg) {
embeddedartists 0:2052561807c5 194 WM_HWIN hItem;
embeddedartists 0:2052561807c5 195 int Id, NCode;
embeddedartists 0:2052561807c5 196 // USER START (Optionally insert additional variables)
embeddedartists 0:2052561807c5 197 char SubTotal[16];
embeddedartists 0:2052561807c5 198 int total = 0, row, subtotal100, subtotal;
embeddedartists 0:2052561807c5 199 uint32_t status;
embeddedartists 0:2052561807c5 200 // USER END
embeddedartists 0:2052561807c5 201
embeddedartists 0:2052561807c5 202 switch (pMsg->MsgId) {
embeddedartists 0:2052561807c5 203 case WM_INIT_DIALOG:
embeddedartists 0:2052561807c5 204 //
embeddedartists 0:2052561807c5 205 // Initialization of 'Button3'
embeddedartists 0:2052561807c5 206 //
embeddedartists 0:2052561807c5 207 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
embeddedartists 0:2052561807c5 208 BUTTON_SetText(hItem, "Black Coffee");
embeddedartists 0:2052561807c5 209 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 210 //
embeddedartists 0:2052561807c5 211 // Initialization of 'Button4'
embeddedartists 0:2052561807c5 212 //
embeddedartists 0:2052561807c5 213 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
embeddedartists 0:2052561807c5 214 BUTTON_SetText(hItem, "Choc. Donut");
embeddedartists 0:2052561807c5 215 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 216 //
embeddedartists 0:2052561807c5 217 // Initialization of 'Button5'
embeddedartists 0:2052561807c5 218 //
embeddedartists 0:2052561807c5 219 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
embeddedartists 0:2052561807c5 220 BUTTON_SetText(hItem, "Milk");
embeddedartists 0:2052561807c5 221 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 222 //
embeddedartists 0:2052561807c5 223 // Initialization of 'Button6'
embeddedartists 0:2052561807c5 224 //
embeddedartists 0:2052561807c5 225 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_3);
embeddedartists 0:2052561807c5 226 BUTTON_SetText(hItem, "Latte");
embeddedartists 0:2052561807c5 227 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 228 //
embeddedartists 0:2052561807c5 229 // Initialization of 'Button7'
embeddedartists 0:2052561807c5 230 //
embeddedartists 0:2052561807c5 231 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_4);
embeddedartists 0:2052561807c5 232 BUTTON_SetText(hItem, "Glazed Donut");
embeddedartists 0:2052561807c5 233 BUTTON_SetFont(hItem, GUI_FONT_16B_1);
embeddedartists 0:2052561807c5 234 //
embeddedartists 0:2052561807c5 235 // Initialization of 'Button8'
embeddedartists 0:2052561807c5 236 //
embeddedartists 0:2052561807c5 237 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_5);
embeddedartists 0:2052561807c5 238 BUTTON_SetText(hItem, "Orange Juice");
embeddedartists 0:2052561807c5 239 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 240 //
embeddedartists 0:2052561807c5 241 // Initialization of 'Button9'
embeddedartists 0:2052561807c5 242 //
embeddedartists 0:2052561807c5 243 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_6);
embeddedartists 0:2052561807c5 244 BUTTON_SetText(hItem, "Newspaper");
embeddedartists 0:2052561807c5 245 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 246 //
embeddedartists 0:2052561807c5 247 // Initialization of 'Button10'
embeddedartists 0:2052561807c5 248 //
embeddedartists 0:2052561807c5 249 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_7);
embeddedartists 0:2052561807c5 250 BUTTON_SetText(hItem, "Danish");
embeddedartists 0:2052561807c5 251 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 252 //
embeddedartists 0:2052561807c5 253 // Initialization of 'Button11'
embeddedartists 0:2052561807c5 254 //
embeddedartists 0:2052561807c5 255 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_8);
embeddedartists 0:2052561807c5 256 BUTTON_SetText(hItem, "Bottled Water");
embeddedartists 0:2052561807c5 257 BUTTON_SetFont(hItem, GUI_FONT_16B_ASCII);
embeddedartists 0:2052561807c5 258 //
embeddedartists 0:2052561807c5 259 // Initialization of 'Listview'
embeddedartists 0:2052561807c5 260 //
embeddedartists 0:2052561807c5 261 hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_0);
embeddedartists 0:2052561807c5 262 LISTVIEW_AddColumn(hItem, 35, "Qnty", GUI_TA_HCENTER | GUI_TA_VCENTER);
embeddedartists 0:2052561807c5 263 LISTVIEW_AddColumn(hItem, 210, "Description", GUI_TA_HCENTER | GUI_TA_VCENTER);
embeddedartists 0:2052561807c5 264 LISTVIEW_AddColumn(hItem, 40, "Cost", GUI_TA_HCENTER | GUI_TA_VCENTER);
embeddedartists 0:2052561807c5 265 LISTVIEW_AddColumn(hItem, 80, "Sub total", GUI_TA_HCENTER | GUI_TA_VCENTER);
embeddedartists 0:2052561807c5 266 LISTVIEW_SetAutoScrollV(hItem, 1);
embeddedartists 0:2052561807c5 267 LISTVIEW_SetGridVis(hItem, 1);
embeddedartists 0:2052561807c5 268 //
embeddedartists 0:2052561807c5 269 // Initialization of 'Checkout'
embeddedartists 0:2052561807c5 270 //
embeddedartists 0:2052561807c5 271 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_9);
embeddedartists 0:2052561807c5 272 BUTTON_SetText(hItem, "Checkout");
embeddedartists 0:2052561807c5 273 BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
embeddedartists 0:2052561807c5 274 //
embeddedartists 0:2052561807c5 275 // Initialization of 'Clear'
embeddedartists 0:2052561807c5 276 //
embeddedartists 0:2052561807c5 277 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_10);
embeddedartists 0:2052561807c5 278 BUTTON_SetText(hItem, "Clear");
embeddedartists 0:2052561807c5 279 BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
embeddedartists 0:2052561807c5 280 //
embeddedartists 0:2052561807c5 281 // Initialization of 'Total'
embeddedartists 0:2052561807c5 282 //
embeddedartists 0:2052561807c5 283 hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
embeddedartists 0:2052561807c5 284 TEXT_SetTextAlign(hItem, GUI_TA_RIGHT | GUI_TA_VCENTER);
embeddedartists 0:2052561807c5 285 TEXT_SetFont(hItem, GUI_FONT_20B_ASCII);
embeddedartists 0:2052561807c5 286 TEXT_SetText(hItem, "Total $0.00");
embeddedartists 0:2052561807c5 287 //
embeddedartists 0:2052561807c5 288 // Initialization of 'QueryCard'
embeddedartists 0:2052561807c5 289 //
embeddedartists 0:2052561807c5 290 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_11);
embeddedartists 0:2052561807c5 291 BUTTON_SetText(hItem, "Query Card");
embeddedartists 0:2052561807c5 292 BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
embeddedartists 0:2052561807c5 293 // USER START (Optionally insert additional code for further widget initialization)
embeddedartists 0:2052561807c5 294 //
embeddedartists 0:2052561807c5 295 // Additional initialization of 'Image'
embeddedartists 0:2052561807c5 296 //
embeddedartists 0:2052561807c5 297 hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);
embeddedartists 0:2052561807c5 298 IMAGE_SetBitmap(hItem, &bmnxplogo_small);
embeddedartists 0:2052561807c5 299 //
embeddedartists 0:2052561807c5 300 // Additional initialization of 'Image'
embeddedartists 0:2052561807c5 301 //
embeddedartists 0:2052561807c5 302 hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_1);
embeddedartists 0:2052561807c5 303 //AR IMAGE_SetBMP(hItem, _acImage_0, sizeof(_acImage_0));
embeddedartists 0:2052561807c5 304 //
embeddedartists 0:2052561807c5 305 // Additional initialization of 'Button3'
embeddedartists 0:2052561807c5 306 //
embeddedartists 0:2052561807c5 307 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
embeddedartists 0:2052561807c5 308 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 309 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 310 //
embeddedartists 0:2052561807c5 311 // Additional initialization of 'Button4'
embeddedartists 0:2052561807c5 312 //
embeddedartists 0:2052561807c5 313 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
embeddedartists 0:2052561807c5 314 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 315 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 316 //
embeddedartists 0:2052561807c5 317 // Additional initialization of 'Button5'
embeddedartists 0:2052561807c5 318 //
embeddedartists 0:2052561807c5 319 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
embeddedartists 0:2052561807c5 320 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 321 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 322 //
embeddedartists 0:2052561807c5 323 // Additional initialization of 'Button6'
embeddedartists 0:2052561807c5 324 //
embeddedartists 0:2052561807c5 325 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_3);
embeddedartists 0:2052561807c5 326 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 327 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 328 //
embeddedartists 0:2052561807c5 329 // Additional initialization of 'Button7'
embeddedartists 0:2052561807c5 330 //
embeddedartists 0:2052561807c5 331 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_4);
embeddedartists 0:2052561807c5 332 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 333 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 334 //
embeddedartists 0:2052561807c5 335 // Additional initialization of 'Button8'
embeddedartists 0:2052561807c5 336 //
embeddedartists 0:2052561807c5 337 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_5);
embeddedartists 0:2052561807c5 338 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 339 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 340 //
embeddedartists 0:2052561807c5 341 // Additional initialization of 'Button9'
embeddedartists 0:2052561807c5 342 //
embeddedartists 0:2052561807c5 343 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_6);
embeddedartists 0:2052561807c5 344 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 345 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 346 //
embeddedartists 0:2052561807c5 347 // Additional initialization of 'Button10'
embeddedartists 0:2052561807c5 348 //
embeddedartists 0:2052561807c5 349 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_7);
embeddedartists 0:2052561807c5 350 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 351 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 352 //
embeddedartists 0:2052561807c5 353 // Additional initialization of 'Button11'
embeddedartists 0:2052561807c5 354 //
embeddedartists 0:2052561807c5 355 hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_8);
embeddedartists 0:2052561807c5 356 BUTTON_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_BOTTOM);
embeddedartists 0:2052561807c5 357 BUTTON_SetSkin(hItem, BUTTON_BitmapSkin);
embeddedartists 0:2052561807c5 358 // USER END
embeddedartists 0:2052561807c5 359 break;
embeddedartists 0:2052561807c5 360 case WM_NOTIFY_PARENT:
embeddedartists 0:2052561807c5 361 Id = WM_GetId(pMsg->hWinSrc);
embeddedartists 0:2052561807c5 362 NCode = pMsg->Data.v;
embeddedartists 0:2052561807c5 363 switch(Id) {
embeddedartists 0:2052561807c5 364 case ID_BUTTON_0: // Notifications sent by 'Button3'
embeddedartists 0:2052561807c5 365 switch(NCode) {
embeddedartists 0:2052561807c5 366 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 367 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 368 // USER END
embeddedartists 0:2052561807c5 369 break;
embeddedartists 0:2052561807c5 370 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 371 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 372 addItem(pMsg->hWin, Id, 132);
embeddedartists 0:2052561807c5 373 // USER END
embeddedartists 0:2052561807c5 374 break;
embeddedartists 0:2052561807c5 375 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 376 // USER END
embeddedartists 0:2052561807c5 377 }
embeddedartists 0:2052561807c5 378 break;
embeddedartists 0:2052561807c5 379 case ID_BUTTON_1: // Notifications sent by 'Button4'
embeddedartists 0:2052561807c5 380 switch(NCode) {
embeddedartists 0:2052561807c5 381 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 382 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 383 // USER END
embeddedartists 0:2052561807c5 384 break;
embeddedartists 0:2052561807c5 385 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 386 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 387 addItem(pMsg->hWin, Id, 55);
embeddedartists 0:2052561807c5 388 // USER END
embeddedartists 0:2052561807c5 389 break;
embeddedartists 0:2052561807c5 390 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 391 // USER END
embeddedartists 0:2052561807c5 392 }
embeddedartists 0:2052561807c5 393 break;
embeddedartists 0:2052561807c5 394 case ID_BUTTON_2: // Notifications sent by 'Button5'
embeddedartists 0:2052561807c5 395 switch(NCode) {
embeddedartists 0:2052561807c5 396 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 397 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 398 // USER END
embeddedartists 0:2052561807c5 399 break;
embeddedartists 0:2052561807c5 400 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 401 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 402 addItem(pMsg->hWin, Id, 110);
embeddedartists 0:2052561807c5 403 // USER END
embeddedartists 0:2052561807c5 404 break;
embeddedartists 0:2052561807c5 405 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 406 // USER END
embeddedartists 0:2052561807c5 407 }
embeddedartists 0:2052561807c5 408 break;
embeddedartists 0:2052561807c5 409 case ID_BUTTON_3: // Notifications sent by 'Button6'
embeddedartists 0:2052561807c5 410 switch(NCode) {
embeddedartists 0:2052561807c5 411 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 412 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 413 // USER END
embeddedartists 0:2052561807c5 414 break;
embeddedartists 0:2052561807c5 415 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 416 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 417 addItem(pMsg->hWin, Id, 175);
embeddedartists 0:2052561807c5 418 // USER END
embeddedartists 0:2052561807c5 419 break;
embeddedartists 0:2052561807c5 420 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 421 // USER END
embeddedartists 0:2052561807c5 422 }
embeddedartists 0:2052561807c5 423 break;
embeddedartists 0:2052561807c5 424 case ID_BUTTON_4: // Notifications sent by 'Button7'
embeddedartists 0:2052561807c5 425 switch(NCode) {
embeddedartists 0:2052561807c5 426 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 427 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 428 // USER END
embeddedartists 0:2052561807c5 429 break;
embeddedartists 0:2052561807c5 430 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 431 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 432 addItem(pMsg->hWin, Id, 55);
embeddedartists 0:2052561807c5 433 // USER END
embeddedartists 0:2052561807c5 434 break;
embeddedartists 0:2052561807c5 435 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 436 // USER END
embeddedartists 0:2052561807c5 437 }
embeddedartists 0:2052561807c5 438 break;
embeddedartists 0:2052561807c5 439 case ID_BUTTON_5: // Notifications sent by 'Button8'
embeddedartists 0:2052561807c5 440 switch(NCode) {
embeddedartists 0:2052561807c5 441 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 442 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 443 // USER END
embeddedartists 0:2052561807c5 444 break;
embeddedartists 0:2052561807c5 445 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 446 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 447 addItem(pMsg->hWin, Id, 180);
embeddedartists 0:2052561807c5 448 // USER END
embeddedartists 0:2052561807c5 449 break;
embeddedartists 0:2052561807c5 450 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 451 // USER END
embeddedartists 0:2052561807c5 452 }
embeddedartists 0:2052561807c5 453 break;
embeddedartists 0:2052561807c5 454 case ID_BUTTON_6: // Notifications sent by 'Button9'
embeddedartists 0:2052561807c5 455 switch(NCode) {
embeddedartists 0:2052561807c5 456 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 457 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 458 // USER END
embeddedartists 0:2052561807c5 459 break;
embeddedartists 0:2052561807c5 460 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 461 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 462 addItem(pMsg->hWin, Id, 75);
embeddedartists 0:2052561807c5 463 // USER END
embeddedartists 0:2052561807c5 464 break;
embeddedartists 0:2052561807c5 465 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 466 // USER END
embeddedartists 0:2052561807c5 467 }
embeddedartists 0:2052561807c5 468 break;
embeddedartists 0:2052561807c5 469 case ID_BUTTON_7: // Notifications sent by 'Button10'
embeddedartists 0:2052561807c5 470 switch(NCode) {
embeddedartists 0:2052561807c5 471 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 472 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 473 // USER END
embeddedartists 0:2052561807c5 474 break;
embeddedartists 0:2052561807c5 475 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 476 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 477 addItem(pMsg->hWin, Id, 119);
embeddedartists 0:2052561807c5 478 // USER END
embeddedartists 0:2052561807c5 479 break;
embeddedartists 0:2052561807c5 480 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 481 // USER END
embeddedartists 0:2052561807c5 482 }
embeddedartists 0:2052561807c5 483 break;
embeddedartists 0:2052561807c5 484 case ID_BUTTON_8: // Notifications sent by 'Button11'
embeddedartists 0:2052561807c5 485 switch(NCode) {
embeddedartists 0:2052561807c5 486 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 487 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 488 // USER END
embeddedartists 0:2052561807c5 489 break;
embeddedartists 0:2052561807c5 490 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 491 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 492 addItem(pMsg->hWin, Id, 155);
embeddedartists 0:2052561807c5 493 // USER END
embeddedartists 0:2052561807c5 494 break;
embeddedartists 0:2052561807c5 495 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 496 // USER END
embeddedartists 0:2052561807c5 497 }
embeddedartists 0:2052561807c5 498 break;
embeddedartists 0:2052561807c5 499 case ID_LISTVIEW_0: // Notifications sent by 'Listview'
embeddedartists 0:2052561807c5 500 switch(NCode) {
embeddedartists 0:2052561807c5 501 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 502 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 503 // USER END
embeddedartists 0:2052561807c5 504 break;
embeddedartists 0:2052561807c5 505 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 506 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 507 // USER END
embeddedartists 0:2052561807c5 508 break;
embeddedartists 0:2052561807c5 509 case WM_NOTIFICATION_SEL_CHANGED:
embeddedartists 0:2052561807c5 510 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 511 // USER END
embeddedartists 0:2052561807c5 512 break;
embeddedartists 0:2052561807c5 513 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 514 // USER END
embeddedartists 0:2052561807c5 515 }
embeddedartists 0:2052561807c5 516 break;
embeddedartists 0:2052561807c5 517 case ID_BUTTON_9: // Notifications sent by 'Checkout'
embeddedartists 0:2052561807c5 518 switch(NCode) {
embeddedartists 0:2052561807c5 519 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 520 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 521 // USER END
embeddedartists 0:2052561807c5 522 break;
embeddedartists 0:2052561807c5 523 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 524 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 525 RFID_Cancelled = 0;
embeddedartists 0:2052561807c5 526 ShowWindow(hWinSwipeCard);
embeddedartists 0:2052561807c5 527 #ifndef _WINDOWS
embeddedartists 0:2052561807c5 528 hItem = WM_GetDialogItem(pMsg->hWin, ID_LISTVIEW_0);
embeddedartists 0:2052561807c5 529 for(row = 0; row < (LISTVIEW_GetNumRows(hItem)); row++)
embeddedartists 0:2052561807c5 530 {
embeddedartists 0:2052561807c5 531 LISTVIEW_GetItemText(hItem, 3, row, SubTotal, sizeof(SubTotal));
embeddedartists 0:2052561807c5 532 sscanf(SubTotal, "%d.%02d", &subtotal100, &subtotal);
embeddedartists 0:2052561807c5 533 total = total + subtotal100 * 100 + subtotal;
embeddedartists 0:2052561807c5 534 }
embeddedartists 0:2052561807c5 535 do
embeddedartists 0:2052561807c5 536 {
embeddedartists 0:2052561807c5 537 //AR status = MifareExecute(DecCredit_CMD, (uint32_t*)&total);
embeddedartists 0:2052561807c5 538 GUI_Delay(250);
embeddedartists 0:2052561807c5 539 }
embeddedartists 0:2052561807c5 540 while((status == (2<<16)) && !RFID_Cancelled);
embeddedartists 0:2052561807c5 541 if(!status)
embeddedartists 0:2052561807c5 542 WM_SendMessageNoPara(hWinCallBack, WM_USER_RFID_Store_OK);
embeddedartists 0:2052561807c5 543 else if(status & 0x00010000)
embeddedartists 0:2052561807c5 544 WM_SendMessageNoPara(hWinCallBack, WM_USER_RFID_Credit_Low);
embeddedartists 0:2052561807c5 545 else if(!RFID_Cancelled)
embeddedartists 0:2052561807c5 546 WM_SendMessageNoPara(hWinCallBack, WM_USER_RFID_Error);
embeddedartists 0:2052561807c5 547 #endif
embeddedartists 0:2052561807c5 548 // USER END
embeddedartists 0:2052561807c5 549 break;
embeddedartists 0:2052561807c5 550 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 551 // USER END
embeddedartists 0:2052561807c5 552 }
embeddedartists 0:2052561807c5 553 break;
embeddedartists 0:2052561807c5 554 case ID_BUTTON_10: // Notifications sent by 'Clear'
embeddedartists 0:2052561807c5 555 switch(NCode) {
embeddedartists 0:2052561807c5 556 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 557 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 558 // USER END
embeddedartists 0:2052561807c5 559 break;
embeddedartists 0:2052561807c5 560 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 561 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 562 clearItems(pMsg->hWin);
embeddedartists 0:2052561807c5 563 // USER END
embeddedartists 0:2052561807c5 564 break;
embeddedartists 0:2052561807c5 565 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 566 // USER END
embeddedartists 0:2052561807c5 567 }
embeddedartists 0:2052561807c5 568 break;
embeddedartists 0:2052561807c5 569 case ID_BUTTON_11: // Notifications sent by 'QueryCard'
embeddedartists 0:2052561807c5 570 switch(NCode) {
embeddedartists 0:2052561807c5 571 case WM_NOTIFICATION_CLICKED:
embeddedartists 0:2052561807c5 572 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 573 // USER END
embeddedartists 0:2052561807c5 574 break;
embeddedartists 0:2052561807c5 575 case WM_NOTIFICATION_RELEASED:
embeddedartists 0:2052561807c5 576 // USER START (Optionally insert code for reacting on notification message)
embeddedartists 0:2052561807c5 577 RFID_Cancelled = 0;
embeddedartists 0:2052561807c5 578 ShowWindow(hWinSwipeCard);
embeddedartists 0:2052561807c5 579 #ifndef _WINDOWS
embeddedartists 0:2052561807c5 580 do
embeddedartists 0:2052561807c5 581 {
embeddedartists 0:2052561807c5 582 //AR status = MifareExecute(GetCredit_CMD, &Credit);
embeddedartists 0:2052561807c5 583 GUI_Delay(250);
embeddedartists 0:2052561807c5 584 }
embeddedartists 0:2052561807c5 585 while((status == (2<<16)) && !RFID_Cancelled);
embeddedartists 0:2052561807c5 586 if(!status)
embeddedartists 0:2052561807c5 587 WM_SendMessageNoPara(hWinCallBack, WM_USER_RFID_Load_OK);
embeddedartists 0:2052561807c5 588 else if(!RFID_Cancelled)
embeddedartists 0:2052561807c5 589 WM_SendMessageNoPara(hWinCallBack, WM_USER_RFID_Error);
embeddedartists 0:2052561807c5 590 #endif
embeddedartists 0:2052561807c5 591 // USER END
embeddedartists 0:2052561807c5 592 break;
embeddedartists 0:2052561807c5 593 // USER START (Optionally insert additional code for further notification handling)
embeddedartists 0:2052561807c5 594 // USER END
embeddedartists 0:2052561807c5 595 }
embeddedartists 0:2052561807c5 596 break;
embeddedartists 0:2052561807c5 597 // USER START (Optionally insert additional code for further Ids)
embeddedartists 0:2052561807c5 598 // USER END
embeddedartists 0:2052561807c5 599 }
embeddedartists 0:2052561807c5 600 break;
embeddedartists 0:2052561807c5 601 // USER START (Optionally insert additional message handling)
embeddedartists 0:2052561807c5 602 // USER END
embeddedartists 0:2052561807c5 603 default:
embeddedartists 0:2052561807c5 604 WM_DefaultProc(pMsg);
embeddedartists 0:2052561807c5 605 break;
embeddedartists 0:2052561807c5 606 }
embeddedartists 0:2052561807c5 607 }
embeddedartists 0:2052561807c5 608
embeddedartists 0:2052561807c5 609 /*********************************************************************
embeddedartists 0:2052561807c5 610 *
embeddedartists 0:2052561807c5 611 * Public code
embeddedartists 0:2052561807c5 612 *
embeddedartists 0:2052561807c5 613 **********************************************************************
embeddedartists 0:2052561807c5 614 */
embeddedartists 0:2052561807c5 615 /*********************************************************************
embeddedartists 0:2052561807c5 616 *
embeddedartists 0:2052561807c5 617 * CreateOrderEntry
embeddedartists 0:2052561807c5 618 */
embeddedartists 0:2052561807c5 619 WM_HWIN CreateOrderEntry(void);
embeddedartists 0:2052561807c5 620 WM_HWIN CreateOrderEntry(void) {
embeddedartists 0:2052561807c5 621 WM_HWIN hWin;
embeddedartists 0:2052561807c5 622
embeddedartists 0:2052561807c5 623 hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, WM_HBKWIN, 0, 0);
embeddedartists 0:2052561807c5 624 return hWin;
embeddedartists 0:2052561807c5 625 }
embeddedartists 0:2052561807c5 626
embeddedartists 0:2052561807c5 627 // USER START (Optionally insert additional public code)
embeddedartists 0:2052561807c5 628 int DrawCustomSkin(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
embeddedartists 0:2052561807c5 629 switch (pDrawItemInfo->Cmd) {
embeddedartists 0:2052561807c5 630 case WIDGET_ITEM_DRAW_BACKGROUND:
embeddedartists 0:2052561807c5 631 //
embeddedartists 0:2052561807c5 632 // Default look with bitmap
embeddedartists 0:2052561807c5 633 //
embeddedartists 0:2052561807c5 634 BUTTON_DrawSkinFlex(pDrawItemInfo);
embeddedartists 0:2052561807c5 635 if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_0))
embeddedartists 0:2052561807c5 636 GUI_DrawBitmap(&bmblack_coffee, 17, 20);
embeddedartists 0:2052561807c5 637 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_1))
embeddedartists 0:2052561807c5 638 GUI_DrawBitmap(&bmchocolate_doughnut, 9, 17);
embeddedartists 0:2052561807c5 639 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_2))
embeddedartists 0:2052561807c5 640 GUI_DrawBitmap(&bmmilk, 40, 20);
embeddedartists 0:2052561807c5 641 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_3))
embeddedartists 0:2052561807c5 642 GUI_DrawBitmap(&bmlatte_coffee, 15, 22);
embeddedartists 0:2052561807c5 643 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_4))
embeddedartists 0:2052561807c5 644 GUI_DrawBitmap(&bmglazed_doughnut, 25, 25);
embeddedartists 0:2052561807c5 645 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_5))
embeddedartists 0:2052561807c5 646 GUI_DrawBitmap(&bmorangejuice, 28, 25);
embeddedartists 0:2052561807c5 647 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_6))
embeddedartists 0:2052561807c5 648 GUI_DrawBitmap(&bmnewspaper, 15, 12);
embeddedartists 0:2052561807c5 649 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_7))
embeddedartists 0:2052561807c5 650 GUI_DrawBitmap(&bmdanish, 25, 20);
embeddedartists 0:2052561807c5 651 else if (pDrawItemInfo->hWin == WM_GetDialogItem(WM_GetActiveWindow(), ID_BUTTON_8))
embeddedartists 0:2052561807c5 652 GUI_DrawBitmap(&bmbottledwater, 42, 20);
embeddedartists 0:2052561807c5 653 break;
embeddedartists 0:2052561807c5 654 default:
embeddedartists 0:2052561807c5 655 //
embeddedartists 0:2052561807c5 656 // Use the default skinning routine for processing all other commands
embeddedartists 0:2052561807c5 657 //
embeddedartists 0:2052561807c5 658 return BUTTON_DrawSkinFlex(pDrawItemInfo);
embeddedartists 0:2052561807c5 659 }
embeddedartists 0:2052561807c5 660 return 0;
embeddedartists 0:2052561807c5 661 }
embeddedartists 0:2052561807c5 662
embeddedartists 0:2052561807c5 663 // USER END
embeddedartists 0:2052561807c5 664
embeddedartists 0:2052561807c5 665 /*************************** End of file ****************************/