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; }
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; } }
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(); }
void geGUIBase::setPos(float x, float y) { m_cPos.set(x, y); onPosition(x, y, 0); }