Hello, it's bee awhile since I wrote any Qooxdoo code (about 4 years).
Now that Qooxdoo is past 1.0, I decide to try it again. I have a block
of old code that I'm trying to convert to Qooxdoo-1.3.
Here's the code in question: (From a working Qooxdoo-0.7 App)
qx.Class.define("mapmedley.MapView",
{
extend : qx.ui.layout.VerticalBoxLayout,
...
members :
{
/**
* TODOC
*
* @type member
* @return {void}
*/
_createMapPane : function()
{
this._anchor = new qx.ui.layout.CanvasLayout;
this._anchor.setWidth(0);
this._anchor.setHeight(0);
this._anchor.setPadding(0, 0);
this._anchor.setBorder("inset-thin");
this._anchor.setOverflow("hidden");
this._anchor.setParent(this);
this._mapField = new qx.ui.basic.Image;
this._mapField.setWidth(this._anchor.getWidth());
this._mapField.setHeight(this._anchor.getHeight());
this._mapField.setMargin(0);
this._mapField.setParent(this._anchor);
this.setImage(this._mapField);
this._mapField.addEventListener("mousedown",
this._mapFieldMouseDown, this);
this._mapField.addEventListener("mouseup", this._mapFieldMouseUp, this);
this._mapField.addEventListener("mousemove",
this._mapFieldMouseMove, this);
this._drawField = new mapmedley.VectorGraphics;
this._drawField.setWidth(this._anchor.getWidth());
this._drawField.setHeight(this._anchor.getHeight());
this._drawField.setCursor("crosshair");
this._drawField.setParent(this._anchor);
this.setGraphics(this._drawField);
this._drawField.addEventListener("mousedown",
this._drawFieldMouseDown, this);
this._drawField.addEventListener("mouseup", this._drawFieldMouseUp, this);
this._drawField.addEventListener("mousemove",
this._drawFieldMouseMove, this);
},
...
What this code does is create a dynamic background image of a map, and
then create an overlay that draws a marque-box for zooming in. I used
the _anchor as the parent of the two Fields. The new version of
Qooxdoo is confusing when it comes to this...
Here is the new code that doesn't work right: (For Qooxdoo-1.3)
qx.Class.define("mmclient.MapView",
{
extend : qx.ui.container.Composite,
...
members :
{
/**
* TODOC
*
* @type member
* @return {void}
*/
_createMapPane : function()
{
this.getMapObj().setWidth(640); //TEMP for now
this.getMapObj().setHeight(480); // (Needs values greater than 0
to work) don't ask, I'm not done with this yet.
this._mapField = new qx.ui.basic.Image;
this.setImage(this._mapField);
this.add(this.getImage());
this._mapField.setSource("mmclient/test.png"); // Temp image
until I get the RPC-server code written.
//this._mapField.addEventListener("mousedown",
this._mapFieldMouseDown, this);
//this._mapField.addEventListener("mouseup", this._mapFieldMouseUp, this);
//this._mapField.addEventListener("mousemove",
this._mapFieldMouseMove, this);
//this._drawField = new mmclient.VectorGraphics;
//this._drawField.setWidth(this._anchor.getWidth());
//this._drawField.setHeight(this._anchor.getHeight());
//this._drawField.setCursor("crosshair");
//this._drawField.setParent(this._anchor);
//this.setGraphics(this._drawField);
//this._drawField.addEventListener("mousedown",
this._drawFieldMouseDown, this);
//this._drawField.addEventListener("mouseup",
this._drawFieldMouseUp, this);
//this._drawField.addEventListener("mousemove",
this._drawFieldMouseMove, this);
},
...
I'm wondering how I position both the _mapField image and the
_drawField to the same location... Also, when I add the image to the
layout the vertical-separator won't resize because the image-size is
blocking it.
I hope someone can make some sense of what I'm trying to describe.
I'll try to draw an ASCII-art picture to try to clarify.
------------------------------------------------------------------------
| | |
| Controls | The MapView control. | <= The
MapView control is what I described above.
| go here | Image goes here. |
| | |
| | <=Drag this to resize... However, | <= The
resizable vertical-separator is another issue.
| | This cannot be resized due to |
| | the image size taking up this |
| | entire area. |
| | |
| | When the user resizes this, the |
| | image is supposed to shrink |
| | based on the size of this frame. |
| | |
| |<=This won't drag to the right |
| | like it's supposed to. |
------------------------------------------------------------------------
I hope the picture helps. I'm stuck and need some direction. Thank you.
~Brant
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel