本文整理汇总了C++中IsInside函数的典型用法代码示例。如果您正苦于以下问题:C++ IsInside函数的具体用法?C++ IsInside怎么用?C++ IsInside使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsInside函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
Thread::Join()
{
assert(IsDefined());
assert(!IsInside());
#ifdef HAVE_POSIX
pthread_join(handle, nullptr);
defined = false;
#else
::WaitForSingleObject(handle, INFINITE);
::CloseHandle(handle);
handle = nullptr;
#endif
#ifndef NDEBUG
all_threads_mutex.lock();
all_threads.erase(all_threads.iterator_to(*this));
all_threads_mutex.unlock();
#endif
}
示例2: Process
unsigned CClanMemberItem::Process( unsigned uiMsg, WPARAM wParam, LPARAM lParam )
{
if( !IsInside( LOWORD(lParam), HIWORD( lParam )) ) return 0;
switch( uiMsg )
{
case WM_LBUTTONDOWN:
{
CTDialog* pDlg = g_itMGR.FindDlg( DLG_TYPE_CLAN );
if( pDlg )
{
CClanDlg* pClanDlg = (CClanDlg*)pDlg;
pClanDlg->SetSelectedMember( m_iClanPoint );
}
SetSelected();
}
return GetControlID();
default:
break;
}
return 0;
}
示例3: Input
void UIBase::Input(){
int key = InputManager::GetInstance().GetMouseMousePressKey();
Point mpos = InputManager::GetInstance().GetMouse();
if (IsInside(mpos.x,mpos.y)){
if (key != 0 && OnMousePress){
OnMousePress(this,key,mpos);
}
key = InputManager::GetInstance().GetMouseMouseReleaseKey();
if (key != 0 && OnMouseRelease){
OnMouseRelease(this,key,mpos);
}
if (!MouseInside){
if (OnMouseEnter){
OnMouseEnter(this,mpos);
}
MouseInside = true;
}
}else{
if (MouseInside){
if (OnMouseLeave){
OnMouseLeave(this,mpos);
}
MouseInside = false;
}
}
key = InputManager::GetInstance().IsAnyKeyPressed();
if (key != -1 && OnKeyPress){
OnKeyPress(this,key);
}
/*for (unsigned i = 0; i < Components.size(); ++i) {
if (!Components[i]->IsDead()){
Components[i]->Input();
}
}*/
}
示例4: Close
WMSG_RESULT CUIPortal::OnLButtonDown( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
{
Close();
return WMSG_FAIL;
}
if( m_pmoveArea && m_pmoveArea->IsInside(x, y))
{
m_bDrag = true;
m_nOriX = x;
m_nOriY = y;
}
CUIManager::getSingleton()->RearrangeOrder( UI_PORTAL, TRUE );
return WMSG_FAIL;
}
示例5: Remove
void
IOThread::LockRemove(int fd)
{
mutex.Lock();
const bool old_modified = modified;
Remove(fd);
const bool new_modified = modified;
if (new_modified && running && !IsInside()) {
/* this method is synchronous: after returning, all handlers must
be finished */
do {
cond.Wait(mutex);
} while (running);
}
mutex.Unlock();
if (!old_modified && new_modified)
pipe.Signal();
}
示例6: OnLButtonDBLClick
WMSG_RESULT CUITrade::OnLButtonDBLClick( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
if (m_pList[eLIST_AMEND_ITEM]->IsInside(x, y) == TRUE)
{
if (m_pList[eLIST_AMEND_ITEM]->HitTest(x, y) < 0)
{
UpdateAmendItem(-1);
UpdateAmendCondition(-1);
if (m_pBtnOk != NULL)
m_pBtnOk->SetEnable(FALSE);
}
}
return WMSG_SUCCESS;
}
示例7: OnLButtonDown
WMSG_RESULT CUIQuestBook::OnLButtonDown( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (m_bLockQuestList == TRUE)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
if( m_pmoveArea && m_pmoveArea->IsInside(x, y))
{
m_bDrag = true;
m_nOriX = x;
m_nOriY = y;
}
CUIManager::getSingleton()->RearrangeOrder( UI_QUESTBOOK_LIST, TRUE );
return WMSG_FAIL;
}
示例8: IsSphereInside
bool Frustum::IsVisible(const Node& node, Mesh& mesh) const
{
if (mesh.IsReady())
{
Vertex3 center = node.GetGlobalPosition();
float radius = mesh.GetBoundingSphereRadius();
Vector3 scale = node.GetGlobalScale();
float maxScale = std::max(std::max(scale.x, scale.y), scale.z);
radius *= maxScale;
Intersection sphereFrustumIntersec = IsSphereInside(center, radius);
if (sphereFrustumIntersec == Intersection::INTERSECTS)
{
BoundingBox bb = mesh.GetBB();
bb.Transform(node);
return IsInside(bb) != Intersection::OUTSIDE;
}
else
return sphereFrustumIntersec != Intersection::OUTSIDE;
}
return false;
}
示例9: MouseWheel
WMSG_RESULT CUIBase::MouseWheel(UINT16 x, UINT16 y, int wheel)
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
WMSG_RESULT ret = WMSG_FAIL;
if (wheel > 0)
OnMouseWheelUp();
else if (wheel < 0)
OnMouseWheelDown();
ret = OnMouseWheel(x, y, wheel);
if (ret == WMSG_FAIL)
ret = MouseWheelChild(x, y, wheel);
return ret;
}
示例10: if
//=================================================================================================
void ListBox::Update(float dt)
{
if(extended)
{
if(menu->visible)
{
// powinno byæ aktualizowane tu ale niestety wed³ug kolejnoœci musi byæ na samym pocz¹tku
//menu->Update(dt);
if(!menu->focus)
menu->visible = false;
}
else if(mouse_focus && Key.Focus() && PointInRect(GUI.cursor_pos, global_pos, size) && Key.PressedRelease(VK_LBUTTON))
{
menu->global_pos = global_pos + INT2(0,size.y);
if(menu->global_pos.y+menu->size.y >= GUI.wnd_size.y)
menu->global_pos.y = GUI.wnd_size.y-menu->size.y;
menu->visible = true;
menu->focus = true;
}
}
else
{
if(mouse_focus && Key.Focus() && PointInRect(GUI.cursor_pos, global_pos, real_size) && Key.PressedRelease(VK_LBUTTON))
{
int n = (GUI.cursor_pos.y-global_pos.y+int(scrollbar.offset))/20;
if(n >= 0 && n < (int)items.size() && n != selected)
{
selected = n;
if(e_change_index)
e_change_index(n);
}
}
if(IsInside(GUI.cursor_pos))
scrollbar.ApplyMouseWheel();
scrollbar.Update(dt);
}
}
示例11: Update
void CClanMemberItem::Update( POINT ptMouse )
{
CTDialog* pDlg = CTDialog::GetProcessMouseOverDialog();
if( pDlg && pDlg->GetDialogType() != DLG_TYPE_CLAN )
return;
if( IsInside( ptMouse.x, ptMouse.y) && m_iChannelNo != 0xFF)
{
m_Info.Clear();
POINT ptDraw = m_sPosition;
ptDraw.y -= 50;
ptDraw.x += 25;
m_Info.SetPosition( ptDraw );
m_Info.AddString( CStr::Printf("%s: %d", CStringManager::GetSingleton().GetAbility( AT_LEVEL ), m_nLevel ) );
m_Info.AddString( CStr::Printf("%s: %s", CStringManager::GetSingleton().GetAbility( AT_CLASS ), m_strJob.c_str() ) );
m_Info.AddString( CStr::Printf("%s: %d","Channel", m_iChannelNo ) );
CToolTipMgr::GetInstance().RegistInfo( m_Info );
}
}
示例12: LOWORD
unsigned int CSlotBuyPrivateStore::Process( UINT uiMsg,WPARAM wParam,LPARAM lParam )
{
POINT pt = { LOWORD( lParam ), HIWORD( lParam ) };
if( !IsInside( pt.x, pt.y )) return 0;
CIcon* pIcon = GetIcon();
if( pIcon && uiMsg == WM_LBUTTONDOWN && GetAsyncKeyState( VK_SHIFT ) < 0 )
{
CIconItem* pItemIcon = (CIconItem*)pIcon;
if( m_bExhibition )
{
CPrivateStore::GetInstance().RemoveItemBuyList( pItemIcon->GetIndex() );
}
else
{
CTDialog* pDlg = g_itMGR.FindDlg( DLG_TYPE_GOODS );
if( pDlg )
{
CGoodsDlg* pGoodsDlg = (CGoodsDlg*)pDlg;
pGoodsDlg->SetIcon( pItemIcon );
pGoodsDlg->SetType( CGoodsDlg::ADD_BUYLIST );
g_itMGR.OpenDialog( DLG_TYPE_GOODS );
}
}
return uiMsg;
}
if( m_bExhibition )
{
if( uiMsg == WM_LBUTTONDOWN )
return uiMsg;
return 0;
}
return CSlot::Process( uiMsg, wParam, lParam );
}
示例13: IsInside
int EditBox::HandleEvent(MouseEvent* evt){
if(!Visible()) return 0;
if(evt->button != LBUTTON) return 0;
bool inside = IsInside(evt->pos);
if(evt->type == BUTTON_DOWN && inside){
mClicked = true;
mClickPos = evt->pos;
UiState::mFocus = this;
}else if(evt->type == BUTTON_UP){
mClicked = false;
if(!inside) return 0;
int cStart = GetCaretFromX(mClickPos.x - mPosition.x);
int cEnd = GetCaretFromX(evt->pos.x - mPosition.x);
mCaret = cEnd;
if(cStart == cEnd){
mSelectStart = mCaret;
mSelectEnd = mCaret;
}
}
return mID;
}
示例14: Move
WMSG_RESULT CUITrade::OnMouseMove( UINT16 x, UINT16 y, MSG* pMsg )
{
if (m_bHide)
return WMSG_FAIL;
if( m_bDrag && ( pMsg->wParam & MK_LBUTTON ) )
{
int ndX = x - m_nOriX;
int ndY = y - m_nOriY;
m_nOriX = x;
m_nOriY = y;
Move( ndX, ndY );
return WMSG_SUCCESS;
}
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
UIMGR()->SetMouseCursorInsideUIs();
return CUIBase::OnMouseMove(x, y, pMsg);
}
示例15: Move
WMSG_RESULT CUIPortal::OnMouseMove( UINT16 x, UINT16 y, MSG* pMsg )
{
if (m_bHide)
return WMSG_FAIL;
if( m_bDrag && ( pMsg->wParam & MK_LBUTTON ) )
{
int ndX = x - m_nOriX;
int ndY = y - m_nOriY;
m_nOriX = x;
m_nOriY = y;
Move( ndX, ndY );
return WMSG_SUCCESS;
}
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
CUIManager::getSingleton()->SetMouseCursorInsideUIs();
return WMSG_FAIL;
}