Hi , I have a window that I want to surround it with some empty space, so I thought of margin but any time I set that I get the background to white (the margin background)
Any idea ?
Hi , I have a window that I want to surround it with some empty space, so I thought of margin but any time I set that I get the background to white (the margin background)
Any idea ?
You need to clarify what you want. What color / appearance should this region have? Is it part of the Window (ie moves with the Window, should fire event on the window if clicked) or part of it’s container?
.. but not anything else. Please re-read what you were asked.
Let me try it one more time.
When you don’t set the Margin, the window is rendered correctly and the border’s background is transparent (you can see the round corners). but if you set it for example to 10pix you see as the attachment shown that the window is placed on white background box and you loos the transparent on the edges.
Any ideas ?
Please post a standalone testcase with an onModuleLoad() that reproduces the issue.
Thanks,
Sanjiv
I hope this will be better example, just notice that the margin space is being filled with “white” and I want it to be transparent.
I really appreciate your help and this great project.
package com.white.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.layout.Layout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class White implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
Layout l=new VLayout();
l.setBackgroundColor("blue");
Window w=new Window();
w.setWidth(300);
w.setHeight(300);
w.setMargin(30);
l.addMember(w);
l.draw();
}
}
What your seeing is the background color of an element behind the Window. Hence the question about whether this space is something you consider to be part of the Window or not, and what color it should be. You never answered that question, but elsewhere you posted above having a Window be immobile, so we’ll assume it doesn’t really matter - just put the Window inside of a Layout that has layoutMargin:30 set, and put whatever backgroundColor you want on the Layout.
As you can see from the example , the layer underneath it is blue, yet I’m getting a white color and I couldn’t find anyway to change that color.
"What your seeing is the background color of an element behind the Window. "
Once again this is not the layer behind the Window, the color is blue not white.
one more thing, the element behind the Window going to have an image background, as I said before if the margin is not set, the window render correctly but if I set the margin, the margin’s area is filled with white and what I need for the margin area is to be transparent.
You have external CSS doing this. If Windows had white around them, rounded transparent edges wouldn’t work, but they obviously do (see any Window sample).
Regardless, again the most appropriate solution is to put the Window into a container (see above).
ok , I got way better example. I also found that that the problem only in the Window element, the problem goes away if you use VLayout.
package com.white.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.Layout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class White implements EntryPoint {
public void onModuleLoad() {
Layout l=new HLayout();
l.setBackgroundColor("blue");
Layout l1=new VLayout();
l1.setShowEdges(true);
l1.setWidth(300);
l1.setHeight(300);
l1.setMargin(30);
l.addMember(l1);
Layout l2=new Window();
l2.setShowEdges(true);
l2.setWidth(300);
l2.setHeight(300);
l2.setMargin(30);
l.addMember(l2);
l.draw();
}
}
One more time: get rid of any CSS that is not coming from SmartClient. This includes the default CSS that comes with GWT - see the sticky threads on installation procedures for various IDEs.