Skip to content

Commit

Permalink
GView make buttons from menu inactive where the functionality is unav…
Browse files Browse the repository at this point in the history
…ailable #238
  • Loading branch information
rzaharia committed Mar 1, 2024
1 parent 4036e06 commit 669e5d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions GViewCore/src/App/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ constexpr _MenuCommand_ menuFileList[] = {
{ "", 0, Key::None },
{ "E&xit", MenuCommands::EXIT_GVIEW, Key::Shift | Key::Escape },
};
constexpr ItemHandle menuFileDisabledCommandsList[] = { 3, 4 };

constexpr _MenuCommand_ menuWindowList[] = {
{ "Arrange &Vertically", MenuCommands::ARRANGE_VERTICALLY, Key::None },
{ "Arrange &Horizontally", MenuCommands::ARRANGE_HORIZONTALLY, Key::None },
Expand Down Expand Up @@ -129,6 +131,9 @@ bool Instance::BuildMainMenus()
{
CHECK(mnuFile = AppCUI::Application::AddMenu("File"), false, "Unable to create 'File' menu");
CHECK(AddMenuCommands(mnuFile, menuFileList, ARRAY_LEN(menuFileList)), false, "");
for (auto itemHandle : menuFileDisabledCommandsList) {
CHECK(mnuFile->SetEnable(itemHandle, false), false, "Fail to disable menu item");
}
CHECK(mnuWindow = AppCUI::Application::AddMenu("&Windows"), false, "Unable to create 'Windows' menu");
CHECK(AddMenuCommands(mnuWindow, menuWindowList, ARRAY_LEN(menuWindowList)), false, "");
CHECK(mnuHelp = AppCUI::Application::AddMenu("&Help"), false, "Unable to create 'Help' menu");
Expand Down

0 comments on commit 669e5d8

Please sign in to comment.