Print Page | Close Window

Select NONE

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=13696
Printed Date: 28 September 2024 at 2:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Select NONE
Posted By: gmail
Subject: Select NONE
Date Posted: 15 March 2009 at 4:20pm
How can we deselect everything (including cell selection with no event on it) on Calendar Control? The reason I'm asking is when we print out Calendar there's also that 'empty selection' shown on printer page? Check the attached image to see what I mean... Thanks for replying!





Replies:
Posted By: zitz
Date Posted: 22 May 2009 at 4:51am
?


Posted By: mdoubson
Date Posted: 21 August 2009 at 12:16am
I think we already get rid from such artefacts - now there is no way to create event without data - just start and end time is not enough

-------------
Mark Doubson, Ph.D.


Posted By: Algae
Date Posted: 25 September 2010 at 2:50pm
Actually that bug still exists.

Here's how I tried to get rid of it. CCalendarView is whatever you've called the CView for your calendar. My addition in blue. It DOES NOT work as expected. So the question to CJ is, how does one turn off the selection box? Especially for printing! It's not a question of an event existing or not, it's how to turn off the highlighting on a non-event when necessary.

void CCalendarView::OnFilePrintPreview()
{
    GetDocument()->m_bPreview = TRUE;

    CXTPCalendarView* pView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, GetCalendarCtrl().GetActiveView());
    if (pView)
    {
        pView->ResetSelection();
        pView->RedrawControl();
    }


    CPrintPreviewState* pState = new CPrintPreviewState;

    if ( !DoPrintPreview( XTP_IDD_PREVIEW_DIALOGBAR, this,
        RUNTIME_CLASS( CXTPPreviewView ), pState ))
    {
        TRACE0( "Error: DoPrintPreview failed.\n" );
        AfxMessageBox( AFX_IDP_COMMAND_FAILURE );
        delete pState;      // preview failed to initialize, delete State now
    }
}

As you can see, ResetSelection removes any selection.




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