BUTTONBAR BORDER

BUTTONBAR BORDER

Postby Silvio.Falconi » Fri May 12, 2023 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: BUTTONBAR BORDER

Postby ukoenig » 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.

Image

Code: Select all  Expand view

// 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 :?:
Last edited by ukoenig on Sat May 13, 2023 12:56 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests

cron