
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM |
TEXT
Make 3D looking Edit Fields
If you want to make a 3D looking edit field, heres a short FN that Iuse :
'
LOCAL FN threeDFX(whichEF):' draws a 3D shaded box around an edit field
DIM rect;0,t,l,b,r:' default rect to use
DIM newFore;0,foreR,foreG,foreB:' new foreground colours to use
DIM oldFore;6:' old foreground colours in use
LONG IF gcolorDepth>=4:' do we have a colour system?
CALL GETFORECOLOR(oldFore):' record the current foreground colour
foreR=17476:foreG=17476:foreB=17476:' sets a dark grey colour
editHndl&=TEHANDLE(whichEF):' get a handle to the specific edit field
LONG IF editHndl&:' sure we got one, it's probably blow up if not fnd
CALL RGBFORECOLOR(newFore):' and reset it on the way out
BLOCKMOVE [editHndl&],@rect,8:' get the destination rect
CALL INSETRECT(rect,-3,-3):' adjusts it out of the rect
r=r-2:b=b-2
PEN 2,2,1,_patCopy,0:' set the transfer
CALL MOVETO(l,t):' draw top horizontal line
CALL LINETO(r,t):' draw the top line
CALL MOVETO(l,t):' draw the left side line
CALL LINETO(l,b):' to complete the top and left sides of the rect
PEN 1,1,1,_patCopy,0:' set the transfer
foreR=61166:foreG=61166:foreB=61166:' sets white
CALL RGBFORECOLOR(newFore):' and reset it on the way out
CALL MOVETO(l+2,b):' draw the 1st bottom horizontal line
CALL LINETO(r,b):' do that now
CALL MOVETO(l+1,b+1):' set up for the second horizontal bottom line
CALL LINETO(r,b+1):' and draw it now
CALL MOVETO(r,b+1):' start setting up the right side of the rect
CALL LINETO(r,t+2):' draw the first line
CALL MOVETO(r+1,b+1):' and now the last line
CALL LINETO(r+1,t+1):' and this will finish the job
CALL PENNORMAL
END IF
CALL RGBFORECOLOR(oldFore):' and reset it on the way out
END IF
END FN
'
|