FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BUTTONBAR BORDER
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
BUTTONBAR BORDER
Posted: Fri May 12, 2023 08:24 AM

It possibile have the border only on bottom and not on top ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BUTTONBAR BORDER
Posted: Sat May 13, 2023 12:49 PM
Hello Silvio,
It possibile have the border only on bottom and not on top ?
Maybe the solution You are looking for ?
You can use any colour, pensize or transparent level.


Code (fw): Select all Collapse
// Translucent ButtonBar and Buttons

#include "fivewin.ch"

FUNCTION MAIN()
local oWnd, oBar, oMsgBar, oBtn, oBrush, oFont, nActual := 0, oMeter, lBorder := .T.
local nAlpha := 0x60
local nBarClr  := RGB( 0, 0x2E, 0x5C )

DEFINE BRUSH oBrush FILE ".\bitmaps\sea.bmp" RESIZE
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

DEFINE WINDOW oWnd FROM 0,0 TO 400,600 PIXEL BRUSH oBrush TITLE "Translucent ButtonBar"

DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 80 2007
oBar:SetFont( oFont )
oBar:SetColor( { |l,o| If( l, CLR_BLACK, CLR_WHITE ) }, oWnd:nClrPane )
oBar:bClrGrad := { |lInvert| If( lInvert, nArgb( 96, CLR_WHITE ), nArgb( nAlpha % 256, nBarClr ) ) }

oBar:GoTop()
//oBar:GoDown()
// oBar:GoLeft()
// oBar:GoRight()
// oBar:Float()

DEFINE BUTTON oBtn OF oBar PROMPT "New"    FILE ".\bitmaps\new.bmp"
DEFINE BUTTON oBtn OF oBar PROMPT "Open"   FILE ".\bitmaps\open.bmp"
DEFINE BUTTON oBtn OF oBar PROMPT "Edit"   FILE ".\bitmaps\edit.bmp"
DEFINE BUTTON oBtn OF oBar PROMPT "Copy"   FILE ".\bitmaps\copy.bmp"
DEFINE BUTTON oBtn OF oBar PROMPT "Paste"  FILE ".\bitmaps\paste.bmp"
DEFINE BUTTON oBtn OF oBar PROMPT "Color"  FILE ".\bitmaps\colors.bmp" ;
      ACTION ( nBarClr := ChooseColor( RGB( 0, 0x2E, 0x5C ) ), oBar:Refresh() )
DEFINE BUTTON oBtn OF oBar PROMPT "Exit"  FILE ".\bitmaps\Exit.bmp" ;
      ACTION ( nBarClr := ChooseColor( RGB( 0, 0x2E, 0x5C ) ), oBar:Refresh() )

//DEFINE MSGBAR oMsgBar OF oWnd PROMPT "Transp. Slider ->" NOINSET
//oMsgBar:SetFont( oFont )

//oMsgBar:nHeight := 50


ACTIVATE WINDOW oWnd CENTERED // ;
//ON INIT  oWnd:nOpacity := 150

RELEASE BRUSH oBrush
RELEASE FONT oFont

RETURN NIL

// --------------

FUNCTION DRAW_BORDER(Object, hDC, nColor, nPensize, nRound, nTransp )
LOCAL oGraphics, oPen, nRed, nGreen, nBlue
LOCAL n, nLEFT, nTOP, nWIDTH, nHEIGHT, nPen
 
oGraphics   := Graphics():New( hDC ) 
nRed            := nRGBRed( nColor )
nGreen        := nRGBGreen( nColor )
nBlue           := nRGBBlue( nColor )

nTOP            := Object:nTop - nPensize
nLEFT           := Object:nLeft - nPensize
nWIDTH        := Object:nWidth + 2 * nPensize 
nHEIGHT     := Object:nHeight + 2 * nPensize 

oPen := Pen():New( nTransp, nRed, nGreen, nBlue, nPensize, .T. )
oGraphics:DrawRoundRect( oPen,  ,nLeft, nTop, nWidth, nHeight, nRound ) 

oPen:Destroy()
oGraphics:Destroy()

RETURN NIL
best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion