iTunes style titlebar

Terry Judd tsj at unimelb.edu.au
Wed Jun 9 00:05:59 EDT 2010


Sounds like a job for either a custom window shape or, if you're happy with
a window with square top corners, a window with the decorations set to empty
and a faked titlebar.

Here's a script I use for dragging a custom window around by its 'titlebar'
that constrains the upper and lower limits of the drag (watch out for line
wraps)

local pDown, pXOffset, pYOffset, pT, pB

on mouseEnter
   put false into pDown
end mouseEnter

on mouseDown
   put true into pDown
   put the mouseH into pXOffset
   put the mouseV into pYOffset
   put the screenRect into tRect
   if platform() = "MacOS" then
      put 20 into pT
      put item 4 of tRect - 28 into pB
   else
      put 0 into pT
      put item 4 of tRect - 63 into pB
   end if
end mouseDown

on mouseUp
   put false into pDown
end mouseUp

on mouseRelease
   put false into pDown
end mouseRelease

on mouseMove x,y
   if pDown then
      put x-pXOffset into tX
      put y-pYOffset into tY
      put globalLoc((tX,tY)) into tTL
      set the topleft of this stack to (item 1 of tTL,min(max(pT,item 2 of
tTL),pB))
    end if
end mouseMove

HTH,

Terry...

On 9/06/10 1:57 PM, "Simon Lord" <slord at karbonized.com> wrote:

> Is it possible to *assign* a style that mimics the thickness of the
> iTunes.app?  The CODA application has the same thickness (~120px
> high).
> 
> I couldn't do it so I figured I'd just trap the mouse position and
> drag the window when the user clicks on the space just below the
> titlebar (in order to simulate a thicker titlebar).  It works great,
> but the bugger drags the whole app right off the top of the screen.
> Mac OS apps don't allow the titlebar to be dragged under the OS menu
> and now I have a few options:
> 
> 1) Does RunRev support a thinker title bar that we can mount icons
> onto etc. (like CODA, iTunes...)
> 2) Properly detect the top of the stack and exit script before user
> drags stack under OS X system menu bar (tried, doesn't work)
> 
> I'd be happy with any solution where the *feel* of OS X integrity is upheld.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne





More information about the use-livecode mailing list