本文整理汇总了C++中StrApp::Assign方法的典型用法代码示例。如果您正苦于以下问题:C++ StrApp::Assign方法的具体用法?C++ StrApp::Assign怎么用?C++ StrApp::Assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrApp
的用法示例。
在下文中一共展示了StrApp::Assign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTestDir
/*------------------------------------------------------------------------------------------
Set the root directory for where things are located, which should be the directory
where this file is located.
------------------------------------------------------------------------------------------*/
void SetTestDir()
{
if (g_strTestDir.Length())
return; // Set this only once!
// Get the path to the template files.
HKEY hk;
if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\SIL\\FieldWorks"), 0,
KEY_QUERY_VALUE, &hk) == ERROR_SUCCESS)
{
achar rgch[MAX_PATH];
DWORD cb = isizeof(rgch);
DWORD dwT;
if (::RegQueryValueEx(hk, _T("RootCodeDir"), NULL, &dwT, (BYTE *)rgch, &cb)
== ERROR_SUCCESS)
{
Assert(dwT == REG_SZ);
StrApp str(rgch);
int ich = str.FindStrCI(_T("\\distfiles"));
if (ich >= 0)
str.Replace(ich, str.Length(), _T(""));
ich = str.FindCh('\\', str.Length() - 1);
if (ich >= 0)
str.Replace(ich, str.Length(), _T(""));
str.Append(_T("\\Src\\Cellar\\Test\\"));
g_strTestDir.Assign(str);
}
RegCloseKey(hk);
}
if (!g_strTestDir.Length())
g_strTestDir.Assign("C:\\FW\\Src\\Cellar\\Test\\");
}
示例2: AddContextInsertItems
/*----------------------------------------------------------------------------------------------
Add menu items for the right-click context Insert menu over tree pane.
----------------------------------------------------------------------------------------------*/
void CleDeSplitChild::AddContextInsertItems(HMENU & hmenu)
{
StrApp str;
CleMainWnd * pcmw = dynamic_cast<CleMainWnd *>(MainWindow());
Assert(pcmw);
PossListInfo * ppli = pcmw->GetPossListInfoPtr();
AssertPtr(ppli);
if (!ppli->GetIsSorted())
{
str.Assign(_T("List Item &Above"));
::AppendMenu(hmenu, MF_STRING, kcidInsItemBef, str.Chars());
str.Assign(_T("List Item &Below"));
::AppendMenu(hmenu, MF_STRING, kcidInsItemAft, str.Chars());
}
else
{
str.Assign(_T("List &Item"));
::AppendMenu(hmenu, MF_STRING, kcidInsItem, str.Chars());
}
if (ppli->GetDepth() != 1)
{
str.Assign(_T("List &Subitem"));
::AppendMenu(hmenu, MF_STRING, kcidInsSubItem, str.Chars());
}
}
示例3: SetDialogValues
//.........这里部分代码省略.........
fFirstBorder = false;
}
AppendBorderInfo(strDesc, mpBTop, kstidTopBdrFmt, fFirstBorder);
AppendBorderInfo(strDesc, mpBB, kstidBottomBdrFmt, fFirstBorder);
AppendBorderInfo(strDesc, mpBL, kstidLeadingBdrFmt, fFirstBorder);
AppendBorderInfo(strDesc, mpBTr, kstidTrailingBdrFmt, fFirstBorder);
}
// Add info about writing-system overrides of font info.
Vector<int> vwsSoFar;
// Get the appropropriate writing system factory.
ILgWritingSystemFactoryPtr qwsf;
AssertPtr(m_pafsd);
m_pafsd->GetLgWritingSystemFactory(&qwsf);
AssertPtr(qwsf);
//- IWritingSystemPtr qws;
// Each iteration of this loop processes information about one writing system.
SmartBstr sbstrCharStyles;
CheckHr(pttp->GetStrPropValue(kspWsStyle, &sbstrCharStyles));
if (sbstrCharStyles.Length())
{
FwStyledText::DecodeFontPropsString(sbstrCharStyles, m_vesi, vwsSoFar);
SmartBstr sbstrWs;
StrApp strWs;
int wsUser;
CheckHr(qwsf->get_UserWs(&wsUser));
SmartBstr sbstrAbbr;
for (int iesi = 0; iesi < m_vesi.Size(); iesi++)
{
WsStyleInfo & esi = m_vesi[iesi];
if (vwsSoFar[iesi] == 0)
continue; // Ignore writing system set to 0.
fFirstPart = true;
StrApp strT;
StrApp strT2;
strT.Format(_T("\n"));
// Use the abbreviation in the user ws if it exists.
// else try for an abbreviation in each ws in m_vwsProj in turn,
// else use the ICU locale name as a last resort.
IWritingSystemPtr qws;
CheckHr(qwsf->GetStrFromWs(vwsSoFar[iesi], &sbstrWs));
CheckHr(qwsf->get_Engine(sbstrWs, &qws));
CheckHr(qws->get_Abbr(wsUser, &sbstrAbbr));
if (sbstrAbbr.Length() == 0)
{
for (int iws = 0; iws < m_vwsProj.Size(); ++iws)
{
CheckHr(qws->get_Abbr(m_vwsProj[iws], &sbstrAbbr));
if (sbstrAbbr.Length() != 0)
break;
}
}
if (sbstrAbbr.Length() == 0)
strWs.Assign(sbstrWs.Chars(), sbstrWs.Length());
else
strWs.Assign(sbstrAbbr.Chars(), sbstrAbbr.Length());
strT2.Format(_T("%s: "), strWs.Chars());
if (strT2 == _T("___: "))
strT2.Load(kctidFgUnknown);
strT.Append(strT2);
strDesc.Append (strT);
AppendDescPart(strDesc,
FwStyledText::FontStringMarkupToUi(false, esi.m_stuFontFamily),
fFirstPart);
if (esi.m_mpSize != knNinch)
{
AfUtil::MakeMsrStr (esi.m_mpSize , knpt, &strb);
AppendDescPart(strDesc, strb, fFirstPart);
}
if (esi.m_fBold == kttvForceOn || esi.m_fBold == kttvInvert)
AppendDescPart(strDesc, kstidBold, fFirstPart);
if (esi.m_fItalic == kttvForceOn || esi.m_fItalic == kttvInvert)
AppendDescPart(strDesc, kstidItalic, fFirstPart);
if (esi.m_ssv == kssvSuper)
AppendDescPart(strDesc, kstidFfdSuperscript, fFirstPart);
else if (esi.m_ssv == kssvSub)
AppendDescPart(strDesc, kstidFfdSubscript, fFirstPart);
AppendTextIs(strDesc, esi.m_clrFore, esi.m_clrBack, fFirstPart);
AppendUnderlineInfo(strDesc, esi.m_clrUnder, esi.m_unt, fFirstPart);
AppendOffsetInfo(strDesc, esi.m_mpOffset, fFirstPart);
} // 'for' loop
}
}
::SetDlgItemText(m_hwnd, kctidFgDescription, strDesc.Chars());
// **************************************
}
catch(...)
{
m_fSuppressLossOfFocus = false;
throw;
}
m_fSuppressLossOfFocus = false;
} //:> FmtGenDlg::SetDialogValues.