30 if (OpCode->OpCode == EFI_IFR_STRING_OP) {
32 *Minimum = StringOp->MinSize;
33 *Maximum = StringOp->MaxSize;
34 }
else if (OpCode->OpCode == EFI_IFR_PASSWORD_OP) {
36 *Minimum = PasswordOp->MinSize;
37 *Maximum = PasswordOp->MaxSize;
59 IN OUT CHAR16 *StringPtr
69 CHAR16 *BufferedString;
75 UINTN DimensionsWidth;
76 UINTN DimensionsHeight;
78 BOOLEAN CursorVisible;
85 DimensionsWidth = gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn;
86 DimensionsHeight = gStatementDimensions.BottomRow - gStatementDimensions.TopRow;
88 NullCharacter = CHAR_NULL;
93 Question = MenuOption->ThisTag;
96 if (Question->OpCode->OpCode == EFI_IFR_PASSWORD_OP) {
102 MaxLen = Maximum + 1;
106 if (ScreenSize < (Maximum + 1)) {
107 ScreenSize = Maximum + 1;
110 if ((ScreenSize + 2) > DimensionsWidth) {
111 ScreenSize = DimensionsWidth - 2;
115 ASSERT (BufferedString);
117 Start = (DimensionsWidth - ScreenSize - 2) / 2 + gStatementDimensions.LeftColumn + 1;
118 Top = ((DimensionsHeight - 6) / 2) + gStatementDimensions.TopRow - 1;
131 if (CurrentCursor != 0) {
148 for (Count = 0; Index + 1 <
GetStringWidth (StringPtr) / 2; Index++, Count++) {
149 BufferedString[Count] = StringPtr[Index];
169 switch (Key.UnicodeChar) {
171 switch (Key.ScanCode) {
173 if (CurrentCursor > 0) {
191 return EFI_DEVICE_ERROR;
194 for (Index = CurrentCursor; StringPtr[Index] != CHAR_NULL; Index++) {
195 StringPtr[Index] = StringPtr[Index + 1];
196 PrintCharAt (Start + Index + 1, Top + 3, IsPassword && StringPtr[Index] != CHAR_NULL ? L
'*' : StringPtr[Index]);
207 case CHAR_CARRIAGE_RETURN:
208 if (
GetStringWidth (StringPtr) >= ((Minimum + 1) *
sizeof (CHAR16))) {
220 CreateDialog (&Key, &NullCharacter, gMiniString, gPressEnter, &NullCharacter,
NULL);
221 }
while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
227 return EFI_DEVICE_ERROR;
231 if ((StringPtr[0] != CHAR_NULL) && (CurrentCursor != 0)) {
232 for (Index = 0; Index < CurrentCursor - 1; Index++) {
233 TempString[Index] = StringPtr[Index];
237 if (Count >= CurrentCursor) {
238 for (Index = CurrentCursor - 1, Index2 = CurrentCursor; Index2 < Count; Index++, Index2++) {
239 TempString[Index] = StringPtr[Index2];
242 TempString[Index] = CHAR_NULL;
248 StrCpyS (StringPtr, MaxLen, TempString);
256 if ((StringPtr[0] == CHAR_NULL) && (Key.UnicodeChar != CHAR_BACKSPACE)) {
257 StrnCpyS (StringPtr, MaxLen, &Key.UnicodeChar, 1);
259 }
else if ((
GetStringWidth (StringPtr) < ((Maximum + 1) *
sizeof (CHAR16))) && (Key.UnicodeChar != CHAR_BACKSPACE)) {
260 KeyPad[0] = Key.UnicodeChar;
261 KeyPad[1] = CHAR_NULL;
263 if (CurrentCursor < Count) {
264 for (Index = 0; Index < CurrentCursor; Index++) {
265 TempString[Index] = StringPtr[Index];
268 TempString[Index] = CHAR_NULL;
269 StrCatS (TempString, MaxLen, KeyPad);
270 StrCatS (TempString, MaxLen, StringPtr + CurrentCursor);
271 StrCpyS (StringPtr, MaxLen, TempString);
273 StrCatS (StringPtr, MaxLen, KeyPad);
296 for (Count = 0; Index + 1 <
GetStringWidth (StringPtr) / 2; Index++, Count++) {
297 BufferedString[Count] = StringPtr[Index];
335 Month = QuestionValue->Value.date.Month;
336 Year = QuestionValue->Value.date.Year;
341 if (((Year % 4) == 0) && (((Year % 100) != 0) || ((Year % 400) == 0))) {
363 if (QuestionValue->Value.date.Day > Maximum) {
364 QuestionValue->Value.date.Day = Maximum;
372 if (QuestionValue->Value.date.Day > Maximum) {
373 QuestionValue->Value.date.Day = Minimum;
400 OUT UINT16 *StorageWidth
407 switch (NumericOp->Flags & EFI_IFR_NUMERIC_SIZE) {
408 case EFI_IFR_NUMERIC_SIZE_1:
410 *Minimum = (INT64)(INT8)NumericOp->data.u8.MinValue;
411 *Maximum = (INT64)(INT8)NumericOp->data.u8.MaxValue;
412 *Value = (INT64)(INT8)QuestionValue->Value.u8;
414 *Minimum = NumericOp->data.u8.MinValue;
415 *Maximum = NumericOp->data.u8.MaxValue;
416 *Value = QuestionValue->Value.u8;
419 *Step = NumericOp->data.u8.Step;
420 *StorageWidth = (UINT16)
sizeof (UINT8);
423 case EFI_IFR_NUMERIC_SIZE_2:
425 *Minimum = (INT64)(INT16)NumericOp->data.u16.MinValue;
426 *Maximum = (INT64)(INT16)NumericOp->data.u16.MaxValue;
427 *Value = (INT64)(INT16)QuestionValue->Value.u16;
429 *Minimum = NumericOp->data.u16.MinValue;
430 *Maximum = NumericOp->data.u16.MaxValue;
431 *Value = QuestionValue->Value.u16;
434 *Step = NumericOp->data.u16.Step;
435 *StorageWidth = (UINT16)
sizeof (UINT16);
438 case EFI_IFR_NUMERIC_SIZE_4:
440 *Minimum = (INT64)(INT32)NumericOp->data.u32.MinValue;
441 *Maximum = (INT64)(INT32)NumericOp->data.u32.MaxValue;
442 *Value = (INT64)(INT32)QuestionValue->Value.u32;
444 *Minimum = NumericOp->data.u32.MinValue;
445 *Maximum = NumericOp->data.u32.MaxValue;
446 *Value = QuestionValue->Value.u32;
449 *Step = NumericOp->data.u32.Step;
450 *StorageWidth = (UINT16)
sizeof (UINT32);
453 case EFI_IFR_NUMERIC_SIZE_8:
455 *Minimum = (INT64)NumericOp->data.u64.MinValue;
456 *Maximum = (INT64)NumericOp->data.u64.MaxValue;
457 *Value = (INT64)QuestionValue->Value.u64;
459 *Minimum = NumericOp->data.u64.MinValue;
460 *Maximum = NumericOp->data.u64.MaxValue;
461 *Value = QuestionValue->Value.u64;
464 *Step = NumericOp->data.u64.Step;
465 *StorageWidth = (UINT16)
sizeof (UINT64);
473 *Maximum = (UINT64)-1;
493 CHAR16 InputText[MAX_NUMERIC_INPUT_WIDTH];
494 CHAR16 FormattedNumber[MAX_NUMERIC_INPUT_WIDTH - 1];
495 UINT64 PreviousNumber[MAX_NUMERIC_INPUT_WIDTH - 3];
502 BOOLEAN ValidateFail;
517 Column = MenuOption->OptCol;
518 Row = MenuOption->Row;
519 PreviousNumber[0] = 0;
530 ValidateFail =
FALSE;
532 Question = MenuOption->ThisTag;
533 QuestionValue = &Question->CurrentValue;
534 ZeroMem (InputText, MAX_NUMERIC_INPUT_WIDTH *
sizeof (CHAR16));
540 ManualInput = (BOOLEAN)(gDirection == 0 ?
TRUE :
FALSE);
542 if ((Question->OpCode->OpCode == EFI_IFR_DATE_OP) || (Question->OpCode->OpCode == EFI_IFR_TIME_OP)) {
553 if (Question->OpCode->OpCode == EFI_IFR_DATE_OP) {
557 switch (MenuOption->Sequence) {
561 EditValue = QuestionValue->Value.date.Month;
565 switch (QuestionValue->Value.date.Month) {
567 if (((QuestionValue->Value.date.Year % 4) == 0) &&
568 (((QuestionValue->Value.date.Year % 100) != 0) ||
569 ((QuestionValue->Value.date.Year % 400) == 0)))
589 EditValue = QuestionValue->Value.date.Day;
595 EditValue = QuestionValue->Value.date.Year;
601 }
else if (Question->OpCode->OpCode == EFI_IFR_TIME_OP) {
605 switch (MenuOption->Sequence) {
609 EditValue = QuestionValue->Value.time.Hour;
615 EditValue = QuestionValue->Value.time.Minute;
621 EditValue = QuestionValue->Value.time.Second;
628 ASSERT (Question->OpCode->OpCode == EFI_IFR_NUMERIC_OP);
630 GetValueFromNum (Question->OpCode, (NumericOp->Flags & EFI_IFR_DISPLAY) == 0, QuestionValue, &EditValue, &Minimum, &Maximum, &Step, &StorageWidth);
631 EraseLen = gOptionBlockWidth;
634 if ((Question->OpCode->OpCode == EFI_IFR_NUMERIC_OP) && (NumericOp !=
NULL)) {
635 if ((NumericOp->Flags & EFI_IFR_DISPLAY) == EFI_IFR_DISPLAY_UINT_HEX) {
637 }
else if ((NumericOp->Flags & EFI_IFR_DISPLAY) == 0) {
649 if (Question->OpCode->OpCode == EFI_IFR_NUMERIC_OP) {
651 InputWidth = StorageWidth * 2;
653 switch (StorageWidth) {
683 InputText[0] = LEFT_NUMERIC_DELIMITER;
685 ASSERT (InputWidth + 2 < MAX_NUMERIC_INPUT_WIDTH);
686 InputText[InputWidth + 1] = RIGHT_NUMERIC_DELIMITER;
687 InputText[InputWidth + 2] = L
'\0';
693 if (Question->OpCode->OpCode == EFI_IFR_DATE_OP) {
694 if (MenuOption->Sequence == 2) {
700 if (MenuOption->Sequence == 0) {
701 InputText[0] = LEFT_NUMERIC_DELIMITER;
703 InputText[InputWidth + 1] = DATE_SEPARATOR;
704 InputText[InputWidth + 2] = L
'\0';
705 }
else if (MenuOption->Sequence == 1) {
707 InputText[InputWidth] = DATE_SEPARATOR;
708 InputText[InputWidth + 1] = L
'\0';
711 InputText[InputWidth] = RIGHT_NUMERIC_DELIMITER;
712 InputText[InputWidth + 1] = L
'\0';
716 if (MenuOption->Sequence == 0) {
721 if (Question->OpCode->OpCode == EFI_IFR_TIME_OP) {
724 if (MenuOption->Sequence == 0) {
725 InputText[0] = LEFT_NUMERIC_DELIMITER;
727 InputText[InputWidth + 1] = TIME_SEPARATOR;
728 InputText[InputWidth + 2] = L
'\0';
729 }
else if (MenuOption->Sequence == 1) {
731 InputText[InputWidth] = TIME_SEPARATOR;
732 InputText[InputWidth + 1] = L
'\0';
735 InputText[InputWidth] = RIGHT_NUMERIC_DELIMITER;
736 InputText[InputWidth + 1] = L
'\0';
740 if (MenuOption->Sequence == 0) {
751 Key.UnicodeChar = CHAR_NULL;
752 if (gDirection != 0) {
753 Key.ScanCode = gDirection;
761 switch (Key.UnicodeChar) {
764 if (ManualInput && IntInput) {
768 if (Key.UnicodeChar ==
'-') {
777 if (Key.UnicodeChar ==
'+') {
778 Key.ScanCode = SCAN_RIGHT;
780 Key.ScanCode = SCAN_LEFT;
783 Key.UnicodeChar = CHAR_NULL;
790 switch (Key.ScanCode) {
793 if (DateOrTime && !ManualInput) {
800 gDirection = SCAN_DOWN;
803 if ((Step != 0) && !ManualInput) {
804 if (Key.ScanCode == SCAN_LEFT) {
806 if ((INT64)EditValue >= (INT64)Minimum + (INT64)Step) {
807 EditValue = EditValue - Step;
808 }
else if ((INT64)EditValue > (INT64)Minimum) {
814 if (EditValue >= Minimum + Step) {
815 EditValue = EditValue - Step;
816 }
else if (EditValue > Minimum) {
822 }
else if (Key.ScanCode == SCAN_RIGHT) {
824 if ((INT64)EditValue + (INT64)Step <= (INT64)Maximum) {
825 EditValue = EditValue + Step;
826 }
else if ((INT64)EditValue < (INT64)Maximum) {
832 if (EditValue + Step <= Maximum) {
833 EditValue = EditValue + Step;
834 }
else if (EditValue < Maximum) {
842 ZeroMem (FormattedNumber, 21 *
sizeof (CHAR16));
843 if (Question->OpCode->OpCode == EFI_IFR_DATE_OP) {
844 if (MenuOption->Sequence == 2) {
848 UnicodeSPrint (FormattedNumber, 21 *
sizeof (CHAR16), L
"%04d", (UINT16)EditValue);
853 UnicodeSPrint (FormattedNumber, 21 *
sizeof (CHAR16), L
"%02d", (UINT8)EditValue);
856 if (MenuOption->Sequence == 0) {
857 ASSERT (EraseLen >= 2);
858 FormattedNumber[EraseLen - 2] = DATE_SEPARATOR;
859 }
else if (MenuOption->Sequence == 1) {
860 ASSERT (EraseLen >= 1);
861 FormattedNumber[EraseLen - 1] = DATE_SEPARATOR;
863 }
else if (Question->OpCode->OpCode == EFI_IFR_TIME_OP) {
864 UnicodeSPrint (FormattedNumber, 21 *
sizeof (CHAR16), L
"%02d", (UINT8)EditValue);
866 if (MenuOption->Sequence == 0) {
867 ASSERT (EraseLen >= 2);
868 FormattedNumber[EraseLen - 2] = TIME_SEPARATOR;
869 }
else if (MenuOption->Sequence == 1) {
870 ASSERT (EraseLen >= 1);
871 FormattedNumber[EraseLen - 1] = TIME_SEPARATOR;
874 QuestionValue->Value.u64 = EditValue;
879 for (Loop = 0; Loop < EraseLen; Loop++) {
880 PrintStringAt (MenuOption->OptCol + Loop, MenuOption->Row, L
" ");
885 if (MenuOption->Sequence == 0) {
886 PrintCharAt (MenuOption->OptCol, Row, LEFT_NUMERIC_DELIMITER);
887 Column = MenuOption->OptCol + 1;
892 if (!DateOrTime || (MenuOption->Sequence == 2)) {
897 goto EnterCarriageReturn;
901 goto EnterCarriageReturn;
904 return EFI_DEVICE_ERROR;
914 case CHAR_CARRIAGE_RETURN:
918 ValidateFail =
FALSE;
926 ValidateFail = (INT64)EditValue > (INT64)Maximum ?
TRUE :
FALSE;
928 ValidateFail = (INT64)EditValue < (INT64)Minimum ?
TRUE :
FALSE;
935 }
else if (EditValue < Minimum) {
942 QuestionValue = &gUserInput->InputValue;
946 if (Question->OpCode->OpCode == EFI_IFR_DATE_OP) {
947 switch (MenuOption->Sequence) {
949 QuestionValue->Value.date.Month = (UINT8)EditValue;
953 QuestionValue->Value.date.Day = (UINT8)EditValue;
957 QuestionValue->Value.date.Year = (UINT16)EditValue;
963 }
else if (Question->OpCode->OpCode == EFI_IFR_TIME_OP) {
964 switch (MenuOption->Sequence) {
966 QuestionValue->Value.time.Hour = (UINT8)EditValue;
970 QuestionValue->Value.time.Minute = (UINT8)EditValue;
974 QuestionValue->Value.time.Second = (UINT8)EditValue;
984 QuestionValue->Value.u64 = EditValue;
992 if ((Question->OpCode->OpCode == EFI_IFR_DATE_OP) &&
993 ((MenuOption->Sequence == 0) || (MenuOption->Sequence == 2)))
1000 case CHAR_BACKSPACE:
1015 EditValue = PreviousNumber[Count - 1];
1027 if ((Key.UnicodeChar >= L
'0') && (Key.UnicodeChar <= L
'9')) {
1028 Digital = (UINT8)(Key.UnicodeChar - L
'0');
1029 }
else if ((Key.UnicodeChar >= L
'A') && (Key.UnicodeChar <= L
'F')) {
1030 Digital = (UINT8)(Key.UnicodeChar - L
'A' + 0x0A);
1031 }
else if ((Key.UnicodeChar >= L
'a') && (Key.UnicodeChar <= L
'f')) {
1032 Digital = (UINT8)(Key.UnicodeChar - L
'a' + 0x0A);
1038 if ((Key.UnicodeChar > L
'9') || (Key.UnicodeChar < L
'0')) {
1047 if (Count >= InputWidth) {
1056 EditValue =
LShiftU64 (EditValue, 4) + Digital;
1057 }
else if (IntInput && Negative) {
1061 EditValue = ~(
MultU64x32 (~(EditValue - 1), 10) + (Key.UnicodeChar - L
'0')) + 1;
1063 EditValue =
MultU64x32 (EditValue, 10) + (Key.UnicodeChar - L
'0');
1067 EditValue = Digital;
1068 }
else if (IntInput && Negative) {
1072 EditValue = ~(Key.UnicodeChar - L
'0') + 1;
1074 EditValue = Key.UnicodeChar - L
'0';
1079 ValidateFail =
FALSE;
1086 ValidateFail = (INT64)EditValue < (INT64)Minimum ?
TRUE :
FALSE;
1088 ValidateFail = (INT64)EditValue > (INT64)Maximum ?
TRUE :
FALSE;
1093 ASSERT (Count <
ARRAY_SIZE (PreviousNumber));
1094 EditValue = PreviousNumber[Count];
1098 if (EditValue > Maximum) {
1100 ASSERT (Count <
ARRAY_SIZE (PreviousNumber));
1101 EditValue = PreviousNumber[Count];
1109 ASSERT (Count < (
ARRAY_SIZE (PreviousNumber)));
1110 PreviousNumber[Count] = EditValue;
1147 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1148 ValueArray = Question->CurrentValue.Buffer;
1149 ValueType = OneOfOption->OptionOpCode->Type;
1152 for (Index = 0; Index < OrderList->MaxContainers; Index++) {
1153 if (
GetArrayData (ValueArray, ValueType, Index) == 0) {
1158 *PopUpMenuLines = Index;
1164 ASSERT (HiiValueArray !=
NULL);
1166 for (Index = 0; Index < *PopUpMenuLines; Index++) {
1167 HiiValueArray[Index].Type = ValueType;
1168 HiiValueArray[Index].Value.u64 =
GetArrayData (ValueArray, ValueType, Index);
1171 for (Index = 0; Index < *PopUpMenuLines; Index++) {
1172 OneOfOption =
ValueToOption (Question, &HiiValueArray[*PopUpMenuLines - Index - 1]);
1173 if (OneOfOption ==
NULL) {
1174 return EFI_NOT_FOUND;
1209 case EFI_IFR_TYPE_BOOLEAN:
1210 case EFI_IFR_TYPE_NUM_SIZE_8:
1211 return (BOOLEAN)(Value1->u8 == Value2->u8);
1213 case EFI_IFR_TYPE_NUM_SIZE_16:
1214 return (BOOLEAN)(Value1->u16 == Value2->u16);
1216 case EFI_IFR_TYPE_NUM_SIZE_32:
1217 return (BOOLEAN)(Value1->u32 == Value2->u32);
1219 case EFI_IFR_TYPE_NUM_SIZE_64:
1220 return (BOOLEAN)(Value1->u64 == Value2->u64);
1244 case EFI_IFR_TYPE_BOOLEAN:
1245 Dest->b = Source->b;
1248 case EFI_IFR_TYPE_NUM_SIZE_8:
1249 Dest->u8 = Source->u8;
1252 case EFI_IFR_TYPE_NUM_SIZE_16:
1253 Dest->u16 = Source->u16;
1256 case EFI_IFR_TYPE_NUM_SIZE_32:
1257 Dest->u32 = Source->u32;
1260 case EFI_IFR_TYPE_NUM_SIZE_64:
1261 Dest->u64 = Source->u64;
1287 CHAR16 *TempStringPtr;
1289 UINTN TopOptionIndex;
1290 UINTN HighlightOptionIndex;
1295 UINTN PopUpMenuLines;
1296 UINTN MenuLinesInView;
1299 INT32 SavedAttribute;
1300 BOOLEAN ShowDownArrow;
1301 BOOLEAN ShowUpArrow;
1302 UINTN DimensionsWidth;
1304 BOOLEAN OrderedList;
1315 DimensionsWidth = gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn;
1319 CurrentOption =
NULL;
1320 ShowDownArrow =
FALSE;
1321 ShowUpArrow =
FALSE;
1325 Question = MenuOption->ThisTag;
1326 if (Question->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
1328 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1329 ValueArray = Question->CurrentValue.Buffer;
1330 ValueType = OneOfOption->OptionOpCode->Type;
1334 OrderedList =
FALSE;
1346 while (!
IsNull (&Question->OptionListHead, Link)) {
1347 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1349 Link =
GetNextNode (&Question->OptionListHead, Link);
1357 HighlightOptionIndex = 0;
1359 for (Index = 0; Index < PopUpMenuLines; Index++) {
1360 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1362 StringPtr =
GetToken (OneOfOption->OptionOpCode->Option, gFormData->HiiHandle);
1363 if (
StrLen (StringPtr) > PopUpWidth) {
1364 PopUpWidth =
StrLen (StringPtr);
1368 HiiValue.Type = OneOfOption->OptionOpCode->Type;
1369 SetValuesByType (&HiiValue.Value, &OneOfOption->OptionOpCode->Value, HiiValue.Type);
1374 HighlightOptionIndex = Index;
1377 Link =
GetNextNode (&Question->OptionListHead, Link);
1383 PopUpWidth = PopUpWidth + POPUP_PAD_SPACE_COUNT;
1388 if ((PopUpWidth + POPUP_FRAME_WIDTH) > DimensionsWidth) {
1389 PopUpWidth = DimensionsWidth - POPUP_FRAME_WIDTH;
1392 Start = (DimensionsWidth - PopUpWidth - POPUP_FRAME_WIDTH) / 2 + gStatementDimensions.LeftColumn;
1393 End = Start + PopUpWidth + POPUP_FRAME_WIDTH;
1394 Top = gStatementDimensions.TopRow;
1395 Bottom = gStatementDimensions.BottomRow - 1;
1397 MenuLinesInView = Bottom - Top - 1;
1398 if (MenuLinesInView >= PopUpMenuLines) {
1399 Top = Top + (MenuLinesInView - PopUpMenuLines) / 2;
1400 Bottom = Top + PopUpMenuLines + 1;
1402 ShowDownArrow =
TRUE;
1405 if (HighlightOptionIndex > (MenuLinesInView - 1)) {
1406 TopOptionIndex = HighlightOptionIndex - MenuLinesInView + 1;
1420 Character = BOXDRAW_DOWN_RIGHT;
1422 for (Index = Start; Index + 2 < End; Index++) {
1423 if ((ShowUpArrow) && ((Index + 1) == (Start + End) / 2)) {
1424 Character = GEOMETRICSHAPE_UP_TRIANGLE;
1426 Character = BOXDRAW_HORIZONTAL;
1432 Character = BOXDRAW_DOWN_LEFT;
1434 Character = BOXDRAW_VERTICAL;
1435 for (Index = Top + 1; Index < Bottom; Index++) {
1444 for (Index = 0; Index < TopOptionIndex; Index++) {
1445 Link =
GetNextNode (&Question->OptionListHead, Link);
1452 for (Index = TopOptionIndex; (Index < PopUpMenuLines) && (Index2 < Bottom); Index++) {
1453 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1454 Link =
GetNextNode (&Question->OptionListHead, Link);
1456 StringPtr =
GetToken (OneOfOption->OptionOpCode->Option, gFormData->HiiHandle);
1457 ASSERT (StringPtr !=
NULL);
1462 if (
StrLen (StringPtr) > (PopUpWidth - 1)) {
1464 ASSERT (TempStringPtr !=
NULL);
1465 CopyMem (TempStringPtr, StringPtr, (
sizeof (CHAR16) * (PopUpWidth - 5)));
1467 StringPtr = TempStringPtr;
1468 StrCatS (StringPtr, PopUpWidth - 1, L
"...");
1471 if (Index == HighlightOptionIndex) {
1475 CurrentOption = OneOfOption;
1489 Character = BOXDRAW_UP_RIGHT;
1491 for (Index = Start; Index + 2 < End; Index++) {
1492 if ((ShowDownArrow) && ((Index + 1) == (Start + End) / 2)) {
1493 Character = GEOMETRICSHAPE_DOWN_TRIANGLE;
1495 Character = BOXDRAW_HORIZONTAL;
1501 Character = BOXDRAW_UP_LEFT;
1507 Key.UnicodeChar = CHAR_NULL;
1508 if ((gDirection == SCAN_UP) || (gDirection == SCAN_DOWN)) {
1509 Key.ScanCode = gDirection;
1517 switch (Key.UnicodeChar) {
1520 if ((TopOptionIndex > 0) && (TopOptionIndex == HighlightOptionIndex)) {
1525 ShowDownArrow =
TRUE;
1528 if (TopOptionIndex == 0) {
1529 ShowUpArrow =
FALSE;
1532 if (HighlightOptionIndex > 0) {
1533 HighlightOptionIndex--;
1535 ASSERT (CurrentOption !=
NULL);
1548 if (((TopOptionIndex + MenuLinesInView) < PopUpMenuLines) &&
1549 (HighlightOptionIndex == (TopOptionIndex + MenuLinesInView - 1)))
1558 if ((TopOptionIndex + MenuLinesInView) == PopUpMenuLines) {
1559 ShowDownArrow =
FALSE;
1562 if (HighlightOptionIndex < (PopUpMenuLines - 1)) {
1563 HighlightOptionIndex++;
1565 ASSERT (CurrentOption !=
NULL);
1566 SwapListEntries (&CurrentOption->Link, CurrentOption->Link.ForwardLink);
1573 if ((TopOptionIndex > 0) && (TopOptionIndex == HighlightOptionIndex)) {
1578 ShowDownArrow =
TRUE;
1581 if (TopOptionIndex == 0) {
1582 ShowUpArrow =
FALSE;
1585 if (HighlightOptionIndex > 0) {
1586 HighlightOptionIndex--;
1593 if (((TopOptionIndex + MenuLinesInView) < PopUpMenuLines) &&
1594 (HighlightOptionIndex == (TopOptionIndex + MenuLinesInView - 1)))
1603 if ((TopOptionIndex + MenuLinesInView) == PopUpMenuLines) {
1604 ShowDownArrow =
FALSE;
1607 if (HighlightOptionIndex < (PopUpMenuLines - 1)) {
1608 HighlightOptionIndex++;
1614 switch (Key.ScanCode) {
1617 if (Key.ScanCode == SCAN_UP) {
1618 if ((TopOptionIndex > 0) && (TopOptionIndex == HighlightOptionIndex)) {
1623 ShowDownArrow =
TRUE;
1626 if (TopOptionIndex == 0) {
1627 ShowUpArrow =
FALSE;
1630 if (HighlightOptionIndex > 0) {
1631 HighlightOptionIndex--;
1634 if (((TopOptionIndex + MenuLinesInView) < PopUpMenuLines) &&
1635 (HighlightOptionIndex == (TopOptionIndex + MenuLinesInView - 1)))
1644 if ((TopOptionIndex + MenuLinesInView) == PopUpMenuLines) {
1645 ShowDownArrow =
FALSE;
1648 if (HighlightOptionIndex < (PopUpMenuLines - 1)) {
1649 HighlightOptionIndex++;
1662 HiiValue.Type = ValueType;
1663 HiiValue.Value.u64 = 0;
1664 for (Index = 0; Index < OrderList->MaxContainers; Index++) {
1665 HiiValue.Value.u64 =
GetArrayData (ValueArray, ValueType, Index);
1666 if (HiiValue.Value.u64 == 0) {
1671 if (OneOfOption ==
NULL) {
1672 return EFI_NOT_FOUND;
1680 return EFI_DEVICE_ERROR;
1688 case CHAR_CARRIAGE_RETURN:
1694 ASSERT (ReturnValue !=
NULL);
1697 while (!
IsNull (&Question->OptionListHead, Link)) {
1698 OneOfOption = DISPLAY_QUESTION_OPTION_FROM_LINK (Link);
1699 Link =
GetNextNode (&Question->OptionListHead, Link);
1701 SetArrayData (ReturnValue, ValueType, Index, OneOfOption->OptionOpCode->Value.u64);
1704 if (Index > OrderList->MaxContainers) {
1709 if (
CompareMem (ReturnValue, ValueArray, Question->CurrentValue.BufferLen) == 0) {
1711 return EFI_DEVICE_ERROR;
1713 gUserInput->InputValue.Buffer = ReturnValue;
1714 gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
1717 ASSERT (CurrentOption !=
NULL);
1718 gUserInput->InputValue.Type = CurrentOption->OptionOpCode->Type;
1719 if (
IsValuesEqual (&Question->CurrentValue.Value, &CurrentOption->OptionOpCode->Value, gUserInput->InputValue.Type)) {
1720 return EFI_DEVICE_ERROR;
1722 SetValuesByType (&gUserInput->InputValue.Value, &CurrentOption->OptionOpCode->Value, gUserInput->InputValue.Type);
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI SwapListEntries(IN OUT LIST_ENTRY *FirstEntry, IN OUT LIST_ENTRY *SecondEntry)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI CreateDialog(OUT EFI_INPUT_KEY *Key OPTIONAL,...)
UINT8 EFIAPI GetPopupColor(VOID)
VOID EFIAPI UpdateStatusBar(IN UINTN MessageType, IN BOOLEAN State)
UINT8 EFIAPI GetFieldTextColor(VOID)
VOID EFIAPI ClearLines(IN UINTN LeftColumn, IN UINTN RightColumn, IN UINTN TopRow, IN UINTN BottomRow, IN UINTN TextAttribute)
UINT8 EFIAPI GetHighlightTextColor(VOID)
UINT8 EFIAPI GetPickListColor(VOID)
EFI_STATUS WaitForKeyStroke(OUT EFI_INPUT_KEY *Key)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define ARRAY_SIZE(Array)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut