summaryrefslogtreecommitdiff
path: root/EDK/MiniSetup/Legacy/legacy.c
blob: 6c34aa195c1db3b7c6e7d08289ff7a84eb71bdbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**        (C)Copyright 1985-2011, American Megatrends, Inc.    **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**             5555 Oakbrook Pkwy   , Norcross, GA 30071       **//
//**                                                             **//
//**                     Phone: (770)-246-8600                   **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/Legacy/legacy.c $
//
// $Author: Premkumara $
//
// $Revision: 10 $
//
// $Date: 8/28/14 11:19a $
//
//*****************************************************************//
//*****************************************************************//
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/Legacy/legacy.c $
// 
// 10    8/28/14 11:19a Premkumara
// [TAG] 			EIP174031
// [Category] 		Improvement
// [Description] 	Removed TODO comments and added proper comments in those
// places
// [Files] 			commonoem.c, commonhelper.c, special.c, submenu.c,
// minisetupext.c, uefi21wapper.c and legacy.c
// 
// 9     2/11/13 6:01a Premkumara
// [TAG]  		EIP112628
// [Category]  	Bug Fix
// [Severity]  	Important
// [Symptom]  	(JP000E)SETUP_GO_TO_EXIT_PAGE_ON_EXIT_KEY does not work on
// 4.6.2_TSE_2_15_1234
// [RootCause]  	The Exit FormID value will change if any form is
// generated before Exit page
// [Solution]  	Handled Exit FormID from Binary and handling Exit FormID
// from binary
// [Files]  		Ezport.c, Ezport.sdl, Legacy.c, Legacy.sdl, EzportPlus.c,
// EzportPlus.sdl
// 
// 8     10/18/12 6:06a Arunsb
// Updated for 2.16.1235 QA submission
// 
// 2     10/10/12 12:42p Arunsb
// Synched the source for v2.16.1232, backup with Aptio
// 
// 7     12/01/11 5:40a Rajashakerg
// [TAG]  		EIP74963 
// [Category]  	Improvement
// [Description]  	MAX_MSGBOX_WIDTH cannot be overridden
// [Files]  		AMITSE.sdl, CommonHelper.c, minisetup.h, legacy.c,
// MessageBox.c, MessageBox.h, FormBrowser.c
// 
// 6     11/21/11 10:39a Premkumara
// [TAG]  		EIP72610
// [Category]  	Improvement
// [Description]  	Moving TSE_MULTILINE_CONTROLS to Binary
// [Files]  		AMITSE-CommonHelper.c, AMITSE.sdl, 
// TSELITE-UefiAction.c, TseLite.sdl, Time.h, Text.c,
// SubMenu.c, ResetButton.c, PopupString.c, PopupSel.h, PopupSel.c, 
// PopupPassword.c, OrderListBox.c, Numeric.c, Label.c, Frame.c, Edit.c, 
// Date.h, Date.c, 
// LEGACY-Legacy.c,
// BOOTONLY- Minisetup.h
// 
// 5     11/14/11 6:55p Blaines
// [TAG] - EIP 75486 
// [Category]- Function Request
// [Synopsis]- Support grayout condition for readonly controls.
// [Description] - Display readonly controls as grayout, non-selectable.
// [Files]
// AMITSE.sdl, CommonHelper.c, Minisetupext.h, stylecommon.c, Legacy.c,
// date.c, edit.c, label.c, memo.c, menu.c,, numeric.c, ordlistbox.c,
// PopupPassword.c, 
// PopupSel.c, PopupString.c, ResetButton.c, SubMenu.c, Text.c, Time.c,
// UefiAction.c, ctrlcond.c,   
// 
// 4     6/29/11 12:43p Rajashakerg
// [TAG]  		EIP47086
// [Category]  	New Feature
// [Description]  	Right clicking from the Main page is not exiting from
// BIOS setup.
// 
// [Files]  		minisetup.h, Ezport\style.h,Ezport\EzportBin.sdl,
// Ezport\EzportBin.mak, Ezport\ezport.c, Ezport\EzportBin.cif,
// EzportPlus\style.h, EzportPlus\EzportPlusBin.sdl, EzportPlusBin.mak,
// EzportPlus\EzportPlusBin.cif, EzportPlus\ezportplus.c, Legacy\style.h,
// Legacy\EzportPlusBin.sdl, Legacy\LegacyBin.mak, Legacy\LegacyBin.cif,
// Legacy\legacy.c, TseLiteBin.sdl, TseLite.cif, Memo.c, frame.c,
// application.h, application.c, commonoem.h, CommonHelper.c
// 
// 3     6/23/11 3:49p Rajashakerg
// [TAG]  		EIP55762, 58925, 59971
// [Category]  	New Feature
// [Description]  	Support REF2,REF3 and REF4 in AMITSE
// Support direct form navigation path
// Improper layout of controls in the root page when Dynamic pages are
// added using the Legacy Setup Style	
// 
// [Files]  		setupdata.h, CommonHelper.c, AMITSE.sdl, Legacy\Legacy.c,
// Legacy\style.h, Legacy\style.h, frame.c, minisetupext.c,
// minisetupext.h, numeric.c, page.c Popupstring.c, Hii.c,
// Uefi21Wrapper.c, Parse.c Hii.c
// 
// 2     3/29/11 12:13a Madhans
// [TAG]  		EIP54968
// [Category]  	Improvement
// [Description]  	To Support different style modules in TSE generically
// [Files]  		Ezport module updated. EzportPlus and Legacy Styles Modules
// added.
// 
// 1     3/28/11 11:51p Madhans
// [TAG]  		EIP54968
// [Category]  	Improvement
// [Description]  	To Support different style modules in TSE generically
// [Files]  		Ezport module updated. EzportPlus and Legacy Styles Modules
// added.
// 
// 1     9/16/10 6:37p Blaines
// 
// 1     9/16/10 6:32p Blaines
// 
// 12    6/14/10 7:07p Madhans
// to avoid warnings
// 
// 11    3/26/10 6:52p Madhans
// Support to Map the do the Control Mapping from gTseControlMap Table. So
// no changes need in Frame.c, With this feature gTseControlMap Can be
// customized to add/customize the TSE controls.
// 
// 10    2/19/10 8:15a Mallikarjunanv
// updated year in copyright message
// 
// 9     2/15/10 10:12p Madhans
// To avoid warnings
// 
// 8     1/09/10 6:11a Mallikarjunanv
// Updated TSE2.01 Release sources with coding standards
// 
// 7     8/24/09 5:15p Blaines
// Fix issue setting title and helptitle background color after clear
// screen
// 
// 6     8/13/09 1:22p Blaines
// Support BgColor for MAIN_FRAME, NAV_FRAME, and HELP_FRAME
// 
// 5     8/04/09 6:57p Blaines
// Add Support for Exit Page SDL tokens
// 
// 3     6/23/09 6:54p Blaines
// Coding standard update, 
// Remove spaces from file header to allow proper chm function list
// creation.
// 
// 2     6/12/09 2:36p Blaines
// Update coding standard
// 
// 1     6/04/09 8:05p Madhans
// 
// 3     5/07/09 10:35a Madhans
// Changes after Bin module
// 
// 9     5/05/09 3:20p Blaines
// 
// 8     5/04/09 6:52p Blaines
// Support customizable Help and Nav frame text Foreground color
// 
// 7     5/01/09 9:25p Blaines
// 
// 6     4/30/09 9:54p Blaines
// 
// 4     4/28/09 9:39p Madhans
// Tse 2.0 Code complete Checkin.
// 
// 3     4/24/09 9:35p Blaines
// 
// 1     12/18/08 7:59p Madhans
// Intial version of TSE Lite sources
//*****************************************************************//
//*****************************************************************//
//<AMI_FHDR_START>
//
// Name:		alternate1.c
//
// Description:	Main file for alternate1 style module.
//
//<AMI_FHDR_END>
//**********************************************************************
#include "minisetup.h"
#include "Legacy.h"

