Skip to content

Commit

Permalink
[NEW_FEATURE] Make Recent File List totally customizable (terminated).
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 783
  • Loading branch information
donho committed Jun 27, 2011
1 parent f225e5f commit afc9661
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions PowerEditor/src/lastRecentFileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,30 @@ void LastRecentFileList::switchMode()
//Remove all menu items
::RemoveMenu(_hMenu, IDM_OPEN_ALL_RECENT_FILE, MF_BYCOMMAND);
::RemoveMenu(_hMenu, IDM_CLEAN_RECENT_FILE_LIST, MF_BYCOMMAND);

for(int i = 0; i < _size; i++)
{
::RemoveMenu(_hMenu, _lrfl.at(i)._id, MF_BYCOMMAND);
}

if (_hParentMenu == NULL) // mode main menu
{
::RemoveMenu(_hMenu, _posBase, MF_BYPOSITION);
::RemoveMenu(_hMenu, _posBase, MF_BYPOSITION);

{ if (_size > 0)
{
::RemoveMenu(_hMenu, _posBase, MF_BYPOSITION);
::RemoveMenu(_hMenu, _posBase, MF_BYPOSITION);
}
// switch to sub-menu mode
_hParentMenu = _hMenu;
_hMenu = ::CreatePopupMenu();
::RemoveMenu(_hMenu, _posBase+1, MF_BYPOSITION);
}
else // mode sub-menu
{
::RemoveMenu(_hParentMenu, _posBase, MF_BYPOSITION);
::RemoveMenu(_hParentMenu, _posBase, MF_BYPOSITION);

if (_size > 0)
{
::RemoveMenu(_hParentMenu, _posBase, MF_BYPOSITION);
::RemoveMenu(_hParentMenu, _posBase, MF_BYPOSITION);
}
// switch to main menu mode
::DestroyMenu(_hMenu);
_hMenu = _hParentMenu;
Expand Down

0 comments on commit afc9661

Please sign in to comment.