Created
September 25, 2018 17:13
-
-
Save branflake2267/31176d05153301bead2c7469e1aaa5bd to your computer and use it in GitHub Desktop.
HorizontalLayoutContainer layout width testing with a FieldLabel in GXT 4.0.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.gwt.core.client.EntryPoint; | |
| import com.google.gwt.user.client.ui.RootPanel; | |
| import com.sencha.gxt.core.client.util.Margins; | |
| import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; | |
| import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData; | |
| import com.sencha.gxt.widget.core.client.form.FieldLabel; | |
| import com.sencha.gxt.widget.core.client.form.FieldSet; | |
| import com.sencha.gxt.widget.core.client.form.FormPanel.LabelAlign; | |
| import com.sencha.gxt.widget.core.client.form.TextField; | |
| public class HlcHtmlWidthIssue implements EntryPoint { | |
| @Override | |
| public void onModuleLoad() { | |
| FieldLabel field1 = new FieldLabel(new TextField(), "label label label"); | |
| field1.setLabelAlign(LabelAlign.TOP); | |
| FieldLabel field2 = new FieldLabel(new TextField(), "label label label"); | |
| field2.setLabelAlign(LabelAlign.TOP); | |
| FieldLabel field3 = new FieldLabel(new TextField(), "label label label"); | |
| field3.setLabelAlign(LabelAlign.TOP); | |
| HorizontalLayoutContainer hlc = new HorizontalLayoutContainer(); | |
| hlc.add(field1, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide | |
| hlc.add(field2, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide | |
| hlc.add(field3, new HorizontalLayoutData(190, -1, new Margins(0, 10, 0, 10))); // 190 - (padding 20) = 170 px wide | |
| FieldSet fieldset = new FieldSet(); | |
| fieldset.add(hlc); | |
| fieldset.setPixelSize(800, 300); // 3*190=570 | |
| RootPanel.get().add(fieldset); | |
| } | |
| } |
Author
branflake2267
commented
Sep 25, 2018

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment