Print Page | Close Window

CXTPDatePickerControl::GetDayMetrics

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=16285
Printed Date: 24 September 2024 at 1:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPDatePickerControl::GetDayMetrics
Posted By: zitz
Subject: CXTPDatePickerControl::GetDayMetrics
Date 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



Replies:
Posted By: zitz
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net