Garmin Fleet Management Controller
2.19.0
|
Modal dialog allowing the user to send a text message to the client. More...
#include <CTxtMsgNewDlg.h>
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 | |
FmiApplicationLayer & | mCom |
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... | |
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.
|
protected |
Typedef for message protocols listed in the combo box.
Definition at line 46 of file CTxtMsgNewDlg.h.
|
protected |
Enum for message protocols.
Definition at line 50 of file CTxtMsgNewDlg.h.
CTxtMsgNewDlg::CTxtMsgNewDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 30 of file CTxtMsgNewDlg.cpp.
|
virtual |
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 60 of file CTxtMsgNewDlg.cpp.
References IDC_MSGNEW_CHK_DISP_IMMED, mDisplayImmediately, mMessageId, mMessageProtocol, and mMessageText.
Referenced by ~CTxtMsgNewDlg().
|
protected |
Click handler for the OK button.
If the selected protocol is a canned response text message, display a dialog allowing the user to select the allowed responses; otherwise, call FmiApplicationLayer to send the text message using the protocol and details entered by the user.
Definition at line 120 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_MESSAGE_TYPE_DISP_IMMEDIATE, A604_MESSAGE_TYPE_NORMAL, A604_OPEN_MESSAGE_PROTOCOL, A611_CANNED_RESPONSE_LONG_TEXT_MESSAGE_PROTOCOL, A611_LONG_TEXT_MESSAGE_PROTOCOL, FMI_ID_SERVER_OK_ACK_TXT_MSG, FMI_ID_SERVER_OPEN_TXT_MSG, FMI_ID_SERVER_YES_NO_CONFIRM_MSG, MessageId::getIdSize(), LONG_TEXT_MSG_MAX_SIZE, FmiApplicationLayer::mClientCodepage, mCom, mDisplayImmediately, mMessageId, mMessageProtocol, mMessageText, mMessageType, FmiApplicationLayer::sendA602TextMessage(), FmiApplicationLayer::sendA604TextMessage(), FmiApplicationLayer::sendA611LongTextMessage(), TEXT_MSG_BUFFER_MAX_SIZE, TEXT_MSG_MAX_SIZE, and TRUE.
|
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().
|
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.
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().
|
protected |
Initialize the dialog.
This function is called when the window is created. It initializes the list of protocols and other dialog fields.
Definition at line 81 of file CTxtMsgNewDlg.cpp.
References MESSAGE_PROTOCOL_CNT, TRUE, and updateDlgFields().
|
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.
aSelectedProtocol | The 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().
|
protected |
Pointer to the main app dialog.
Definition at line 86 of file CTxtMsgNewDlg.h.
Referenced by OnBnClickedOk().
|
protected |
If TRUE, the "Display Immediately" box is checked.
Definition at line 101 of file CTxtMsgNewDlg.h.
Referenced by DoDataExchange(), and OnBnClickedOk().
|
protected |
Contents of the Message ID edit box.
Definition at line 96 of file CTxtMsgNewDlg.h.
Referenced by DoDataExchange(), OnBnClickedOk(), and OnEnChangeEditFields().
|
protected |
Index of the selected message protocol.
Definition at line 92 of file CTxtMsgNewDlg.h.
Referenced by DoDataExchange(), OnBnClickedOk(), OnCbnSelChangeMsgProtocol(), and OnEnChangeEditFields().
|
protected |
Contents of the Message Text edit box.
Definition at line 89 of file CTxtMsgNewDlg.h.
Referenced by DoDataExchange(), OnBnClickedOk(), and OnEnChangeEditFields().
|
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().