DCPushButtonXP Radius Area Transparent

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

DCPushButtonXP Radius Area Transparent

#1 Post by PedroAlex »

Hi Roger.

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

Image

Many Thanks!
Attachments
Teste_2027.rar
(115.07 KiB) Downloaded 395 times
bIMG.jpg
bIMG.jpg (14.71 KiB) Viewed 5829 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPushButtonXP Radius Area Transparent

#2 Post by rdonnay »

If you are using a config object do this:

oConfig:isTransparent := .t.

Or do this:

DCPUSHBUTTONXP .. TRANSPARENT
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP Radius Area Transparent

#3 Post 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
Attachments
bIMG.jpg
bIMG.jpg (15.74 KiB) Viewed 5796 times
Pedro Alexandre

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: DCPushButtonXP Radius Area Transparent

#4 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPushButtonXP Radius Area Transparent

#5 Post by rdonnay »

If you give me a sample that I can compile and run I will try to find a solution for you.
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: DCPushButtonXP Radius Area Transparent

#6 Post 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!
Pedro Alexandre

Post Reply