Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Window Manager w/Maximize and Minimize

Reply
Thread Tools

Window Manager w/Maximize and Minimize

 
 
Martin Rinehart
Guest
Posts: n/a
 
      12-06-2008
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?

 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      12-06-2008
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>

--
sm
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      12-06-2008
On Dec 6, 10:43*am, SAM <(E-Mail Removed)>
wrote:
> 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 = 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]
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-06-2008
David Mark wrote:
> 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;

And don't forget after that

if (!e) return true;

or something like it.

>> e.cancelBubble = true;

>
> // 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;
}

>> if (e.stopPropagation) e.stopPropagation();

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


ACK, the standards-compliant approach should have precedence.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      12-06-2008
On Dec 6, 5:52*pm, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
wrote:
> David Mark wrote:
> > 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.

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

>
> >> * * * * e.cancelBubble = true;

>
> > // Don't augment host objects, especially the event object.

>
> 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]
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-07-2008
David Mark wrote:
> Thomas 'PointedEars' Lahn wrote:
>> David Mark wrote:
>>> 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.

>> And don't forget after that
>>
>> if (!e) return true;

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

>> or something like it.

>
> return;


Since `undefined' is a false-value, it could be considered equivalent to
`false' by the implementation, which one wants to avoid.

>>>> e.cancelBubble = true;
>>> // Don't augment host objects, especially the event object.

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


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
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
 
Reply With Quote
 
Martin Rinehart
Guest
Posts: n/a
 
      12-07-2008
SAM wrote:

> 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.
 
Reply With Quote
 
Martin Rinehart
Guest
Posts: n/a
 
      12-07-2008
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.)
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-07-2008
Martin Rinehart wrote:
> 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."


Why would you need to do that in the first place?

> (My attempt was something I found by Googling.


<http://catb.org/~esr/faqs/smart-questions.html#examples>

> It doesn't work.)


<http://www.jibbering.com/faq/faq_notes/clj_posts.html#ps1DontWork>


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
SAM
Guest
Posts: n/a
 
      12-07-2008
Le 12/7/08 1:37 PM, Martin Rinehart a écrit :
> SAM wrote:
>
>> 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.


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

--
sm
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
an IE window with no minimize and close buttons =?Utf-8?B?TGluZGE=?= ASP .Net 4 10-05-2006 08:11 PM
in wxPython, how to minimize the window in absence of minimize button? Erik Bethke Python 1 02-08-2005 03:35 PM



Advertisments