Window Manager w/Maximize and Minimize

  • Thread starter Martin Rinehart
  • Start date
M

Martin Rinehart

My proof-of-concept window manager now includes max/minimize and
restores:

http://www.martinrinehart.com/examples/js-wm.html

It's feature-complete except for resizing. It's miniscule. Now to
think carefully about how the application coder can use the window
manager. Design goal: easy as Visual Basic. (Last I looked, "Hello
World!" in VB cost 3MB.)

I need a Firefox guru to tell me how to get this running in Eichland.
(Opera's great, but their market share isn't.)

Meanwhile I'm going to try to generalize the drag code. Dragging a
window around by the title bar has a lot in common with dragging a
side or corner, doesn't it?
 
S

SAM

Le 12/6/08 3:32 PM, Martin Rinehart a écrit :
My proof-of-concept window manager now includes max/minimize and
restores:

http://www.martinrinehart.com/examples/js-wm.html

It's feature-complete except for resizing. It's miniscule. Now to
think carefully about how the application coder can use the window
manager. Design goal: easy as Visual Basic. (Last I looked, "Hello
World!" in VB cost 3MB.)

I need a Firefox guru to tell me how to get this running in Eichland.
(Opera's great, but their market share isn't.)

Meanwhile I'm going to try to generalize the drag code. Dragging a
window around by the title bar has a lot in common with dragging a
side or corner, doesn't it?

Nothing work in my FF.3 (buttons: - [] [x] )
I get 8 what I suppose to be tables displayed, nothing more.

Now, when seeing :
window.event.cancelBubble = true;
in the code, all I can say is that speaks only to IE
(and probably Opera ?)

Have a look to :
<http://www.quirksmode.org/js/events_order.html>

function doSomething(e)
{
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}


See also :
Listeners and "delegation event model" or "listenners delegation"
in particular for your tableManager
tableManager.find_ and so on
(don't need to "find" the table (index, id, etc.), it'll have its own
listener that will permit to do no more have functions as
'clickChooseMe( tableId )' referencing to an individual 'tableId'


You need no z-index, the browser knows by itself how to display objects
over the others. To pass in front a table I think you have just to slide
it at the end of the body : document.body.appendChild(this.table);
<http://cjoint.com/?mgrCAOCZcd>
 
D

David Mark

Le 12/6/08 3:32 PM, Martin Rinehart a écrit :


My proof-of-concept window manager now includes max/minimize and
restores:

It's feature-complete except for resizing. It's miniscule. Now to
think carefully about how the application coder can use the window
manager. Design goal: easy as Visual Basic. (Last I looked, "Hello
World!" in VB cost 3MB.)
I need a Firefox guru to tell me how to get this running in Eichland.
(Opera's great, but their market share isn't.)
Meanwhile I'm going to try to generalize the drag code. Dragging a
window around by the title bar has a lot in common with dragging a
side or corner, doesn't it?

Nothing work in my FF.3 (buttons: - [] [x] )
I get 8 what I suppose to be tables displayed, nothing more.

Now, when seeing :
       window.event.cancelBubble = true;
in the code, all I can say is that speaks only to IE
(and probably Opera ?)

Have a look to :
<http://www.quirksmode.org/js/events_order.html>

function doSomething(e)
{
        if (!e) var e = window.event;

e = e || window.event; // Don't need to declare e
        e.cancelBubble = true;

// Don't augment host objects, especially the event object.
        if (e.stopPropagation) e.stopPropagation();

// Should detect that method with typeof and skip the cancelBubble
addition if present.

[snip]
 
T

Thomas 'PointedEars' Lahn

David said:
SAM said:
[...]
Have a look to :
<http://www.quirksmode.org/js/events_order.html>

function doSomething(e)
{
if (!e) var e = window.event;

e = e || window.event; // Don't need to declare e

if (!e) e = window.event;

And don't forget after that

if (!e) return true;

or something like it.
// Don't augment host objects, especially the event object.

It isn't augmentation in the MSHTML DOM. In order to avoid augmentation of
host objects, try to check if the property exists before assigning to it.

if (typeof e.cancelBubble != "undefined")
{
e.cancelBubble = true;
}
// Should detect that method with typeof and skip the cancelBubble
addition if present.

ACK, the standards-compliant approach should have precedence.


PointedEars
 
D

David Mark

David said:
SAM said:
[...]
Have a look to :
<http://www.quirksmode.org/js/events_order.html>
function doSomething(e)
{
        if (!e) var e = window.event;
e = e || window.event; // Don't need to declare e

  if (!e) e = window.event;
Bah.


And don't forget after that

  if (!e) return true;

I suppose. But how does it help to return true?
or something like it.
return;



It isn't augmentation in the MSHTML DOM.  In order to avoid augmentation of

Right, my point is that other DOM's should skip it. I suppose that
rather than rely on an inference from stopPropagation, it would make
sense to see if cancelBubble is a boolean, but then what to do if it
isn't?

[snip]
 
T

Thomas 'PointedEars' Lahn

David said:
Thomas said:
David said:
SAM wrote:
[...]
Have a look to :
<http://www.quirksmode.org/js/events_order.html>
function doSomething(e)
{
if (!e) var e = window.event;
e = e || window.event; // Don't need to declare e
if (!e) e = window.event;

Bah.

I'm glad you approve.
I suppose. But how does it help to return true?

If the method is used in an intrinsic event handler attribute value or
proprietary event handler property value, and its return value is returned
to the event handler, returning `true' has a better chance not to prevent
the default action for the target element and event.

Since `undefined' is a false-value, it could be considered equivalent to
`false' by the implementation, which one wants to avoid.
Right, my point is that other DOM's should skip it. I suppose that
rather than rely on an inference from stopPropagation, it would make
sense to see if cancelBubble is a boolean, but then what to do if it
isn't?

You should read my posting whole.

That said, there are DOMs that support both features, most notably the Gecko
DOM. However, my tests in Firefox 2.0.x had showed that you must not assign
`true' to `cancelBubble' before you called stopPropagation() or propagation
would not be stopped; there was no such problem if the order was reversed.
This might have been a bug that is fixed now, though.


PointedEars
 
M

Martin Rinehart

SAM said:
You need no z-index, the browser knows by itself how to display objects
over the others. To pass in front a table I think you have just to slide
it at the end of the body : document.body.appendChild(this.table);

This is for application programming. The application running in the
table may be using multiple z-indexes for its own purposes.

Thanks much for those helpful references.
 
M

Martin Rinehart

Mr. Mark and Mr. Lahn:

Very learned discussion. Thank you.

I am still not sure how to pull together the various thoughts into a
bit of best code that will say "OK, this event has been handled, we're
done with it." (My attempt was something I found by Googling. It
doesn't work.)
 
S

SAM

Le 12/7/08 1:37 PM, Martin Rinehart a écrit :
This is for application programming. The application running in the
table may be using multiple z-indexes for its own purposes.

? why ?

If the "application" is html, following the html flux is enough to get
all (or each element) well z-indexed. That is automatically made by the
browser. At worst the DOM does the job (if there is no declared z-index)
and reconstructs the complet z indexing when something happens (new or
moved element in the tree).

.... at least that's what I think.
maybe I'm in error ? (I do not much know IE's particularities)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top