本文整理汇总了C++中GetTop函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTop函数的具体用法?C++ GetTop怎么用?C++ GetTop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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());
}
示例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() );
}
示例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);
}
示例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;
}
示例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()) } };
}
示例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);
}
示例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;
}
}
示例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);
}
}
}
}
}
示例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");
}
示例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();
}
}
}
}
示例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); //右孩子指针进栈
}
}
}
示例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);
}
示例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));
}
}
示例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 );
}