FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Transparents radios
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Transparents radios
Posted: Sat Aug 20, 2011 09: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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Transparents radios
Posted: Sat Aug 20, 2011 09:17 PM
Marcelo,

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



Code (fw): Select all Collapse
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 :-)
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.
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: Transparents radios
Posted: Sat Aug 20, 2011 09: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

Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: Transparents radios
Posted: Sat Aug 20, 2011 09:48 PM

Uwe,

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

regards

Marcelo

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Transparents radios
Posted: Sat Aug 20, 2011 09: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 :-)
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.
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: Transparents radios
Posted: 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

Continue the discussion