当前位置: 首页>>代码示例>>C++>>正文


C++ IsChild函数代码示例

本文整理汇总了C++中IsChild函数的典型用法代码示例。如果您正苦于以下问题:C++ IsChild函数的具体用法?C++ IsChild怎么用?C++ IsChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IsChild函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetMouseLButton

void OUGUIObject::SetMouseLButton(bool bDown)
{
    if(bDown == m_bMouseLButton) return;

    m_bMouseLButton = bDown;

    if(m_bMouseLButton)
    {
        /** 设置控件 */
        if(!IsChild(OUGUIObject::GetFocusControl()))
        {
            OUGUIObject::SetFocusControl(this);
        }

        /** 激活控件 (如拖曳) */
        if(!IsChild(OUGUIObject::GetActiveControl()))
        {
            OUGUIObject::SetActiveControl(this);
        }

        OnMouseLButtonDown();
    }
    else
    {
        if(OUGUIObject::GetActiveControl() == this)
        {
            OUGUIObject::SetActiveControl(NULL);
        }

        OnMouseLButtonUp();
    }
}
开发者ID:XadillaX,项目名称:hge-mfc-demo,代码行数:32,代码来源:OUGUIObject.cpp

示例2: GetEdge

 IGraphEdge * GetEdge(unsigned int hash) const
 {
     CComPtr<IGraphEdge> retVal = m_graph.GetEdge(hash);
     if (IsChild(retVal->GetSource()) || IsChild(retVal->GetTarget()))
     {
         return retVal;
     }
     return NULL;
 }
开发者ID:dehilsterlexis,项目名称:eclide-1,代码行数:9,代码来源:GraphSubgraphImpl.cpp

示例3: HandleAdd

void Container::Add( const Widget::Ptr& widget ) {
	if( IsChild( widget ) ) {
		return;
	}

	m_children.push_back( widget );
	HandleAdd( widget );

	// Check if HandleAdd still wants the little boy.
	if( IsChild( widget ) ) {
		widget->SetParent( shared_from_this() );
		RequestResize();
	}
}
开发者ID:Stigmatized,项目名称:glassomium,代码行数:14,代码来源:Container.cpp

示例4: DockWnd_NextWindow

//
//	Usually called in response to a Ctrl+Tab keyboard accelerator
//
BOOL WINAPI DockWnd_NextWindow(HWND hwndMain)
{
	HWND hwndFocus;
	HWND hwndLast = 0;
	DOCKSERVER *dsp;
	DOCKPANEL *dpp;
	BOOL fMainFocus = TRUE;

	if((dsp = GetDockServer(hwndMain)) == 0)
		return FALSE;

	hwndFocus = GetFocus();

	// is focus on one of the dockwindows?
	//for(i = 0; i < dsp->nNumDockPanels; i++)
	for(dpp = dsp->PanelListHead; dpp; dpp = dpp->flink)
	{
		//DOCKPANEL *dwp = &dsp->PanelList[i];

		if(hwndFocus == dpp->hwndPanel || IsChild(dpp->hwndPanel, hwndFocus))
			fMainFocus = FALSE;
	}

	//for(i = 0; i < dsp->nNumDockPanels; i++)
	for(dpp = dsp->PanelListHead; dpp; dpp = dpp->flink)
	{
	//	DOCKPANEL *dwp = &dsp->PanelList[i];

		if(dpp->hwndPanel)
		{
			// is the focus set to this window?
			if(hwndFocus == dpp->hwndPanel || IsChild(dpp->hwndPanel, hwndFocus))
			{
				hwndLast = dpp->hwndPanel;
			}
			// look for next window that doesn't have focus
			else if((hwndLast || fMainFocus) && !(dpp->dwStyle & DWS_NOSETFOCUS))
			{
				SetFocus(dpp->hwndPanel);	
				return TRUE;
			}
		}
	}

	// not found? go to the main window
	SetFocus(hwndMain);
	return TRUE;
}
开发者ID:4aiman,项目名称:HexEdit,代码行数:51,代码来源:DockLib.c

示例5: FindAdviseChild

