Garmin Fleet Management Controller  2.19.0
CTxtMsgNewDlg Class Reference

Modal dialog allowing the user to send a text message to the client. More...

#include <CTxtMsgNewDlg.h>

+ Inheritance diagram for CTxtMsgNewDlg:

Public Member Functions

 CTxtMsgNewDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CTxtMsgNewDlg ()
 Destructor. More...
 

Protected Types

enum  MessageProtocolEnum {
  A611_LONG_TEXT_MESSAGE_PROTOCOL,
  A611_CANNED_RESPONSE_LONG_TEXT_MESSAGE_PROTOCOL,
  A604_OPEN_MESSAGE_PROTOCOL,
  A604_CANNED_RESPONSE_MESSAGE_PROTOCOL,
  A602_OPEN_MESSAGE_PROTOCOL,
  A602_OK_ACK_MESSAGE_PROTOCOL,
  A602_YES_NO_ACK_MESSAGE_PROTOCOL,
  MESSAGE_PROTOCOL_CNT
}
 Enum for message protocols. More...
 
typedef int MessageProtocolType
 Typedef for message protocols listed in the combo box. More...
 

Protected Member Functions

virtual void DoDataExchange (CDataExchange *aDataExchange)
 Perform dialog data exchange and validation. More...
 
afx_msg void OnBnClickedOk ()
 Click handler for the OK button. More...
 
afx_msg void OnCbnSelChangeMsgProtocol ()
 Selection Changed handler for the Protocol combo box. More...
 
afx_msg void OnEnChangeEditFields ()
 Edit Change handler for all edit boxes on the dialog. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
void updateDlgFields (int aSelectedProtocol)
 Enable/disable controls as appropriate for the selected protocol. More...
 

Protected Attributes

FmiApplicationLayermCom
 Pointer to the main app dialog. More...
 
BOOL mDisplayImmediately
 If TRUE, the "Display Immediately" box is checked. More...
 
CString mMessageId
 Contents of the Message ID edit box. More...
 
MessageProtocolType mMessageProtocol
 Index of the selected message protocol. More...
 
CString mMessageText
 Contents of the Message Text edit box. More...
 
uint8 mMessageType
 Value to use on the message_type member of the A604 text message. More...
 

Detailed Description

Modal dialog allowing the user to send a text message to the client.

This dialog allows the user to send a text message using any of the supported text message protocols. The Message ID and Display Immediately controls are enabled or disabled depending on the selected protocol. Most of the text message protocol are initiated immediately when the Send button is clicked; the Canned Response Text Message protocol is the exception because additional information is needed. If the user selects this protocol, clicking Send causes a second dialog to be opened; the protocol is initiated after the user selects the canned responses.

Definition at line 30 of file CTxtMsgNewDlg.h.

Member Typedef Documentation

typedef int CTxtMsgNewDlg::MessageProtocolType
protected

Typedef for message protocols listed in the combo box.

See also
MessageProtocolEnum for valid values

Definition at line 46 of file CTxtMsgNewDlg.h.

Member Enumeration Documentation

Enum for message protocols.

Note
Must follow the sequence and order in OnInitDialog()
Enumerator
A611_LONG_TEXT_MESSAGE_PROTOCOL 
A611_CANNED_RESPONSE_LONG_TEXT_MESSAGE_PROTOCOL 
A604_OPEN_MESSAGE_PROTOCOL 
A604_CANNED_RESPONSE_MESSAGE_PROTOCOL 
A602_OPEN_MESSAGE_PROTOCOL 
A602_OK_ACK_MESSAGE_PROTOCOL 
A602_YES_NO_ACK_MESSAGE_PROTOCOL 
MESSAGE_PROTOCOL_CNT 

Definition at line 50 of file CTxtMsgNewDlg.h.

Constructor & Destructor Documentation

CTxtMsgNewDlg::CTxtMsgNewDlg ( CWnd *  aParent,
FmiApplicationLayer aCom 
)

Constructor.

Parameters
aParentThe parent of this dialog
aComReference to the FMI communication controller

Definition at line 30 of file CTxtMsgNewDlg.cpp.

CTxtMsgNewDlg::~CTxtMsgNewDlg ( )
virtual

Destructor.

Definition at line 51 of file CTxtMsgNewDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CTxtMsgNewDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 60 of file CTxtMsgNewDlg.cpp.

References IDC_MSGNEW_CHK_DISP_IMMED, mDisplayImmediately, mMessageId, mMessageProtocol, and mMessageText.

