本文整理汇总了C++中CN3UIBase::UIType方法的典型用法代码示例。如果您正苦于以下问题:C++ CN3UIBase::UIType方法的具体用法?C++ CN3UIBase::UIType怎么用?C++ CN3UIBase::UIType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CN3UIBase
的用法示例。
在下文中一共展示了CN3UIBase::UIType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool CN3UIStatic::Load(HANDLE hFile)
{
if (false == CN3UIBase::Load(hFile)) return false;
// m_pImageBkGnd, m_pBuffOutRef 설정하기
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
CN3UIBase* pChild = (*itor);
if (UI_TYPE_IMAGE == pChild->UIType())
{
m_pImageBkGnd = (CN3UIImage*)pChild;
}
else if (UI_TYPE_STRING == pChild->UIType())
{
m_pBuffOutRef = (CN3UIString*)pChild;
}
}
// 이전 uif파일을 컨버팅 하려면 사운드 로드 하는 부분 막기
int iSndFNLen = 0;
DWORD dwNum;
ReadFile(hFile, &iSndFNLen, sizeof(iSndFNLen), &dwNum, NULL); // 사운드 파일 문자열 길이
if (iSndFNLen>0)
{
std::vector<char> buffer(iSndFNLen+1, NULL);
ReadFile(hFile, &buffer[0], iSndFNLen, &dwNum, NULL);
__ASSERT(NULL == m_pSnd_Click, "memory leak");
m_pSnd_Click = s_SndMgr.CreateObj(&buffer[0], SNDTYPE_2D);
}
return true;
}
示例2: BroadcastIconDropMsg
bool CUIManager::BroadcastIconDropMsg(__IconItemSkill* spItem)
{
bool bFound = false;
POINT ptCur = CGameProcedure::s_pLocalInput->MouseGetPos();
// 윈도우들을 돌아 다니면서 검사..
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
if ( bFound ) break;
CN3UIBase* pChild = (*itor);
if ( pChild->UIType() == UI_TYPE_ICON_MANAGER )
{
// 해당 윈도우가 보이고(활성화 되어 있고), 그 윈도우 영역 안에 있으면..
if ( ((CN3UIWndBase* )pChild)->IsVisible() && ((CN3UIWndBase* )pChild)->IsIn(ptCur.x, ptCur.y) )
// 해당 윈도우에 아이콘 드롭 메시지 함수를 호출..
if ( ((CN3UIWndBase* )pChild)->ReceiveIconDrop(spItem, ptCur) )
return true;
else
bFound = true;
}
}
// 어느 누구의 영역에도 속하지 않으면.. 해당 아이콘을 가진 윈도우에게 Cancel 메시지를 날려 준다..
if ( !bFound )
{
switch ( CN3UIWndBase::m_sSelectedIconInfo.UIWndSelect.UIWnd )
{
case UIWND_INVENTORY:
CGameProcedure::s_pProcMain->m_pUIInventory->CancelIconDrop(spItem);
break;
case UIWND_TRANSACTION:
CGameProcedure::s_pProcMain->m_pUITransactionDlg->CancelIconDrop(spItem);
break;
case UIWND_WARE_HOUSE:
CGameProcedure::s_pProcMain->m_pUIWareHouseDlg->CancelIconDrop(spItem);
break;
case UIWND_EXCHANGE_REPAIR:
CGameProcedure::s_pProcMain->m_pUIItemREDlg->CancelIconDrop(spItem);
break;
}
}
return false;
}
示例3: sizeof
bool CN3UIBase::Save(HANDLE hFile)
{
CN3BaseFileAccess::Save(hFile);
DWORD dwRWC = NULL;
// child 정보
int iCC = m_Children.size();
WriteFile(hFile, &iCC, sizeof(iCC), &dwRWC, NULL); // Child 갯수 ㅆ고..고..
for(UIListReverseItor itor = m_Children.rbegin(); m_Children.rend() != itor; ++itor)
// childadd할때 push_front이므로 저장할 때 거꾸로 저장해야 한다.
{
CN3UIBase* pChild = (*itor);
eUI_TYPE eUIType = pChild->UIType();
WriteFile(hFile, &eUIType, sizeof(eUIType), &dwRWC, NULL); // UI Type 쓰고..
pChild->Save(hFile);
}
// base 정보
int iIDLen = 0;
iIDLen = m_szID.size();
WriteFile(hFile, &iIDLen, sizeof(iIDLen), &dwRWC, NULL); // id length
if (iIDLen>0) WriteFile(hFile, m_szID.c_str(), iIDLen, &dwRWC, NULL); // ui id
WriteFile(hFile, &m_rcRegion, sizeof(m_rcRegion), &dwRWC, NULL); // m_rcRegion
WriteFile(hFile, &m_rcMovable, sizeof(m_rcMovable), &dwRWC, NULL); // m_rcMovable
WriteFile(hFile, &m_dwStyle, sizeof(m_dwStyle), &dwRWC, NULL); // style
WriteFile(hFile, &m_dwReserved, sizeof(m_dwReserved), &dwRWC, NULL); // m_dwReserved
int iTooltipLen = m_szToolTip.size();
WriteFile(hFile, &iTooltipLen, sizeof(iTooltipLen), &dwRWC, NULL); // tooltip문자열 길이
if (iTooltipLen>0) WriteFile(hFile, m_szToolTip.c_str(), iTooltipLen, &dwRWC, NULL);
int iSndFNLen = 0;
if (m_pSnd_OpenUI) iSndFNLen = m_pSnd_OpenUI->m_szFileName.size();
WriteFile(hFile, &iSndFNLen, sizeof(iSndFNLen), &dwRWC, NULL); // 사운드 파일 문자열 길이
if (iSndFNLen>0) WriteFile(hFile, m_pSnd_OpenUI->m_szFileName.c_str(), iSndFNLen, &dwRWC, NULL);
iSndFNLen = 0;
if (m_pSnd_CloseUI) iSndFNLen = m_pSnd_CloseUI->m_szFileName.size();
WriteFile(hFile, &iSndFNLen, sizeof(iSndFNLen), &dwRWC, NULL); // 사운드 파일 문자열 길이
if (iSndFNLen>0) WriteFile(hFile, m_pSnd_CloseUI->m_szFileName.c_str(), iSndFNLen, &dwRWC, NULL);
return true;
}
示例4: sizeof
bool CN3UIButton::Load(HANDLE hFile)
{
if (false == CN3UIBase::Load(hFile)) return false;
DWORD dwNum;
ReadFile(hFile, &m_rcClick, sizeof(m_rcClick), &dwNum, NULL); // click 영역
// m_ImageRef 설정하기
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
CN3UIBase* pChild = (*itor);
if (UI_TYPE_IMAGE != pChild->UIType()) continue; // image만 골라내기
int iBtnState = (int)(pChild->GetReserved());
if (iBtnState<NUM_BTN_STATE)
{
m_ImageRef[iBtnState] = (CN3UIImage*)pChild;
}
}
// 이전 uif파일을 컨버팅 하려면 사운드 로드 하는 부분 막기
int iSndFNLen = 0;
ReadFile(hFile, &iSndFNLen, sizeof(iSndFNLen), &dwNum, NULL); // 사운드 파일 문자열 길이
if (iSndFNLen>0)
{
std::vector<char> buffer(iSndFNLen+1, NULL);
ReadFile(hFile, &buffer[0], iSndFNLen, &dwNum, NULL);
__ASSERT(NULL == m_pSnd_On, "memory leak");
m_pSnd_On = s_SndMgr.CreateObj(&buffer[0], SNDTYPE_2D);
}
ReadFile(hFile, &iSndFNLen, sizeof(iSndFNLen), &dwNum, NULL); // 사운드 파일 문자열 길이
if (iSndFNLen>0)
{
std::vector<char> buffer(iSndFNLen+1, NULL);
ReadFile(hFile, &buffer[0], iSndFNLen, &dwNum, NULL);
__ASSERT(NULL == m_pSnd_Click, "memory leak");
m_pSnd_Click = s_SndMgr.CreateObj(&buffer[0], SNDTYPE_2D);
}
return true;
}
示例5: sizeof
bool CN3UIList::Load(HANDLE hFile)
{
bool bSuccess = CN3UIBase::Load(hFile);
// font 정보
DWORD dwNum;
int iStrLen = 0;
ReadFile(hFile, &iStrLen, sizeof(iStrLen), &dwNum, NULL); // font 이름 길이
__ASSERT(iStrLen>0, "No font name");
if (iStrLen>0)
{
m_szFontName.assign(iStrLen, ' ');
ReadFile(hFile, &(m_szFontName[0]), iStrLen, &dwNum, NULL); // string
ReadFile(hFile, &m_dwFontHeight, 4, &dwNum, NULL); // font height
ReadFile(hFile, &m_crFont, 4, &dwNum, NULL); // font color
ReadFile(hFile, &m_bFontBold, 4, &dwNum, NULL); // font flag (bold, italic)
ReadFile(hFile, &m_bFontItalic, 4, &dwNum, NULL); // font flag (bold, italic)
}
// Child 중에 Scroll Bar 가 있는지 찾아본다.
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
CN3UIBase* pUI = *itor;
if(pUI->UIType() == UI_TYPE_SCROLLBAR)
{
m_pScrollBarRef = (CN3UIScrollBar*)pUI;
}
// else if(pUI->Type() == UI_TYPE_STRING)
// {
// CN3UIString* pString = *itor;
// if( pString->GetFontName != m_szFontName ||
// pString->GetFontHeight() != m_dwFontHeight ||
// m_bFontBold != (pString->GetFontFlags() & D3DFONT_BOLD) ||
// m_bFontItalic != (pString->GetFontFlags() & D3DFONT_ITALIC) ) // 폰트가 다르면.. 적용
// {
// pString->SetFont(m_szFontName, m_dwFontHeight, m_bFontBold, m_bFontItalic);
// }
// }
}
return bSuccess;
}
示例6:
void CN3UIButton::operator = (const CN3UIButton& other)
{
CN3UIBase::operator = (other);
m_rcClick = other.m_rcClick; // 클릭 영역
SetSndOn(other.GetSndFName_On()); // 사운드
SetSndClick(other.GetSndFName_Click()); // 사운드
// m_ImageRef 설정하기
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
CN3UIBase* pChild = (*itor);
if (UI_TYPE_IMAGE != pChild->UIType()) continue; // image만 골라내기
int iBtnState = (int)(pChild->GetReserved());
if (iBtnState<NUM_BTN_STATE)
{
m_ImageRef[iBtnState] = (CN3UIImage*)pChild;
}
}
}
示例7:
void CN3UIBase::ArrangeZOrder()
{
// 보통 image가 배경그림이 되므로 child list에서 맨 뒤로 보낸다.
// 왜냐하면 맨 뒤에 있는것이 맨 먼저 그려지므로
UIList tempList;
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor;)
{
CN3UIBase* pChild = (*itor);
if(UI_TYPE_IMAGE == pChild->UIType())
{
itor = m_Children.erase(itor); // 현재 위치에서 지우고
tempList.push_back(pChild); // 임시 버퍼에 저장
}
else ++itor;
}
for(itor = tempList.begin(); tempList.end() != itor; ++itor)
{
CN3UIBase* pChild = (*itor);
m_Children.push_back(pChild); // child list맨 뒤에 넣기
}
tempList.clear();
}
示例8: Render
void CUIItemExchange::Render()
{
if (!m_bVisible) return; // 보이지 않으면 자식들을 render하지 않는다.
POINT ptCur = CGameProcedure::s_pLocalInput->MouseGetPos();
m_pUITooltipDlg->DisplayTooltipsDisable();
bool bTooltipRender = false;
__IconItemSkill* spItem;
for(UIListReverseItor itor = m_Children.rbegin(); m_Children.rend() != itor; ++itor)
{
CN3UIBase* pChild = (*itor);
pChild->Render();
if ( (pChild->UIType() == UI_TYPE_ICON) && (pChild->GetStyle() & UISTYLE_ICON_HIGHLIGHT) )
{
bTooltipRender = true;
spItem = GetHighlightIconItem( (CN3UIIcon* )pChild );
}
}
if ( bTooltipRender )
m_pUITooltipDlg->DisplayTooltipsEnable(ptCur.x, ptCur.y, spItem );
}
示例9: static
void CN3UIBase::operator = (const CN3UIBase& other)
{
Init(NULL); // 일단 부모는 없게 초기화
UIListItorConst it = other.m_Children.begin();
UIListItorConst itEnd = other.m_Children.end();
CN3UIBase* pOtherChild = NULL;
CN3UIBase* pChild = NULL;
for(; it != itEnd; it++)
{
pOtherChild = *it;
if(NULL == pOtherChild) continue;
pChild = NULL;
switch(pOtherChild->UIType())
{
case UI_TYPE_BASE:
{
pChild = new CN3UIBase();
*pChild = *pOtherChild;
}
break;
case UI_TYPE_BUTTON:
{
CN3UIButton *pUINew = new CN3UIButton();
*pUINew = *((CN3UIButton*)pOtherChild);
pChild = pUINew;
}
break; // button
case UI_TYPE_STATIC:
{
CN3UIStatic* pUINew = new CN3UIStatic();
*pUINew = *((CN3UIStatic*)pOtherChild);
pChild = pUINew;
}
break; // static (배경그림과 글자가 나오는 클래스)
case UI_TYPE_PROGRESS:
{
CN3UIProgress* pUINew = new CN3UIProgress();
*pUINew = *((CN3UIProgress*)pOtherChild);
pChild = pUINew;
}
break; // progress
case UI_TYPE_IMAGE:
{
CN3UIImage* pUINew = new CN3UIImage();
*pUINew = *((CN3UIImage*)pOtherChild);
pChild = pUINew;
}
break; // image
case UI_TYPE_SCROLLBAR:
{
CN3UIScrollBar* pUINew = new CN3UIScrollBar();
*pUINew = *((CN3UIScrollBar*)pOtherChild);
pChild = pUINew;
}
break; // scroll bar
case UI_TYPE_STRING:
{
CN3UIString* pUINew = new CN3UIString();
*pUINew = *((CN3UIString*)pOtherChild);
pChild = pUINew;
}
break; // string
case UI_TYPE_TRACKBAR:
{
CN3UITrackBar* pUINew = new CN3UITrackBar();
*pUINew = *((CN3UITrackBar*)pOtherChild);
pChild = pUINew;
}
break; // track bar
case UI_TYPE_EDIT:
{
CN3UIEdit* pUINew = new CN3UIEdit();
*pUINew = *((CN3UIEdit*)pOtherChild);
pChild = pUINew;
}
break; // edit
case UI_TYPE_AREA:
{
CN3UIArea* pUINew = new CN3UIArea();
*pUINew = *((CN3UIArea*)pOtherChild);
pChild = pUINew;
}
break; // area
case UI_TYPE_TOOLTIP:
{
CN3UITooltip* pUINew = new CN3UITooltip();
*pUINew = *((CN3UITooltip*)pOtherChild);
pChild = pUINew;
}
break; // tooltip
case UI_TYPE_LIST:
{
CN3UIList* pUINew = new CN3UIList();
*pUINew = *((CN3UIList*)pOtherChild);
pChild = pUINew;
}
break; // tooltip
//.........这里部分代码省略.........