On 4/19/06, Jim Hunter <[EMAIL PROTECTED]> wrote:
> Provide your source code and someone can point you in the right direction.
> It's probably something simple that you are overlooking.
>
> Jim

Here's the source of test.html :

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="de">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
    <title>qooxdoo demo</title>
    <script type="text/javascript" src="../qooxdoo/script/qooxdoo.js"></script>
  </head>
  <body>
        <script type="text/javascript" src="app.js"></script>
  </body>
</html>

And here's the code I put in put in app.js (I just copied the whole
thing from the toolbar1 demo) :

    window.application.main = function()
    {
      var d = this.getClientWindow().getClientDocument();

      var tb = new QxToolBar;
      with(tb)
      {
        setTop(48);
        setLeft(20);
        setRight(335);

        // setWidth("auto");
      };

      var btns1 = [
        { type : "button", icon : "file-new", text : "New" },
        { type : "separator" },
        { type : "button", icon : "edit-copy", text : "Copy" },
        { type : "button", icon : "edit-cut", text : "Cut" },
        { type : "button", icon : "edit-paste", text : "Paste" }
      ];

      var btns2 = [
        { type : "button", icon : "up", text : "Upload" },
        { type : "button", icon : "down", text : "Download" }
      ];

      var btns3 = [
        { type : "button", icon : "help", text : "Help" }
      ];

      var bars = [ btns1, btns2, btns3 ];

      function changeLayout(e) {
        this.setShow(e.getData());
      };

      function changeSize(e) {
        var v = e.getData();
        var o = v == 22 ? 32 : 22;

        this.setIcon(this.getIcon().replace(o, v));
      };

      function buttonExecute() { this.debug("Executed: " + this.getLabel()); };

      var useParts = true;


      for (var j=0; j<bars.length; j++)
      {
        var btns = bars[j];

        if (useParts) {
          var tbp = new QxToolBarPart;
        };

        for (var i=0; i<btns.length; i++)
        {
          var btn = btns[i];

          switch(btn.type)
          {
            case "separator":
              var o = new QxToolBarSeparator;
              break;

            case "button":
              var o = new QxToolBarButton(btn.text,
"../qooxdoo/icons/22/" + btn.icon + ".png");

              // beautiful decoupling: toolbar buttons don't know
about radio boxes

              d.addEventListener("changeLayout", changeLayout, o);
              d.addEventListener("changeSize", changeSize, o);

              o.addEventListener("execute", buttonExecute);
              break;
          };

          if (useParts)
          {
            tbp.add(o);
          }
          else
          {
            tb.add(o);
          };
        };

        if (useParts) {
          tb.add(tbp);
        };
      };

      d.add(tb);






      var rd1 = new QxRadioButton("Show Icons and Label", "both");
      var rd2 = new QxRadioButton("Show Icons", "icon");
      var rd3 = new QxRadioButton("Show Label", "label");

      with(rd1)
      {
        setTop(140);
        setLeft(20);
        setChecked(true);
      };

      with(rd2)
      {
        setTop(160);
        setLeft(20);
      };

      with(rd3)
      {
        setTop(180);
        setLeft(20);
      };


      var rbm = new QxRadioManager();

      rbm.add(rd1);
      rbm.add(rd2);
      rbm.add(rd3);


      // beautiful decoupling: radio boxes don't know about toolbar buttons
      rbm.addEventListener("changeSelected", function(e) {
        d.dispatchEvent( new QxDataEvent("changeLayout",
e.getData().getValue() ) );
      });

      d.add(rd1, rd2, rd3);



      // Alignment
      var ra1 = new QxRadioButton("Left Aligned", "left");
      var ra2 = new QxRadioButton("Centered", "center");
      var ra3 = new QxRadioButton("Right Aligned", "right");

      with(ra1)
      {
        setTop(140);
        setLeft(220);
        setChecked(true);
      };

      with(ra2)
      {
        setTop(160);
        setLeft(220);
      };

      with(ra3)
      {
        setTop(180);
        setLeft(220);
      };


      var ram = new QxRadioManager();

      ram.add(ra1);
      ram.add(ra2);
      ram.add(ra3);

      d.add(ra1, ra2, ra3);

      ram.addEventListener("changeSelected", function(e) {
        tb.setHorizontalChildrenAlign(e.getData().getValue());
      });




      // Icon Sizes
      var b3 = new QxButton("Icons: 22 Pixel",
"../qooxdoo/icons/16/colors.png");

      with(b3)
      {
        setTop(140);
        setLeft(420);
        setHorizontalAlign("center");
      };

      b3.addEventListener("execute", function(e) {
        d.dispatchEvent(new QxDataEvent("changeSize", 22));
      });

      var b4 = new QxButton("Icons: 32 Pixel",
"../qooxdoo/icons/16/colors.png");

      with(b4)
      {
        setTop(170);
        setLeft(420);
        setHorizontalAlign("center");
      };

      b4.addEventListener("execute", function(e) {
        d.dispatchEvent(new QxDataEvent("changeSize", 32));
      });

      d.add(b3, b4);





      // Icon & Color Themes
      QxImageManager.createThemeList(d, 20, 248);
      QxColorManager.createThemeList(d, 220, 248);



      /*
      Test for cloning support

      tb2 = tb.clone(true);
      tb2.setTop(400);
      */
    };

The only thing I changed was to modify the path for icons by prefixing
it with ../qooxdoo/ to be consistent with the structure given in first
steps.  My directory structure looks like this :

test
|
+-qooxdoo
| |
| +-- Everything that's supposed to be under this directory (images,
script, themes)
|
+--pages
    |
    +-- test.html and app.js


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Qooxdoo-devel mailing list
Qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to