Drop shade 
Author Message
 Drop shade

I am looking for a funtion for a shadow drop shade for boxes and menus. I
know I saw it somewhere but I cannot find it. I could of sworn it was called
WinShade? Any function will do for a simple menu or box with a transparent
shade or shadow. thanks,
                                                                        Mike



Sat, 25 Nov 2000 03:00:00 GMT  
 Drop shade

Quote:

> I am looking for a funtion for a shadow drop shade for boxes and menus. I
> know I saw it somewhere but I cannot find it. I could of sworn it was
> called WinShade? Any function will do for a simple menu or box with a
> transparent shade or shadow. thanks, Mike

You'll probably find many variations of this function on The Oasis
(http://www.iag.net/~philb/), I'm sure that the NF and GT libs (both free
with source) contain such functions.

However, a quick and dirty way of doing it in Clipper is:

/*  $DOC$
 *  $FUNCNAME$
 *      DropShadow()
 *  $CATEGORY$
 *      Screen
 *  $ONELINER$
 *      Draw a drop shadow.
 *  $SYNTAX$
 *      DropShadow( <nTop>, <nLeft>, <nBottom>, <nRight> ) --> NIL
 *  $ARGUMENTS$
 *      <nTop>, <nLeft>, <nBottom> and <nRight> are the coordinates
 *      of the area of screen around which the shadow will be drawn.
 *  $RETURNS$
 *      Nothing.
 *  $DESCRIPTION$
 *      DropShadow() can be used to draw a see thru drop shadow around
 *      an area of screen.
 *
 *      REMEMBER!!! If you are drawing a box on screen that will be saving
 *      the screen area and intend to place a shadow around the box, save
 *      the screen for nTop, nLeft, nBottom + 1 and nRight + 1.
 *  $EXAMPLES$
 *      // Draw a box and place a shadow around it.
 *
 *      #include "Box.Ch"
 *
 *      dispbox( 10, 10, 20, 60, B_DOUBLE + " " )
 *      DropShadow( 10, 10, 20, 60 )
 *  $SEEALSO$
 *
 *  $END$
 */

Function DropShadow( nTop, nLeft, nBottom, nRight )
Local cBuffer
Local cPicture := "X" + chr( 8 )

   dispbegin()

      cBuffer := savescreen( nTop + 1, nRight + 1, nBottom + 1, nRight + 1 )
      cBuffer := transform( cBuffer, replic( cPicture, len( cBuffer ) ) )
      restscreen( nTop + 1, nRight + 1, nBottom + 1, nRight + 1, cBuffer )

      cBuffer := savescreen( nBottom + 1, nLeft + 1, nBottom + 1, nRight + 1 )
      cBuffer := transform( cBuffer, replic( cPicture, len( cBuffer ) ) )
      restscreen( nBottom + 1, nLeft + 1, nBottom + 1, nRight + 1, cBuffer )

   dispend()

Return( NIL )

--
Take a look in Hagbard's World: |     w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ |  ng2html - The NG to HTML converter.
http://www.hagbard.demon.co.uk/ |       eg - Norton Guide reader for Linux.
Free software, including........|   dgscan - DGROUP scanner for Clipper.



Sat, 25 Nov 2000 03:00:00 GMT  
 Drop shade

On Tue, 9 Jun 1998 11:54:13 -0400, "Michael Ingrassia"

Quote:
>I am looking for a funtion for a shadow drop shade for boxes and menus. I
>know I saw it somewhere but I cannot find it. I could of sworn it was called
>WinShade? Any function will do for a simple menu or box with a transparent
>shade or shadow. thanks,

Mike

There's sure to be something in one of the many libraries on The
Oasis, try:

                WWW             http://www.iag.net/~philb/
                FTP Site        ftp://ftp.iag.net/pub/clipper

Thanks to Phil Barnett.  If you cannot find something, contact me by
email and I'll send you some code.

Don

"When I die, I want to go peacefully in my sleep - like my
grandfather - not screaming like the passengers in  his car."



Sat, 25 Nov 2000 03:00:00 GMT  
 Drop shade

Quote:

> I am looking for a funtion for a shadow drop shade for boxes and menus. I
> know I saw it somewhere but I cannot find it. I could of sworn it was called
> WinShade? Any function will do for a simple menu or box with a transparent
> shade or shadow. thanks,
>                                                                         Mike

The drop-shade 3D type window comes with the windowing function of
ClipperTools.


Sat, 25 Nov 2000 03:00:00 GMT  
 Drop shade


Quote:

> On Tue, 9 Jun 1998 11:54:13 -0400, "Michael Ingrassia"

> >I am looking for a funtion for a shadow drop shade for boxes and menus. I
> >know I saw it somewhere but I cannot find it. I could of sworn it was called
> >WinShade? Any function will do for a simple menu or box with a transparent
> >shade or shadow. thanks,

procedure shadow(mt_l,mt_c,mb_l,mb_c)
local buff1:=savescreen(mt_l,mt_c,mb_l,mb_c)
local i,mline:=""
local mlen:=int(len(buff1)/2)
for i=1 to mlen
 mline+=substr(buff1,(i*2)-1,1)+;
          iif(!iscolor(),chr(7),chr(mod(asc(substr(buff1,(i*2),1)),16)))
next
restscreen(mt_l,mt_c,mb_l,mb_c,mline)

The above routine shadows a given area of screen.
Note , unlike common shadow routines , this retains the foreground colour ,
but shadows the background colour.It does it that way cause i like it <g>

--
Sean Webb,Spyder Computing
Security , Risk Management , Fire & Rescue Database Systems
Marina Booking Systems, POS developments,
Import/Export and Freight Forwarding  Systems
Personal Home Page: http://users.iafrica.com/s/sp/spwebb



Sun, 26 Nov 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Drag and Drop - How to get what was dropped onto

2. Drop combo related to another drop combo

3. Drop Combo dependent on another drop combo

4. Drop Combo to Auto Drop

5. another General publicly calling to drop Ada (drop the General instead :-)

6. Drop-N-Drop bet Motif apps and tcl/tk apps

7. Title bar shading

8. Looking for Shading tips

9. LOGO-L> Strange shade

10. LOGO-L> shading

11. LOGO-L> Color Shades

12. how do I shade both faces of an indexed faceset

 

 
Powered by phpBB® Forum Software