This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions

View File

@@ -77,6 +77,8 @@ static CIDLangPair kIDLangPairs[] =
{ IDM_DELETE, 0x03000233 },
{ IDM_FILE_PROPERTIES, 0x03000240 },
{ IDM_FILE_COMMENT, 0x03000241 },
{ IDM_FILE_SPLIT, 0x03000270 },
{ IDM_FILE_COMBINE, 0x03000271 },
{ IDM_CREATE_FOLDER, 0x03000250 },
{ IDM_CREATE_FILE, 0x03000251 },
{ IDCLOSE, 0x03000260 },
@@ -189,6 +191,56 @@ void MyChangeMenu(HMENU menuLoc, int baseIndex = -1)
}
*/
/*
static bool g_IsNew_fMask = true;
class CInit_fMask
{
public:
CInit_fMask()
{
g_IsNew_fMask = false;
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (::GetVersionEx(&vi))
{
g_IsNew_fMask = (vi.dwMajorVersion > 4 ||
(vi.dwMajorVersion == 4 && vi.dwMinorVersion > 0));
}
g_IsNew_fMask = false;
}
} g_Init_fMask;
// it's hack for supporting Windows NT
// constants are from WinUser.h
#if(WINVER < 0x0500)
#define MIIM_STRING 0x00000040
#define MIIM_BITMAP 0x00000080
#define MIIM_FTYPE 0x00000100
#endif
static UINT Get_fMaskForString()
{
return g_IsNew_fMask ? MIIM_STRING : MIIM_TYPE;
}
static UINT Get_fMaskForFTypeAndString()
{
return g_IsNew_fMask ? (MIIM_STRING | MIIM_FTYPE) : MIIM_TYPE;
}
*/
static UINT Get_fMaskForString()
{
return MIIM_TYPE;
}
static UINT Get_fMaskForFTypeAndString()
{
return MIIM_TYPE;
}
static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
{
CMenu menu;
@@ -198,7 +250,7 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
MENUITEMINFO menuInfo;
ZeroMemory(&menuInfo, sizeof(menuInfo));
menuInfo.cbSize = sizeof(menuInfo);
menuInfo.fMask = MIIM_STRING | MIIM_SUBMENU | MIIM_ID;
menuInfo.fMask = Get_fMaskForString() | MIIM_SUBMENU | MIIM_ID;
menuInfo.fType = MFT_STRING;
const int kBufferSize = 1024;
TCHAR buffer[kBufferSize + 1];
@@ -250,9 +302,9 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
newString += shorcutString.Mid(tabPos);
}
menuInfo.dwTypeData = (LPTSTR)(LPCTSTR)newString;
menuInfo.fMask = MIIM_STRING;
menuInfo.fMask = Get_fMaskForString();
menuInfo.fType = MFT_STRING;
menu.SetItemInfo(i, true, &menuInfo);
// HMENU subMenu = menu.GetSubMenu(i);
}
}
}
@@ -278,7 +330,7 @@ void MyLoadMenu(HWND hWnd)
HMENU baseMenu = ::LoadMenu(g_hInstance, MAKEINTRESOURCE(IDM_MENU));
::SetMenu(hWnd, baseMenu);
::DestroyMenu(oldMenu);
if (!g_LangPath.IsEmpty())
if (!g_LangID.IsEmpty())
{
HMENU menuOld = ::GetMenu(hWnd);
MyChangeMenu(menuOld, 0, 0);
@@ -304,7 +356,7 @@ static void CopyMenu(HMENU srcMenuSpec, HMENU destMenuSpec)
MENUITEMINFO menuInfo;
ZeroMemory(&menuInfo, sizeof(menuInfo));
menuInfo.cbSize = sizeof(menuInfo);
menuInfo.fMask = MIIM_STATE | MIIM_ID | MIIM_FTYPE | MIIM_STRING;
menuInfo.fMask = MIIM_STATE | MIIM_ID | Get_fMaskForFTypeAndString();
menuInfo.fType = MFT_STRING;
const int kBufferSize = 1024;
TCHAR buffer[kBufferSize + 1];
@@ -464,7 +516,7 @@ void LoadFileMenu(HMENU hMenu, int startPos, bool forFileMode,
menuInfo.dwTypeData = (LPTSTR)(LPCTSTR)menuString;
*/
menuInfo.fMask = MIIM_STATE | MIIM_ID | MIIM_FTYPE | MIIM_STRING;
menuInfo.fMask = MIIM_STATE | MIIM_ID | Get_fMaskForFTypeAndString();
menuInfo.fType = MFT_STRING;
const int kBufferSize = 1024;
TCHAR buffer[kBufferSize + 1];
@@ -476,9 +528,9 @@ void LoadFileMenu(HMENU hMenu, int startPos, bool forFileMode,
if (!programMenu)
if (menuInfo.wID == IDCLOSE)
continue;
/*
bool createItem = (menuInfo.wID == IDM_CREATE_FOLDER ||
menuInfo.wID == IDM_CREATE_FILE);
/*
if (forFileMode)
{
if (createItem)
@@ -550,6 +602,12 @@ bool ExecuteFileCommand(int id)
case IDM_DELETE:
g_App.Delete();
break;
case IDM_FILE_SPLIT:
g_App.Split();
break;
case IDM_FILE_COMBINE:
g_App.Combine();
break;
case IDM_FILE_PROPERTIES:
g_App.Properties();
break;