本文整理汇总了C++中ccollect::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ccollect::get方法的具体用法?C++ ccollect::get怎么用?C++ ccollect::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ccollect
的用法示例。
在下文中一共展示了ccollect::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
const char *CfgLangDialog::GetId()
{
int n = _list.GetCurrent();
if (n <= 0 ) return "+";
if (n == 1) return "-";
n-=2;
if (n >= nodeList->count()) return "+";
return nodeList->get(n).id.ptr();
}
示例2: RefreshFontInfo
void StyleOptDialog::RefreshFontInfo()
{
int count = pList->count();
int cur = fontList.GetCurrent();
const char *s = "";
if (count>=0 && cur>=0 && cur<count)
{
int n = fontList.GetCurrentInt();
if (pList->get(n).newFont.ptr())
s = pList->get(n).newFont->printable_name();
else
if (pList->get(n).oldFont)
s = pList->get(n).oldFont->printable_name();
}
fontNameStatic.SetText(utf8_to_unicode(s).ptr());
}
示例3: Command
bool StyleOptDialog::Command(int id, int subId, Win *win, void *data)
{
if (win == &fontList)
{
RefreshFontInfo();
return true;
}
#ifdef _WIN32
if (id == CMD_CHFONT)
{
int count = pList->count();
int cur = fontList.GetCurrent();
if (count<=0 || cur<0 || cur>=count) return true;
LOGFONT lf;
carray<char> *pUri = pList->get(fontList.GetCurrentInt()).pUri;
cfont::UriToLogFont(&lf, pUri && pUri->ptr() ? pUri->ptr() : 0);
CHOOSEFONT cf;
memset(&cf,0,sizeof(cf));
cf.lStructSize = sizeof(cf);
cf.hwndOwner = GetID();
cf.lpLogFont = &lf;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT ;
if (pList->get(fontList.GetCurrentInt()).fixed)
cf.Flags |= CF_FIXEDPITCHONLY;
if (ChooseFont(&cf))
{
cptr<cfont> p = new cfont(cfont::LogFontToUru(lf).ptr());
if (p.ptr()) {
pList->get(fontList.GetCurrentInt()).newFont = p;
RefreshFontInfo();
}
}
return true;
}
#else
if (id == CMD_CHFONT)
{
int count = pList->count();
int cur = fontList.GetCurrent();
if (count<=0 || cur<0 || cur>=count) return true;
carray<char> *pUri = pList->get(fontList.GetCurrentInt()).pUri;
cptr<cfont> p = SelectFTFont((NCDialogParent*)Parent(), pList->get(fontList.GetCurrentInt()).fixed, (pUri && pUri->ptr()) ? pUri->ptr() : 0 );
if (p.ptr()) {
pList->get(fontList.GetCurrentInt()).newFont = p;
RefreshFontInfo();
}
return true;
}
if (id == CMD_CHFONTX11)
{
int count = pList->count();
int cur = fontList.GetCurrent();
if (count<=0 || cur<0 || cur>=count) return true;
cptr<cfont> p = SelectX11Font((NCDialogParent*)Parent(), pList->get(fontList.GetCurrentInt()).fixed);
if (p.ptr()) {
pList->get(fontList.GetCurrentInt()).newFont = p;
RefreshFontInfo();
}
return true;
}
#endif
return NCVertDialog::Command(id, subId, win, data);
}