IDEMPIERE-1100 BP field split in two lines.

This commit is contained in:
Heng Sin Low 2013-06-24 15:32:40 +08:00
parent 577057b1ba
commit 90b35e5bc7
4 changed files with 58 additions and 35 deletions

View File

@ -32,7 +32,6 @@ public class EditorBox extends Div {
this); this);
protected Textbox txt; protected Textbox txt;
protected Button btn; protected Button btn;
// private Hlayout hlayout;
public EditorBox() { public EditorBox() {
initComponents(); initComponents();
@ -54,9 +53,9 @@ public class EditorBox extends Div {
} }
private void initComponents() { private void initComponents() {
// hlayout = new Hlayout();
// hlayout.setHflex("1");
txt = new Textbox(); txt = new Textbox();
txt.setSclass("editor-input");
txt.setHflex("0");
appendChild(txt); appendChild(txt);
btn = new Button(); btn = new Button();
btn.setTabindex(-1); btn.setTabindex(-1);
@ -103,6 +102,11 @@ public class EditorBox extends Div {
if (btn.getParent() != null) if (btn.getParent() != null)
btn.detach(); btn.detach();
} }
if (enabled) {
LayoutUtils.removeSclass("editor-input-disd", txt);
} else {
LayoutUtils.addSclass("editor-input-disd", txt);
}
} }
/** /**
@ -147,12 +151,10 @@ public class EditorBox extends Div {
public void setTableEditorMode(boolean flag) { public void setTableEditorMode(boolean flag) {
if (flag) { if (flag) {
txt.setHflex("0");
setHflex("0"); setHflex("0");
LayoutUtils.addSclass("grid-editor-input", txt); LayoutUtils.addSclass("grid-editor-input", txt);
LayoutUtils.addSclass("grid-editor-button", btn); LayoutUtils.addSclass("grid-editor-button", btn);
} else { } else {
txt.setHflex("1");
setHflex("1"); setHflex("1");
LayoutUtils.removeSclass("grid-editor-input", txt); LayoutUtils.removeSclass("grid-editor-input", txt);
LayoutUtils.removeSclass("grid-editor-button", btn); LayoutUtils.removeSclass("grid-editor-button", btn);

View File

@ -82,7 +82,8 @@ public class NumberBox extends Div
if (integral) if (integral)
decimalBox.setScale(0); decimalBox.setScale(0);
decimalBox.setStyle("display: inline-block;text-align:right"); decimalBox.setStyle("display: inline-block;text-align:right");
decimalBox.setHflex("1"); decimalBox.setHflex("0");
decimalBox.setSclass("editor-input");
appendChild(decimalBox); appendChild(decimalBox);
btn = new Button(); btn = new Button();
@ -385,11 +386,22 @@ public class NumberBox extends Div
decimalBox.setReadonly(!enabled); decimalBox.setReadonly(!enabled);
btn.setEnabled(enabled); btn.setEnabled(enabled);
if (enabled) if (enabled)
{
if (btn.getParent() != decimalBox.getParent())
btn.setParent(decimalBox.getParent());
btn.setPopup(popup); btn.setPopup(popup);
}
else else
{ {
Popup p = null; Popup p = null;
btn.setPopup(p); btn.setPopup(p);
if (btn.getParent() != null)
btn.detach();
}
if (enabled) {
LayoutUtils.removeSclass("editor-input-disd", decimalBox);
} else {
LayoutUtils.addSclass("editor-input-disd", decimalBox);
} }
} }
@ -437,12 +449,10 @@ public class NumberBox extends Div
public void setTableEditorMode(boolean flag) { public void setTableEditorMode(boolean flag) {
if (flag) { if (flag) {
decimalBox.setHflex("0");
setHflex("0"); setHflex("0");
LayoutUtils.addSclass("grid-editor-input", decimalBox); LayoutUtils.addSclass("grid-editor-input", decimalBox);
LayoutUtils.addSclass("grid-editor-button", btn); LayoutUtils.addSclass("grid-editor-button", btn);
} else { } else {
decimalBox.setHflex("1");
setHflex("1"); setHflex("1");
LayoutUtils.removeSclass("grid-editor-input", decimalBox); LayoutUtils.removeSclass("grid-editor-input", decimalBox);
LayoutUtils.removeSclass("grid-editor-button", btn); LayoutUtils.removeSclass("grid-editor-button", btn);

View File

@ -319,6 +319,7 @@ ContextMenuListener, IZoomableEditor
@Override @Override
public void setReadWrite(boolean readWrite) { public void setReadWrite(boolean readWrite) {
getComponent().setEnabled(readWrite); getComponent().setEnabled(readWrite);
getComponent().setButtonVisible(readWrite);
} }
private void refreshList() private void refreshList()

View File

@ -988,19 +988,26 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
background-color: transparent; background-color: transparent;
position: relative;
} }
.editor-box .z-textbox { .editor-input {
box-sizing: border-box;
-moz-box-sizing: border-box; /* Firefox */
display: inline-block; display: inline-block;
border-right-color: transparent; padding-right: 22px;
border-top-right-radius: 0px; width: 100%;
border-bottom-right-radius: 0px; height: 21px;
} }
.editor-box .z-textbox:focus { .editor-input:focus {
border: 1px solid #0000ff; border: 1px solid #0000ff;
} }
.editor-input-disd {
padding-right: 0px !important;
}
.editor-button { .editor-button {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
@ -1008,11 +1015,11 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer {
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
width: 19px; width: 19px;
height: 20px; height: 18px;
border: 1px solid #e6e6e6; border: none;
border-top-color: #b2b2b2; position: absolute;
border-left-width: 0px; right: 2px;
border-radius: 0 2px 2px 0; top: 1px;
} }
.editor-button :hover { .editor-button :hover {
@ -1024,12 +1031,11 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer {
text-align: left; text-align: left;
width: 16px; width: 16px;
height: 16px; height: 16px;
padding: 2px 1px; padding: 1px 1px;
} }
.editor-box .grid-editor-input.z-textbox { .editor-box .grid-editor-input.z-textbox {
width: 90%;
} }
.grid-editor-button { .grid-editor-button {
@ -1043,19 +1049,7 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer {
white-space:nowrap; white-space:nowrap;
} }
.number-box .z-decimalbox {
display: inline-block;
border-right-color: transparent;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
.number-box .grid-editor-input.z-decimalbox { .number-box .grid-editor-input.z-decimalbox {
width: 80%;
}
.number-box .z-decimalbox:focus {
border: 1px solid #0000ff;
} }
.datetime-box { .datetime-box {
@ -1325,11 +1319,27 @@ tbody.z-grid-empty-body td {
} }
i.grid-combobox-editor { i.grid-combobox-editor {
width: 96% !important; width: 99% !important;
position: relative;
} }
.grid-combobox-editor input { .grid-combobox-editor input {
width: 85% !important; width: 100% !important;
padding-right: 22px;
box-sizing: border-box;
-moz-box-sizing: border-box; /* Firefox */
height: 21px;
}
.grid-combobox-editor .z-combobox-btn {
position: absolute;
right: 0px;
top: 0px;
border-radius: 0px 0px;
}
.grid-combobox-editor.z-combobox-focus .z-combobox-btn {
border-left: 1px solid #0000ff;
} }
.embedded-dialog { .embedded-dialog {