[DUG] Friday giveaway - Form Effects

Conor Boyd Conor.Boyd at trimble.co.nz
Fri Nov 9 14:51:42 NZDT 2007


Sounds good John.
 
If it's what I think you're talking about, they're often known as
"toast" windows (i.e. popping up as if out of a toaster).
 
The JVCL library (http://jvcl.sourceforge.net) has a similar component
in it already which we use.
 
But yeah, as you say, it's a nice effect for notifications.
 
I'm sure people would be interested in your implementation.
 
Cheers,
 
C.

________________________________

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of John Bird
 
Anyone looked at the little popup windows from Outlook/Skype
messaging/Antivirus programs/Google news alerts/, you know the little
windows that slide into a corner of the screen and/or fade in and out
and thought "I would like to be able to do that"?
 
I wrote a simple function in a standalone unit that can be called to
provide several such simple form effects - can be called for any form
instead of calling the show or hide methods.  I thought I would do it as
a free giveaway, and for anyone to suggest any possible improvements.
 
It does not do sounds on show/hide yet, but I may add that later.
 
Anyone interested? either email me or I can post it here in email, its
not very long.  And it looks pretty cool.
(I have a full test program for it as well.)
 
here is the description of the parameters
 
 
(*
Form Effects
 
Freeware from JBCL - John Bird
A function unit - code only (no form attached) that can be called
to provide some pretty form effects.
 
Call by function
jFormEffect(
 
  aForm   TForm or descendent
 
  aShowfl    one of jfeShow jfeShowModal jfeHide jfeClose
 
  //from here to simplify parameters are in alphabetic order
  Note you can call using numbers, or if you prefer using the
  constant values defined below, as they are in scope -
  eg for aShowfl can be 1 (show) or you can use jfeShow
            Hide form can be 3 or jfeHide
 
  aBorderfl  Borderstyle of form
            0=no change
            jfeStd      (bsSizeable)
            jfeToolwin  (bsToolWin)
            jfeNone
            NOTE! only change this when form is not visible
 
  acolorfl  0=no set color of form
          1=set to aColorval folowing
  aColorval  if set sets color of form.
 
  aFadefl   0=None
          1=Fade in/out
          Form becomes gradually less transparent as shows,
          and more transparent as hidden, (fades out gradually).
 
  aPosfl   0=No Move - use form position
          1=Position at point on screen, no movement
          2=Moveout/Hide into border
 
  aPosVal    0=none (ie as defined)
                rest correspond to clock hour positions
                eg 1= 1 O'Clock is top border, on right side
                2=right border, at top  up to 12=middle top border
                13=Centre
                for Show, this is where form ends up
                for Hide, this is where form will disappear to
                eg aPosFl=2 and aPosVal=1 means Form slides down when
shown
                or slides up into on Hide to or from 1 O'Clock position
on screen
                in the case of 1 O'Clock slides down from top right hand
                corner of screen to occupy top right hand corner of
screen.
                and so on for the other 12 clock positions
                eg 2 O'Clock is same position, but slides in from
                the right screen border on show,
                and off to the right on hide.
 
  aRollfl    0=None
           1=Roll down/Roll up
           that is the form drops down from the title bar as shown, and
           rolls up into the title bar as hidden.
           Can be used along with the position function as well.
 

  aSmoothfl   one of jfeLow jfeMed jfeHigh  how many iterations done
 
  aTimeval     time in Milliseconds to take - default 1000
 

Note form show ends at transparency,pos and height of form as set when
called.
after disappears, set to original values so that show and hide do valid
things...
 
Note - to avoid windows UI bugs, do not change forms border type while
the
form is visible, only when not visible (does not repaint correctly).
*)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20071109/0d85aa18/attachment-0001.html


More information about the Delphi mailing list