Referenced by ~CTxtMsgNewDlg().

void CTxtMsgNewDlg::OnCbnSelChangeMsgProtocol ( )
protected

Selection Changed handler for the Protocol combo box.

Enable the text boxes that are valid for the newly selected protocol, and disable the rest.

Definition at line 255 of file CTxtMsgNewDlg.cpp.

References mMessageProtocol, TRUE, and updateDlgFields().

void CTxtMsgNewDlg::OnEnChangeEditFields ( )
protected

Edit Change handler for all edit boxes on the dialog.

Validates that all required fields have input. If they do, enable the OK button; otherwise, disable the OK button.

Since
Protocol A604

Definition at line 360 of file CTxtMsgNewDlg.cpp.

References A604_CANNED_RESPONSE_MESSAGE_PROTOCOL, A611_CANNED_RESPONSE_LONG_TEXT_MESSAGE_PROTOCOL, A611_LONG_TEXT_MESSAGE_PROTOCOL, FALSE, FMI_SUPPORT_A611, LONG_TEXT_MSG_MAX_SIZE, mMessageId, mMessageProtocol, mMessageText, TEXT_MSG_MAX_SIZE, and TRUE.

Referenced by updateDlgFields().

BOOL CTxtMsgNewDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initializes the list of protocols and other dialog fields.

Returns
TRUE, since this function does not set focus to a control

Definition at line 81 of file CTxtMsgNewDlg.cpp.

References MESSAGE_PROTOCOL_CNT, TRUE, and updateDlgFields().

void CTxtMsgNewDlg::updateDlgFields ( int  aSelectedProtocol)
protected

Enable/disable controls as appropriate for the selected protocol.

Enable the controls that are valid for the newly selected protocol, and disable the rest.

Parameters
aSelectedProtocolThe index of the selected protocol in the combo box.

Definition at line 270 of file CTxtMsgNewDlg.cpp.

References A602_OK_ACK_MESSAGE_PROTOCOL, A602_OPEN_MESSAGE_PROTOCOL, A602_YES_NO_ACK_MESSAGE_PROTOCOL, A604_CANNED_RESPONSE_MESSAGE_PROTOCOL, A604_OPEN_MESSAGE_PROTOCOL, A611_CANNED_RESPONSE_LONG_TEXT_MESSAGE_PROTOCOL, A611_LONG_TEXT_MESSAGE_PROTOCOL, FALSE, IDC_MSGNEW_CHK_DISP_IMMED, IDC_MSGNEW_LBL_CANRSP_HINT, IDC_MSGNEW_LBL_MSG_ID, IDC_MSGNEW_LBL_MSG_ID_HINT, IDC_MSGNEW_LBL_MSG_TEXT_HINT, OnEnChangeEditFields(), and TRUE.

Referenced by OnCbnSelChangeMsgProtocol(), and OnInitDialog().

Member Data Documentation

FmiApplicationLayer& CTxtMsgNewDlg::mCom
protected

Pointer to the main app dialog.

Definition at line 86 of file CTxtMsgNewDlg.h.

Referenced by OnBnClickedOk().

BOOL CTxtMsgNewDlg::mDisplayImmediately
protected

If TRUE, the "Display Immediately" box is checked.

Definition at line 101 of file CTxtMsgNewDlg.h.

Referenced by DoDataExchange(), and OnBnClickedOk().

CString CTxtMsgNewDlg::mMessageId
protected

Contents of the Message ID edit box.

Definition at line 96 of file CTxtMsgNewDlg.h.

Referenced by DoDataExchange(), OnBnClickedOk(), and OnEnChangeEditFields().

MessageProtocolType CTxtMsgNewDlg::mMessageProtocol
protected

Index of the selected message protocol.

Definition at line 92 of file CTxtMsgNewDlg.h.

Referenced by DoDataExchange(), OnBnClickedOk(), OnCbnSelChangeMsgProtocol(), and OnEnChangeEditFields().

CString CTxtMsgNewDlg::mMessageText
protected

Contents of the Message Text edit box.

Definition at line 89 of file CTxtMsgNewDlg.h.

Referenced by DoDataExchange(), OnBnClickedOk(), and OnEnChangeEditFields().

uint8 CTxtMsgNewDlg::mMessageType
protected

Value to use on the message_type member of the A604 text message.

Definition at line 104 of file CTxtMsgNewDlg.h.

Referenced by OnBnClickedOk().


The documentation for this class was generated from the following files: