Ejemplo n.º 1
0
void XWidget::setRect(XRect* rect)
{
	//这里添加一个发送重新布局消息,但是必须在程序运行之后发送
	if(run_state && (rect->w !=widget_rect.w || rect->h != widget_rect.h))
	{
		X_Event event;
		event.type = X_RELAYOUT;
		XAbstractWidget::sendSystemMsg(&event);
		
		widget_rect=*rect;
		onSize(rect->w,rect->h);//通知大小改变
		onPosition(rect->x,rect->y);
		
		return ;
	}
	
	widget_rect=*rect;
}
Ejemplo n.º 2
0
void XWidget::setLaction(int x,int y)
{
	//这里添加一个发送重新布局消息,但是必须在程序运行之后发送
	if(run_state && (x !=widget_rect.x || y != widget_rect.y))
	{
		X_Event event;
		event.type = X_RELAYOUT;
		XAbstractWidget::sendSystemMsg(&event);
		
		widget_rect.x=x;
		widget_rect.y=y;
		
		onPosition(x,y);//通知大小改变	
	}else
	{
		widget_rect.x=x;
		widget_rect.y=y;
	}
}
Ejemplo n.º 3
0
void Widget::setPosition(const RECT rLoc)
{
  //if((left == m_position.left) && (m_position.top == top) && (m_position.right == right) && (m_position.bottom == bottom)) return;
  m_position = rLoc;
  onPosition();
}
Ejemplo n.º 4
0
void geGUIBase::setPos(float x, float y)
{
	m_cPos.set(x, y);
	onPosition(x, y, 0);
}