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


C++ MaterialDoc::GetAttributeInt方法代码示例

本文整理汇总了C++中MaterialDoc::GetAttributeInt方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialDoc::GetAttributeInt方法的具体用法?C++ MaterialDoc::GetAttributeInt怎么用?C++ MaterialDoc::GetAttributeInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaterialDoc的用法示例。


在下文中一共展示了MaterialDoc::GetAttributeInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnLvnBeginlabeledit

/**
* Determines is a label edit can be performed on the selected stage.
*/
void StageView::OnLvnBeginlabeledit(NMHDR *pNMHDR, LRESULT *pResult) {
	NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);

	//if this is a special stage then don't allow edit
	int index = pDispInfo->item.iItem;

	MaterialDoc* material = materialDocManager->GetCurrentMaterialDoc();
	if(index <= 0 || material->GetAttributeInt(index-1, "stagetype") != MaterialDoc::STAGE_TYPE_NORMAL)
	{
		*pResult = 1;
		return;
	}

	//ToDo: Can we move the edit box
	/*HWND edit = ListView_GetEditControl(m_hWnd);
	CWnd* editWnd = CWnd::FromHandle(edit);
	CRect rect;
	editWnd->GetWindowRect(rect);
	rect.left += 22;
	rect.right += 22;
	editWnd->MoveWindow(rect);*/


	*pResult = 0;
}
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:28,代码来源:StageView.cpp

示例2: PopupMenu

/**
* Dispalys the popup menu with the appropriate menu items enabled.
*/
void StageView::PopupMenu(CPoint* pt) {

	//Determine the type of object clicked on
	CListCtrl& list = GetListCtrl();


	ClientToScreen (pt);

	CMenu FloatingMenu;
	VERIFY(FloatingMenu.LoadMenu(IDR_ME_STAGELIST_POPUP));
	CMenu* pPopupMenu = FloatingMenu.GetSubMenu (0);
	ASSERT(pPopupMenu != NULL);

	POSITION pos = list.GetFirstSelectedItemPosition();
	int nItem = -1;
	if(pos)
		nItem = list.GetNextSelectedItem(pos);

	if(nItem <= 0) {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_RENAMESTAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_DELETESTAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);

		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_CUT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_COPY, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	} else {
		MaterialDoc* material = materialDocManager->GetCurrentMaterialDoc();
		if(material->GetAttributeInt(nItem-1, "stagetype") != MaterialDoc::STAGE_TYPE_NORMAL) {
			pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_RENAMESTAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		}
	}

	MaterialDoc* material = materialDocManager->GetCurrentMaterialDoc();
	if(material->FindStage(MaterialDoc::STAGE_TYPE_SPECIALMAP, "bumpmap") >= 0) {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_ADDBUMPMAP, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}
	if(material->FindStage(MaterialDoc::STAGE_TYPE_SPECIALMAP, "diffusemap") >= 0) {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_ADDDIFFUSEMAP, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}
	if(material->FindStage(MaterialDoc::STAGE_TYPE_SPECIALMAP, "specularmap") >= 0) {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_ADDSPECULAR, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}

	if(materialDocManager->IsCopyStage()) {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_PASTE, MF_BYCOMMAND | MF_ENABLED);
	} else {
		pPopupMenu->EnableMenuItem(ID_STAGEPOPUP_PASTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
	}

	pPopupMenu->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt->x, pt->y, &list);
}
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:53,代码来源:StageView.cpp

示例3: CanRename

/**
* Returns true if the current state of the stage view will allow a rename operation
*/
bool StageView::CanRename() {
	CListCtrl &list = GetListCtrl();
	POSITION pos = list.GetFirstSelectedItemPosition();
	int nItem = -1;
	if( pos ) {
		nItem = list.GetNextSelectedItem( pos );
	}
	if( nItem > 0 ) {
		MaterialDoc *material = materialDocManager->GetCurrentMaterialDoc();
		if( nItem > 0 && material->GetAttributeInt( nItem - 1, "stagetype" ) == MaterialDoc::STAGE_TYPE_NORMAL ) {
			return true;
		}
	}
	return false;
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:18,代码来源:StageView.cpp


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