Display Borderless no good work

Report any Hollywood bugs here
Post Reply
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Display Borderless no good work

Post by sinisrus »

Hello

I have problem with my script if i use Display with border => good work
if i use Display with borderless => No good work

(Just change the variable NoBorderWindow=1 ou 0 and run for see my problem)

Code: Select all

/* Nouveau projet Hollywood */

W=100
H=100

@DISPLAY 1,{X=100, Y=200, width=100, height=100,hidden=true}

/************************************************************************************************************/

NoBorderWindow=1

Disp2=CreateDisplay(Nil,{X=100, Y=200, Width = 100, Height = 100, borderless=NoBorderWindow})
SelectDisplay(Disp2)
OpenDisplay(Disp2)

    CreateBrush(1, W, H ,"$5D5D5D")
    SelectBrush(1)

        POS=3
        FOR B=0 TO 4
        SetFillStyle(#FILLNONE)
        BOX(2,POS,96,20,#BLUE) TextOut(#CENTER,POS+6,"Button"..B)
        POS=POS+25
        NEXT

    EndSelect
    DisplayBrush(1,0,0)

        POS=3
        FOR B=0 TO 4
           Action1={
               OnMouseUp   = Function(msg) win1(msg) EndFunction,
               OnMouseOver = Function(msg) win1(msg) EndFunction,
               OnMouseOut  = Function(msg) win1(msg) EndFunction
           }
        MakeButton(B, #SIMPLEBUTTON, 2, POS, 96, 20, Action1)
        POS=POS+25
        NEXT

/************************************************************************************************************/

Disp4=CreateDisplay(Nil,{X=300, Y=200, Width = 100, Height = 100, Borderless=NoBorderWindow})
SelectDisplay(Disp4)

    CreateBrush(2, W, H ,"$5D5D5D")
    SelectBrush(2)

        POS=3
        FOR B=0 TO 4
        SetFillStyle(#FILLNONE)
        BOX(2,POS,96,20,#BLUE) TextOut(#CENTER,POS+6,"Button"..B)
        POS=POS+25
        NEXT

    EndSelect
    DisplayBrush(2,0,0)

        POS=3
        FOR B=0 TO 4
           Action2={
               OnMouseUp   = Function(msg) win2(msg) EndFunction,
               OnMouseOver = Function(msg) win2(msg) EndFunction,
               OnMouseOut  = Function(msg) win2(msg) EndFunction
           }
        MakeButton(B, #SIMPLEBUTTON, 2, POS, 96, 20, Action2)
        POS=POS+25
        NEXT

/************************************************************************************************************/

Function win1(msg)

SelectDisplay(msg.display, True)

    Switch msg.ACTION
    CASE "OnMouseUp":
        IF (Getattribute(#DISPLAY,Disp4,#ATTRSTATE)=0)
        OpenDisplay(Disp4)
        SelectDisplay(Disp4)
        ActivateDisplay(Disp4)
        EndIF 

    CASE "OnMouseOver":
        BOX(2,msg.y,96,20,#RED)

    CASE "OnMouseOut":
        BOX(2,msg.y,96,20,#BLUE)

    EndSwitch

EndFunction

/************************************************************************************************************/

Function win2(msg)

SelectDisplay(msg.display, True)

    Switch msg.ACTION
    CASE "OnMouseUp":
        CloseDisplay(Disp4)

    CASE "OnMouseOver":
        BOX(2,msg.y,96,20,#RED)

    CASE "OnMouseOut":
        BOX(2,msg.y,96,20,#BLUE)

    EndSwitch

EndFunction

/************************************************************************************************************/

/* Boucle infinie */
Repeat
        WaitEvent
Forever

User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Display Borderless no good work

Post by airsoftsoftwair »

This is probably because the (invisible) drag bar of the borderless display overlaps with your first button. To solve this you must make sure that both elements don't overlap. Check out the "DragRegion" tag for @DISPLAY or CreateDisplay(), it allows you to change the position and size of the drag bar.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Display Borderless no good work

Post by sinisrus »

Arrrgggg but yes !!

thank you :-)
Post Reply