Page 1 of 1

DCPushButtonXP Radius Area Transparent

Posted: Mon Jan 11, 2021 9:26 am
by PedroAlex
Hi Roger.

When use Background BitMap, it is possible make transparent the Radius Area of DcPushButtonXP ?

Image

Many Thanks!

Re: DCPushButtonXP Radius Area Transparent

Posted: Tue Jan 12, 2021 5:32 am
by rdonnay
If you are using a config object do this:

oConfig:isTransparent := .t.

Or do this:

DCPUSHBUTTONXP .. TRANSPARENT

Re: DCPushButtonXP Radius Area Transparent

Posted: Tue Jan 12, 2021 7:16 am
by PedroAlex
Roger!

Does not work!

Here is my code ( XB 2.0.1176 and eXpress 267 ):

Code: Select all

#include "dcdialog.ch"
#include "dcgra.ch"

Procedure AppSys
return

#define COLOR_BROWN      GraMakeRGBColor( { 127, 127,   0 } )
#define COLOR_YELLOW     GraMakeRGBColor( { 255, 255,   0 } )
#define COLOR_WHITE      GraMakeRGBColor( { 255, 255, 255 } )
#define COLOR_BLACK      GraMakeRGBColor( {   0,   0,   0 } )
#define COLOR_PALEGRAY   GraMakeRGBColor( { 192, 192, 192 } )
#define COLOR_LTBLUE     GraMakeRGBColor( {  30, 187, 255 } )
#define COLOR_LTYELLOW   GraMakeRGBColor( { 128, 128,   0 } )
#define COLOR_SLATEGRAY  GraMakeRGBColor( { 158, 182, 205 } )
#define COLOR_SOFTBLUE   GraMakeRGBColor( { 185, 209, 239 } )
#define COLOR_SOFTYELLOW GraMakeRGBColor( { 255, 250, 205 } )

//=========================================================
Procedure MAIN()
//=========================================================
LOCAL GetList := {}, GetOptions, Var_Login := Space(15), Var_Password := Space(15)
LOCAL oButtonConfig

Dc_BitMapTransparentColor({192,192,192})

oButtonConfig                 := DC_XbpPushButtonXPDefault():new()
//oButtonConfig:isTransparent   := .t.
oButtonConfig:Font            := "10.Arial Bold"
oButtonConfig:fgColor         := COLOR_BLACK
oButtonConfig:bgColor         := COLOR_LTBLUE
oButtonConfig:fgColorMouse    := GraMakeRGBColor({0,0,0})
oButtonConfig:bgColorMouse    := GraMakeRGBColor({245,215,100})
oButtonConfig:bgColorClick    := GraMakeRGBColor({245,215,100})
oButtonConfig:disabledfgcolor := GraMakeRGBColor({150,150,150})
oButtonConfig:disabledbgcolor := GraMakeRGBColor({215,215,215})
oButtonConfig:bordercolor     := GraMakeRGBColor({83,123,173})
oButtonConfig:radius          := 30


DC_PushButtonStyle( oButtonConfig )


@ 165,150 DcSay '   Login' GET Var_Login SAYSIZE 100 GETSIZE 170 GETFONT '12.Courier New Bold' ;
							   GETPRESENTATION {{ XBP_PP_BORDER_CLR, GRA_AS_ANGLE  }} Parent oUser

@ 195,150 DcSay 'Password' GET Var_PassWord  SAYSIZE 100 GETSIZE 170 PASSWORD GETFONT '12.Courier New Bold' Parent oUser

@ 228,260 DCPUSHBUTTONXP ;
CAPTION 'Cancelar' ;
SIZE 80,28 ;
Config oButtonConfig ; //TRANSPARENT ;
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList) }

@ 228,350 DCPUSHBUTTONXP ;
CAPTION 'Confirmar' ;
SIZE 80,28 ;
Config oButtonConfig ; //TRANSPARENT ;
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList) }

@ 150,70 DCPUSHBUTTONXP ;
CAPTION 'EXIT' ;
SIZE 80,80 ;
RADIUS 50 ; // TRANSPARENT ;
COLOR COLOR_BLACK, COLOR_BROWN ;
MOUSECOLOR COLOR_BLACK, COLOR_SOFTYELLOW ;
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList) }


DCGETOPTIONS NORESIZE PIXEL NOTITLEBAR ;
WINDOWWIDTH 500 ;
WINDOWHEIGHT 310 ;
SAYRIGHT ;
SAYFONT '12.Arial Bold' ;
BITMAP Dc_GetBitMap( 'Login.jpg' ) ;
COLORGETS {{ Nil,COLOR_SOFTYELLOW },{ Nil,COLOR_LTBLUE }}

DCREAD GUI         ;
to OPCAO           ;
TITLE 'Password'   ;
MODAL              ;
OPTIONS GetOptions ;
ENTEREXIT          ;
SETAPPWINDOW

Return
The area around the button withdrawn by radius appears in gray..

Image

Re: DCPushButtonXP Radius Area Transparent

Posted: Thu Jan 14, 2021 2:05 am
by Victorio
Hi Pedro,

I had similar problem, when I had some bitmap as background under buttons. I found not solution, only when disable background picture on main window, buttons works fine with rounded edges.
Try disable bitmap background on main window only for verification.
Problem was on discuss several months ? years here and as I remember, it is some about bitmap trim.
In my app I still not found working solution, then when I want use rounded buttons, I disable main background bitmap.

Re: DCPushButtonXP Radius Area Transparent

Posted: Thu Jan 14, 2021 8:04 am
by rdonnay
If you give me a sample that I can compile and run I will try to find a solution for you.

Re: DCPushButtonXP Radius Area Transparent

Posted: Fri Jan 15, 2021 10:32 am
by PedroAlex
Hi Roger.
thanks for the clarification
The sample program is on the first topic of this post named teste_027.rar.
I Wrote this sample program just to show you the problem and send it as a test example.
I give some importance to the graphical aspect of the applications.
This improvement would be important!