Comments (9)
Here is some testing code that shows the problem:
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton(p, "top left"));
t.setWidget(0,1,createLocationButton(p, "top right"));
t.setWidget(1,0,createLocationButton(p, "bottom left"));
t.setWidget(1,1,createLocationButton(p, "bottom right"));
}
private Button createLocationButton(ScrollPanel p, String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
}
Reported by gwt.team.ecc
on 2006-09-21 11:33:20
from gwt.
Reported by gwt.team.bruce
on 2006-09-21 20:10:15
- Labels added: Priority-High, Milestone-1_2_RC
- Labels removed: Priority-Medium
from gwt.
Below is a more complete test. Fails for Opera.
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
root.add(new Label("check scroll offset"));
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton(p, "top left"));
t.setWidget(0,1,createLocationButton(p, "top right"));
t.setWidget(1,0,createLocationButton(p, "bottom left"));
t.setWidget(1,1,createLocationButton(p, "bottom right"));
root.add(new Label("Check border offset"));
final FlowPanel flowPanel = new FlowPanel();
root.add(flowPanel);
flowPanel.setStyleName("my-BigBorder");
flowPanel.setSize("409px", "195px");
{
final Button button = new Button();
flowPanel.add(button);
button.addClickListener(new ClickListener() {
public void onClick(Widget e) {
Window.alert("flowPanel location: " + flowPanel.getAbsoluteLeft() + ", "
+ flowPanel.getAbsoluteTop() + "\nbutton location: " +
button.getAbsoluteLeft() + ", "
+ button.getAbsoluteTop());
}
});
button.setText("getLocation");
}
}
private Button createLocationButton(ScrollPanel p, String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
Reported by gwt.team.ecc
on 2006-09-25 12:04:30
from gwt.
#added absolutely possitions button to example above
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
root.add(new Label("______Scroll offset"));
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton("top left"));
t.setWidget(0,1,createLocationButton("top right"));
t.setWidget(1,0,createLocationButton("bottom left"));
t.setWidget(1,1,createLocationButton("bottom right"));
root.add(new Label("Check border offset"));
final FlowPanel flowPanel = new FlowPanel();
root.add(flowPanel);
flowPanel.setStyleName("my-BigBorder");
flowPanel.setSize("409px", "195px");
{
final Button button = new Button();
flowPanel.add(button);
button.addClickListener(new ClickListener() {
public void onClick(Widget e) {
Window.alert("flowPanel location: " + flowPanel.getAbsoluteLeft() + ", "
+ flowPanel.getAbsoluteTop() + "\nbutton location: " +
button.getAbsoluteLeft() + ", "
+ button.getAbsoluteTop());
}
});
button.setText("getLocation");
}
Button absolute= createLocationButton("absolute");
root.add(absolute, 10,10);
}
private Button createLocationButton(String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
Reported by gwt.team.ecc
on 2006-09-26 11:55:05
from gwt.
Fixed on Mozilla by manually crawling through parents and looking for scroll panels.
Reported by gwt.team.ecc
on 2006-09-26 18:33:10
- Status changed:
FixedNotReleased
from gwt.
Related discussion:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c908d345afb514f1/
Reported by gwt.team.vli
on 2006-09-27 17:15:01
from gwt.
Reported by gwt.team.jgw
on 2006-10-31 16:59:58
- Status changed:
Fixed
from gwt.
Reported by [email protected]
on 2008-05-02 02:32:22
from gwt.
Reported by [email protected]
on 2011-02-09 00:10:59
- Labels added: Milestone-1_2-RC
- Labels removed: Milestone-1_2_RC
from gwt.
Related Issues (20)
- RequestFactory tests fails under java 21 due to changes in the List API
- GWT release with Jetty 11.x HOT 2
- Remove general usage of Window `unload` event
- Explore options to update `long` emulation
- Enum and Enum[] can't be received on Java 21
- Properties defined with JsProperty are not enumerable, do not work with spread operator HOT 1
- java.io.Reader.read(char[] buf/char[] buf, int off, int len) must throw IOException
- GWT compile errors when trying to build with GWT 2.10 or 2.11 HOT 14
- Finish removing deprecated SynchronousFragmentLoadCallback
- Explore eagerly initializing selected classes HOT 2
- GWT 2.12 deprecations/removals HOT 1
- Can't set UNNECESSARY roundingMode HOT 3
- Error on compile Java 8 - GWT 2.11 HOT 3
- Optimize out casts that must succeed
- Compile error - GWT Google Web Toolkit (2.10.0, 2.10.1, 2.11.0) on java17. HOT 13
- SerializableThrowable does not handle suppressed exceptions
- StackTraceDeobfuscator sometimes produces total nonsense HOT 5
- Regression in jsinterop varargs causing internal compiler error HOT 3
- Tutorial: webAppCreator deprecated but necessary for tutorials HOT 2
- Need a method to run DevMode on systems without GUI support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwt.