question about popup notification

Sciter Forums Layout question about popup notification

This topic contains 3 replies, has 2 voices, and was last updated by  Something else 1 month, 2 weeks ago.

  • Author
    Posts
  • #49357

    Something else
    Participant

    Hello
    i have 2 questions :
    1.how to change the popup notification from the bottom right to the middle of the screen

    var (w,h) = msg.box(#dimension,#border);
        
        // getting **declared** margins widths, note: they can be different from computed ones due to margin collapsing
        w += msg.toPixels(msg.style#margin-right,#width);
        h += msg.toPixels(msg.style#margin-bottom,#height);
        
        // position its border box at bottom / right corner of the screen
    	      msg.move( screenX2 - (w + 600), 
                  screenY2 - (h + 400), 
                  #screen, 
                  #detached-topmost-window );
        // request to start animation
        msg.post( revealIt );

    2.how to change the appearance effect to fade or any other effect close to it
    thank you

    • This topic was modified 1 month, 2 weeks ago by  Andrew.
  • #49360

    Andrew
    Keymaster

    This:

    element.move( x, y, #screen, #detached-topmost-window );
    

    positions element in separate window on screen.

    x and y here are screen coordinates (that #screen symbol).

    screenX1, screenX2, screenY1, screenY2 are coordinates of left,right,top,bottom corners of current screen (monitor box on desktop).

    So you need to compute x and y (left/top) corner of element’s box in the way it appears in the center of the screen.

    Use basic arithmetic (+,-,*,/) operations to solve that mystery. If I am not mistaken that is second grade of primary school. At least it was so in country named USSR.

  • #49361

    Something else
    Participant

    lol 😀 yes i did it but i was little afraid if someone has screen with different resolution it would show the notification in different positions (Simply i wanted to confirm something 🙂 )
    thank u

  • #49363

    Something else
    Participant

    and the appearance effect is
    transform(blend,500ms)
    i don’t know what’s wrong with me 🙂 … next time i will search more before i ask

You must be logged in to reply to this topic.