本文整理汇总了C++中CN3UIBase类的典型用法代码示例。如果您正苦于以下问题:C++ CN3UIBase类的具体用法?C++ CN3UIBase怎么用?C++ CN3UIBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CN3UIBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// offset만큼 이동해준다.(children도 이동)
BOOL CN3UIBase::MoveOffset(int iOffsetX, int iOffsetY)
{
if (0 == iOffsetX && 0 == iOffsetY) return FALSE;
// ui 영역
m_rcRegion.left += iOffsetX; m_rcRegion.top += iOffsetY;
m_rcRegion.right += iOffsetX; m_rcRegion.bottom += iOffsetY;
// movable 영역
if( m_rcMovable.right - m_rcMovable.left != 0 &&
m_rcMovable.bottom - m_rcMovable.top != 0 )
{
m_rcMovable.left += iOffsetX; m_rcMovable.top += iOffsetY;
m_rcMovable.right += iOffsetX; m_rcMovable.bottom += iOffsetY;
}
// children 좌표 갱신
CN3UIBase* pCUI = NULL; // Child UI...
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
pCUI = (*itor);
__ASSERT(pCUI, "child UI pointer is NULL!");
pCUI->MoveOffset(iOffsetX, iOffsetY);
}
return TRUE;
}
示例2: MoveOffset
BOOL CUIChat::MoveOffset(int iOffsetX, int iOffsetY)
{
if (0 == iOffsetX && 0 == iOffsetY) return FALSE;
// ui 영역
m_rcRegion.left += iOffsetX; m_rcRegion.top += iOffsetY;
m_rcRegion.right += iOffsetX; m_rcRegion.bottom += iOffsetY;
// movable 영역
m_rcMovable.left += iOffsetX; m_rcMovable.top += iOffsetY;
m_rcMovable.right += iOffsetX; m_rcMovable.bottom += iOffsetY;
// children 좌표 갱신
CN3UIBase* pCUI = NULL; // Child UI...
for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ++itor)
{
pCUI = (*itor);
__ASSERT(pCUI, "child UI pointer is NULL!");
pCUI->MoveOffset(iOffsetX, iOffsetY);
}
if(CGameProcedure::s_pProcMain->m_pUIMsgDlg)
{
POINT pt = CGameProcedure::s_pProcMain->m_pUIMsgDlg->GetPos();
RECT rt = this->GetRegion();
if( (rt.right != pt.x) || (rt.top != pt.y) )
{
CGameProcedure::s_pProcMain->m_pUIMsgDlg->SetPos(rt.right, rt.top);
}
}
return TRUE;
}
示例3: 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;
}
示例4: if
bool CUILogIn::ReceiveMessage(CN3UIBase* pSender, DWORD dwMsg)
{
if(NULL == pSender) return false;
//s_CameraData.vp; //불러 오는 과정을 살펴본다
//DWORD mm = s_CameraData.vp.Height;
//DWORD ss = s_CameraData.vp.Width;
if (dwMsg == UIMSG_BUTTON_CLICK)
{
if (pSender == m_pBtn_LogIn && m_pEdit_id && m_pEdit_pw)
{
CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
}
else if(pSender == m_pBtn_Connect)
{
CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
}
else if (pSender == m_pBtn_Cancel)
{
//PostQuitMessage(0); // 종료...
CGameBase::s_bRunning = false;
}
else if(pSender == m_pBtn_Option) // 옵션..
{
std::string szMsg;
szMsg = "Would you like to open the options?";//::_LoadStringFromResource(IDS_CONFIRM_EXECUTE_OPTION, szMsg);
CGameProcedure::MessageBoxPost(szMsg, "", MB_YESNO, BEHAVIOR_EXECUTE_OPTION);
}
}
else if(UIMSG_LIST_DBLCLK == dwMsg)
{
CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
}
else if (dwMsg == UIMSG_EDIT_RETURN)
{
// TEMP(srmeier): there is a weird issue where the key inputs aren't going
// through CGameProcedure::ProcessUIKeyInput() so CUILogIn::OnKeyPress() isn't
// being called...
if(!m_bLogIn && m_pEdit_id && m_pEdit_pw)
{
CN3UIBase* pMsgBox = CGameProcedure::s_pMsgBoxMgr->GetFocusMsgBox();
if( !(pMsgBox && pMsgBox->IsVisible()) )
CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
}
else {
ReceiveMessage(m_pBtn_Connect, UIMSG_BUTTON_CLICK);
}
}
else if (dwMsg == UIMSG_EDIT_TAB)
{
// TEMP(srmeier): there is a weird issue where the key inputs aren't going
// through CGameProcedure::ProcessUIKeyInput() so CUILogIn::OnKeyPress() isn't
// being called...
FocusCircular();
}
return true;
}
示例5: switch
bool CUIChat::OnKeyPress(int iKey)
{
switch(iKey)
{
case DIK_ESCAPE:
{ //hotkey가 포커스 잡혀있을때는 다른 ui를 닫을수 없으므로 DIK_ESCAPE가 들어오면 포커스를 다시잡고
//열려있는 다른 유아이를 닫아준다.
CGameProcedure::s_pUIMgr->ReFocusUI();//this_ui
CN3UIBase* pFocus = CGameProcedure::s_pUIMgr->GetFocusedUI();
if(pFocus && pFocus != this) pFocus->OnKeyPress(iKey);
}
return true;
}
return CN3UIBase::OnKeyPress(iKey);
}
示例6: 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;
}
示例7: GetTopUI
CN3UIBase* CUIManager::GetTopUI(bool bVisible)
{
if(!bVisible)
{
if(m_Children.empty()) return NULL;
else return *(m_Children.begin());
}
UIListItor it = m_Children.begin(), itEnd = m_Children.end();
for(; it != itEnd; it++)
{
CN3UIBase* pUI = *(it);
if(pUI->IsVisible()) return pUI;
}
return NULL;
}
示例8: if
bool CUILogIn::ReceiveMessage(CN3UIBase* pSender, DWORD dwMsg)
{
if(NULL == pSender) return false;
//s_CameraData.vp; //불러 오는 과정을 살펴본다
//DWORD mm = s_CameraData.vp.Height;
//DWORD ss = s_CameraData.vp.Width;
if (dwMsg == UIMSG_BUTTON_CLICK)
{
if (pSender == m_pBtn_LogIn && m_pEdit_id && m_pEdit_pw)
{
CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
}
else if(pSender == m_pBtn_Connect)
{
CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
}
else if (pSender == m_pBtn_Cancel)
{
PostQuitMessage(0); // 종료...
}
else if(pSender == m_pBtn_Option) // 옵션..
{
std::string szMsg;
::_LoadStringFromResource(IDS_CONFIRM_EXECUTE_OPTION, szMsg);
CGameProcedure::MessageBoxPost(szMsg, "", MB_YESNO, BEHAVIOR_EXECUTE_OPTION);
}
}
else if(UIMSG_LIST_DBLCLK == dwMsg)
{
CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
}
else if (dwMsg == UIMSG_EDIT_RETURN)
{
if(!m_bLogIn && m_pEdit_id && m_pEdit_pw)
{
CN3UIBase* pMsgBox = CGameProcedure::s_pMsgBoxMgr->GetFocusMsgBox();
if( !(pMsgBox && pMsgBox->IsVisible()) )
CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
}
}
return true;
}
示例9: WriteFile
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;
}
示例10: UserMoveHideUIs
void CUIManager::UserMoveHideUIs()
{
bool bHide = false;
UIListItor it = m_Children.begin(), itEnd = m_Children.end();
for(; it != itEnd; it++)
{
CN3UIBase* pUI = *(it);
if(pUI == NULL) continue;
if(pUI->IsVisible() && (pUI->GetStyle() & UISTYLE_USER_MOVE_HIDE))
{
bHide = true;
pUI->SetVisibleWithNoSound(false, true);
}
}
if(bHide) ReFocusUI();
}
示例11: ReadFile
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;
}
示例12: ReadFile
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;
}
示例13: SetSndClick
void CN3UIStatic::operator = (const CN3UIStatic& other)
{
CN3UIBase::operator = (other);
SetSndClick(other.GetSndFName_Click());
// 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;
}
}
}
示例14: GetEnableFocusTopUI
CN3UIBase* CUIManager::GetEnableFocusTopUI(bool bVisible)
{
if(!bVisible)
{
if(m_Children.empty()) return NULL;
else return *(m_Children.begin());
}
UIListItor it = m_Children.begin(), itEnd = m_Children.end();
for(; it != itEnd; it++)
{
CN3UIBase* pUI = *(it);
if(pUI && pUI->IsVisible() && //보이고
!(pUI->GetStyle() & UISTYLE_FOCUS_UNABLE) && //포커스가 가능하고
!(pUI->GetStyle() & UISTYLE_HIDE_UNABLE)) //닫힐수 있는
return pUI;
}
return NULL;
}
示例15: SetSndOn
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;
}
}
}