Add an Infobar style warning for window resize/move

From CDOT Wiki
Revision as of 18:24, 5 October 2008 by Twlai1 (talk | contribs)
Jump to: navigation, search

Project Details

10/05/2008 -

  • nsEventDispatcher's nsEventDispatcher::DispatchDOMEvent() function needs to recognize our event, DOMWindowResized.
  • A similar idl file to define a DOMWindowResized event /dom/public/idl/events/nsIDOMPopupBlockedEvent.idl

10/01/2008 -

Okay, I believe here are the steps i need to do before I start coding an observer. One: I need to code a function to send an event call from C++ from | nsGlobalWindow much like the link shows.
This event will probably be named something like "DOMWindowResized".
In other words the following function is required:

FireBlockedWindowResize();

Similar to the pop-up blocked, it will fire an event which will be caught by the window object. In order to hook that event up though, I will need this line:

gBrowser.addEventListener("DOMWindowResized", gResizedWindowObserver.onWindowResized, false);

Then code gResizedWindowObserver to contain onWindowResized() which will initiate a notification window, along with all its required texts and menu options.

Now I need to know how to get the menu items to run a function to open preferences. But for release 0.1, I think the above should suffice.

09/28/2008 -

  • Correction to below... browser.xul is the user interface. It runs functions found in the browser.js file, which then grabs strings from the bundle_browser object in order to display the lines of text.

09/24/2008 -

  • I've found the place where infobar text is displayed, and how it is displayed.
    The text can actually be found in a file "\src\browser\base\content\browser.xul". This is what I will use to define a new set of text for a resize event.

    In the meantime I am still looking for a way to cause the resize event to display an infobar
  • bundle_browser is accessible within the browser object. It contains all the strings from browser.properties.
  • by utilizing bundle_browser.GetString("NameofString") you can retrieve the string stored
  • inside browser.properties, a %S signifies the browser name.

09/22/2008 -

  • It is possible to trigger the event simply by writing code that resizes the window (using SetPositionAndSize I believe?)

09/21/2008 -

  • Found two files which might have something to do with this:

dom\src\base\nsGlobalWindow.cpp
dom\src\base\nsGlobalWindow.h

I don't know how useful these files are yet.

  • \widget\public\nsGUIEvent.h contains details on the windows_resize event
  • The name of the event dealt with is called: nsSizeEvent, a class inherited from nsGUIEvent. A base event.