• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetTop函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: VisualTreeWalker

Size 
Canvas::ArrangeOverrideWithError (Size finalSize, MoonError *error)
{
	VisualTreeWalker walker = VisualTreeWalker (this);
	while (FrameworkElement *child = (FrameworkElement *)walker.Step ()) {
		Size desired = child->GetDesiredSize ();
		Rect child_final = Rect (GetLeft (child), GetTop (child),
					 desired.width, desired.height);
		child->ArrangeWithError (child_final, error);
		//child->ClearValue (LayoutInformation::LayoutClipProperty);
	}

	return finalSize;
}
开发者ID:kangaroo,项目名称:moon,代码行数:14,代码来源:canvas.cpp


示例2: GetHeight

void GuiCheckbox::InitCheckImg()
{
	/*PLuint border = sCaption.GetBorder();
	PLfloat hOff = (GetHeight() - fSpacing)/2 - border*GuiComponent::fYfactor;
	PLfloat hSize = fSpacing;
	if (hOff < 0)
	{
		hOff = border*GuiComponent::fYfactor;
		hSize = GetHeight() - 2*border*GuiComponent::fYfactor;
		if (hSize < 0)
			hSize = 0;
	}
	else
		hOff += border*GuiComponent::fYfactor;*/
	PLfloat border = sCaption.GetBorder();
	PLfloat hSize;
	PLfloat hOff = GetCheckImgSize(border, hSize);

	vboCheckImg = CreateVertexObj(	GetLeft()+border,
									GetTop()+hOff, hSize, hSize);
	sCaption.SetRenderRect(	GetLeft()+border+hSize, GetTop(), 
							GetWidth()-border-hSize, GetHeight());
}
开发者ID:bogdan-godlevsky,项目名称:PL,代码行数:23,代码来源:GuiCheckbox.cpp


示例3: SetLeft

