I remeber posting this patch a while ago.  here's what I have in the afroapi:

DragEvent.setHandle=function(dlyr) {
    var a=arguments;
    switch(a.length) {
        case 1 : dlyr.dragHandle=dlyr; break;
        case 2 : dlyr.dragHandle=a[1]; break;
        case 5 : dlyr.dragHandle=[a[1],a[2],a[3],a[4]];
    };
    return;
};

DragEvent.lyrListener. {
    var lyr=e.getSource();
    if (lyr.dragHandle) {
        var dH=lyr.dragHandle;
        if (typeof(dH)=="object")
            var b=dH.getY()+dH.getHeight(),
                r=dH.getX()+dH.getWidth(),
                l=dH.getX(), t=dH.getY();
        else var b=dH[2],r=dH[1],l=dH[3],t=dH[0];
        if (e.x<l || e.x>r || e.y<t || e.y>b) {
            lyr.invokeEvent('mouseup');
            return;
        };
    };
.....

if you have any questions, email me and I'll try go into more detail.

btw.  i've attached the code I use to creat windozish frames.  it is not dynapi compatible but I can give you a hand if you want to convert it.

Øyvind Bollingmo wrote:

I have some layers that I want to drag around on the screen. But I want a
'windows look and feel', I should only be able to drag the layer if the
mousebutton is clicked in the top area of the layer (I have made the layer
look like Windows Explorer).

Is this possible?

[EMAIL PROTECTED]

_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010
 

widgets.zip

Reply via email to