extern	STYLECOLORS  Colors ;
extern 	AMI_IFR_MENU gMenuData ;

extern UINTN gLabelLeftMargin ;
extern UINTN gControlLeftMargin ;
extern UINTN gControlLeftPad ;
extern UINTN gControlRightAreaWidth ;
static CALLBACK_SUBMENU gMenuCallbackData = { { CALLBACK_TYPE_MENU, sizeof(CALLBACK_MENU) }, 0 };
static CALLBACK_SUBMENU gSubmenuCallbackData = { { CALLBACK_TYPE_SUBMENU, sizeof(CALLBACK_SUBMENU) }, 0 };
static CALLBACK_VARIABLE gVariableCallbackData = { { CALLBACK_TYPE_VARIABLE, sizeof(CALLBACK_VARIABLE) }, 0, 0, 0, NULL };
static CALLBACK_PASSWORD gPasswordCallbackData = { { CALLBACK_TYPE_PASSWORD, sizeof(CALLBACK_PASSWORD) }, 0, 0, 0, NULL, TRUE };

VOID _FrameSubmenuCallback( FRAME_DATA *frame, SUBMENU_DATA *submenu, VOID *cookie );
VOID _FrameMenuCallback( FRAME_DATA *frame, MENU_DATA *menu, VOID *cookie );

BOOLEAN   gotoExitOnEscKey(EFI_GUID *exitFormGuid, UINT16 *pageClass, UINT16 *pageSubclass, UINT16 *pageFormID);//EIP-112628 GotoExitPageOnEscKey

#if SETUP_STYLE_LEGACY

static FRAME_INFO _gStyleLegacyMainFrames[] =
{
//	{FrameType		Drawable	Border, BorderType, Width, Height, Top, Left, FGColor, BGColor }	
	{ TITLE_FRAME,		TRUE,		FALSE, 0, 80, 1, 0, 0, TITLE_FGCOLOR, TITLE_BGCOLOR },			// Title
	{ MAIN_FRAME,		TRUE,		FALSE, 0, 78, 15, 2, 1, PAGE_FGCOLOR, PAGE_BGCOLOR },			// Main
	{ HELP_FRAME,		TRUE,		FALSE, 0, 76, 1, 21, 1, HELP_FGCOLOR, PAGE_BGCOLOR },			// Help text
	{ NAV_FRAME,		TRUE,		FALSE, 0, 76, 2, 18, 2, NAV_FGCOLOR, PAGE_BGCOLOR }			// Navigation
};

static FRAME_INFO _gStyleLegacySubFrames[] =
{
//	{ FrameType		Drawable	Border, BorderType, Width, Height, Top, Left, FGColor, BGColor }	
	
	{ TITLE_FRAME,		TRUE,		FALSE, 0, 80,  1,  0, 0,  TITLE_FGCOLOR, TITLE_BGCOLOR},		// Title
    	{ SUBTITLE_FRAME,	TRUE,		FALSE, 0, 80,  1,  1, 0,  MENU_FGCOLOR, MENU_BGCOLOR },		// Subtitle
	{ MAIN_FRAME,		TRUE,		FALSE, 0, 50, 19,  3, 1,  PAGE_FGCOLOR, PAGE_BGCOLOR },		// Main
	{ HELPTITLE_FRAME,	TRUE,		FALSE, 0, 23,  1,  3, 56, HELPTITLE_FGCOLOR, PAGE_BGCOLOR },	// Help title
	{ HELP_FRAME,		TRUE,		FALSE, 0, 23, 16,  5, 56, HELP_FGCOLOR, PAGE_BGCOLOR },		// Help text
	{ NAV_FRAME,		TRUE,		FALSE, 0, 80,  2, 22, 0,  NAV_FGCOLOR, PAGE_BGCOLOR },		// Navigation
};

#if SETUP_STYLE_FULL_SCREEN
static FRAME_INFO _gStyleLegacyFullMainFrames[] =
{
//	{FrameType			Drawable		Border, BorderType, Width, Height, Top, Left, FGColor, BGColor }	
	{ TITLE_FRAME,		TRUE,		FALSE, 0, 100, 1, 0, 0, TITLE_FGCOLOR, TITLE_BGCOLOR },			// Title
	{ MAIN_FRAME,		TRUE,		FALSE, 0, 98, 19, 2, 1, PAGE_FGCOLOR, PAGE_BGCOLOR },			// Main
	{ HELP_FRAME,		TRUE,		FALSE, 0, 95, 1, 28, 1, HELP_FGCOLOR, PAGE_BGCOLOR },			// Help text
	{ NAV_FRAME,		TRUE,		FALSE, 0, 95, 2, 25, 2, NAV_FGCOLOR, PAGE_BGCOLOR }			// Navigation
};

static FRAME_INFO _gStyleLegacyFullSubFrames[] =
{
//	{ FrameType		Drawable	Border, BorderType, Width, Height, Top, Left, FGColor, BGColor }	
	{ TITLE_FRAME,		TRUE,		FALSE, 0, 100,  1,  0,  0,  TITLE_FGCOLOR, TITLE_BGCOLOR},		// Title
    { SUBTITLE_FRAME,	TRUE,		FALSE, 0, 100,  1,  1,  0,  MENU_FGCOLOR, MENU_BGCOLOR },		// Subtitle
	{ MAIN_FRAME,		TRUE,		FALSE, 0,  63, 25,  3,  1,  PAGE_FGCOLOR, PAGE_BGCOLOR },		// Main
	{ HELPTITLE_FRAME,	TRUE,		FALSE, 0,  29,  1,  3, 70,  HELPTITLE_FGCOLOR, PAGE_BGCOLOR },	// Help title
	{ HELP_FRAME,		TRUE,		FALSE, 0,  29, 21,  5, 70,  HELP_FGCOLOR, PAGE_BGCOLOR },		// Help text
	{ NAV_FRAME,		TRUE,		FALSE, 0, 100,  2, 29,  0,  NAV_FGCOLOR, PAGE_BGCOLOR },		// Navigation
};
#endif

FRAME_INFO *_gStyleMainFrames = _gStyleLegacyMainFrames ;
FRAME_INFO *_gStyleSubFrames = _gStyleLegacySubFrames ;

INT16 gTabIndex = 0 ;