void wxRect2DInt::ConstrainTo( const wxRect2DInt &rect )
{
    if ( GetLeft() < rect.GetLeft() )
        SetLeft( rect.GetLeft() );

    if ( GetRight() > rect.GetRight() )
        SetRight( rect.GetRight() );

    if ( GetBottom() > rect.GetBottom() )
        SetBottom( rect.GetBottom() );

    if ( GetTop() < rect.GetTop() )
        SetTop( rect.GetTop() );
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:14,代码来源:geometry.cpp


示例4: GetLeft

void nsStyleSides::AppendToString(nsString& aBuffer) const
{
  aBuffer.AppendLiteral("left: ");
  GetLeft().AppendToString(aBuffer);

  aBuffer.AppendLiteral("top: ");
  GetTop().AppendToString(aBuffer);

  aBuffer.AppendLiteral("right: ");
  GetRight().AppendToString(aBuffer);

  aBuffer.AppendLiteral("bottom: ");
  GetBottom().AppendToString(aBuffer);
}
开发者ID:ahadzi,项目名称:celtx,代码行数:14,代码来源:nsStyleCoord.cpp


示例5: main

int main()
{
	Stack s;
	ElemType x;
	cout<<"(1)³õʼ»¯Õ»s"<<endl;
	InitStack(s);
	cout<<"(2)ջΪ"<<(StackEmpty(s)?"¿Õ":"·Ç¿Õ")<<endl;
	cout<<"(3)ÒÀ´ÎÊäÈë×ÖĸÐòÁУ¬ÒÔ¡°#¡±½áÊø£º"<<endl;
	cin>>x;
	while( x!='#')
	{
		Push(s,x);
		cin>>x;
	}
	cout<<"(4)ջΪ"<<(StackEmpty(s)?"¿Õ":"·Ç¿Õ")<<endl;
	cout<<"(5)Õ»³¤¶ÈStackLength(s):"<<StackLength(s)<<endl;
	cout<<"(6a)Õ»¶¥ÔªËØGetTop(s)Ϊ£º";
	cout<<GetTop(s)<<endl;
	cout<<"(6b)Õ»¶¥ÔªËØGetTop1(s,x)Ϊ£º"<<endl;
	GetTop1(s,x);
	cout<<x<<endl;
	cout<<"(7)´ÓÕ»¶¥µ½Õ»µ×ÔªËØPrintStack(s)Ϊ£º"<<endl;
	PrintStack(s);
	cout<<"(8)³öÕ»Pop1(s,x)µÄÔªËØΪ£º"<<endl;
	Pop1(s,x);
	cout<<x<<endl;
	cout<<"(9)³öÕ»ÐòÁÐ:"<<endl;
	while(!StackEmpty(s))
    {
        cout<<Pop(s)<<" ";
    }
    cout<<endl;
    cout<<"(10)ջΪ:"<<(StackEmpty(s)?"¿Õ":"·Ç¿Õ")<<endl;
    cout<<"(11)ÒÀ´Î½øÕ»ÔªËØa,b,c:"<<endl;
    Push(s,'a');
    Push(s,'b');
    Push(s,'c');
    cout<<"(12)´ÓÕ»¶¥µ½Õ»µ×ÔªËØPrintStack(s)Ϊ£º"<<endl;
    PrintStack(s);
    cout<<"(13)Çå¿ÕÕ»ClearStack(s)"<<endl;
    ClearStack(s);
    cout<<"(14)ջΪ"<<(StackEmpty(s)?"¿Õ":"·Ç¿Õ")<<endl;
    cout<<"(15)Ïú»ÙÕ»s:"<<endl;
    DestoryStack(s);
    cout<<"(16)Ïú»ÙÕ»ºóµ÷ÓÃPush(s,e)ºÍPrintStack(s)"<<endl;
    Push(s,'e');
    PrintStack(s);
	return 0;
}
开发者ID:Soarkey,项目名称:DataStructureWork,代码行数:49,代码来源:Stack.cpp


示例6: drawFunctionSpec

// -----------------------------------------------------------------------------
// Draws function text (spec+args) for [context] at [left,top].
// Returns a rect of the bounds of the drawn text
// -----------------------------------------------------------------------------
wxRect SCallTip::drawFunctionContext(
	wxDC&                      dc,
	const TLFunction::Context& context,
	int                        left,
	int                        top,
	wxColour&                  col_faded,
	wxFont&                    bold) const
{
	auto rect_func = drawFunctionSpec(dc, context, left, top);
	auto rect_args = drawArgs(dc, context, rect_func.GetRight() + 1, rect_func.GetTop(), col_faded, bold);

	return wxRect{ rect_func.GetTopLeft(),
				   wxPoint{ std::max(rect_func.GetRight(), rect_args.GetRight()),
							std::max(rect_func.GetBottom(), rect_args.GetBottom()) } };
}
开发者ID:SteelTitanium,项目名称:SLADE,代码行数:19,代码来源:SCallTip.cpp


示例7: SystemMenuProc

int SystemMenuProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
{
    int mx, my;
    WINDOW wnd1;
    switch (msg)    {
        case CREATE_WINDOW:
            wnd->holdmenu = ActiveMenuBar;
            ActiveMenuBar = &SystemMenu;
            SystemMenu.PullDown[0].Selection = 0;
            break;
        case LEFT_BUTTON:
            wnd1 = GetParent(wnd);
            mx = (int) p1 - GetLeft(wnd1);
            my = (int) p2 - GetTop(wnd1);
            if (HitControlBox(wnd1, mx, my))
                return TRUE;
            break;
        case LB_CHOOSE:
            PostMessage(wnd, CLOSE_WINDOW, 0, 0);
            break;
        case DOUBLE_CLICK:
            if (p2 == GetTop(GetParent(wnd)))    {
                PostMessage(GetParent(wnd), msg, p1, p2);
                SendMessage(wnd, CLOSE_WINDOW, TRUE, 0);
            }
            return TRUE;
        case SHIFT_CHANGED:
            return TRUE;
        case CLOSE_WINDOW:
            ActiveMenuBar = wnd->holdmenu;
            break;
        default:
            break;
    }
    return DefaultWndProc(wnd, msg, p1, p2);
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:36,代码来源:SYSMENU.C


示例8: GetHead

/**
 * @brief get head element from the queue.
 *
 * @param[in]      Q     queue struct pointer
 * @param[out]     e     the element
 *
 * @return return OK if success, else return ERROR
 */
Status GetHead(Queue* Q, ElementType* e)
{
    assert(Q != NULL && e != NULL);
    if (StackEmpty(&Q->s2) == FALSE) {
        GetTop(&Q->s2, e);
        return OK;
    } else if (StackEmpty(&Q->s1) == FALSE) {
        while (Pop(&Q->s1, e)) {
            Push(&Q->s2, *e);
        }
        return OK;
    } else {
        return ERROR;
    }
}
开发者ID:chenxilinsidney,项目名称:funnycprogram,代码行数:23,代码来源:queue_by_stack.c


示例9: InOrderTraverse1_xdwang

/* 我自己写的,可以运行,代码不如示例的简洁 */
void InOrderTraverse1_xdwang(BiTree T,Status(*Visit)(TElemType))
{
	SqStack sq;
	SElemType s;

	if (T) {
		InitStack(&sq);
		Push(&sq, T);
		while (GetTop(sq, &s) && s->lchild) {
			Push(&sq, s->lchild);
		}

		while (GetTop(sq, &s)) {
			Pop(&sq, &s);
			Visit(s->data);
			if (s->rchild) {
				Push(&sq, s->rchild);
				while (GetTop(sq, &s) && s->lchild) {
					Push(&sq, s->lchild);
				}
			}
		}
	}
}
开发者ID:schwxd,项目名称:linux-kernel,代码行数:25,代码来源:bitree.c


示例10: main_SeqStack

//********************
void main_SeqStack(){
	SeqStack S;
	int i;
	DataType a[]={'a','b','c','d','e'};
	DataType e;
	InitStack(&S);
	for(i=0;i<sizeof(a)/sizeof(a[0]);i++)
	{
		if(PushStack(&S,a[i])==0)
		{
			printf("栈已满,不能进栈!");
			return;
		}
	}
	printf("出栈的元素是:");
	if(PopStack(&S,&e)==1)
		printf("%4c",e);
	if(PopStack(&S,&e)==1)
		printf("%4c",e);  
	printf("\n");
	printf("当前栈顶的元素是:");  
	if(GetTop(S,&e)==0)
	{
		printf("栈已空!");
		return;
	}
	else
		printf("%4c\n",e);
	if(PushStack(&S,'f')==0)
	{
		printf("栈已满,不能进栈!");
		return;
	}
	if(PushStack(&S,'g')==0)
	{
		printf("栈已满,不能进栈!");
		return;
	}
	printf("当前栈中的元素个数是:%d\n",StackLength(S));
	printf("元素出栈的序列是:");
	while(!StackEmpty(S))
	{
		PopStack(&S,&e);
		printf("%4c",e);
	}
	printf("\n");
	system("pause");
}
开发者ID:pengfeifan,项目名称:JustForTest,代码行数:49,代码来源:SeqStack.cpp


示例11: Forward

void Forward()
{
	GetTop();
	if (t == NULL) return;

	if (!strcmp(cname, "IEFrame") ||
		!strcmp(cname, "CabinetWClass")) {
		//FindIE(t);
		if (t) {
			wb2 wb = GetIE(t);
			if (wb) {
				wb->raw_GoForward();
			}
		}
	}
}
开发者ID:herf,项目名称:bumper,代码行数:16,代码来源:bumper.cpp


示例12: InOrderTraverse1

/*中序遍历,非递归算法*/
void InOrderTraverse1(BiTree T,void (*visit)(BiTree)){
	Stack stack;
	BiTree p;
	init(stack);
	push(stack,T);	//根指针进栈
	while(!empty(stack)){
		while(p = GetTop(stack))
			push(stack,p->lchild);	//向左走到尽头
		pop(stack,p);	//空指针出栈
		if(!empty(stack)){
			pop(stack,p);
			visit(p);  //访问节点
			push(stack,p->rchild);	//右孩子指针进栈
		}
	}
}
开发者ID:ichengit,项目名称:DataStructure,代码行数:17,代码来源:tree.cpp


示例13: switch

template<class T> void HTMLElementDisplay<T>::SetXYPosition(DISPLAY_INT iXPos, DISPLAY_INT iYPos)
{
	switch (GetPosition())
	{
	case TU_POSITION_RELATIVE:
		// tbd - this should take into account right and bottom if left or top aren't defined
		iXPos += GetLeft();
		iYPos += GetTop();
		// intentional fall-through
	default:
		T::SetFixedPosition(WEBC_FALSE);
		break;
	}

	T::MoveTo(iXPos, iYPos);
}
开发者ID:peteratebs,项目名称:webcwebbrowser,代码行数:16,代码来源:dhelem.cpp


示例14: GetParent

void Scrollbar::Thumb::Arrange()
{
  if (auto sb = _scrollbar.lock())
  {
    auto scrollDelegate = sb->GetScrollDelegate();

    auto p = GetParent();
    SetLeft(p->GetLeft());
    SetRight(p->GetRight());
    auto trackHeight = p->GetHeight();
    auto height      = scrollDelegate->GetThumbSizePercent() * trackHeight;
    auto top         = p->GetTop() + (scrollDelegate->GetCurrentOffsetPercent() * trackHeight);
    SetTop(std::round(top));
    SetBottom(std::round(top + height));
  }
}
开发者ID:bobkocisko,项目名称:libgui,代码行数:16,代码来源:Scrollbar.cpp


示例15: SetRect

void CDiagramEntity::MoveRect( double x, double y )
/* ============================================================
	Function :		CDiagramEntity::MoveRect
	Description :	Moves the object rect.
					
	Return :		void
	Parameters :	double x	-	Move x steps horizontally.
					double y	-	Move y steps vertically.
					
	Usage :			Call to move the object on screen.

   ============================================================*/
{

	SetRect( GetLeft() + x, GetTop() + y, GetRight() + x, GetBottom() + y );

}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:17,代码来源:DiagramEntity.cpp


示例16: GetHeight

void GuiFrameImage::Draw()
{
	if(!IsVisible())
		return;

	if(	oldWidth != GetWidth()
		||	oldHeight != GetHeight()
		||	oldX != GetLeft()
		||	oldY != GetTop()
		||	oldZ != 0
		||	oldAlpha != GetAlpha())
	{
		CreateDrawList();
	}

	GX_CallDispList(DrawList, DrawListSize);
}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:17,代码来源:gui_frameimage.cpp


示例17: BiTree_free

void BiTree_free(BiTree *T)
{
	
	SqStack S=NULL;
	S=InitStack(S);
	BiTree p=NULL;
	p = *T;
  Push(S, p);
	while(!StackEmpty(S))
	{

		while(p){
			if(p->lflag != 1 )
			{
				p->lflag = 1;
				if(p->lchild){
					Push(S, p->lchild);
					p = p->lchild;
				}
			}else if(p->rflag != 1)
			{
				p->rflag = 1;
				if(p->rchild){
					Push(S, p->rchild);
					p = p->rchild;
				}

			}else if(p->lflag == 1 && p->rflag == 1){
				break;
			}
		}
		p = Pop(S);
		//printf("%4c", p->data);
		free(p);
		p = NULL;
		if(StackEmpty(S)) {
			break;	
		}
		p = GetTop(S);
	}
	
	*T = NULL;
	free(S->base);
	free(S);
}
开发者ID:zhangzewen,项目名称:Algorithms,代码行数:45,代码来源:BiTree.cpp


示例18: rect

CRect CDiagramEntity::GetRect() const
/* ============================================================
	Function :		CDiagramEntity::GetRect
	Description :	Returns the object rect.
					
	Return :		CRect	-	The object rect.
	Parameters :	none

	Usage :			Call to get the object position and size. 
					Will round of fractions.

   ============================================================*/
{

	CRect rect( ( int ) GetLeft(), ( int ) GetTop(), ( int ) GetRight(), ( int ) GetBottom() );
	return rect;

}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:18,代码来源:DiagramEntity.cpp


示例19: main

int main (){
	Stack *S = (Stack *) malloc (sizeof (Stack));
	InitStack(S);
	printf ("Push: a, b, c, d, e, f\nThe length:");
	Push(S, 'a');
	Push(S, 'b');
	Push(S, 'c');
	Push(S, 'd');
	Push(S, 'e');
	Push(S, 'f');
	StackLength1(S);
	printf ("The top value is ");
	GetTop(S);
	printf ("---\nPop:\n");
	for(int i = 0; i < 6; i++)
		Pop(S);
	return 0;
}
开发者ID:Rjerk,项目名称:Core,代码行数:18,代码来源:顺序栈的各种操作.cpp


示例20: HorsePath

int HorsePath(struct around start)
{
    struct around curpos;
    int horsestep=0, off;
    struct zhan elem;
    int i;

    curpos = start;
    do{
        i++;
        if(Pass(curpos)) {
            horsestep++;
            elem.di = 0;
            elem.ord = horsestep;
            elem.seat = curpos;
            Push(elem);
            if(N*N == horsestep) {
                printf("%d\n",i);
                return 1;
            }
            off = borad[elem.seat.x][elem.seat.y][elem.di]+1;
            curpos = NextPos(elem.seat, off);
        }
        else {
            if(s.top) {
                while(s.top && elem.di == 8){
                    Pop(&elem);
                    if(s.top) {
                        elem = GetTop();
                        horsestep = elem.ord;
                    }
                }
                if(s.top && elem.di < 8) {
                    Pop(&elem);
                    off = borad[elem.seat.x][elem.seat.y][++elem.di];
                    curpos = NextPos(elem.seat, off+1);
                    Push(elem);
                }
            }
        }
    }while(s.top != 0);
    printf("no way\n");
    exit(0);
}
开发者ID:wrx1721267632,项目名称:math,代码行数:44,代码来源:马踏棋盘.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetTopLevelFrame函数代码示例发布时间:2022-05-30
下一篇:
C++ GetToolId函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap