本文整理汇总了C++中CLang类的典型用法代码示例。如果您正苦于以下问题:C++ CLang类的具体用法?C++ CLang怎么用?C++ CLang使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLang类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LangSetDlgItems
BOOL CLangPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
UString temp = NWindows::MyLoadString(IDS_LANG_ENGLISH);
NativeLangString(temp, NWindows::MyLoadString(IDS_LANG_NATIVE));
int index = (int)m_cmbLang.AddString(GetSystemString(temp));
m_cmbLang.SetItemData(index, _paths.Size());
_paths.Add(L"-");
m_cmbLang.SetCurSel(0);
const FString dirPrefix = GetLangDirPrefix();
NWindows::NFile::NFind::CEnumerator enumerator(dirPrefix + FTEXT("*.txt"));
NWindows::NFile::NFind::CFileInfo fi;
CLang lang;
UString error;
while (enumerator.Next(fi))
{
if (fi.IsDir())
continue;
const int kExtSize = 4;
if (fi.Name.Len() < kExtSize)
continue;
unsigned pos = fi.Name.Len() - kExtSize;
if (!StringsAreEqualNoCase_Ascii(fi.Name.Ptr(pos), ".txt"))
continue;
if (!LangOpen(lang, dirPrefix + fi.Name))
{
error.Add_Space_if_NotEmpty();
error += fs2us(fi.Name);
continue;
}
const UString shortName = fs2us(fi.Name.Left(pos));
UString s = shortName;
const wchar_t *eng = lang.Get(IDS_LANG_ENGLISH);
if (eng)
s = eng;
const wchar_t *native = lang.Get(IDS_LANG_NATIVE);
if (native)
NativeLangString(s, native);
index = (int)m_cmbLang.AddString(GetSystemString(s));
m_cmbLang.SetItemData(index, _paths.Size());
_paths.Add(shortName);
if (g_LangID.IsEqualTo_NoCase(shortName))
m_cmbLang.SetCurSel(index);
}
if (!error.IsEmpty())
::MessageBoxW(m_hWnd, error, L"Error in Lang file", MB_ICONERROR);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例2: LangSetDlgItems
bool CLangPage::OnInit()
{
LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
_langCombo.Attach(GetItem(IDC_LANG_LANG));
UString temp = MyLoadString(IDS_LANG_ENGLISH);
NativeLangString(temp, MyLoadString(IDS_LANG_NATIVE));
int index = (int)_langCombo.AddString(temp);
_langCombo.SetItemData(index, _paths.Size());
_paths.Add(L"-");
_langCombo.SetCurSel(0);
const FString dirPrefix = GetLangDirPrefix();
NFile::NFind::CEnumerator enumerator(dirPrefix + FTEXT("*.txt"));
NFile::NFind::CFileInfo fi;
CLang lang;
UString error;
while (enumerator.Next(fi))
{
if (fi.IsDir())
continue;
const int kExtSize = 4;
if (fi.Name.Len() < kExtSize)
continue;
unsigned pos = fi.Name.Len() - kExtSize;
if (!StringsAreEqualNoCase_Ascii(fi.Name.Ptr(pos), ".txt"))
continue;
if (!LangOpen(lang, dirPrefix + fi.Name))
{
if (!error.IsEmpty())
error += L' ';
error += fs2us(fi.Name);
continue;
}
const UString shortName = fs2us(fi.Name.Left(pos));
UString s = shortName;
const wchar_t *eng = lang.Get(IDS_LANG_ENGLISH);
if (eng)
s = eng;
const wchar_t *native = lang.Get(IDS_LANG_NATIVE);
if (native)
NativeLangString(s, native);
index = (int)_langCombo.AddString(s);
_langCombo.SetItemData(index, _paths.Size());
_paths.Add(shortName);
if (g_LangID.IsEqualToNoCase(shortName))
_langCombo.SetCurSel(index);
}
if (!error.IsEmpty())
MessageBoxW(0, error, L"Error in Lang file", MB_OK | MB_ICONSTOP);
return CPropertyPage::OnInit();
}
示例3: CLang
// Find a CLang by name, if not found, add it
CLangMngr::CLang * CLangMngr::GetLang(const char *name)
{
for (size_t iter = 0; iter < m_Languages.length(); ++iter)
{
if (strcmp(m_Languages[iter]->GetName(), name) == 0)
return m_Languages[iter];
}
CLang *p = new CLang(name);
p->SetMngr(this);
m_Languages.append(p);
return p;
}
示例4: GetLangR
const char *CLangMngr::GetDef(const char *langName, const char *key, int &status)
{
CLang *lang = GetLangR(langName);
keytbl_val &val = KeyTable.AltFindOrInsert(ke::AString(key)); //KeyTable[make_string(key)];
if (lang == NULL)
{
status = ERR_BADLANG;
return NULL;
} else if (val.index == -1) {
status = ERR_BADKEY;
return NULL;
} else {
status = 0;
return lang->GetDef(val.index, status);
}
}
示例5: LangString
UString LangString(UInt32 langID)
{
const wchar_t *s = g_Lang.Get(langID);
if (s)
return s;
return MyLoadString(langID);
}
示例6: LangString_OnlyFromLangFile
void LangString_OnlyFromLangFile(UInt32 langID, UString &dest)
{
dest.Empty();
const wchar_t *s = g_Lang.Get(langID);
if (s)
dest = s;
}
示例7: ReloadLang
void ReloadLang()
{
g_Lang.Clear();
ReadRegLang(g_LangID);
#ifndef _UNICODE
if (g_IsNT)
#endif
{
if (g_LangID.IsEmpty())
{
OpenDefaultLang();
return;
}
}
if (g_LangID.Len() > 1 || g_LangID[0] != L'-')
{
FString s = us2fs(g_LangID);
if (s.Find(FCHAR_PATH_SEPARATOR) < 0)
{
if (s.Find(FTEXT('.')) < 0)
s += FTEXT(".txt");
s.Insert(0, GetLangDirPrefix());
}
LangOpen(g_Lang, s);
}
}
示例8: OnInitDialog
BOOL CStartTargetDB::OnInitDialog()
{
CDialog::OnInitDialog();
// Windows의 Button 등의 글자를 선택한 언어에 맞게 보여진다.
SetWindowText(theLang.GetMessage(WN_STD_TITLE));
m_su_ok.SetWindowText(theLang.GetMessage(WN_STD_OK));
m_su_cancel.SetWindowText(theLang.GetMessage(WN_STD_CANCEL));
// Master를 검사하여, Master가 실행이 안 되어있으면, 실행시킨다.
if( cCUBRID->bCheckMaster() )
if( !cCUBRID->bStartMaster() )
{
AfxMessageBox(theLang.GetMessage(MSG_MASTER_ERROR), MB_OK | MB_ICONSTOP);
return FALSE;
}
// 기동된 DB를 가져온다. DB가 없으면, OK Buttone을 Disable한다.
DBNAMEPtr_t pStartList = cCUBRID->pReqStopDBList();
if( !pStartList )
{
m_su_ok.EnableWindow(false);
return TRUE;
}
DBNAMEPtr_t pCur = pStartList;
int index = 0;
// ListBox에서 보여 줄수 있는 DB의 최대 갯수
for (int i = 0; i < MAXSERVER; i++) {
m_ListDB.InsertString( index, pCur->sName );
if( !pCur->next ) break;
pCur = pCur->next;
index++;
}
cCUBRID->bDestoryDBList( pStartList );
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例9: LangSetDlgItemText
void LangSetDlgItemText(HWND dialog, UInt32 controlID, UInt32 langID)
{
const wchar_t *s = g_Lang.Get(langID);
if (s)
{
CWindow window(GetDlgItem(dialog, controlID));
window.SetText(s);
}
}
示例10: CheckFile
void CUCPDetail::CheckFile(CEdit &edit, bool file)
{
CFilename tmpFile;
edit.GetWindowText(tmpFile);
if (file) {
if (tmpFile.isIncludeDir()) {
MessageBox(theLang.GetMessage(MSG_UCP_PATH));
m_ucpd_ok.EnableWindow(false);
return;
}
tmpFile = theEnv.GetUniCAS() + "\\bin\\" + tmpFile;
tmpFile.Unix2Dos();
if (_access(LPCSTR(tmpFile), 0)) {
m_ucpd_ok.EnableWindow(false);
return;
}
} else {
if (tmpFile.isFullpath()) {
MessageBox(theLang.GetMessage(MSG_UCP_FULLPATH));
m_ucpd_ok.EnableWindow(false);
return;
}
if (tmpFile.isIncludeDosPath()) {
MessageBox(theLang.GetMessage(MSG_UCP_DOSPATH));
m_ucpd_ok.EnableWindow(false);
return;
}
tmpFile = theEnv.GetUniCAS() + '\\' + tmpFile;
tmpFile.Unix2Dos();
if (_access(LPCSTR(tmpFile), 0)) {
m_ucpd_ok.EnableWindow(false);
return;
}
}
EnableApply();
}
示例11: GetEnviornment
bool CEnv::GetEnviornment()
{
CFilename cubrid, cubrid_databases, unicas;
SetCUBRIDEnvVar();
if (!getenv(ENV_CUBRID)) {
m_errmsg.Format(MSG_ENV_ERROR, ENV_CUBRID);
return false;
} else if (!getenv(ENV_CUBRID_DATABASES)) {
m_errmsg.Format(MSG_ENV_ERROR, ENV_CUBRID_DATABASES);
return false;
} else if (!getenv(ENV_CUBRID_LANG)) {
m_errmsg.Format(MSG_ENV_ERROR, ENV_CUBRID_LANG);
return false;
} else {
theLang.ReadMessage(getenv(ENV_CUBRID), getenv(ENV_CUBRID_LANG));
}
cubrid.Format("%s", getenv(ENV_CUBRID));
cubrid.TrimRight("\\");
cubrid.MakeLower();
cubrid.GetDriver(m_cubrid_driver, m_cubrid);
cubrid_databases.Format("%s", getenv(ENV_CUBRID_DATABASES));
cubrid_databases.TrimRight("\\");
cubrid_databases.MakeLower();
cubrid_databases.GetDriver(m_cubrid_databases_driver, m_cubrid_databases);
unicas.Format("%s", getenv(ENV_CUBRID));
unicas.TrimRight("\\");
unicas.MakeLower();
unicas.GetDriver(m_unicas_driver, m_unicas);
if (!CheckCUBRID()) {
m_errmsg.Format(theLang.GetMessage(MSG_INSTALL_ERROR), "CUBRID");
return false;
}
if (!CheckUniCAS()) {
m_errmsg.Format(theLang.GetMessage(MSG_INSTALL_ERROR), "CUBRIDCAS");
return false;
}
return true;
}
示例12: SetLangID
int SetLangID( int langID )
{
int nRet = 0;
int curID = s_SysLang.GetLangID();
if ( curID != langID )
{
nRet = s_SysLang.SetLangID( langID );
if ( nRet == 0 )
{
char path[256];
const char *pLangFile = s_SysLang.GetLangFile( langID );
snprintf( path, sizeof(path), "%s/%s", SYS_CONFIG_LANG_PATH, pLangFile );
nRet = s_SysLang.LoadLangFile( path );
if ( nRet != 0 ) s_SysLang.SetLangID( curID );
}
}
return nRet;
}
示例13: OnInitDialog
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString serverVersion;
serverVersion.Format("CUBRID %s", PRODUCT_STRING);
m_txt_msg.SetWindowText((LPCTSTR)serverVersion);
m_ok.SetWindowText(theLang.GetMessage(WN_ABT_OK));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例14: OnInitDialog
BOOL CShutdown::OnInitDialog()
{
int index = 0;
CDialog::OnInitDialog();
// Windows의 Button 등의 글자를 선택한 언어에 맞게 보여진다.
SetWindowText(theLang.GetMessage(WN_SHD_TITLE));
m_ss_ok.SetWindowText(theLang.GetMessage(WN_SHD_OK));
m_ss_cancel.SetWindowText(theLang.GetMessage(WN_SHD_CANCEL));
for (int i = 0; i < MAXSERVER; i++) {
if (!g_Server[i].m_DBName.IsEmpty()) {
m_ListDB.InsertString(index, LPCSTR(g_Server[i].m_DBName));
index++;
}
}
if (m_ListDB.GetCount() == 0) m_ss_ok.EnableWindow(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例15: LangSetDlgItems_Colon
void LangSetDlgItems_Colon(HWND dialog, const UInt32 *ids, unsigned numItems)
{
for (unsigned i = 0; i < numItems; i++)
{
UInt32 id = ids[i];
const wchar_t *s = g_Lang.Get(id);
if (s)
{
CWindow window(GetDlgItem(dialog, id));
UString s2 = s;
s2 += L':';
window.SetText(s2);
}
}
}