本文整理汇总了C++中CGumpEditorDoc::GetGump方法的典型用法代码示例。如果您正苦于以下问题:C++ CGumpEditorDoc::GetGump方法的具体用法?C++ CGumpEditorDoc::GetGump怎么用?C++ CGumpEditorDoc::GetGump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGumpEditorDoc
的用法示例。
在下文中一共展示了CGumpEditorDoc::GetGump方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyValues
void CGumpSliderPropertyPage::ApplyValues()
{
if (GetSafeHwnd() && GetEntity())
{
UpdateData();
CGumpEditorDoc* pDoc = GfxGetGumpDocument();
CGumpSlider* pSlider= dynamic_cast<CGumpSlider*>(GetEntity()); ASSERT(pSlider);
if (!pSlider) return;
int iTrackID = GfxAtoX(m_strTrackID);
int iThumbID = GfxAtoX(m_strThumbID);
CGumpPtr pTrack, pThumb, pGump;
pSlider->GetGump(pTrack, pThumb);
if (pTrack->GetGumpID() != iTrackID && (pGump = pDoc->GetGump(iTrackID)))
{
pSlider->SetGump(CGumpSlider::TRACK, pGump);
}
if (pThumb->GetGumpID() != iThumbID && (pGump = pDoc->GetGump(iThumbID)))
{
pSlider->SetGump(CGumpSlider::THUMB, pGump);
}
pSlider->SetRange(m_iMin, m_iMax);
pSlider->SetPos(m_iPos);
pSlider->SetVertical(m_bVertical);
Redraw();
}
}
示例2: ApplyValues
void CGumpCheckboxPropertyPage::ApplyValues()
{
if (GetSafeHwnd() && GetEntity())
{
UpdateData();
CGumpEditorDoc* pDoc = GfxGetGumpDocument();
ASSERT(pDoc);
CGumpCheckbox* pCheckbox = (CGumpCheckbox*)GetEntity();
pCheckbox->SetCheck(m_bChecked);
int iNormalID =GfxAtoX(m_strNormalID);
int iCheckedID =GfxAtoX(m_strCheckedID);
CGumpPtr pNormal, pChecked, pPressed, pGump;
pCheckbox->GetGump(pNormal, pChecked);
if (pNormal->GetGumpID() != iNormalID
&& (pGump = pDoc->GetGump(iNormalID)))
{
pCheckbox->SetGump(CGumpCheckbox::NORMAL, pGump);
m_btnTest.SetGump(CHoverButton::NORMAL, pGump);
}
if (pChecked->GetGumpID() != iCheckedID
&& (pGump = pDoc->GetGump(iCheckedID)))
{
pCheckbox->SetGump(CGumpCheckbox::CHECKED, pGump);
m_btnTest.SetGump(CHoverButton::PRESSED, pGump);
}
Redraw();
}
}
示例3: ApplyValues
void CGumpScrollbarPropertyPage::ApplyValues()
{
if (GetSafeHwnd() && GetEntity())
{
UpdateData();
CGumpEditorDoc* pDoc = GfxGetGumpDocument();
CGumpScrollbar* pScrollbar = dynamic_cast<CGumpScrollbar*>(GetEntity()); ASSERT(pScrollbar);
if (!pScrollbar) return;
CGumpPtr pGump;
int iGumpID1 = -1, iGumpID2 = -1;
for (int i = 0; i < NUM_PART; i++) {
iGumpID1 = GfxAtoX(m_strGumpID[i]);
iGumpID2 = pScrollbar->GetGumpID(CGumpScrollbar::PART(i));
if (iGumpID1 != iGumpID2 && (pGump = pDoc->GetGump(iGumpID1)))
pScrollbar->SetGump(CGumpScrollbar::PART(i), pGump);
}
pScrollbar->SetRange(m_iMin, m_iMax);
pScrollbar->SetPos(m_iPos);
pScrollbar->SetVertical(m_bVertical);
pScrollbar->SetUseArrowButton(m_bUseArrow);
Redraw();
}
}
示例4: 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->GetGump(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);
}
示例5: 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->GetGump(iGumpID);
if (!pGump) return;
pBorder->SetGump(pGump);
}
Redraw();
}
}