Results 1 to 7 of 7

Thread: [CLOSED] Resizable + padding + issue

  1. #1
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default [CLOSED] Resizable + padding + issue

    if you set the setStyleAttribute("padding", "50px"); to ContentPanel you can see that cursor mouse, have 50px longer than ContentPanel.

    Version. 1.1.4

    Code:
    package example;
    
    import com.extjs.gxt.ui.client.fx.Resizable;
    import com.extjs.gxt.ui.client.widget.ContentPanel;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.Button;
    import com.google.gwt.user.client.ui.ClickListener;
    import com.google.gwt.user.client.ui.DialogBox;
    import com.google.gwt.user.client.ui.Image;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.VerticalPanel;
    import com.google.gwt.user.client.ui.Widget;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class App implements EntryPoint {
    
    	/**
    	 * This is the entry point method.
    	 */
    	public void onModuleLoad() {
    		Image img = new Image("http://code.google.com/webtoolkit/logo-185x175.png");
    		Button button = new Button("Click me");
    
    		// We can add style names
    		button.addStyleName("pc-template-btn");
    		// or we can set an id on a specific element for styling
    		img.getElement().setId("pc-template-img");
    
    		ContentPanel vPanel = new ContentPanel();
    		vPanel.add(img);
    		vPanel.add(button);
    		vPanel.setStyleAttribute("padding", "50px");
    
    		new Resizable(vPanel);
    
    		// Add image and button to the RootPanel
    		RootPanel.get().add(vPanel);
    
    		// Create the dialog box
    		final DialogBox dialogBox = new DialogBox();
    		dialogBox.setText("Welcome to GWT!");
    		dialogBox.setAnimationEnabled(true);
    		Button closeButton = new Button("close");
    		VerticalPanel dialogVPanel = new VerticalPanel();
    		dialogVPanel.setWidth("100%");
    		dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    		dialogVPanel.add(closeButton);
    
    		closeButton.addClickListener(new ClickListener() {
    			public void onClick(Widget sender) {
    				dialogBox.hide();
    			}
    		});
    
    		// Set the contents of the Widget
    		dialogBox.setWidget(dialogVPanel);
    
    		button.addClickListener(new ClickListener() {
    			public void onClick(Widget sender) {
    				dialogBox.center();
    				dialogBox.show();
    			}
    		});
    	}
    }

  2. #2

    Default Still occurs in [1.2.2]

    package test.client;


    import com.extjs.gxt.ui.client.fx.Resizable;
    import com.extjs.gxt.ui.client.widget.ContentPanel;
    import com.extjs.gxt.ui.client.widget.Viewport;
    import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;

    public class test implements EntryPoint {

    public void onModuleLoad() {
    Viewport viewport = new Viewport();
    viewport.setLayout(new FlowLayout());

    ContentPanel cp = new ContentPanel();
    cp.setSize(400, 400);
    //Note: Resize handle will be 50px off of visible boarder
    cp.setStyleAttribute("padding", "50px");
    new Resizable(cp);
    viewport.add(cp);
    RootPanel.get().add(viewport);
    }

    }

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    It works as intended.

  4. #4
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default

    you can explain with more detail what meanings "It works as intended."

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    It works as it should work. You are moving the resizehandles with your added padding.

  6. #6
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default

    I need set the padding.. have one different way to do this?

  7. #7
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default

    Its easy

    tabItem.setStyleAttribute("padding", "0px 10px 10px 10px");
    contentPanel.setStyleAttribute("paddingTop", "10px");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •