Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPDatePickerControl::GetDayMetrics
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPDatePickerControl::GetDayMetrics

 Post Reply Post Reply
Author
Message
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Topic: CXTPDatePickerControl::GetDayMetrics
    Posted: 26 February 2010 at 7:37am
CXTPDatePickerControl::GetDayMetrics( COleDateTime& dtDay, XTP_DAYITEM_METRICS* pDayMetics );
Please add to XTP_DAYITEM_METRICS field:
BOOL IsNonMonthDay();

like:

struct _XTP_EXT_CLASS XTP_DAYITEM_METRICS : public CXTPCmdTarget
{
    BOOL IsNonMonthDay() { return m_bIsNonMonthDay; };
    //-----------------------------------------------------------------------
    // Summary:
    //     Get day item font..
    // Remarks:
    //     Return a day font stored by the structure.
    //-----------------------------------------------------------------------
    CFont* GetFont();
    //-----------------------------------------------------------------------
    // Summary:
    //     Set a new font for the day item.
    // Parameters:
    //  pFont - Pointer to a CFont object.
    //-----------------------------------------------------------------------
    void SetFont(CFont* pFont);

    COLORREF clrForeground; // A COLORREF object that contains the item's foreground color.
    COLORREF clrBackground; // A COLORREF object that contains the item's background color.

//{{AFX_CODEJOCK_PRIVATE
    XTP_DAYITEM_METRICS();
    virtual ~XTP_DAYITEM_METRICS(){};

private:
    CFont m_fntText;        // A CFont object that contains the item's text font.
    BOOL m_bIsNonMonthDay;

//}}AFX_CODEJOCK_PRIVATE

};

Xtreme ToolkitPro v13.1.0, static, VC++6
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2010 at 7:40am
Now i must do so:

void CDatePickerControlEx::GetDayMetrics( COleDateTime& dtDay, XTP_DAYITEM_METRICS* pDayMetics )
{
    if ( pDayMetics->clrForeground != GetPaintManager()->GetNonMonthDayTextColor() ) // будет кака если цветовая схема совпадет
    {
        if ( dtDay.GetDayOfWeek() == 1 )
        {
            pDayMetics->clrForeground = RGB( 230, 25, 25 );
        }
        else if ( dtDay.GetDayOfWeek() == 7 )
        {
            pDayMetics->clrForeground = RGB( 25, 25, 230 );
        }
    }
    CXTPDatePickerControl::GetDayMetrics( dtDay, pDayMetics );
}

Xtreme ToolkitPro v13.1.0, static, VC++6
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.