I have hard head: move stack without title bar...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tabbiati
Posts: 18
Joined: Sat Jul 09, 2011 3:18 pm

I have hard head: move stack without title bar...

Post by tabbiati » Thu Aug 25, 2011 2:19 pm

I have hard head: when removed title bar from stack i not have
possibility to move stack: it's possible or not?

Thanks

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: I have hard head: move stack without title bar...

Post by Klaus » Thu Aug 25, 2011 2:32 pm

Buongiorno tabbiati,

si, é possibile :D

You could:
create a graphic in size of your card
check "opaque" in the inspector (colors don't matter)
set its INK (Inspector -> Blending) to "noop", so it is invisible to the user but not for the mouse!
set it to the lowest layer, so it appears behind all of your objects and add this script to that graphic

Code: Select all

local maydrag

## We store the curent mouseloc
on mouseDown
  put mouseH() & "," & mouseV() into maydrag
end mouseDown

## We ned to do the "movement" in a mousemove handler, since this willbe sent continuously!
on mouseMove
  if maydrag is not empty then

    ## Calculate the OFFSET mouse <-> sides of stack and set the loc of stack accordingly
    set the topLeft of this stack to item 1 of the screenMouseLoc - item 1 of maydrag,item 2 of the screenMouseLoc - item 2 of maydrag
  end if
end mouseMove

## EMPTY local variable
on mouseUp
  put empty into maydrag
end mouseUp

on mouserelease
  mouseup
end mouserelease
Try this an be happy :D

You can of course also create a fancy FAKE title bar with this script.


Best

Klaus

tabbiati
Posts: 18
Joined: Sat Jul 09, 2011 3:18 pm

Re: I have hard head: move stack without title bar...

Post by tabbiati » Thu Aug 25, 2011 4:40 pm

Thank Klaus,
You are a devil ....

You've probably realized that I persist with the skinning of the stack
and now, thanks to your suggestions, I begin to understand how
I could get a custom window .....
i have a hard head!
:lol:

PM: but why You know so italian language?

Post Reply