Update ListDate.h

Remove a line, fix title case, adjust spacing
This commit is contained in:
Derek "Turtle" Roe 2021-03-17 04:30:14 -05:00
parent 2d427d3a3b
commit 82059adc6f
1 changed files with 10 additions and 11 deletions

View File

@ -1,4 +1,3 @@
#pragma once #pragma once
#include "ListTypes.h" #include "ListTypes.h"
@ -35,7 +34,7 @@ public:
m_nFlags = nFlags; m_nFlags = nFlags;
m_nExitChar = 0; m_nExitChar = 0;
// destroy old date control... // Destroy old date control
if ( IsWindow() ) if ( IsWindow() )
DestroyWindow(); DestroyWindow();
@ -47,15 +46,15 @@ public:
if ( nFlags & ITEM_FLAGS_TIME_ONLY ) if ( nFlags & ITEM_FLAGS_TIME_ONLY )
dwStyle |= DTS_UPDOWN; dwStyle |= DTS_UPDOWN;
// create date-time control // Create date-time control
CRect Area( rcRect.left + 3, rcRect.top + 2, rcRect.right - 3, rcRect.bottom - 2 ); CRect Area( rcRect.left + 3, rcRect.top + 2, rcRect.right - 3, rcRect.bottom - 2 );
if ( CWindowImpl< CListDate, CDateTimePickerCtrl >::Create( hWndParent, Area, NULL, dwStyle ) == NULL ) if ( CWindowImpl< CListDate, CDateTimePickerCtrl >::Create( hWndParent, Area, NULL, dwStyle ) == NULL )
return FALSE; return FALSE;
// remove border // Remove border
ModifyStyleEx( WS_EX_CLIENTEDGE, 0, SWP_FRAMECHANGED ); ModifyStyleEx( WS_EX_CLIENTEDGE, 0, SWP_FRAMECHANGED );
// get system message font // Get system message font
CLogFont logFont; CLogFont logFont;
logFont.SetMessageBoxFont(); logFont.SetMessageBoxFont();
if ( !m_fntDateFont.IsNull() ) if ( !m_fntDateFont.IsNull() )
@ -78,7 +77,7 @@ public:
else else
SetFormat(stdstr_f("%s %s",szDateFormat,szTimeFormat ).ToUTF16().c_str()); SetFormat(stdstr_f("%s %s",szDateFormat,szTimeFormat ).ToUTF16().c_str());
// get current date if setting time-only // Get current date if setting time-only
if ( nFlags & ITEM_FLAGS_TIME_ONLY ) if ( nFlags & ITEM_FLAGS_TIME_ONLY )
{ {
SYSTEMTIME stCurrentDate; SYSTEMTIME stCurrentDate;
@ -92,7 +91,7 @@ public:
SetSystemTime( ( !( nFlags & ITEM_FLAGS_TIME_ONLY ) && stItemDate.wYear == 0 ) ? GDT_NONE : GDT_VALID, &stItemDate ); SetSystemTime( ( !( nFlags & ITEM_FLAGS_TIME_ONLY ) && stItemDate.wYear == 0 ) ? GDT_NONE : GDT_VALID, &stItemDate );
// show date-time control // Show date-time control
ShowWindow( SW_SHOW ); ShowWindow( SW_SHOW );
SetFocus(); SetFocus();
@ -110,15 +109,15 @@ public:
void OnKillFocus( HWND hNewWnd ) void OnKillFocus( HWND hNewWnd )
{ {
// have we dropped down the calendar control? // Have we dropped down the calendar control?
if ( hNewWnd != NULL && GetMonthCal() == hNewWnd ) if ( hNewWnd != NULL && GetMonthCal() == hNewWnd )
return; return;
// have we selected a new date from the calendar control? // Have we selected a new date from the calendar control?
if ( GetFocus() == m_hWnd ) if ( GetFocus() == m_hWnd )
return; return;
// hide calendar control in case it's not closed by losing focus // Hide calendar control in case it's not closed by losing focus
if ( GetMonthCal().IsWindow() ) if ( GetMonthCal().IsWindow() )
GetMonthCal().ShowWindow( SW_HIDE ); GetMonthCal().ShowWindow( SW_HIDE );
@ -156,7 +155,7 @@ public:
listNotify.m_lpszItemText = bValidDate ? _T( "1" ) : _T( "0" ); listNotify.m_lpszItemText = bValidDate ? _T( "1" ) : _T( "0" );
listNotify.m_lpItemDate = &stItemDate; listNotify.m_lpItemDate = &stItemDate;
// forward notification to parent // Forward notification to parent
FORWARD_WM_NOTIFY( wndParent, listNotify.m_hdrNotify.idFrom, &listNotify.m_hdrNotify, ::SendMessage ); FORWARD_WM_NOTIFY( wndParent, listNotify.m_hdrNotify.idFrom, &listNotify.m_hdrNotify, ::SendMessage );
} }