本文整理汇总了C++中Widget::GetY方法的典型用法代码示例。如果您正苦于以下问题:C++ Widget::GetY方法的具体用法?C++ Widget::GetY怎么用?C++ Widget::GetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::GetY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAbsY
/**\brief Tests if point is within a rectangle.
*/
int Widget::GetAbsY( void ) {
int absy = GetY();
Widget* theParent = parent;
while( theParent != NULL ) {
assert( theParent->GetMask() & WIDGET_CONTAINER );
absy += theParent->GetY();
theParent = theParent->parent;
}
return absy;
}
示例2: GetEdges
/**\brief Get the Position and size of a Widget
*/
int UI_Lua::GetEdges(lua_State *L){
int n = lua_gettop(L); // Number of arguments
if (n != 1)
return luaL_error(L, "Got %d arguments expected 1 (self)", n);
Widget *widget = checkWidget(L,1);
lua_pushinteger(L, widget->GetX() );
lua_pushinteger(L, widget->GetY() );
lua_pushinteger(L, widget->GetW() );
lua_pushinteger(L, widget->GetH() );
return 4;
}
示例3: ResetScrollBars
void Tab::ResetScrollBars(){
int widget_height,widget_width;
int max_height,max_width;
max_height=0;
max_width=0;
// It doesn't make sense to add scrollbars for a TAB without a size
if(this->w==0 || this->h==0 ) return;
// Find the Max edges
Widget* widget;
list<Widget *>::iterator i;
for( i = children.begin(); i != children.end(); ++i ) {
widget = *i;
widget_width = widget->GetX()+widget->GetW();
widget_height = widget->GetY()+widget->GetH();
if( widget_height > max_height) max_height=widget_height;
if( widget_width > max_width) max_width=widget_width;
}
max_height += SCROLLBAR_THICK + SCROLLBAR_PAD;
// Add a Vertical ScrollBar if necessary
if ( max_height > GetH() || this->vscrollbar != NULL ){
int v_x = this->w-SCROLLBAR_THICK-SCROLLBAR_PAD;
int v_y = SCROLLBAR_PAD;
int v_l = this->h-2*SCROLLBAR_PAD;
// Only add a Scrollbar when it doesn't already exist
if ( this->vscrollbar ){
Container::DelChild( this->vscrollbar );
this->vscrollbar = NULL;
LogMsg(INFO, "Changing Vert ScrollBar to %s: (%d,%d) [%d]\n", GetName().c_str(),v_x,v_y,v_l );
} else {
LogMsg(INFO, "Adding Vert ScrollBar to %s: (%d,%d) [%d]\n", GetName().c_str(),v_x,v_y,v_l );
}
this->vscrollbar = new Scrollbar(v_x, v_y, v_l,this);
Container::AddChild( this->vscrollbar );
this->vscrollbar->maxpos = max_height;
}
}