Skip to content

Commit

Permalink
Refactored VMenu::ShowMenu and its vicinity.
Browse files Browse the repository at this point in the history
  • Loading branch information
MKadaner committed Dec 29, 2023
1 parent f495aae commit e27e14d
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 410 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
MZK 2023-12-28 23:10:05-08:00 - build 6239

1. Refactored `VMenu::ShowMenu` and its vicinity.

--------------------------------------------------------------------------------
drkns 2023-12-28 21:59:39+00:00 - build 6238

Expand Down
10 changes: 4 additions & 6 deletions far/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ void Dialog::InitDialogObjects(size_t ID)
static_cast<int>(m_Where.left + Item.X2),
static_cast<int>(m_Where.top + Item.Y2)
});
ListPtr->SetBoxType(SHORT_SINGLE_BOX);

// поле FarDialogItem.Data для DI_LISTBOX используется как верхний заголовок листа
if (!(Item.Flags & DIF_LISTNOBOX) && !DialogMode.Check(DMODE_OBJECTS_CREATED))
Expand Down Expand Up @@ -812,7 +811,6 @@ void Dialog::InitDialogObjects(size_t ID)
{
if (const auto& ListPtr = Item.ListPtr)
{
ListPtr->SetBoxType(SHORT_SINGLE_BOX);
DialogEdit->SetDropDownBox((Item.Flags& DIF_DROPDOWNLIST) != 0);
ListPtr->ChangeFlags(VMENU_WRAPMODE, (Item.Flags& DIF_LISTWRAPMODE) != 0);
ListPtr->ChangeFlags(VMENU_DISABLED, (Item.Flags& DIF_DISABLE) != 0);
Expand Down Expand Up @@ -2034,8 +2032,8 @@ void Dialog::ShowDialog(size_t ID)
if (Item.ListPtr)
{
// Перед отрисовкой спросим об изменении цветовых атрибутов
FarColor RealColors[VMENU_COLOR_COUNT]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, VMENU_COLOR_COUNT, RealColors };
FarColor RealColors[std::to_underlying(vmenu_colors::COUNT)]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, std::to_underlying(vmenu_colors::COUNT), RealColors };
Item.ListPtr->GetColors(&ListColors);

if (DlgProc(DN_CTLCOLORDLGLIST,I,&ListColors))
Expand Down Expand Up @@ -3867,8 +3865,8 @@ int Dialog::SelectFromComboBox(DialogItemEx& CurItem, DlgEdit& EditLine)
DlgProc(DN_DROPDOWNOPENED, m_FocusPos, ToPtr(1));
SetComboBoxPos(&CurItem);
// Перед отрисовкой спросим об изменении цветовых атрибутов
FarColor RealColors[VMENU_COLOR_COUNT]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, VMENU_COLOR_COUNT, RealColors };
FarColor RealColors[std::to_underlying(vmenu_colors::COUNT)]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, std::to_underlying(vmenu_colors::COUNT), RealColors };
ComboBox->SetColors(nullptr);
ComboBox->GetColors(&ListColors);

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6238
6239
Loading

0 comments on commit e27e14d

Please sign in to comment.