Ejemplo n.º 1
0
bool NFCUISelectServer::initLayout()
{	
	if(!NFCUIDialog::initLayout())
		return false;

	m_pServerList = ui::ListView::create();
	m_pServerList->setSizeType(ui::SizeType::PERCENT);
	m_pServerList->setSizePercent(Vec2(0.1f, 0.25f));
	m_pServerList->setPositionType(ui::PositionType::PERCENT);
	m_pServerList->setPositionPercent(Vec2(0.5f, 0.5f));
	m_pServerList->setBackGroundColorType(ui::LayoutBackGroundColorType::SOLID);
	m_pServerList->setBackGroundColor(Color3B(150, 200, 255));
	m_pServerList->setAnchorPoint(Vec2(0.5, 0.5));
	m_pContent->addChild(m_pServerList);

	auto button = ui::Button::create();
	button->loadTextureNormal("Default/Button_Normal.png",ui::TextureResType::LOCAL);
	button->setScale9Enabled(true);
	button->setSizePercent(Vec2(1.0f, 0.2f));
	button->setSizeType(ui::SizeType::PERCENT);

	m_pServerList->setItemModel(button);
	
	g_pLoginLogic->AddEventCallBack(E_LoginEvent_WorldList, this, &NFCUISelectServer::OnWorldListEvent);
	g_pLoginLogic->AddEventCallBack(E_LoginEvent_ServerList, this, &NFCUISelectServer::OnServerListEvent);
	return true;
}
Ejemplo n.º 2
0
XKPPlacementLayout::XKPPlacementLayout(QWidget *parent, int spacing, int margin)
    : QLayout(parent), inSetGeometry(false)
{
    setMargin(margin);
    setSpacing(spacing);
    setSizeType(PlacementSize);
}
Ejemplo n.º 3
0
XKPPlacementLayout::XKPPlacementLayout(int spacing)
    : inSetGeometry(false)
{
    setMargin(0);
    setSpacing(spacing);
    setSizeType(PlacementSize);
}
Ejemplo n.º 4
0
Spacer::Spacer( QWidget *parent, const char *name )
    : QWidget( parent, name, WMouseNoMask ), orient( Vertical )
{
    setSizeType( Expanding );
    setAutoMask( TRUE );
    ar = TRUE;
}
Ejemplo n.º 5
0
void
Spring::setOrientation(Qt::Orientation orient)
{
    QSizePolicy::Policy policy = sizeType();
    m_orient = orient;
    setSizeType(policy);
    repaint();
}
Ejemplo n.º 6
0
Spring::Spring(QWidget *parent)
        : QWidget(parent)
{
    m_orient = Qt::Horizontal;
    setSizeType(QSizePolicy::Expanding);
    QPalette pal(palette());
    pal.setColor(backgroundRole(), Qt::transparent);
    setPalette(pal);
}
Ejemplo n.º 7
0
void Spacer::setOrientation( Qt::Orientation o )
{
    if ( orient == o )
 	return;
	
    SizeType st = sizeType();
    orient = o;
    setSizeType( st );
    if ( ar )
	resize( QSize( size().height(), size().width() ) );
    updateMask();
    update();
    updateGeometry();
}
Ejemplo n.º 8
0
void Spacer::setOrientation(Qt::Orientation o)
{
    if (m_orientation == o)
        return;

    const QSizePolicy::Policy st = sizeType(); // flip size type
    m_orientation = o;
    setSizeType(st);

    if (m_interactive) {
        m_sizeHint = QSize(m_sizeHint.height(), m_sizeHint.width());
        if (!isInLayout())
            resize(m_sizeHint + m_SizeOffset);
    }

    updateMask();
    update();
    updateGeometry();
}
Ejemplo n.º 9
0
QT_BEGIN_NAMESPACE

// The Spacer widget is Designer representation of  QLayoutItem.
// It uses QLayoutItem's sizeHint property as QWidget
// sizeHint and the QLayoutItem's sizeType property as QWidget size policy.
// If it is not within a layout, it adds a margin (m_SizeOffset) around it
// to avoid being shrunk to an invisible state when the sizeHint is reset to 0,0
// and enables sizeHandle-resizing. In a layout, however, this m_SizeOffset
// should not be applied for  pixel-exact design.

Spacer::Spacer(QWidget *parent) :
    QWidget(parent),
    m_SizeOffset(3, 3), // A small offset to ensure the spacer is still visible when reset to size 0,0
    m_orientation(Qt::Vertical),
    m_interactive(true),
    m_layoutState(UnknownLayoutState),
    m_sizeHint(0, 0)
{
    setAttribute(Qt::WA_MouseNoMask);
    m_formWindow = QDesignerFormWindowInterface::findFormWindow(this);
    setSizeType(QSizePolicy::Expanding);
}
Ejemplo n.º 10
0
bool Spacer::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: case 1: case 3: case 4: case 5: goto resolve;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 0: setOrientation((Orientation&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->orientation() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setSizeType((SizeType&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->sizeType() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 3: switch( f ) {
	case 0: setSizeHint(v->asSize()); break;
	case 1: *v = QVariant( this->sizeHint() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 4: switch( f ) {
	case 0: case 1: case 4: case 5: goto resolve;
	default: return FALSE;
    } break;
    default:
	return QWidget::qt_property( id, f, v );
    }
    return TRUE;
resolve:
    return QWidget::qt_property( staticMetaObject()->resolveProperty(id), f, v );
}