Sorry I can't be of any more assistance,
Jim
On 9/5/06, Mike Crowe <[EMAIL PROTECTED]> wrote:
Thanks, Jim. That clears up a lot. However, I still have problems
with building a menu in a toolbar in AtaGlance.js. Here's a snippet:
var menuFileMenu = new qx.ui.menu.Menu;
doc.add(menuFileMenu);
var menuFileLogin = new qx.ui.menu.MenuButton("Log in as Another
User", "/lib/qooxdoo/resource/icon/crystalsvg/16/reload.png");
var menuFileExit = new qx.ui.menu.MenuButton("Exit",
"/lib/qooxdoo/resource/icon/crystalsvg/16/stop.png");
menuFileMenu.add( menuFileLogin, menuFileExit );
var menuFile = new qx.ui.toolbar.ToolBarMenuButton("File", menuFileMenu);
toolBar.add(menuFile);
main.add(toolBar);
Here's what's strange. The " doc.add(menuFileMenu);" is *required*.
If I remove, menu doesn't work. If I add the menu to main (a
VerticalBoxLayout), the toolbar skips down the screen.
Any thoughts of why I have to add to Documents?
TIA
Mike
On 9/5/06, Jim Hunter <[EMAIL PROTECTED]> wrote:
> Take a step back from your code and look at it closely. If you have never
> programmed before you might not get that you are building an application
> layer by layer. If you create a FlowLayout to hold a menu, then you have to
> add the menu to the FlowLayout not the main document. Generally, not many
> things get added to the main document, most things get added to a layer (or
> more) that you place on the main document, in your case its "flow". And when
> you create menu buttons, they need to be added to a toolbar then add the
> toolbar to the HorizontalBoxLayout (use Horizontal for menus that go from
> left to right).
> Think of the whole process like building a card house and the table is your
> clientDocument.
>
> So take things one step at a time to create your house of cards. I suggest
> that while you are still learning the toolkit, create things one layer at a
> time. And a trick I do is that I give things distinct colors at first so
> that I know they are created and that they are in the correct place. So
> create the FlowLayout first and place it on the clientDocument, make sure
> that it is where you want it. Then create a HorizontalBoxLayout to hold the
> menu and place it on the FlowLayout. It may be hard to know if this is where
> you want it unless you temporarily give it a height and width and color.
> Then create your ToolBar and place it on the HorizontalBoxLayout. Again, you
> may need to give it a width and height to make sure it is where you want it.
> Create on button and place it on the ToolBar. Do the same for your other
> buttons. If you follow this type of construction you can create almost
> anything, just do it one step at a time. Once things are on the page you
> can then remove the fixed dimensions to see if everything still shows, and I
> suggest removing the dimensions one level at a time also so you know where
> you are if something stops working.
>
> Hope this helps.
>
> Jim
>
>
> On 9/5/06, Mike Crowe <[EMAIL PROTECTED]> wrote:
> >
> Hi folks,
>
> I really haven't studied this enough, so any pointers would be appreciated.
>
> Looking at the AtAGlance.js file, I'm trying to understand how and
> where to add my objects. For instance, in the "createToolbarDemo
> routine, here's what happens:
>
> Menubar Example:
> Individual MenuButtons added to Menu object
> Menu objects added to Document object
> Toolbar created and (linked?) to Menu objects
> ToolBarMenuButton created and added to Toolbar object
> Toolbar added to VerticalBoxLayout object
>
> That is for the main menu. Now, a separate toolbar is created:
>
> Toolbar Example:
> Toolbar created and added to VerticalBoxLayout object
> (lots of other controls added to Toolbar)
> HorizontalBoxLayout created and added to VerticalBoxLayout
> New VerticalBoxLayout2 created and added to HorizontalBoxLayout
> (lots of controls and more layouts added to these)
>
> Can somebody please give me the 30,000' view of what's going on?
> In Menubar, why do the Menu items need to be added to the Document?
> Where "must" we add the components to insure they are included?
>
> I took Sebastian's advice, and removed all my "with" statements.
> Here's where I am now, and it still doesn't work.
>
> TIA
> Mike
>
> var doc = qx.ui.core.ClientDocument.getInstance();
> var flow = new qx.ui.layout.FlowLayout;
>
> flow.setTop(0);
> flow.setLeft(0);
> flow.setWidth ("100%");
> flow.setHeight("100%");
>
>
> // Create the Main Menu
> var main = new qx.ui.layout.VerticalBoxLayout ;
> main.setPadding(10);
>
> // Create the Toolbar
> var toolBar = new qx.ui.toolbar.ToolBar;
>
>
> // File Menu
> var menuFileLogin = new qx.ui.menu.MenuButton("Log in as
> Another User",
> "/lib/qooxdoo/resource/icon/crystalsvg/16/reload.png");
> var menuFileExit = new qx.ui.menu.MenuButton("Exit",
> "/lib/qooxdoo/resource/icon/crystalsvg/16/stop.png");
>
> var menuFileMenu = new qx.ui.menu.Menu;
> menuFileMenu.add ( menuFileLogin, menuFileExit);
> doc.add(menuFileMenu);
>
> var menuFile = new qx.ui.toolbar.ToolBarMenuButton("File",
> menuFileMenu);
>
> toolBar.add(menuFileMenu);
>
> main.add(toolBar);
>
> doc.add(main);
>
> doc.add(flow);
>
> -------------------------------------------------------------------------
> 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&kid=120709&bid=263057&dat=121642
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> -------------------------------------------------------------------------
> 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&kid=120709&bid=263057&dat=121642
>
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
-------------------------------------------------------------------------
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&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------- 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&kid=120709&bid=263057&dat=121642
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
