Hi all,

 

I am inserting below a small piece of code that shows that a menu will not recalculate its width if an item has been added to it since the last time it popped up.

It looks like the width of a menu is only calculated before the first time it shows (I’m using QooXdoo 0.5.2 with Firefox on a Windows XP Pro SP2 machine)

 

Try the code below two ways :

 

  1. Click on the “File” menu to show it
  2. Click on the “Add long-text item” button
  3. Click on the “File” menu again : the width oh the menu has not been recalculated

 

OR

 

  1. Click on the “Add long-text item” button
  2. Click on the “File” menu : the width of the menu is correct

 

 

Thanks,

Laurent.

 

 

Here goes the code…

 

 

window.application.main = function()

{

            // Main container

            var mainContainer = new QxBoxLayout();

            mainContainer.setOrientation(QxConst.ORIENTATION_VERTICAL);

            mainContainer.setWidth('100%');

            mainContainer.setHeight('auto');

            mainContainer.setSpacing(20);

            window.application.add(mainContainer);

           

            // Menu bar

            var menuBar = new QxMenuBar();

            menuBar.setWidth("100%");

            menuBar.setHeight("auto");

           

            // "File" menu

            var menuFile = new QxMenu();

            window.application.add(menuFile);

           

            // "About..." item

            var menuFileAbout = new QxMenuButton();

            menuFileAbout.setLabel('About...');

            menuFile.add(menuFileAbout);

           

            // Separator

            var separator = new QxMenuSeparator();

            menuFile.add(separator);

           

            // "Quit" item

            var menuFileQuit = new QxMenuButton();

            menuFileQuit.setLabel('Quit');

            menuFile.add(menuFileQuit);

           

            // Menu bar button

            var menuButton =new QxMenuBarButton();

            menuButton.setLabel('File');

            menuButton.setMenu(menuFile);

            menuBar.add(menuButton);

           

            // Insert menu bar in DOM

            mainContainer.add(menuBar);

           

            // "Add Item" button

            var addItemButton = new QxButton('Add long-text item');

            addItemButton.addEventListener('execute', function(){

                        var longMenuItem = new QxMenuButton();

                        longMenuItem.setLabel('Menu width will not adapt to this item\'s width if menu has already shown');

                        menuFile.add(longMenuItem);

            });

            mainContainer.add(addItemButton);

}

 

 

 

Laurent Donstetter - SI-Factory

Téléphone : 06.70.68.37.63

Email : [EMAIL PROTECTED]

Skype : ldonstetter

 

 

**************************************************************************

Ce message et toutes les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires.

Toute utilisation ou diffusion non autorisée est interdite.

Tout message électronique est susceptible d'altération.

Nous déclinons toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié.

Ce message et ses pièces jointes ne contiennent, a priori, pas de virus.

Il est de votre responsabilité de vous en assurer avant de les ouvrir.

------------------------------------------------------------------------------------------

This message and all attachments are confidential and intended solely for the recipients.

Any unauthorized use or dissemination is prohibited.

E-mail is susceptible to tampering.

We decline all responsability for the message if tampered, changed or falsified.

We believe, but do not warrant, that this message and all attachments are virus free.

You should take full responsability for virus checking.

 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006

-------------------------------------------------------------------------
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

Reply via email to