[wx-dev] Re: pen/brush styles changes

Stefan Csomor csomor at advancedconcepts.ch
Thu Mar 20 00:53:55 PDT 2008


Hi

> MW> and I don't think we need a special function + a special enum just to
> MW> make a text background transparent. It would be enough to have one
> MW> function that changes text background in wxDC.
> 
>  This is true but only if we don't plan to ever have any other background
> modes. I admit I have troubles thinking of what else a background mode
> could be but maybe I'm missing something? Stefan (Csomor), is there any use
> for this enum in the new wxGC classes?
> 
> MW> We can set transparent background by using
> MW> SetBackground(*wxTRANSPARENT_COLOR) (if such a pointer is defined).
> 
>  There is no wxTRANSPARENT_COLOR because it doesn't really make sense. And
> using SetBackground(wxNullColour) already does something [different]. So I
> like your other suggestion of having SetTransparentTextBackground(bool)
> (or maybe SetOpaqueTextBackground() as transparent should be the default)
> better.

you mean just with text and its background ? I just have two DrawText calls,
in wxGC one with a background brush and one without, so no mode enum
propagation here, the only place the mode is used is in wxGCDCImpl::DrawText
along the lines of

    if ( m_backgroundMode == wxTRANSPARENT )
        m_graphicContext->DrawText( .... );
    else
        m_graphicContext->DrawText( ..., brush param .. )


Best,

Stefan







More information about the wx-dev mailing list