PDA

View Full Version : Incorrect button position in window when padding added to body



vitalidze
5 Sep 2015, 12:25 AM
Hi

I am trying to run 'Simple dialog' example on my side. I have created a project from public archetype by following instructions from here http://docs.sencha.com/gxt/3.x/getting_started/maven/Archetypes.html

Then I have copied and pasted example code from https://www.sencha.com/examples/#ExamplePlace:dialog that creates a 'simple' dialog. Now my SandboxyEntryPoint class looks like:


package com.sencha.examples.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.GXT;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.box.MessageBox;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class SandboxyEntryPoint implements EntryPoint {

final String TEXT = "Lorem Ipsum is simply dummy text of the printing" +
" and typesetting industry. Lorem Ipsum has been the industry's" +
" standard dummy text ever since the 1500s.";

@Override
public void onModuleLoad() {
String version = GXT.getVersion().getRelease();
TextButton textButton = new TextButton("Verify GXT Works: Version=" + version);
RootPanel.get().add(textButton);
textButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
final Dialog simple = new Dialog();
simple.setHeadingText("Dialog Test");
simple.setPredefinedButtons(Dialog.PredefinedButton.YES, Dialog.PredefinedButton.NO);
simple.setBodyStyleName("pad-text");
simple.add(new Label(TEXT));
simple.getBody().addClassName("pad-text");
simple.setHideOnButtonClick(true);
simple.setWidth(300);
simple.show();
// MessageBox messageBox = new MessageBox("GXT Works.");
// messageBox.show();
}
});
}

}

Then I went to the 'Sandboxy.css' and added the following css-class:


.pad-text {
padding: 5px;
font-size: 12px;
}

The main issue that I experience here is that control buttons at the bottom are placed incorrectly with a gap at the right:

53192

While in examples everything seems to be correct:

53193

I have tried both GWT 2.6.1 and 2.7.0 with same result. Please point me what am I doing wrong?