XTLDR Rewrite #7

Merged
belliash merged 184 commits from xtldr_rewrite into master 2024-01-09 18:51:04 +01:00
Showing only changes of commit c2d40e3011 - Show all commits

View File

@ -341,16 +341,13 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
Handle->DialogColor = EFI_TEXT_BGCOLOR_RED;
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
}
else
else if(Handle->Attributes & XTBL_TUI_DIALOG_GENERIC_BOX)
{
/* Generic dialog with blue background and cyan button */
Handle->DialogColor = EFI_TEXT_BGCOLOR_BLUE;
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
}
/* Get caption length */
CaptionLength = RtlWideStringLength(Caption, 0);
/* Set dialog box colors */
BlSetConsoleAttributes(Handle->DialogColor | 0x0F);
@ -365,16 +362,30 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
{
/* Draw top line of the dialog box, starting from the left corner */
BoxLine[0] = EFI_TEXT_BOX_DOWN_RIGHT;
BoxLine[1] = EFI_TEXT_BOX_VERTICAL_LEFT;
/* Fill caption area with spaces */
for(PosX = 2; PosX < CaptionLength + 4; PosX++)
/* Check if there is a caption for this dialog */
if(Caption != NULL)
{
BoxLine[PosX] = ' ';
}
/* Get caption length */
CaptionLength = RtlWideStringLength(Caption, 0);
/* End caption area with vertical line */
BoxLine[CaptionLength + 4] = EFI_TEXT_BOX_VERTICAL_RIGHT;
/* Start caption area with vertical line */
BoxLine[1] = EFI_TEXT_BOX_VERTICAL_LEFT;
/* Fill caption area with spaces */
for(PosX = 2; PosX < CaptionLength + 4; PosX++)
{
BoxLine[PosX] = ' ';
}
/* End caption area with vertical line */
BoxLine[CaptionLength + 4] = EFI_TEXT_BOX_VERTICAL_RIGHT;
}
else
{
/* No caption, -4 because of left and right vertical lines and corresponding spaces */
CaptionLength = -4;
}
/* Draw bottom line */
for(PosX = CaptionLength + 5; PosX < Handle->Width - 1; PosX++)
@ -421,12 +432,20 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
BlConsoleWrite(BoxLine);
}
/* Make sure there is a caption to print */
if(Caption != NULL)
{
/* Write dialog box caption */
BlSetCursorPosition(Handle->PosX + 3, Handle->PosY);
BlConsolePrint(L"%S", Caption);
BlSetCursorPosition(Handle->PosX + 3, Handle->PosY);
BlConsolePrint(L"%S", Caption);
}
/* Write a message on the dialog box */
BlpDrawDialogMessage(Handle, Message);
/* Make sure there is a message to print */
if(Message != NULL)
{
/* Write a message on the dialog box */
BlpDrawDialogMessage(Handle, Message);
}
}
/**