/****************************************************************************
 *                                                                          *
 *  FUNCTION   : FindAdviseChild()                                          *
 *                                                                          *
 *  PURPOSE    : Search through the child windows of hwndMDI for an info    *
 *               ctrl that has the same Item and format and is an           *
 *               ADVSTART ADVSTOP or ADVDATA transaction window.            *
 *                                                                          *
 *               We use these to show the associated advise data.           *
 *                                                                          *
 *  RETURNS    : The transaction window handle or 0 on failure.             *
 *                                                                          *
 ****************************************************************************/
HWND FindAdviseChild(
HWND hwndMDI,
HSZ hszItem,
WORD wFmt)
{
    HWND hwnd, hwndStart;
    XACT *pxact;

    if (!IsWindow(hwndMDI))
        return 0;
    
    hwnd = hwndStart = GetWindow(hwndMDI, GW_CHILD);
    while (hwnd && IsChild(hwndMDI, hwnd)) {
        pxact = (XACT *)GetWindowWord(hwnd, GWW_WUSER);
        if (pxact &&
                (pxact)->wFmt == wFmt &&
                (pxact)->hszItem == hszItem &&
                (
                    ((pxact->wType & XTYP_ADVSTART) == XTYP_ADVSTART) ||
                    (pxact->wType == XTYP_ADVSTOP) ||
                    (pxact->wType == XTYP_ADVDATA)
                )
           ) {
            return(hwnd);
        }
        hwnd = GetWindow(hwnd, GW_HWNDNEXT);
        if (hwnd == hwndStart) 
            return 0;
    }
    return 0;
}
开发者ID:chunhualiu,项目名称:OpenNT,代码行数:44,代码来源:dde.c

示例6: GetSafeHwnd

void CNGWizard::OnPaletteChanged(CWnd* pFocusWnd) 
{
	if (!m_bmpHeader.IsEmpty() )
	{
		CPalette* pPal = m_bmpHeader.GetPalette();
		if ( (NULL != pPal) &&
			(NULL != GetSafeHwnd()) &&
			(this != pFocusWnd) &&
			!IsChild(pFocusWnd) )
		{
			CClientDC dc(this);
			CPalette* pOldPalette = dc.SelectPalette(pPal, TRUE);
			UINT nChanged = dc.RealizePalette();
			dc.SelectPalette(pOldPalette, TRUE);

			if (0 != nChanged)
			{
				Invalidate();
			}
		}
	}
	else
	{
		CNGWizard_BASE::OnPaletteChanged(pFocusWnd);
	}
}
开发者ID:jhbsz,项目名称:cpe-1,代码行数:26,代码来源:NGWizard.cpp

示例7: AtEndOfTabList

// Returns TRUE if we're at the end of the tab list
static BOOL NEAR
AtEndOfTabList(HWND hwndDlg)
{
	HWND	hCtl;
	BOOL	bShift;
	 
	// See whether we should check for the end of the tab list or
	// the shift-tab list
	bShift = GetKeyState(VK_SHIFT) < 0;

	// Get the control that currently has focus
	hCtl = GetFocus();
	assert(IsChild(hwndDlg, hCtl));

	// Get the first-level child for the control. This matters for controls
	// like a combo box which have child windows
	while (GetParent(hCtl) != hwndDlg)
		hCtl = GetParent(hCtl);

	// Look for another child window that's enabled and wants TAB keys
	do {
		hCtl = bShift ? GetPrevSibling(hCtl) : GetNextSibling(hCtl);

		if (hCtl == NULL)
			return TRUE;  // no more child windows
	} while ((GetWindowStyle(hCtl) & (WS_DISABLED | WS_TABSTOP)) != WS_TABSTOP);

	return FALSE;
}
开发者ID:vicamo,项目名称:b2g_mozilla-central,代码行数:30,代码来源:cppageex.cpp

示例8: Key

