Garmin Fleet Management Controller  2.19.0
CTxtMsgAckDlg.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * CTxtMsgAckDlg.cpp
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #include "stdafx.h"
11 #include "CFmiApplication.h"
12 #include "CTxtMsgAckDlg.h"
13 #include "CFmiPcAppDlg.h"
14 
15 IMPLEMENT_DYNAMIC( CTxtMsgAckDlg, CDialog )
16 
17 BEGIN_MESSAGE_MAP( CTxtMsgAckDlg, CDialog )
18 END_MESSAGE_MAP()
19 
20 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 CTxtMsgAckDlg::CTxtMsgAckDlg
27  (
28  CWnd * aParent,
29  const FmiApplicationLayer & aCom,
30  const text_msg_ack_event_type * aAckEvent
31  )
32  : CDialog( IDD_TXT_MSG_ACK, aParent )
33  , mCom( aCom )
34  , mAckEvent( *aAckEvent )
35  , mMessageId( _T("") )
36  , mResponseText( _T("") )
37 {
38 }
39 
40 //----------------------------------------------------------------------
42 //----------------------------------------------------------------------
44 {
45 }
46 
47 //----------------------------------------------------------------------
50 //----------------------------------------------------------------------
52  (
53  CDataExchange * aDataExchange
54  )
55 {
56  CDialog::DoDataExchange( aDataExchange );
57  DDX_Text( aDataExchange, IDC_MSGACK_TXT_MSG_ID, mMessageId );
58  DDX_Text( aDataExchange, IDC_MSGACK_TXT_RESPONSE, mResponseText );
59 }
60 
61 //----------------------------------------------------------------------
67 //----------------------------------------------------------------------
69 {
70  CDialog::OnInitDialog();
71 
72  TCHAR stringBuffer[50];
73 
75 
76  MultiByteToWideChar( mCom.mClientCodepage, 0, mAckEvent.ack_text, -1, stringBuffer, 50 );
77  stringBuffer[49] = '\0';
78  mResponseText.Format( _T(" %s"), stringBuffer );
79 
80  UpdateData( FALSE );
81 
82  return TRUE;
83 } /* OnInitDialog() */
BOOL OnInitDialog()
Initialize the dialog.
MessageId message_id
The message ID that was ACKed.
Definition: EventId.h:143
#define FALSE
Definition: garmin_types.h:46
#define TRUE
Definition: garmin_types.h:45
CString toCString(codepage_type aCodePage) const
CString representation of the message ID.
Definition: MessageId.cpp:167
char ack_text[50]
Text of the ack (OK, Yes, No, or a canned response)
Definition: EventId.h:144
codepage_type mClientCodepage
Code page used for encoding of text fields when communicating with the client.
Serial communication controller for Garmin and FMI packets.
#define IDC_MSGACK_TXT_RESPONSE
Definition: resource.h:262
Modal pop up which displays a text message ack received from the client.
Definition: CTxtMsgAckDlg.h:25
text_msg_ack_event_type mAckEvent
The text message ack event that is being displayed.
Definition: CTxtMsgAckDlg.h:51
const FmiApplicationLayer & mCom
The reference to the communication controller.
Definition: CTxtMsgAckDlg.h:48
Structure containing details for a text message ACK from the client.
Definition: EventId.h:141
CString mResponseText
Text representation of the response from the client.
Definition: CTxtMsgAckDlg.h:57
CString mMessageId
Text representation of the text message ID.
Definition: CTxtMsgAckDlg.h:54
virtual void DoDataExchange(CDataExchange *aDataExchange)
Perform dialog data exchange and validation.
#define IDD_TXT_MSG_ACK
Definition: resource.h:38
virtual ~CTxtMsgAckDlg()
Destructor.
#define IDC_MSGACK_TXT_MSG_ID
Definition: resource.h:261