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


C++ CGumpEditorDoc::LoadGump方法代码示例

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


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

示例1: SetGump

void CGumpBorder::SetGump(CGumpPtr pGump, bool bUpdateRect)
{
//	ASSERT(pGump);
	for (int i = 0; i < NUM_PART; i++) { 
		m_pGumpB[i] = NULL;
		m_sizeGumpB[i].SetSize(0,0);
	}
	
	if (!pGump) return;
	int iGumpID = pGump->GetGumpID();

	int iWidth = 0, iHeight = 0;
	CGumpEditorDoc* pDoc = GfxGetGumpDocument();
	m_pGumpB[LT] = pGump;
	m_sizeGumpB[LT] = pGump->GetDimensions();
	for (int i = 1; i < NUM_PART; i++) {
		m_pGumpB[i] = pDoc->LoadGump(iGumpID+i);
		if (!m_pGumpB[i]) continue;
		m_sizeGumpB[i] = m_pGumpB[i]->GetDimensions();
		if (i < LC) iWidth += m_sizeGumpB[i].cx;
		if (i % LC == 0) iHeight += m_sizeGumpB[i].cy;
	}

	if (!bUpdateRect) return;
	
	CRect rect = GetRect();
	SetRect(rect.left,rect.top,rect.left+iWidth,rect.top+iHeight);
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:28,代码来源:GumpBorder.cpp

示例2: ApplyValues

void CGumpButtonPropertyPage::ApplyValues()
{
	if( GetSafeHwnd() && GetEntity() )
	{
		UpdateData();

		CGumpEditorDoc* pDoc = GfxGetGumpDocument();
		CGumpButton* pButton = (CGumpButton*)GetEntity();

		int iNormalID =GfxAtoX(m_strNormalID);
		int iHoverID  =GfxAtoX(m_strHoverID);
		int iPressedID=GfxAtoX(m_strPressedID);

		CGumpPtr pNormal, pHover, pPressed, pGump;
		pButton->GetGump(pNormal, pHover, pPressed);

		if (pNormal->GetGumpID() != iNormalID 
			&& (pGump = pDoc->LoadGump(iNormalID))) 
		{
			pButton->SetGump(CGumpButton::NORMAL, pGump);
			m_btnTest.SetGump(CHoverButton::NORMAL, pGump);
		}
		if (pHover->GetGumpID() != iHoverID
			&& (pGump = pDoc->LoadGump(iHoverID))) 
		{
			pButton->SetGump(CGumpButton::HOVER, pGump);
			m_btnTest.SetGump(CHoverButton::HOVER, pGump);
		}
		if (pPressed->GetGumpID() != iPressedID
			&& (pGump = pDoc->LoadGump(iPressedID))) 
		{
			pButton->SetGump(CGumpButton::PRESSED, pGump);
			m_btnTest.SetGump(CHoverButton::PRESSED, pGump);
		}


		Redraw();
	}
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:39,代码来源:GumpButtonPropertyPage.cpp

示例3: FromString

BOOL CGumpButton::FromString( XML::Node* node )
{
	if (!CGumpEntity::FromString(node)) return FALSE;

	int normal, over, pressed;;

	XML::Node* gump_node = node->findNode("gump");
	if (gump_node) { 
		gump_node->lookupAttribute("normal", normal);
		gump_node->lookupAttribute("over", over);
		gump_node->lookupAttribute("pressed", pressed);
	}

	CSize size = GetRect().Size();
	SetConstraints(size,size);
	
	CGumpEditorDoc* pDoc = GfxGetGumpDocument(); ASSERT(pDoc);
	
	m_pGump[NORMAL] = pDoc->LoadGump(normal);
	m_pGump[HOVER] = pDoc->LoadGump(over);
	m_pGump[PRESSED] = pDoc->LoadGump(pressed);
	
	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:24,代码来源:GumpButton.cpp

示例4: ApplyValues

void CGumpBorderPropertyPage::ApplyValues()
{
	if( GetSafeHwnd() && GetEntity() )
	{
		UpdateData();
		CGumpBorder* pBorder = (CGumpBorder*)GetEntity();
		CGumpEditorDoc* pDoc = GfxGetGumpDocument();
		int iGumpID = GfxAtoX(m_strGumpID);

		if (pBorder->GetGumpID() != iGumpID) {	
			CGumpPtr pGump = pDoc->LoadGump(iGumpID);
			if (!pGump) return;
			pBorder->SetGump(pGump);
		}
					
		Redraw();
	
	}	
}
开发者ID:Admin-Yukiko,项目名称:Iris1_DeveloperTools,代码行数:19,代码来源:GumpBorderPropertyPage.cpp


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