bool TopWindow::Key(dword key, int count)
{
	if(Ctrl::Key(key, count))
		return true;
	if(IsChild()) return false;
	if(key == K_DOWN || key == K_RIGHT || key == K_TAB) {
		Ctrl *ctrl = GetFocusChildDeep();
		if(ctrl && IterateFocusForward(ctrl, this))
			return true;
		ctrl = GetFirstChild();
		if(ctrl) {
			if(ctrl->SetWantFocus()) return true;
			return IterateFocusForward(ctrl, this);
		}
	}
	if(key == K_UP || key == K_LEFT || key == K_SHIFT_TAB) {
		Ctrl *ctrl = GetFocusChildDeep();
		if(ctrl && IterateFocusBackward(ctrl, this))
			return true;
		ctrl = GetLastChild();
		if(ctrl) {
			if(ctrl->SetWantFocus()) return true;
			return IterateFocusBackward(ctrl, this);
		}
	}
	return false;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:27,代码来源:TopWindow.cpp

示例9: GetFocus

BOOL CSAPrefsSubDlg::PreTranslateMessage(MSG* pMsg) 
{
	// Don't let CDialog process the Escape key.
	if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
	{
		return TRUE;
	}
	
	// Don't let CDialog process the Return key, if a multi-line edit has focus
	if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
	{
		// Special case: if control with focus is an edit control with
		// ES_WANTRETURN style, let it handle the Return key.
		
		TCHAR szClass[10];
		CWnd* pWndFocus = GetFocus();
		if (((pWndFocus = GetFocus()) != NULL) &&
			IsChild(pWndFocus) &&
			(pWndFocus->GetStyle() & ES_WANTRETURN) &&
			GetClassName(pWndFocus->m_hWnd, szClass, 10) &&
			(lstrcmpi(szClass, _T("EDIT")) == 0))
		{
			pWndFocus->SendMessage(WM_CHAR, pMsg->wParam, pMsg->lParam);
			return TRUE;
		}
		
		return FALSE;
	}

	return CDialog::PreTranslateMessage(pMsg);
}
开发者ID:RandallFlagg,项目名称:kgbarchiver,代码行数:31,代码来源:SAPrefsSubDlg.cpp

示例10: OnPaletteChanged

void palEditDlg::OnPaletteChanged(CWnd* pFocusWnd) 
{
	if (pFocusWnd == this || IsChild(pFocusWnd))
		return;

	OnQueryNewPalette();
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:7,代码来源:palEditDlg.cpp

示例11: LLOG

Bar::Item& MenuBar::AddSubMenu(Event<Bar&> proc)
{
	LLOG("MenuBar::AddSubMenu " << Name());
	SubMenuBase *w;
	MenuItemBase *q;
	if(IsChild()) {
		TopSubMenuItem *a = new TopSubMenuItem;
		q = a;
		w = a;
	}
	else {
		SubMenuItem *a = new SubMenuItem;
		q = a;
		w = a;
	}
	item.Add(q);
	pane.Add(q, Null);
	q->SetFont(font);
	q->LeftGap(Nvl(leftgap, style->leftgap));
	q->TextGap(style->textgap);
	q->Style(style);
	q->MaxIconSize(IsNull(maxiconsize) ? style->maxiconsize : maxiconsize);
	w->SetParent(this);
	w->Set(proc);
	return *q;
}
开发者ID:koz4k,项目名称:soccer,代码行数:26,代码来源:MenuBar.cpp

示例12: ASSERT

bool CChordEaseApp::HandleDlgKeyMsg(MSG* pMsg)
{
	static const LPCSTR	EditBoxCtrlKeys = "ACHVX";	// Z reserved for app undo
	CMainFrame	*Main = theApp.GetMain();
	ASSERT(Main != NULL);	// main frame must exist
	switch (pMsg->message) {
	case WM_KEYDOWN:
		{
			int	VKey = INT64TO32(pMsg->wParam);
			bool	bTryMainAccels = FALSE;	// assume failure
			if ((VKey >= VK_F1 && VKey <= VK_F24) || VKey == VK_ESCAPE) {
				bTryMainAccels = TRUE;	// function key or escape
			} else {
				bool	IsAlpha = VKey >= 'A' && VKey <= 'Z';
				CEdit	*pEdit = CFocusEdit::GetEdit();
				if (pEdit != NULL) {	// if an edit control has focus
					if ((IsAlpha									// if (alpha key
					&& strchr(EditBoxCtrlKeys, VKey) == NULL		// and unused by edit
					&& (GetKeyState(VK_CONTROL) & GKS_DOWN))		// and Ctrl is down)
					|| ((VKey == VK_SPACE							// or (space key,
					|| VKey == VK_RETURN || VKey == VK_BACK)		// Enter or Backspace
					&& (GetKeyState(VK_CONTROL) & GKS_DOWN))		// and Ctrl is down)
					|| (VKey == VK_SPACE							// or (space key
					&& (GetKeyState(VK_SHIFT) & GKS_DOWN))			// and Shift is down)
					|| (IsAlpha										// or (alpha key
					&& pEdit->IsKindOf(RUNTIME_CLASS(CNumEdit))		// and numeric edit
					&& (VKey > 'G'									// and (key above G
					|| !pEdit->IsKindOf(RUNTIME_CLASS(CNoteEdit)))	// or not note edit)
					&& (GetKeyState(VK_SHIFT) & GKS_DOWN)))			// and Shift is down)
						bTryMainAccels = TRUE;	// give main accelerators a try
				} else {	// non-edit control has focus
					if (IsAlpha										// if alpha key
					|| VKey == VK_SPACE								// or space key
					|| (GetKeyState(VK_CONTROL) & GKS_DOWN)			// or Ctrl is down
					|| (GetKeyState(VK_SHIFT) & GKS_DOWN))			// or Shift is down
						bTryMainAccels = TRUE;	// give main accelerators a try
				}
			}
			if (bTryMainAccels) {
				HACCEL	hAccel = Main->GetAccelTable();
				if (hAccel != NULL
				&& TranslateAccelerator(Main->m_hWnd, hAccel, pMsg))
					return(TRUE);	// message was translated, stop dispatching
			}
		}
		break;
	case WM_SYSKEYDOWN:
		// if focused window isn't descendant of main frame (e.g. floating bar's controls
		// are descendants of miniframe) main frame must steal focus else main menus fail
		if (!IsChild(Main->m_hWnd, GetFocus())) {	// avoid stealing focus needlessly
			if (GetKeyState(VK_SHIFT) & GKS_DOWN)	// if context menu
				return(FALSE);	// keep dispatching (false alarm)
			Main->SetFocus();	// main frame must have focus to display menus
			Main->SendMessage(pMsg->message, pMsg->wParam, pMsg->lParam);	// enter menu mode
			return(TRUE);	// message was translated, stop dispatching
		}
		break;
	}
	return(FALSE);	// continue dispatching
}
开发者ID:victimofleisure,项目名称:ChordEase,代码行数:60,代码来源:ChordEase.cpp

示例13: GetNextDlgGroupItem

HWND WINAPI
GetNextDlgGroupItem(HWND hWndDlg, HWND hWndCtrl, BOOL fPrevious)
{
    if (!IsChild(hWndDlg,hWndCtrl))
        return (HWND)0;
    return GetWindow(hWndCtrl,(fPrevious)?GW_HWNDPREVGROUP:GW_HWNDNEXTGROUP);
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:7,代码来源:Dialog.c

示例14:

vector<LocalStmtPair> FakeDirectiveHandler::GenerateWritePairs(Stmt * Base,
                                                      SwitchStmt * Parent,
                                                      Stmt * Top) {

  vector<LocalStmtPair> Pairs;
  LocalStmtPair Pair;
  
  // Cond
  if (IsChild(Base, Parent->getCond())) {

    Pair.insertAfter = false;
    Pair.stmt = Top;
    Pairs.push_back(Pair);

  // Body
  } else {

    Pair.insertAfter = false;
    Pair.stmt = Base;
    Pairs.push_back(Pair);

  }

  return Pairs;

}
开发者ID:divot,项目名称:SpecCodeConv,代码行数:26,代码来源:FakeDirectiveHandler.cpp

示例15: VisitCompoundStmt

bool FakeDirectiveHandler::VisitCompoundStmt(CompoundStmt *S) {

  if (WaitingHeader) {

    CompilerInstance &CI = FullDirectives->GetCI(S->getLocStart());

    if (IsChild(S, WaitingHeader)) {
      return true;
    }

    FullDirectives->Push(WaitingDirective, WaitingHeader, S, CI);
    
    WaitingDirective = NULL;
    WaitingHeader = NULL;
    
    return true;
  
  } else {

    PragmaDirectiveMap::iterator it;
    
    it = Directives->find(S->getLocStart().getRawEncoding());
  
    if (it != Directives->end()) {
    
      WaitingHeader = S;
      WaitingDirective = it->second;
    
    }
    
    return true;
    
  }

}
开发者ID:divot,项目名称:SpecCodeConv,代码行数:35,代码来源:FakeDirectiveHandler.cpp


注:本文中的IsChild函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。