////////////////////////////////////////
// START of File: C0_DATB.CPP
////////////////////////////////////////


//
// Include this source file's necessary header files:
//
#include	<cf_api/bf_defs.h>
#include    <cf_api/c0_datb.hpp> 
            // relative to the IDE's (global) include path: ~/cfrz

//---------------------------------------------------------------
// Use this ctor to generate a default cf_DispAttribs object:
//---------------------------------------------------------------
cf_DispAttribs
    ::cf_DispAttribs()
{
    // Init applicable member vars (as per the hpp spec):
    this->bIsActive = FALSE;

    this->bf_clrGroupPen = CF_BLACK;
        // Normally kept black for the life of the group...

    this->bf_clrGroupBrush = CF_WHITE;
        // This brush color usually will get updated (from a 
        // "palette" of colors) by the "owner chart" object in 
        // the chart's activateGroupUserData(...) routine...
    
    this->bf_pstyGroupPen      = CF_PS_SOLID;
    this->iGroupPenWidth        = 1;
    this->bf_bhatGroupBrush    = CF_BHAT_NONE;
        // Normally these do not get reset (but 
        // they CAN be, of course)...

    this->bMarkWhen2D = FALSE;
    this->bMarkWhen3D = FALSE;
        // Most objects (except for 2D/3D point series 
        // and 2D polylines) keep these FALSE...

}   // end of c-tor


cf_DispAttribs
    ::~cf_DispAttribs() 
        {}

cf_DispAttribs  
    cf_DispAttribs
        ::operator=( const cf_DispAttribs &cr_cf_datbSource )
{
    //
    // Copy the essential datagroup object member vars:
    //
    this->bIsActive         = cr_cf_datbSource.bIsActive;

    this->bf_clrGroupPen   = (bf_Color&) 
                                cr_cf_datbSource.bf_clrGroupPen;
                                  
    this->bf_clrGroupBrush = (bf_Color&)
                                cr_cf_datbSource.bf_clrGroupBrush;

    this->bf_pstyGroupPen      = cr_cf_datbSource.bf_pstyGroupPen;
    this->iGroupPenWidth        = cr_cf_datbSource.iGroupPenWidth;
    this->bf_bhatGroupBrush    = cr_cf_datbSource.bf_bhatGroupBrush;
                                // (note -- no need to cast enums to refs)
    return *this;

}   // end of cf_DispAttribs::operator=( const cf_DispAttribs& );


//---------------------------------------------------------------
// Users may want to turn sets of display attributes on/off.
//---------------------------------------------------------------
/*
BOOL
    cf_DispAttribs
        ::active()
            { return this->bIsActive; }
void
    cf_DispAttribs
        ::active( BOOL bNewState )
            { this->bIsActive = bNewState; }
*/

//------------------------------------------------
// Users may want to get/set group color attribs.
//------------------------------------------------
bf_Color
    cf_DispAttribs
        ::colorBrush()
            { return this->bf_clrGroupBrush; }
void
    cf_DispAttribs
        ::colorBrush( const bf_Color &cr_bf_clrNewVal )
            { this->bf_clrGroupBrush = (bf_Color&) cr_bf_clrNewVal; }

bf_Color
    cf_DispAttribs
        ::colorPen()
            { return this->bf_clrGroupPen; }
void
    cf_DispAttribs
        ::colorPen( const bf_Color &cr_bf_clrNewVal )
            { this->bf_clrGroupPen = (bf_Color&) cr_bf_clrNewVal; }


//------------------------------------------------
// User objects can turn 2D/3D markings on/off.
//------------------------------------------------
BOOL
    cf_DispAttribs
        ::markWhen2D()
            { return this->bMarkWhen2D; }
void
    cf_DispAttribs
        ::markWhen2D( BOOL bNewState )
            { this->bMarkWhen2D = bNewState; }
BOOL
    cf_DispAttribs
        ::markWhen3D()
            { return this->bMarkWhen3D; }
void
    cf_DispAttribs
        ::markWhen3D( BOOL bNewState )
            { this->bMarkWhen3D = bNewState; }




//
// Set methods which are synonyms of this->active( BOOL ).
//
/*
void
    cf_DispAttribs
        ::on()
            { this->bIsActive = TRUE; }

void
    cf_DispAttribs
        ::off()
            { this->bIsActive = FALSE; }
*/


//--------------------------------------------------------------------
// "Push and/or Pop" these Attribs onto an active "Display" object:
//--------------------------------------------------------------------
void
    cf_DispAttribs
        ::popBrushAttribs( bf_Display *p_bf_dspTarget ) 
            { delete p_bf_dspTarget->dsp_popBrush(); }
void
    cf_DispAttribs
        ::popPenAttribs( bf_Display *p_bf_dspTarget ) 
            { delete p_bf_dspTarget->dsp_popPen(); }

void
    cf_DispAttribs
        ::pushBrushAttribs( bf_Display *p_bf_dspActive ) 
{
    p_bf_dspActive
        ->dsp_pushBrush( new bf_Brush( this->bf_clrGroupBrush ) );
    /*
      Note: Brush Hatching causes "unfilled" pie wedge rendering
      in Win NT -- maybe caused by an implicit "no-hatch implies
      no-fill" condition? -- will resolve when regular hatching
      is implemented -- DPC 10/28/96
    p_bf_dspActive
        ->dsp_pushBrush( new bf_Brush( this->bf_clrGroupBrush,
                                        this->bf_bhatGroupBrush ) ); 
     */
}
        
void
    cf_DispAttribs
        ::pushPenAttribs( bf_Display *p_bf_dspActive ) 
{
    p_bf_dspActive
        ->dsp_pushPen( new bf_Pen( this->bf_clrGroupPen,
                                    this->bf_pstyGroupPen,
                                    this->iGroupPenWidth    )  );
}



//--------------------------------------------------
// Users may want to get/set group style attribs.
//--------------------------------------------------
bf_BrushHatch  
    cf_DispAttribs
        ::styleBrushHatch()
            { return this->bf_bhatGroupBrush; }
void            
    cf_DispAttribs
//        ::styleBrushHatch( const bf_BrushHatch &cr_bf_bhatNewVal )
        ::styleBrushHatch( bf_BrushHatch bf_bhatNewVal )
            { this->bf_bhatGroupBrush = bf_bhatNewVal; }

bf_PenStyle    
    cf_DispAttribs
        ::stylePen()
            { return this->bf_pstyGroupPen; }
void            
    cf_DispAttribs
//        ::stylePen( const bf_PenStyle &cr_bf_pstyNewVal )
        ::stylePen( bf_PenStyle bf_pstyNewVal )
            { this->bf_pstyGroupPen = bf_pstyNewVal; }
int             
    cf_DispAttribs
        ::stylePenWidth()
            { return this->iGroupPenWidth; }
void            
    cf_DispAttribs
        ::stylePenWidth( int iNewVal )
            { this->iGroupPenWidth = iNewVal; }

//
// End of class cf_DispAttribs Implementation
//

////////////////////////////////////////
// END of File: C0_DATB.CPP
////////////////////////////////////////
    
    







