Hi,
I'm building my first small qooxdoo application and one of the tasks is to 
build a layer where images can be scaled. When images are scaled bigger than 
the layer they have to be scrolled. Inside this layer I'd like to scroll via 
drag&drop and not only via scrollbars. I've already found the Class: 
DragDropScrolling but don't know how to apply it to my Objects (and to which: 
qx.ui.container.Scroll, or the inside elements?).
Here some of the code so far:

  var main_container = new qx.ui.container.Composite();
  var container = new qx.ui.container.Composite();

  var layout_manager = new qx.ui.layout.Canvas();
  var layout_manager2 = new qx.ui.layout.Canvas();
  main_container.setLayout(layout_manager);
  this.getRoot().add(main_container);

// how do I set an element to be drag&drop scrollable?
  var ddscroll = new qx.ui.core.DragDropScrolling();
  var scroll = new qx.ui.container.Scroll().set({
    width: 930,
    height: 610
  });
  scroll.set({
    backgroundColor: "black",
    //decorator: border,
    decorator: "main"
  });

  main_container.add(scroll);
  container.setLayout(layout_manager2);

  scroll.add(container);

  var big = new qx.ui.basic.Image("resource/imagetest/Image_249.jpg").set({
    width : 910,
    height : 545
  });
  big.setScale(true);
  container.add(big,{
  left: 10,
      top: 60
});

  var button = new qx.ui.form.RepeatButton(null, 
"resource/imagetest/list-add.png");
  main_container.add(button,{
    left: 60,
    top: 620
  });

  // Listener
  button.addListener("execute", function()
  {
    big.setWidth(big.getHeight()*2);
    big.setHeight(big.getWidth()*2);
  });

  var button2 = new qx.ui.form.RepeatButton(null, 
"resource/imagetest/list-remove.png");
  main_container.add(button2,{
    left: 10,
    top: 620
  });

  // Listener
  button2.addListener("execute", function()
  {
    big.setWidth(big.getHeight()/2);
    big.setHeight(big.getWidth()/2);
  });

}


Thanks in advance!

Sebastian Stelmasik



------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to