Transparents radios

Transparents radios

Postby Marcelo Via Giglio » Sat Aug 20, 2011 9:09 pm

Hello,

I trying to display radios inside a painted area ( painted with GradientFill or RoundRect ) on dialog, the dialog is defined like TRANSPARENT ( DEFINE DIALOG..... TRANSPARENT ), the say are displayed correctly, but the radios no, I am using
AEval( oRadio:aItems, { | oRm | oRm:lTransparent := .T. } ) to define transparent in radio but I can't obtain the right result

some sugestion?

rtegards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Transparents radios

Postby ukoenig » Sat Aug 20, 2011 9:17 pm

Marcelo,

please have a look at the Dialog-background-function.

Image

Code: Select all  Expand view

FUNCTION SHOW_MSG()
Local nValue := 3, oRad

DEFINE DIALOG oPopup FROM nTop, nLeft TO nTop + 280, nLeft + 300 OF oDlg PIXEL FONT oSysFont1 ;
TITLE cHead TRANSPARENT ;
STYLE nOr(WS_POPUP, WS_BORDER, WS_THICKFRAME, WS_CAPTION )

@ 100, 5 RADIO oRad VAR nValue  PIXEL ;
ITEMS "&One", "&Two", "T&hree" _3D SIZE 40, 12 ;
HELPID 100, 101, 102 ;
ON CHANGE MsgBeep()

DLG_BRUSH( oPopup, 1, .T., 16770250, 14089979, 0.2 )

ACTIVATE DIALOG oPopup

RETURN( NIL )

//--------- DIALOG Background ------------------------

FUNCTION DLG_BRUSH(oControl, nStyle, lDirect, nVColor, nBColor, nMove, cBrush, cImage)
LOCAL oBrush, oTmp
LOCAL aGrad := { { nMove, nVColor, nBColor }, { nMove, nBColor, nVColor } }

IF nStyle = 1
    hDC = CreateCompatibleDC( oControl:GetDC() )
    hBmp = CreateCompatibleBitMap( oControl:hDC, oControl:nWidth, oControl:nHeight )
    hBmpOld = SelectObject( hDC, hBmp )
    GradientFill( hDC, 0, 0, oControl:nHeight, oControl:nWidth, aGrad, lDirect )
    DeleteObject( oControl:oBrush:hBrush )
    oBrush := TBrush():New( ,,,, hBmp )
    oBrush:Cargo  := aGrad
    SelectObject( hDC, hBmpOld )
    oControl:ReleaseDC()
    oControl:SetBrush( oBrush )
    RELEASE BRUSH oBrush
ENDIF
IF nStyle = 2
    IF File( cImage )
        DEFINE IMAGE oTmp FILE cImage
            oBrush := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, oControl:nWidth, oControl:nHeight, .T. ) )
        oControl:SetBrush( oBrush )
        oBrush:End()
    ELSE
        MsgAlert( "Cannot load : " + CRLF + ;
                 cImage, "Error" )
    ENDIF
ENDIF

RETURN( NIL )
 


Best Regards
Uwe :lol:
Last edited by ukoenig on Sat Aug 20, 2011 9:43 pm, edited 1 time 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

Re: Transparents radios

Postby Marcelo Via Giglio » Sat Aug 20, 2011 9:42 pm

Uwe,

thanks for response, ok, I can see the transparent radio, but how can I do it, BUT please take in mind that I don't use a gradient or other dialog background, only some dialog area are painted and inside it, I want to put the radios, the says work perfectly.

regards

Marcelo

P.D. sorry I didn't see the code, I will try thanks
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Transparents radios

Postby Marcelo Via Giglio » Sat Aug 20, 2011 9:48 pm

Uwe,

your sample is using background dialog brush, it is possible to do without brush? only paint some dialog area

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Transparents radios

Postby ukoenig » Sat Aug 20, 2011 9:56 pm

// Area
GradientFill( hDC, 50, 0, 130, 100, aGrad, lDirect )

// complete
// GradientFill( hDC, 0, 0, oControl:nHeight, oControl:nWidth, aGrad, lDirect )

Best Regards
Uwe :lol:
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

Re: Transparents radios

Postby Marcelo Via Giglio » Sat Aug 20, 2011 10:10 pm

Thanks again Uwe,

but I have a problems with brush, what I am using is a RGROUP class this means that is working like a control, and we can use many of it in the same dialog, do you know if are there others possibilities for solve this issue

regards and thanks for your time

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests