djNumberTextBox text-align:right

时间:2016-01-04 13:43:11

标签: xpages

我希望Dojo组件的内容正确对齐。请在下面找到我的Dojo组件代码。

<xe:djNumberTextBox id="djNumberTextBox1" style="text-align:right!important;">
</xe:djNumberTextBox>

我的CSS代码;

.dijitNumberTextBox input.dijitInputInner, .dijitCurrencyTextBox input.dijitInputInner, .dijitSpinner input.dijitInputInner
{
    padding-right: 1px;
    text-align: right;
}

.numeric input { text-align: right;}

How It looks like (Screenshot)

1 个答案:

答案 0 :(得分:1)

适用于具有样式的特定数字文本框&#34; text-align:right&#34;:

Matrix4 orthographic_matrix(float width, float height, float z_near, float z_far)
{
    float x_right = width * 0.5f;
    float x_left = width * -0.5f;
    float y_top = height * 0.5f;
    float y_bottom = height * -0.5f;

    float one_delta_x = 1.0f / (x_right - x_left);
    float one_delta_y = 1.0f / (y_top - y_bottom);
    float one_delta_z = 1.0f / (z_far - z_near);

    Matrix4 proj;

    proj(0, 0) = 2.0f * one_delta_x;
    proj(1, 1) = 2.0f * one_delta_y;
    proj(2, 2) = -2.0f * one_delta_z;

    proj(3, 0) = -1.0f * (x_right + x_left) * one_delta_x;
    proj(3, 1) = -1.0f * (y_top + y_bottom) * one_delta_y;
    proj(3, 2) = 1.0f * (z_far + z_near) * one_delta_z;
    proj(3, 3) = 1.0f;

    return proj;
}

如果要将所有数字文本框对齐,请添加到CSS:

<xe:djNumberTextBox 
    id="djNumberTextBox1"
    value="#{viewScope.number}" 
    style="text-align:right">
</xe:djNumberTextBox>