Which is the simplest solution for popup windows dragable with text and exit button?

  • I'am researching inside the example "xml-usage> dragable=layers-plugins..." that does not seem very complicated, But it is a little more than what I need only to do a simple popup with exit button.

    Steps would be:

    1) Create a layer1 (dragable text or image)
    2) Create other layer2 for exit (child exit button) and make it child's layer1
    3) Create code to drag the layer1
    4)Create code to close both layer.

    Are these steps correct?

    Thanks very much, and please be patient with me that am learning *g*

    Regards,

    Fernando.

  • Thanks very much Tmhok, Your code is great, it inspirate new ideas in my project... Only a details: the window cannot be dragged.

    The mimimal popup wold be:

    1) Cosmetic image or title image or fix banner (solved)
    2) Scrolling text (solved)
    3) Exit button (solved)
    4) The window dragable inside stage area


    I will continue researching, but almost solved, thanks.

    Greets,

    Fernando

    Edited once, last by publicitarios360: the image linked is not visible (February 23, 2015 at 4:46 PM).

  • Code
    <action name="draglayer">		if(%1 != dragging,			copy(drag_currentx, x);			copy(drag_currenty, y);			copy(drag_stagex, mouse.stagex);			copy(drag_stagey, mouse.stagey);			set(drag_sx, +1);			set(drag_sy, +1);			if(align == righttop,    set(drag_sx,-1); );			if(align == right,       set(drag_sx,-1); );			if(align == rightbottom, set(drag_sx,-1); set(drag_sy,-1); );			if(align == bottom,      set(drag_sy,-1); );			if(align == leftbottom,  set(drag_sy,-1); );			draglayer(dragging);		  ,			if(pressed,				sub(dx, mouse.stagex, drag_stagex);				sub(dy, mouse.stagey, drag_stagey);				mul(dx, drag_sx);				mul(dy, drag_sy);				add(x, drag_currentx, dx);				add(y, drag_currenty, dy);				delayedcall(0, draglayer(dragging) );			  );		  );	</action>

    and insert ondown="draglayer();" into your windows parent layer

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!