当前位置: 首页>>代码示例>>C++>>正文


C++ ccollect::get方法代码示例

本文整理汇总了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();
}
开发者ID:Karamax,项目名称:WalCommander,代码行数:9,代码来源:wcm-config.cpp

示例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());
}
开发者ID:Karamax,项目名称:WalCommander,代码行数:18,代码来源:wcm-config.cpp

示例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);
}
开发者ID:Karamax,项目名称:WalCommander,代码行数:81,代码来源:wcm-config.cpp


注:本文中的ccollect::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。