July 23rd, 2014

New Menu Implementation

Introduction

Browsers have changed since the first menu implementations of Bindows were created. New restrictions caused various issues for our old menu implementations. For Bindows 4.0, I have been working on a brand new implementation written with these restrictions in mind. As a bonus, we now have nicer themes and we can expand the range of browsers we support. I hope you like what we’ve created.

Reasons for the change

In Bindows 3.0 (and previous versions) we had two different implementations for menus, XUL popups for Firefox and WebFX DHTML Menus 4 for Internet Explorer. These implementations allowed menus to be displayed anywhere on the screen. In Bindows 4.0 we have discarded these implementations and wrote a brand new one. Apart from unifying the two browsers, there are few additional reasons for this.

Security issues

The ability to display a popup anywhere can be used maliciously (e.g. by hiding and impersonating an element of the main browser window). Since these implementations were first created, browser security patches have forbidden popups from being displayed outside the window (or even the frame) where they were created. As a result, Bindows menus that were placed near the bottom edge of the window/frame displayed some strange behavior. We were able to solve several of these issues, but some proved too difficult.

Additional browser support

Bindows 4.0 introduces support for WebKit based browsers (i.e. Safari and Google Chrome). Neither of the menu implementations would work for these browsers, so we would have to add a new implementation anyway. We might as well write one that would work for all browsers, and solve our menu issues at the same time.

API Changes

As a result of the new implementation there has been one major API change. The left and top properties no longer relate to the screen, but to the parent component (which is usually the BiApplicationWindow).

Two new methods have been added: popupAtComponent(oComponent) and popupAtMouse(oMouseEvent). The first sets the component property and displays the menu just below oComponent. The latter uses the mouse coordinates (from oMouseEvent) to display the menu.

Themes

The fact that we have a single implementation for all supported browsers means we also have only one set of CSS styles (for each theme), which applies to all users. When we created our brand new themes for Bindows 4.0, we took this opportunity to revamp the theme properties for menus, making the CSS classes consistent with the rest of Bindows. Your old themes will not be compatible with Bindows 4.0 without some changes. The good news is that we have many compatible themes, free to download at http://www.bindows.net/download/themes/.

2 Responses to 'New Menu Implementation'

  1. 1GreyGoblin
    May 23rd, 2010 at 1:03 pm

    Is there anyone who is still using WebFX DHTML Menus 4 and has found a fix for the submenu positioning problem caused by the recent security patches? The submenus now open within their parent menus. It’s really a pity, because otherwise DHTML Menus 4 work wonderfully in our intranet’s IE-only frame-based environment. No other menu system I’ve looked at works with frames satisfactorily.


  2. 2Ran Meriaz
    May 25th, 2010 at 4:43 am

    Due to changes in the security defaults of IE, sub menus might open inside the parent menu.

    The workaround for this is change the setting of [Tools][Internet Options][Security][Custom] “Allow script-initiated windows without size or
    position constraints” for zone to “enabled”.


Leave a Response

Imhotep theme designed by Chris Lin. Proudly powered by Wordpress.
XHTML | CSS | RSS | Comments RSS