AMITSE_CONTROL_MAP gTseControlMap[] =
{
//	ControlType			 ControlMethods		 	CallbackSuppored 	CallbackFunction		CallbackContext		
 { CONTROL_TYPE_MENU, 	 (CONTROL_METHODS*)&gMenu, 	TRUE, (VOID*)(UINTN)&_FrameMenuCallback, (VOID*)(UINTN)&gMenuCallbackData},
 { CONTROL_TYPE_SUBMENU, (CONTROL_METHODS*)&gSubMenu,TRUE, (VOID*)(UINTN)&_FrameSubmenuCallback, (VOID*) &gSubmenuCallbackData},
 { CONTROL_TYPE_LABEL, 	 (CONTROL_METHODS*)&gLabel, 	TRUE, (VOID*)(UINTN)&StyleLabelCallback, (VOID*) NULL},
 { CONTROL_TYPE_TEXT, 	 (CONTROL_METHODS*)&gText, 	FALSE,(VOID*)NULL, (VOID*) NULL},
 { CONTROL_TYPE_POPUP_STRING, (CONTROL_METHODS*)&gPopupString, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData},
 { CONTROL_TYPE_DATE, (CONTROL_METHODS*)&gDate, FALSE, (VOID*)NULL, (VOID*) NULL},
 { CONTROL_TYPE_TIME, (CONTROL_METHODS*)&gTime, FALSE, (VOID*)NULL, (VOID*) NULL},
 { CONTROL_TYPE_POPUPSEL, (CONTROL_METHODS*)&gPopupSel, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData},
	// Checkbox is just popup sel
 { CONTROL_TYPE_CHECKBOX, (CONTROL_METHODS*)&gPopupSel, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData},
 { CONTROL_TYPE_MEMO, (CONTROL_METHODS*)&gMemo, FALSE, (VOID*)NULL, (VOID*)NULL},
 { CONTROL_TYPE_NUMERIC, (CONTROL_METHODS*)&gNumeric, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData},
 { CONTROL_TYPE_ORDERED_LIST, (CONTROL_METHODS*)&gOrdListBox, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData},
 { CONTROL_TYPE_PASSWORD, (CONTROL_METHODS*)&gPopupPassword, TRUE, (VOID*)(UINTN)&_FramePasswordCallback, (VOID*)&gPasswordCallbackData},
 { CONTROL_TYPE_ACTION, (CONTROL_METHODS*)&gUefiAction, TRUE, (VOID*)(UINTN) &StyleLabelCallback, (VOID*) NULL},
 { CONTROL_TYPE_RESET, (CONTROL_METHODS*)&gResetButton, TRUE, (VOID*)(UINTN) &StyleLabelCallback, (VOID*) NULL},//EIP:56413 Updated the Reset Button Control information
	// CONTROL_TYPE_NULL need to be last member 
 { CONTROL_TYPE_NULL, (CONTROL_METHODS*)NULL, FALSE, (VOID*)NULL, (VOID*) NULL}
};



