MCPcopy Create free account
hub / github.com/DennisLiu1993/Fastest_Image_Pattern_Matching / ChangeLanguage

Method ChangeLanguage

MatchTool/MatchToolDlg.cpp:618–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616 return true;
617}
618void CMatchToolDlg::ChangeLanguage (CString strLan)
619{
620 if (strLan.CompareNoCase (L"Chinese (Tranditional)") == 0)
621 strLan = L"Chinese_Traditional";
622 else if (strLan.CompareNoCase (L"Chinese (Simplified)") == 0)
623 strLan = L"Chinese_Simplified";
624 else
625 strLan = L"English";
626
627 _TCHAR szExe[MAX_PATH] = _T ("");
628 GetExeDir (szExe);
629 CString strLanPath (szExe);
630 strLanPath += L"MatchTool.lang";
631
632 _TCHAR szBuf[MAX_PATH];
633
634 GetPrivateProfileString (strLan, L"ImageMatchTool", L"Image Match Tool", szBuf, _MAX_PATH, strLanPath);
635 SetWindowText (szBuf);
636
637 GetPrivateProfileString (strLan, L"File", L"File", szBuf, _MAX_PATH, strLanPath);
638 m_Menu.ModifyMenuW (0, MF_BYPOSITION | MF_STRING, 0, szBuf);
639 CMenu *pSubMenu = m_Menu.GetSubMenu (0);
640 int iMenuItemCount = pSubMenu->GetMenuItemCount ();
641 for (int i = 0; i < iMenuItemCount; i++)
642 pSubMenu->DeleteMenu (0, MF_BYPOSITION);
643 GetPrivateProfileString (strLan, L"ReadSourceImage", L"Read Source Image", szBuf, _MAX_PATH, strLanPath);
644 pSubMenu->InsertMenuW (0, MF_BYPOSITION | MF_STRING, ID_LOAD_SRC, szBuf);
645 GetPrivateProfileString (strLan, L"ReadDstImage", L"Read Dst Image", szBuf, _MAX_PATH, strLanPath);
646 pSubMenu->InsertMenuW (1, MF_BYPOSITION | MF_STRING, ID_LOAD_DST, szBuf);
647
648
649 GetPrivateProfileString (strLan, L"ParameterSetting", L"Parameter Setting", szBuf, _MAX_PATH, strLanPath);
650 GetDlgItem (IDC_GROUP_PARAMS)->SetWindowText (szBuf);
651 GetPrivateProfileString (strLan, L"TargetNumber", L"Target Number:", szBuf, _MAX_PATH, strLanPath);
652 GetDlgItem (IDC_STATIC_MAX_POS)->SetWindowText (szBuf);
653
654 GetPrivateProfileString (strLan, L"MaxOverLapRatio", L"Max OverLap Ratio:", szBuf, _MAX_PATH, strLanPath);
655 GetDlgItem (IDC_STATIC_MAX_OVERLAP)->SetWindowText (szBuf);
656 GetPrivateProfileString (strLan, L"Score(Similarity)", L"Score (Similarity):", szBuf, _MAX_PATH, strLanPath);
657 GetDlgItem (IDC_STATIC_SCORE)->SetWindowText (szBuf);
658 GetPrivateProfileString (strLan, L"ToleranceAngle", L"Tolerance Angle:", szBuf, _MAX_PATH, strLanPath);
659 GetDlgItem (IDC_STATIC_TOLERANCE_ANGLE)->SetWindowText (szBuf);
660 GetPrivateProfileString (strLan, L"MinReducedArea", L"Min Reduced Area", szBuf, _MAX_PATH, strLanPath);
661 GetDlgItem (IDC_STATIC_MIN_REDUCE_AREA)->SetWindowText (szBuf);
662 GetPrivateProfileString (strLan, L"Execute", L"Execute", szBuf, _MAX_PATH, strLanPath);
663 GetDlgItem (IDC_BUTTON_EXECUTE)->SetWindowText (szBuf);
664 GetPrivateProfileString (strLan, L"Language", L"Language:", szBuf, _MAX_PATH, strLanPath);
665 GetDlgItem (IDC_STATIC_LANGUAGE)->SetWindowText (szBuf);
666 GetPrivateProfileString (strLan, L"SubPixel", L"SubPixel:", szBuf, _MAX_PATH, strLanPath);
667 GetDlgItem (IDC_CHECK_SUBPIXEL)->SetWindowText (szBuf);
668
669 GetPrivateProfileString (strLan, L"Index", L"Index", szBuf, _MAX_PATH, strLanPath);
670 m_strLanIndex = szBuf;
671 GetPrivateProfileString (strLan, L"Score", L"Score", szBuf, _MAX_PATH, strLanPath);
672 m_strLanScore = szBuf;
673 GetPrivateProfileString (strLan, L"Angle(deg)", L"Angle (deg)", szBuf, _MAX_PATH, strLanPath);
674 m_strLanAngle = szBuf;
675 GetPrivateProfileString (strLan, L"PosX", L"PosX", szBuf, _MAX_PATH, strLanPath);

Callers

nothing calls this directly

Calls 1

GetExeDirFunction · 0.85

Tested by

no test coverage detected