本文整理汇总了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);
}
示例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();
}
}
示例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;
}
示例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();
}
}