Garmin Fleet Management Controller  2.19.0
CTimeOfDayPickerDlg.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * CTimeOfDayPickerDlg.cpp
5 *
6 * Copyright 2014 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 
11 #include "stdafx.h"
12 #include "CTimeOfDayPickerDlg.h"
13 
14 #if( FMI_SUPPORT_A620 )
15 
16 // CTimeOfDayPickerDlg dialog
17 
18 IMPLEMENT_DYNAMIC(CTimeOfDayPickerDlg, CDialog)
19 
20 UINT CTimeOfDayPickerDlg::CaptureSetting(
21  CWnd* pParent,
22  UINT titleStringId,
23  UINT valueLabelStringId,
24  COleDateTime & value
25  )
26 {
27  CTimeOfDayPickerDlg dlg( pParent );
28  dlg.mTitleStringId = titleStringId;
29  dlg.mValueLabelStringId = valueLabelStringId;
30  dlg.mValue = value;
31  if( IDOK == dlg.DoModal() )
32  {
33  value = dlg.mValue;
34  return IDOK;
35  }
36  return IDCANCEL;
37 }
38 
39 //----------------------------------------------------------------------
43 //----------------------------------------------------------------------
45  CWnd* pParent
46  )
47  : CDialog(CTimeOfDayPickerDlg::IDD, pParent)
48  , mValue(COleDateTime::GetCurrentTime())
49  {
50 
51 }
52 
54 {
55 }
56 
57 void CTimeOfDayPickerDlg::DoDataExchange(CDataExchange* pDX)
58 {
59 CDialog::DoDataExchange(pDX);
60 DDX_DateTimeCtrl(pDX, IDC_TIME_OF_DAY, mValue);
61  }
62 
63 
64 BEGIN_MESSAGE_MAP(CTimeOfDayPickerDlg, CDialog)
65 END_MESSAGE_MAP()
66 
67 // CTimeOfDayPickerDlg message handlers
68 
69 //----------------------------------------------------------------------
75 //----------------------------------------------------------------------
77 {
78  CDialog::OnInitDialog();
79 
80  //initialize controls
81  CString title;
82  title.LoadString( mTitleStringId );
83  SetWindowText( title );
84 
85  CString label;
86  label.LoadString( mValueLabelStringId );
87  GetDlgItem( IDC_HOS_SETTING_VALUE_LABEL )->SetWindowText( label );
88 
89  return TRUE;
90 }
91 
92 #endif
BOOL OnInitDialog()
Initialize the dialog.
#define IDC_TIME_OF_DAY
Definition: resource.h:516
CTimeOfDayPickerDlg(CWnd *pParent)
Constructor.
COleDateTime mValue
Control value representing the selected value.
#define TRUE
Definition: garmin_types.h:45
UINT mValueLabelStringId
Resource ID for the value field label.
Form for individually capturing time of day.
virtual void DoDataExchange(CDataExchange *pDX)
#define IDC_HOS_SETTING_VALUE_LABEL
Definition: resource.h:478
UINT mTitleStringId
Resource ID for the window title.