//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacyPageHandleAction
//
// Description:	function to handle the page actions
//
// Input:	PAGE_DATA *page, ACTION_DATA *action
//
// Output:	status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacyPageHandleAction( PAGE_DATA *page, ACTION_DATA *action )
{
	UINT32	i;
    EFI_STATUS Status = EFI_UNSUPPORTED;

//EIP# 58925
    UINT32 stackIndex = 0xFFFFFFFF;
    UINT16 parentPgID = 0;
//EIP# 58925
	// On printScreen HotKey, Just return Unsupported and It will handed by Application Hotkey Handler.
	if( ( action->Input.Type == ACTION_TYPE_KEY ) &&
		(TsePrintScreenEventSupport(action->Input.Data.AmiKey.Key.ScanCode) ) ) 
	{
		Status = EFI_UNSUPPORTED;
		goto DONE;
        
	}
/*
#if TSE_PRN_SCRN_EVENT_SUPPORT
	if (( action->Input.Type == ACTION_TYPE_KEY ) && ( action->Input.Data.AmiKey.Key.ScanCode == TSE_PRN_SCRN_KEY_SCAN ))
            return EFI_UNSUPPORTED;
#endif
*/
	for ( i = 0; i < page->FrameCount; i++ )
	{
		if ( gFrame.HandleAction( page->FrameList[StyleFrameIndexOf(i)], action ) == EFI_SUCCESS )
		{	
            Status = EFI_SUCCESS;
		    goto DONE;
        }
	}

	for ( i = 0; i < page->HotKeyCount; i++ )
	{
		if ( gHotKey.HandleAction( page->HotKeyList[i], action ) == EFI_SUCCESS )
        {
			Status = EFI_SUCCESS;
		    goto DONE;
        }
	}

	if(
        (( action->Input.Type == ACTION_TYPE_KEY ) && (ControlActionAbort == MapControlKeysHook(action->Input.Data.AmiKey)))
        || ((action->Input.Type == ACTION_TYPE_MOUSE) && (ControlActionAbort == MapControlMouseActionHook(&(action->Input.Data.MouseInfo))) /*(TSEMOUSE_RIGHT_CLICK == action->Input.Data.MouseInfo.ButtonStatus)*/)
      )
	{
	
	//Commented for Legacy Style 07/07/10
	//if ( page->PageData.PageParentID == 0 )
        //    return EFI_UNSUPPORTED;

        
        if ( page->PageData.PageID != page->PageData.PageParentID )
        {
            // check for inconsistency here too.
            if (CheckInconsistence((PAGE_INFO*)((UINTN)gApplicationData + gPages->PageList[page->PageData.PageID]))!= TRUE )
            {
                // reset focus to first control
                FRAME_DATA *frame = page->FrameList[StyleFrameIndexOf(MAIN_FRAME)];
                UINT32 i;

                for ( i = 0; i < frame->ControlCount; i++ )
                {
                    if ( _FrameSetControlFocus( frame, i ) )
                    {
                        frame->FirstVisibleCtrl = 0;
                        break;
                    }
                }
//EIP# 58925
                if(IsLinkHistorySupport())
                {
                    // tell application that we need to change pages
                    Status = GetParentFormID((UINT16)gApp->CurrentPage, &parentPgID, &stackIndex); //Gets the parent page of the current page
    				if(Status != EFI_SUCCESS)
    					gApp->CurrentPage = page->PageData.PageParentID;
    				 else
                        gApp->CurrentPage = parentPgID; //Else set the current page to the parent page
                }
                else
                {
                    gApp->CurrentPage = page->PageData.PageParentID;
                }
//EIP# 58925
                gApp->CompleteRedraw = TRUE;
				gApp->OnRedraw = SUBMENU_COMPLETE_REDRAW;
            }

            Status = EFI_SUCCESS;
        }
    }
DONE:
//EIP# 58925   
    if(IsLinkHistorySupport())
    {
        if(Status == EFI_SUCCESS){
       		SetParentFormID(page->PageData.PageID, (UINT16)gApp->CurrentPage);
    	}
    }
//EIP# 58925
    return Status ;
    
}
//<AMI_PHDR_START>
//--------------------------------------------------------------------------
//
// Name:	    LegacyFrameAddControl
//
// Description: Adds controls to the frame 
//
// Input:		FRAME_DATA *frame - Pointer to the frame data
//				CONTROL_INFO *controlData - Control date to be added
//
// Output:		EFI_STATUS Status - EFI_SUCCESS if successful, else
//										EFI_UNSUPPORTED
//
//--------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacyFrameAddControl( FRAME_DATA *frame, CONTROL_INFO *controlData )
{
	EFI_STATUS Status = EFI_UNSUPPORTED;
	CONTROL_DATA **control;
	POSITION_INFO *pos;
	UINT16 count = (UINT16)frame->ControlCount;
	UINT16 i;
	BOOLEAN		IsValidControl = FALSE;
	PAGE_INFO *pageInfo=NULL;

	gActiveFrame = frame;


	if(controlData->ControlType == CONTROL_TYPE_SUBMENU)
	{
		pageInfo = (PAGE_INFO *)((UINTN)gApplicationData + gPages->PageList[controlData->ControlDestPageID]);
		
		if(pageInfo->PageHandle == NULL)
		{
			frame->NullCount--;
			return EFI_OUT_OF_RESOURCES;
		}
	}
		
	control = MemReallocateZeroPool( frame->ControlList, count * sizeof(CONTROL_INFO *), (count + 1) * sizeof(CONTROL_INFO *) );

	if ( control == NULL )
		return EFI_OUT_OF_RESOURCES;

	frame->ControlList = control;
	control = &frame->ControlList[ count ];

	for(i=0;gTseControlMap[i].ControlType != CONTROL_TYPE_NULL;i++)
	{
		if(gTseControlMap[i].ControlType == controlData->ControlType)
		{
			Status = gTseControlMap[i].ControlMethods->Create(control);
			if ( ! EFI_ERROR(Status) )
			{
				if(gTseControlMap[i].CallbackSuppored )
					gTseControlMap[i].ControlMethods->SetCallback(*control, frame, 
							(OBJECT_CALLBACK)(UINTN)gTseControlMap[i].CallbackFunction, 
							(VOID*)gTseControlMap[i].CallbackContext);
			}
			IsValidControl = TRUE;
		}
	}

	if(!IsValidControl)
	{
		if(controlData->ControlType == CONTROL_TYPE_NULL )
			frame->NullCount++;
		return Status;
	}
	
	if ( ! EFI_ERROR( Status ) )
	{
		Status = (*control)->Methods->Initialize( *control, controlData );

		if ( ! EFI_ERROR( Status ) )
		{
            UINT16 height = 1;
			//EIP-72610 TSE_MULTILINE_CONTROLS moved to binary
			if(IsTSEMultilineControlSupported())
			{
				Status = (*control)->Methods->GetControlHeight( *control, (VOID*)frame,&height);
	   			height = height ? height:1;
			}

			if(frame->FrameData.FrameType == SUBTITLE_FRAME)
				(*control)->Methods->SetDimensions( *control, frame->FrameData.Width , height );
			else
				(*control)->Methods->SetDimensions( *control, frame->FrameData.Width - (UINT8)gLabelLeftMargin - 2 , height );

			(*control)->ParentFrameType = frame->FrameData.FrameType ;

			frame->ControlCount++;
			count++;

			(*control)->Methods->SetPosition( *control, frame->FrameData.Left + (UINT8)gLabelLeftMargin, frame->FrameData.Top + count -1 );

		 	
		 	if( EFI_ERROR( StyleHandleControlOverflow( frame, frame->ControlList[ count -1 ], (UINT16)frame->ControlCount )) )
			{
				frame->LastVisibleCtrl = frame->ControlCount-1;
			}

			// set position information
			pos = MemReallocateZeroPool( frame->OrigPosition, (count-1) * sizeof(POSITION_INFO), (count ) * sizeof(POSITION_INFO) );
			if ( pos != NULL )
			{
				pos[count-1].Left = (*control)->Left;
				pos[count-1].Top = (*control)->Top;
				frame->OrigPosition = pos;
			}

			MemFreePointer( (VOID **)&frame->CurrPosition );
			frame->CurrPosition = EfiLibAllocateZeroPool( count * sizeof(POSITION_INFO) );
			
		}

	}
	return Status;
}
//<AMI_PHDR_START>
//--------------------------------------------------------------------------
//
// Name:		 LegacyFrameDrawScrollBar
//
// Description:  Draws the scrollbar controls for the frame..
//
// Input:		FRAME_DATA *frame	- Pointer to the current frame
//				UINT32	FirstLine	- FirstLine of the scrollbar
//				UINT32 LastLine		- LastLine	 
//				UINT32	modVal		- modVal 
//				UINT32	sizeOfBar	- Size of the Scrollbar
//				UINT32 numOfBlocks	- Number of blocks 
//				BOOLEAN bEraseScrollBar	- flag to erase the scrollbar
//
// Output: EFI_STATUS status - 
//					EFI_SUCCESS - If there exists a next page and the 
//								   function successfully loads it				
//					EFI_OUT_PF_RESOURCES - If there are know previous page
//
//--------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacyFrameDrawScrollBar (FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, UINT32	sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar)
{
	UINT32	i, j ; //,FirstLine=0,LastLine=0, count,visibleControlCount = 0, modVal=0, sizeOfBar, numOfBlocks = 0;
	CHAR16	ArrUp[2]={{GEOMETRICSHAPE_UP_TRIANGLE},{0x0000}},ArrDown[2]={{GEOMETRICSHAPE_DOWN_TRIANGLE},{0x0000}},ScrlSel[2]={{BLOCKELEMENT_FULL_BLOCK/*L'N'*/},{0x0000}},ScrlNSel[2]={{BLOCKELEMENT_LIGHT_SHADE/*L'S'*/},{0x0000}};


	// draw scrollbar if necessary
	if ( frame->BlankLine != NULL )
	{
		j = frame->FrameData.Top;
		for ( i = 1; i < frame->FrameData.Height; i++, j++ )
		{
            // use this loop to draw the scrollbar
		    if(frame->UseScrollbar)
		    {
				if(i==1)
					DrawStringWithAttribute( frame->FrameData.Left + frame->FrameData.Width+2 , j, ArrUp, 
				                            StyleGetScrollBarUpArrowColor() );
				else if(i==(UINT16)(frame->FrameData.Height - 1))
					DrawStringWithAttribute( frame->FrameData.Left+ frame->FrameData.Width+2, j, ArrDown, 
					                             StyleGetScrollBarDownArrowColor() );
				else
				{
					if( (j > FirstLine) && (j < LastLine) &&  ((sizeOfBar + modVal) != 0))
					{	
						DrawStringWithAttribute( frame->FrameData.Left+ frame->FrameData.Width+2, j, ScrlSel, 
													StyleGetScrollBarColor() );
						sizeOfBar--;
					}
					else
					{
						DrawStringWithAttribute( frame->FrameData.Left+ frame->FrameData.Width+2, j, ScrlNSel, 
							                         StyleGetScrollBarColor() ); 
					}
				}
			}
			else if (bEraseScrollBar == TRUE)
				DrawStringWithAttribute( frame->FrameData.Left+ frame->FrameData.Width+2, j, L" ", 
					                         StyleGetScrollBarColor() ); 

		}
		bEraseScrollBar = FALSE;
	}
			

	return EFI_SUCCESS;
}
//<AMI_PHDR_START>
//--------------------------------------------------------------------------
//
// Name:		LegacyFrameDraw
//
// Description: Draws the controls for the given frame 
//
// Input:       FRAME_DATA *frame - Frame information to draw controls
//
// Output:		EFI_STATUS - EFI_SUCCESS if successful, else EFI_ERROR
//
//--------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacyFrameDraw( FRAME_DATA *frame )
{
	CONTROL_DATA **control;
	UINT32	i, j,FirstLine=0,LastLine=0, count,visibleControlCount = 0, modVal=0, sizeOfBar, numOfBlocks = 0;
	UINT16 CurrHeight, ControlTop;
    	UINT8 u8ChkResult;
	EFI_STATUS Status = EFI_UNSUPPORTED;

    	BOOLEAN bCurrNotFocused = FALSE,bEraseScrollBar=FALSE;

	if((frame->FrameData.FrameType != MAIN_FRAME) || ( frame->PageID != 0 ))
    	{
        Status = FrameDraw(frame );
        return Status;
    	}


	if(StyleFrameDrawable(frame)) 
		return EFI_UNSUPPORTED;
	
	if ( frame->ControlCount == 0 )
		return EFI_UNSUPPORTED;

    //If there is an active control send draw only for that
   	if(frame->CurrentControl == FRAME_NONE_FOCUSED)
	{
		control = NULL;
		bCurrNotFocused = TRUE; // Non is focused
	}
	else
		control = &frame->ControlList[frame->CurrentControl];

	if ( control != NULL )
	{
        //If a control is active only draw that
		if( (*control)->ControlActive == TRUE )
		{
			(*control)->Methods->Draw( *control );
			return EFI_SUCCESS;
		}
		
		if(COND_NONE == CheckControlCondition( &((*control)->ControlData) ))
		{
			// Set the Focus to current control
			if((*control)->Methods->SetFocus(*control,TRUE) !=  EFI_SUCCESS)
			{
				frame->CurrentControl = FRAME_NONE_FOCUSED;
				bCurrNotFocused = TRUE; // Non is focused
			}
		}
	}

    //There is no active control we have to draw all in the view.

   	// First, clear the frame.
	if ( frame->BlankLine != NULL )
	{
		j = frame->FrameData.Top;
		for ( i = 1; i < frame->FrameData.Height; i++, j++ )
		{
			DrawStringWithAttribute( frame->FrameData.Left, j, frame->BlankLine, frame->FrameData.FGColor | frame->FrameData.BGColor );
		}
	}

	//Set position for all controls begining from FirstVisibleControl.
    //In the process calculate the correct LastVisibleControl.
    control = frame->ControlList;

    control = control+ frame->FirstVisibleCtrl;
    CurrHeight = frame->FrameData.Top;
    frame->LastVisibleCtrl = frame->FirstVisibleCtrl;

	for ( i = frame->FirstVisibleCtrl; i < frame->ControlCount; i++, control++ )
	{
        ControlTop = CurrHeight;

        //Check conditional
        u8ChkResult = CheckControlCondition( &((*control)->ControlData) );

        if(u8ChkResult == COND_NONE || u8ChkResult == COND_GRAYOUT)
        {
            //Control is drawn increament height
            CurrHeight = CurrHeight + (*control)->Height;
            if((frame->ControlCount > 1) && ((frame->FrameData.Top +frame->FrameData.Height) < CurrHeight+1 ))
            {
                break;
            }
            else
            {
                frame->LastVisibleCtrl = i;
            }
        }

        if(u8ChkResult != COND_NONE)
        {
            //Control grayed out or suppressed
            if(frame->CurrentControl == i)
            {
                //Current control cant be focused
                (*control)->Methods->SetFocus(*control,FALSE);
                bCurrNotFocused = TRUE;
            }
        }

        //(*control)->Methods->SetPosition( *control, (*control)->Left, ControlTop);
    }

    //Current control can not be focused? Find another one to focus.
    if(bCurrNotFocused)
    {
        control = frame->ControlList;
        control = control+ frame->FirstVisibleCtrl;

        for ( i = frame->FirstVisibleCtrl; i <= frame->LastVisibleCtrl; i++, control++ )
        {
            if ( (*control)->Methods->SetFocus( *control, TRUE ) == EFI_SUCCESS )
            {
                frame->CurrentControl = i;
                break;
            }
        }

        if(i > frame->LastVisibleCtrl)
            frame->CurrentControl = FRAME_NONE_FOCUSED;
    }

	//Draw controls in the set positions
    control = frame->ControlList;
    control = control+ frame->FirstVisibleCtrl;
    for ( i = frame->FirstVisibleCtrl; i <= frame->LastVisibleCtrl; i++, control++ )
    {
        (*control)->Methods->Draw( *control );
    }

    CurrHeight = frame->FrameData.Top;
	for (count = 0; count < frame->ControlCount; count++)
	{
		u8ChkResult = COND_NONE;

		//EIP 75486 Support grayout condition for readonly controls
        u8ChkResult = CheckControlCondition( &(frame->ControlList[count]->ControlData) );
        
        if((COND_NONE == u8ChkResult) || (COND_GRAYOUT == u8ChkResult))
        {
			visibleControlCount++ ; 
            CurrHeight = CurrHeight + frame->ControlList[count]->Height;
	    }
	}

	// if already have a Scroll bar and due some changes (some controls may bedisabled) we don't need a scroll bar in this frame.
	if((frame->UseScrollbar) && ((frame->FrameData.Top + frame->FrameData.Height) >= CurrHeight+1))
	{
		bEraseScrollBar = TRUE;
		frame->UseScrollbar = FALSE;
	}

	// if we don't have a Scroll bar and due some changes (some controls may be enabled) we  need a scroll bar in this frame.
	if((frame->ControlCount > 1) && (!frame->UseScrollbar) && ((frame->FrameData.Top + frame->FrameData.Height) < CurrHeight+1))
	{
		frame->UseScrollbar = TRUE;
	}

	if(visibleControlCount==0)visibleControlCount=1;
    	FirstLine = (frame->FrameData.Height* frame->FirstVisibleCtrl/visibleControlCount )+ frame->FrameData.Top;
	LastLine  = (frame->FrameData.Height* frame->LastVisibleCtrl/visibleControlCount )+ frame->FrameData.Top;

	numOfBlocks = frame->FrameData.Height - 2;
	sizeOfBar = ((frame->FrameData.Height -1) * numOfBlocks) / visibleControlCount;
	modVal = ((((frame->FrameData.Height -1) * numOfBlocks) % visibleControlCount)* numOfBlocks) > (numOfBlocks/2) ? 1 : 0;

	// draw scrollbar if necessary
	StyleDrawScrollBar(frame, FirstLine, LastLine, modVal, sizeOfBar, numOfBlocks, bEraseScrollBar);	
			
	FlushLines( frame->FrameData.Top, frame->FrameData.Top + frame->FrameData.Height );

	return EFI_SUCCESS;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacyMsgBoxInitialize
//
// Description:	Function to Initialize Message Box, which uses the Popup functions.
//
// Input:	MSGBOX_DATA *msgbox, VOID *data
//
// Output:	status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacyMsgBoxInitialize( MSGBOX_DATA *msgbox, VOID *data )
{
	EFI_STATUS Status = EFI_UNSUPPORTED;
	UINT16 Length =0 ;
	VOID *buff;
	CONTROL_INFO MemoCtrlData;
	MEMO_DATA *memo;
	UINT8 Color ;

	UINT16 titleToken;
    	VOID* TextHandle =((AMI_IFR_MSGBOX*)(((CONTROL_INFO*)data)->ControlPtr))->TextHandle;

	// initializes the heigth and width
	Status = gPopup.Initialize( msgbox, data );
	if (EFI_ERROR(Status))
		return Status;

	Status = StyleGetMessageboxColor(msgbox->MsgBoxCatagory, &Color) ; 
	
	if ( EFI_ERROR( Status ) == EFI_SUCCESS)
	{
		msgbox->FGColor = Color & 0x0f ; 
		msgbox->BGColor = Color & 0xf0 ; 
	}else
	// add extra initialization here...
	SetControlColorsHook( NULL, NULL, NULL , NULL, NULL , NULL, NULL ,
	                      NULL , NULL,  NULL,NULL ,
						  NULL,NULL ,&(msgbox->FGColor),&(msgbox->BGColor)  );
	
	msgbox->FGColor = Colors.PopupFGColor ;
	msgbox->BGColor = Colors.PopupBGColor ;

	msgbox->Container = NULL;
	
	msgbox->Border =TRUE;

	titleToken = (UINT16)(((AMI_IFR_MSGBOX*)(msgbox->ControlData.ControlPtr))->Title);
	if ( titleToken != 0 ) {
		msgbox->Title = HiiGetString(msgbox->ControlData.ControlHandle, titleToken);
		if ( msgbox->Title == NULL )
			return EFI_OUT_OF_RESOURCES;
	}

	Length = (UINT16)HiiMyGetMultiLineStringLength(msgbox->ControlData.ControlHandle, (UINT16)(((AMI_IFR_MSGBOX*)(msgbox->ControlData.ControlPtr))->Text));

	if ( ( msgbox->Title != NULL) && ( Length < (TestPrintLength( msgbox->Title )/ (NG_SIZE)) ) )
		Length = (UINT16)(TestPrintLength( msgbox->Title ) / (NG_SIZE));

	msgbox->Width = (UINT16)(Length + 4);

	if(( msgbox->MsgBoxType == MSGBOX_TYPE_NULL ) && ( msgbox->Legend != NULL ))
	{ 
		if ( msgbox->Width < (UINT16)(TestPrintLength( msgbox->Legend )/ (NG_SIZE)) )
			msgbox->Width = (UINT16)(TestPrintLength( msgbox->Legend ) / (NG_SIZE)) + 8;
	}	
//EIP74963 : MAX_MSGBOX_WIDTH macro changed as token and handled from binary
	if ( msgbox->Width > GetMsgboxWidth())
		msgbox->Width = GetMsgboxWidth();

	msgbox->ScreenBuf = SaveScreen();

	// initialize memo control 
	memo = msgbox->Memo;

	buff = UefiCreateSubTitleTemplate(((AMI_IFR_MSGBOX*)(msgbox->ControlData.ControlPtr))->Text );

	
	MemSet( &MemoCtrlData, sizeof(MemoCtrlData), 0 );
	MemoCtrlData.ControlPtr = (VOID*)buff;
	MemoCtrlData.ControlHandle = TextHandle;
	MemoCtrlData.ControlFlags.ControlVisible = TRUE;
	gMemo.Initialize(memo,(VOID *)&(MemoCtrlData));
	memo->Width = msgbox->Width - 2;
	gMemo.GetControlHeight( memo, NULL, &msgbox->Height );
	msgbox->Height += 4;

	gMemo.SetAttributes(memo,msgbox->FGColor ,msgbox->BGColor);
	gMemo.SetDimensions( memo, msgbox->Width-2 , msgbox->Height-3 );
	gMemo.SetJustify( memo, JUSTIFY_CENTER );

	return Status;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacySubMenuInitialize
//
// Description:	this function uses the initialize function of control
//					and initializes the submenu.
//
// Input:	SUBMENU_DATA *submenu, VOID *data
//
// Output:	status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacySubMenuInitialize( SUBMENU_DATA *submenu, VOID *data )
{
	EFI_STATUS Status = EFI_UNSUPPORTED;
	//PAGE_INFO *pageInfo=NULL;
	//PAGE_DATA *Page ;
	
	Status = gControl.Initialize( submenu, data );
	if (EFI_ERROR(Status))
		return Status;

	

	// add extra initialization here...
	submenu->ControlData.ControlHelp = UefiGetHelpField((VOID *)submenu->ControlData.ControlPtr); //refPtr->Help;
	submenu->ControlFocus = FALSE;
	submenu->LabelMargin = (UINT8)gControlLeftMargin;

	// initialize default colors
	SetControlColorsHook(&(submenu->BGColor), &(submenu->FGColor),  
						NULL, NULL,
						&(submenu->SelBGColor), &(submenu->SelFGColor),
			            		&(submenu->NSelBGColor), &(submenu->NSelFGColor),  
						NULL,&(submenu->LabelFGColor) ,
					    	&(submenu->NSelLabelFGColor),
						NULL,NULL,
						NULL,NULL );


	//if((submenu->SubMenuType==0) && (submenu->ControlData.ControlPageID!=0))
	//	submenu->SelFGColor = FOCUS_COLOR ;

	

/*        

	if(submenu->SubMenuType==0)
	{
		Page = gApp->PageList[gApp->CurrentPage];
		
		if(Page->PageData.PageTitle == STRING_TOKEN(STR_EXIT))
		{
			submenu->SelFGColor = FOCUS_COLOR ;

		}
	}
*/        

/*						
	if((submenu->SubMenuType==0) && (submenu->ControlData.ControlPageID!=0))
	{
		pageInfo = (PAGE_INFO *)((UINTN)gApplicationData + gPages->PageList[submenu->ControlData.ControlPageID]);
		
		if(pageInfo->PageTitle == STRING_TOKEN(STR_EXIT))
		{
			submenu->SelFGColor = FOCUS_COLOR ;

		}
	}	
*/			
	
	

#if SETUP_STYLE_LEGACY
	submenu->SubMenuType = (UINT8)(submenu->ControlData.ControlPageID != 0);
#endif

	return Status;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacySubMenuDraw
//
// Description:	function to draw a sub-menu.
//
// Input:	SUBMENU_DATA *submenu
//
// Output:	status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS LegacySubMenuDraw( SUBMENU_DATA *submenu )
{
	CHAR16 *text=NULL,*text1;
	UINTN length;
	EFI_STATUS Status = EFI_SUCCESS;
//	UINT8 ColorSubMenu = submenu->NSelFGColor;
	UINT8 ColorLabel = (submenu->ControlFocus) ? submenu->LabelFGColor : submenu->NSelLabelFGColor ;
	UINT32 PageNum ;

	PageNum = gApp->CurrentPage ;

	// check conditional ptr if necessary
    //EIP 75486 Support grayout condition for readonly controls
	//if( submenu->ControlData.ControlConditionalPtr != 0x0)
	//{
		switch( CheckControlCondition( &submenu->ControlData ) )
		{
			case COND_NONE:
				break;
			case COND_GRAYOUT:
				Status = EFI_WARN_WRITE_FAILURE;
				ColorLabel = CONTROL_GRAYOUT_COLOR;
				break;
			default:
				return EFI_UNSUPPORTED;
				break;
		}
	//}

	text1 = HiiGetString( submenu->ControlData.ControlHandle,  UefiGetPromptField((VOID *)(submenu->ControlData.ControlPtr)));
	if ( text1 == NULL )
		return EFI_OUT_OF_RESOURCES;
	// XXX check to see if text1 is not NULL
	length = (3 + (TestPrintLength( text1 ) / (NG_SIZE))) * sizeof(CHAR16);
	text = EfiLibAllocateZeroPool( length );
	if ( text == NULL )
		return EFI_OUT_OF_RESOURCES;

	if((submenu->SubMenuType == 0)&&( PageNum == 0 ))
		SPrint( text, length,  L"%s", text1 );
	else if(submenu->SubMenuType == 2)
		SPrint( text, length, L"%s", text1 );
	else
		SPrint( text, length, L"%c %s", GEOMETRICSHAPE_RIGHT_TRIANGLE, text1 );		


	//SPrint( text, length, L"%c %s", (submenu->SubMenuType == 2)?L' ':GEOMETRICSHAPE_RIGHT_TRIANGLE, text1 );

	//SPrint( text, length,  ((submenu->SubMenuType == 0)&&( PageNum == 0 ))?L"%c%s":L"%c %s", ((submenu->SubMenuType == 2)||( PageNum == 0 ))?L' ':GEOMETRICSHAPE_RIGHT_TRIANGLE, text1 );

	//SPrint( text, length,  ((submenu->SubMenuType == 0)&&( PageNum == 0 ))?L"%c%s":L"%c %s", ((submenu->SubMenuType == 2)||( PageNum == 0 ))?L' ':GEOMETRICSHAPE_RIGHT_TRIANGLE, text1 );
	MemFreePointer( (VOID **)&text1 );

	if ( submenu->SubMenuType != 1 )
	{
		//EIP-72610 TSE_MULTILINE_CONTROLS moved to binary
		if(submenu->Height>1 && IsTSEMultilineControlSupported())
		{
			DrawMultiLineStringWithAttribute( submenu->Left , submenu->Top, 
					(UINTN)(submenu->Width-2),(UINTN) submenu->Height,
					&text[2], (UINT8)(  (submenu->ControlFocus) ? 
							  submenu->SelBGColor  | ColorLabel /*submenu->SelFGColor*/ :
							  submenu->NSelBGColor | ColorLabel /*ColorSubMenu*/ )  );
			if(submenu->SubMenuType != 2)
			{
				text[2]=0;
				DrawStringWithAttribute( submenu->Left - 2, submenu->Top, (CHAR16*)text, 
						(UINT8)(  (submenu->ControlFocus) ? 
								  submenu->SelBGColor  | ColorLabel /*submenu->SelFGColor*/ :
								  submenu->NSelBGColor | ColorLabel /*ColorSubMenu*/ ) );
			}
		}
		else	
		{
			
			if(submenu->SubMenuType==0 && !submenu->ControlFocus && ColorLabel != CONTROL_GRAYOUT_COLOR)
				ColorLabel = StyleGetPageLinkColor();


            if( PageNum == 0 )
            {
                if((TestPrintLength( text ) / (NG_SIZE)) > (UINTN)((submenu->Width/2)-2))
				    EfiStrCpy( &text[HiiFindStrPrintBoundary(text,(UINTN)((submenu->Width/2)-5))],L"...");
                
            }else{
						
			
			if((TestPrintLength( text ) / (NG_SIZE)) > (UINTN)(submenu->Width-2))
				EfiStrCpy( &text[HiiFindStrPrintBoundary(text,(UINTN)(submenu->Width-5))],L"...");

            }
	
			DrawStringWithAttribute( submenu->Left, submenu->Top, (CHAR16*)text, 
					(UINT8)(  (submenu->ControlFocus) ? 
							  submenu->SelBGColor  | submenu->SelFGColor :
							  submenu->NSelBGColor | ColorLabel ) );
		}
	}
	else
	{
		if((TestPrintLength( text ) / (NG_SIZE)) > (UINTN)(submenu->Width-2))
			EfiStrCpy( &text[HiiFindStrPrintBoundary(text,(UINTN)(submenu->Width-5))],L"...");

		text1 = HiiGetString( gHiiHandle, STRING_TOKEN(STR_SUBMENU_OPTION) );
		if ( text1 != NULL )
		{
			DrawStringWithAttribute( submenu->Left - 2, submenu->Top, (CHAR16*)text, 
					EFI_BACKGROUND_BLUE | EFI_WHITE );
			MemFreePointer( (VOID **)&text );

			length = (3 + (TestPrintLength( text1 ) / (NG_SIZE))) * sizeof(CHAR16);
			text = EfiLibAllocatePool( length );
			if ( text != NULL )
			{
				SPrint( text, length, L"[%s]", text1 );
		
			 	if ((TestPrintLength( text ) / (NG_SIZE)) > (UINTN)(submenu->Width-2))
					EfiStrCpy( &text[HiiFindStrPrintBoundary(text,(UINTN)(submenu->Width-5))],L"...");

				DrawStringWithAttribute( submenu->Left  + submenu->LabelMargin , submenu->Top, text,
					(UINT8)(  (submenu->ControlFocus) ? 
						  	submenu->SelBGColor  | submenu->SelFGColor :
							submenu->NSelBGColor | submenu->NSelFGColor ) );

				//if ( submenu->ControlFocus )
				//	DrawStringWithAttribute( submenu->Left + submenu->LabelMargin + 1,
				//			submenu->Top, text1, (UINT8)(submenu->SelBGColor | submenu->SelFGColor) );
			}
		}
	}

	MemFreePointer( (VOID **)&text );
	MemFreePointer( (VOID **)&text1 );

	FlushLines( submenu->Top, submenu->Top );

	return Status;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	OverRideStyleInit	
//
// Description:	Function to initialize style
//
// Input:		VOID
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID	OverRideStyleInit( VOID )
{
	VOID *data = NULL ;
	data = (UINT8 *)gApplicationData + gPages->PageList[0] ;

	if( ((PAGE_INFO*)data)->PageHandle == 0)
	       	((PAGE_INFO*)data)->PageHandle = gHiiHandle ;

	
	gLabelLeftMargin = STYLE_LABEL_LEFT_MARGIN ;
	gControlLeftMargin = STYLE_CONTROL_LEFT_MARGIN ;
	gControlLeftPad = STYLE_CONTROL_LEFT_PAD ;
	

	#if SETUP_STYLE_FULL_SCREEN
	if ( gMaxCols == STYLE_FULL_MAX_COLS )
	{
		_gStyleMainFrames = _gStyleLegacyFullMainFrames ;
		_gStyleSubFrames = _gStyleLegacyFullSubFrames ;

		gLabelLeftMargin = FULL_STYLE_LABEL_LEFT_MARGIN ;
		gControlLeftMargin = FULL_STYLE_CONTROL_LEFT_MARGIN ;
		gControlLeftPad = FULL_STYLE_CONTROL_LEFT_PAD ;
	
	}
	#endif


}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	StyleFrameIndexOf	
//
// Description:	Function to get frame index
//
// Input:		UINT32 frameType
//
// Output:		UINT32 index
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT32	StyleFrameIndexOf( UINT32 frameType )
{
	UINT32 FrameCount ;
	UINT32 i, PageNum ;

	PageNum = gApp->CurrentPage ;


	if ( PageNum == 0 )
		FrameCount = sizeof(_gStyleLegacyMainFrames) / sizeof(FRAME_INFO);
	else
		FrameCount = sizeof(_gStyleLegacySubFrames) / sizeof(FRAME_INFO);


	for ( i = 0; i < FrameCount; i++ )
	{
		if ( PageNum == 0 )
		{
			if( _gStyleMainFrames[i].FrameType == frameType )
			{
				return i ;
				break ;
			}
		}else{

			if( _gStyleSubFrames[i].FrameType == frameType )
			{
				return i ;
				break ;
			}

		}

	}
	
	return i ;
	
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	StyleGetPageFrames	
//
// Description:	Function to number of frames
//
// Input:		UINT32 page
//
// Output:		UINT32 number of frames
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT32	StyleGetPageFrames( UINT32 page )
{
	if ( page == 0 )
		return sizeof(_gStyleLegacyMainFrames) / sizeof(FRAME_INFO);

	return sizeof(_gStyleLegacySubFrames) / sizeof(FRAME_INFO);
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	OverRideStyleDrawPageBorder	
//
// Description:	Function to draw page border
//
// Input:		UINT32 page
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID OverRideStyleDrawPageBorder( UINT32 page )
{
	CHAR16 *line;
	UINT8 lineNumber;

	UINT8 start, end, col;

	PAGE_DATA *Page=NULL ;
	FRAME_DATA *fHelptitle=NULL, *fHelp=NULL ;

	Page = gApp->PageList[page];
	
	fHelptitle = Page->FrameList[StyleFrameIndexOf(HELPTITLE_FRAME)];
	fHelp = Page->FrameList[StyleFrameIndexOf(HELP_FRAME)];
	




	line = EfiLibAllocateZeroPool( (gMaxCols + 1) * sizeof(CHAR16) );
	if ( line == NULL )
		return;

	ClearScreenWithoutFlush( EFI_BACKGROUND_BLUE | EFI_WHITE );

	MemFillUINT16Buffer( &line[1], gMaxCols - 2, L' ' );
	line[0] = line[gMaxCols - 1] = BOXDRAW_DOUBLE_VERTICAL;

	if ( page == 0 )
	{
		start = 2;
		end = (UINT8)(gMaxRows - 2);
	}
	else
	{
		start = 3;
		end = (UINT8)(gMaxRows - 3);
	}

	for ( lineNumber = start; lineNumber < end; lineNumber++ )
		DrawString( 0, lineNumber, line );

	MemFillUINT16Buffer( &line[1], gMaxCols - 2, BOXDRAW_DOUBLE_HORIZONTAL );
	// top line
	line[0] = BOXDRAW_DOUBLE_DOWN_RIGHT;
	line[gMaxCols - 1] = BOXDRAW_DOUBLE_DOWN_LEFT;
	DrawString( 0, start - 1, line );

	// bottom line
	line[0] = BOXDRAW_DOUBLE_UP_RIGHT;
	line[gMaxCols - 1] = BOXDRAW_DOUBLE_UP_LEFT;
	DrawString( 0, end, line );

	MemFillUINT16Buffer( &line[1], gMaxCols - 2, BOXDRAW_HORIZONTAL );

	if ( page == 0 )
	{
		line[0] = BOXDRAW_VERTICAL_DOUBLE_RIGHT;
		line[gMaxCols - 1] = BOXDRAW_VERTICAL_DOUBLE_LEFT;
		DrawString( 0, gMaxRows - 4, line );
		line[gMaxCols / 2] = BOXDRAW_UP_HORIZONTAL;
		DrawString( 0, gMaxRows - 7, line );

		line[0] = BOXDRAW_DOWN_HORIZONTAL_DOUBLE;
		line[1] = L'\0';
		DrawString( gMaxCols / 2, 1, line );
	}
	else
	{
		// dividing line
		line[0] = BOXDRAW_VERTICAL_RIGHT;
		line[fHelp->FrameData.Width + 2] = BOXDRAW_VERTICAL_DOUBLE_LEFT;
		line[fHelp->FrameData.Width + 3] = L'\0';
		DrawString( fHelp->FrameData.Left - 2, 4, line );
		line[0] = BOXDRAW_DOWN_HORIZONTAL_DOUBLE;
		line[1] = L'\0';
		DrawString( fHelp->FrameData.Left - 2, 2, line );
		line[0] = BOXDRAW_UP_HORIZONTAL_DOUBLE;
		DrawString( fHelp->FrameData.Left - 2, gMaxRows - 3, line );

	}

	// center divider
	line[0] = BOXDRAW_VERTICAL;

	if ( page == 0 )
	{
		start = 2;
		end = (UINT8)(gMaxRows - 7);
		col = (UINT8)(gMaxCols / 2);
	}
	else
	{
		start = 5;
		end = (UINT8)(gMaxRows - 3);
		col = fHelp->FrameData.Left - 2;
	}
	for ( lineNumber = start; lineNumber < end; lineNumber++ )
		DrawString( col, lineNumber, line );

	if ( page != 0 )
		DrawString( fHelp->FrameData.Left - 2, 3, line );

	FlushLines( 0, gMaxRows - 1 );

	gBS->FreePool( line );
	
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	OverRideStyleGetFrameInitData	
//
// Description:	Function to get frame initialization data
//
// Input:		UINT32 page, UINT32 frame
//
// Output:		VOID* 
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID *OverRideStyleGetFrameInitData( UINT32 page, UINT32 frame )
{
	if ( page == 0 )
				return &_gStyleMainFrames[frame];

	return &_gStyleSubFrames[frame];

}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:   OverRideComponent
//
// Description: Function to override component or control functionality
//
// Input:   VOID
//
// Output:  VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID OverRideComponent(VOID)
{
    gMsgBox.Initialize = LegacyMsgBoxInitialize ;
    gSubMenu.Initialize = LegacySubMenuInitialize ;
    gSubMenu.Draw = LegacySubMenuDraw ;
    gFrame.Draw = LegacyFrameDraw ;    		        // Override framedraw
	gFrame.AddControl = LegacyFrameAddControl ;     // Override FrameAddControl
    gPage.HandleAction = LegacyPageHandleAction ;   // Override FrameAddControl
    
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	StyleFrameAddTitle	
//
// Description:	Function to add frame title 
//
// Input:		FRAME_DATA *frame, UINT32 frameType, CONTROL_INFO * dummy
//
// Output:		EFI_STATUS
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS StyleFrameAddTitle( FRAME_DATA *frame, UINT32 frameType,CONTROL_INFO * dummy )
{
	return EFI_UNSUPPORTED;
}

#endif /* SETUP_STYLE_LEGACY */

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandleEscKey	
//
// Description:	Function to handle ESC Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandleEscKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	UINT16 pageClass = 0, pageSubclass = 0, pageFormID = 0;
	EFI_GUID ExitPageGuid;


	if(FormBrowserHandleValid())
		app->Quit = TRUE;

	else if ( gotoExitOnEscKey (&ExitPageGuid, &pageClass, &pageSubclass, &pageFormID) )//EIP-112628 GotoExitPageOnEscKey
	{
    	UINT32 i=0;
    	PAGE_INFO *pageInfo;

		for ( i = 0; i < gPages->PageCount; i++ )
		{
			pageInfo = (PAGE_INFO *)((UINTN)gApplicationData + gPages->PageList[i]);
			if (
	         	( EfiCompareGuid(&ExitPageGuid,&(gPageIdInfo[pageInfo->PageIdIndex].PageGuid)) ) &&
					( pageClass == gPageIdInfo[pageInfo->PageIdIndex].PageClass ) 							&&
					( pageSubclass == gPageIdInfo[pageInfo->PageIdIndex].PageSubClass ) 					&&
					( pageFormID == pageInfo->PageFormID ) 
			   )
			{
				gApp->CurrentPage = i; // Page found go to exit page
	            gApp->CompleteRedraw = TRUE;
	            gApp->Fixed = FALSE;
				break;
			}
		}
		if(i >= gPages->PageCount) //Page not found exit application
			app->Quit = ExitApplication();
	}

	else
		app->Quit = ExitApplication();
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandleSaveExitKey	
//
// Description:	Function to handle Save and Exit Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandleSaveExitKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	app->Quit = SaveAndExit();
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandlePrevValuesKey	
//
// Description:	Function to handle Load Previous value Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandlePrevValuesKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	//if ( app->CurrentPage != 0 )
		LoadPreviousValues( TRUE );
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandleFailsafeKey	
//
// Description:	Function to handle Load Failsafe values Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandleFailsafeKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	//if ( app->CurrentPage != 0 )
		LoadFailsafeDefaults();
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandleOptimalKey	
//
// Description:	Function to handle Load Optimal values Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandleOptimalKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	//if ( app->CurrentPage != 0 )
		LoadOptimalDefaults();
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandleHelpKey	
//
// Description:	Function to handle Help Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandleHelpKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	//if ( app->CurrentPage != 0 )
		ShowHelpMessageBox();
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HandlePrnScrnKey	
//
// Description:	Function to handle print screen Hotkey action
//
// Input:		APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie 
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHandlePrnScrnKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie )
{
	TseHotkeyPrintScreenSupport();
}

//EIP:47086 - Right clicking from the Main page is not exiting from BIOS setup.
//EIP:47086 START
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacyMainFrameHandlewithMouse	
//
// Description:	Function to handle Main Frame with Mouse
//
// Input:		APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie 
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyMainFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie )
{
	if(app->Action->Input.Data.MouseInfo.ButtonStatus == TSEMOUSE_RIGHT_CLICK)
		app->Quit = ExitApplication();
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacyHelpFrameHandlewithMouse	
//
// Description:	Function to handle Help Frame with Mouse
//
// Input:		APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie 
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyHelpFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie )
{
	
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	LegacyNavFrameHandlewithMouse	
//
// Description:	Function to handle Navigation Frame with Mouse
//
// Input:		APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie 
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID LegacyNavFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie )
{

}
//EIP:47086 END


//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**        (C)Copyright 1985-2011, American Megatrends, Inc.    **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**             5555 Oakbrook Pkwy   , Norcross, GA 30071       **//
//**                                                             **//
//**                     Phone: (770)-246-8600                   **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//