Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Select NONE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Select NONE

 Post Reply Post Reply
Author
Message
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Topic: Select NONE
    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!


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: 22 May 2009 at 4:51am
?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post 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.

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.156 seconds.