18 ON_BN_CLICKED( IDOK, OnBnClickedOk )
29 CTxtMsgNewDlg::CTxtMsgNewDlg
36 , mMessageText( _T("") )
37 , mMessageProtocol( 0 )
39 , mMessageId( _T(
"") )
43 , mDisplayImmediately(
FALSE )
61 CDataExchange * aDataExchange
64 CDialog::DoDataExchange( aDataExchange );
65 DDX_Text( aDataExchange, IDC_MSGNEW_EDIT_MESSAGE_TEXT,
mMessageText );
68 DDX_Text( aDataExchange, IDC_MSGNEW_EDIT_MSG_ID,
mMessageId );
70 #if( FMI_SUPPORT_A604 ) 83 CDialog::OnInitDialog();
85 CComboBox * comboBox = (CComboBox *)GetDlgItem( IDC_MSGNEW_CBO_PROTOCOL );
88 #if( FMI_SUPPORT_A611 ) 89 comboBox->AddString( _T(
"A611 - Long Text Message") );
90 comboBox->AddString( _T(
"A611 - Canned Response Long Text Message") );
92 #if( FMI_SUPPORT_A604 ) 93 comboBox->AddString( _T(
"A604 - Open Text Message") );
94 comboBox->AddString( _T(
"A604 - Canned Response Text Message") );
96 #if( FMI_SUPPORT_A602 ) 97 comboBox->AddString( _T(
"A602 - Open Text Message") );
98 comboBox->AddString( _T(
"A602 - Simple Okay Acknowledge") );
99 comboBox->AddString( _T(
"A602 - Yes/No Confirmation") );
101 #if( FMI_SUPPORT_LEGACY ) 102 comboBox->AddString( _T(
"Legacy Text Message") );
106 comboBox->SetCurSel( 0 );
126 #if( FMI_SUPPORT_A602 ) 130 #if( FMI_SUPPORT_A611 ) 139 messageText[maxLength - 1] =
'\0';
141 #if( FMI_SUPPORT_A602 ) 145 #if( FMI_SUPPORT_A602 ) 152 #if( FMI_SUPPORT_A611 ) 156 #if( FMI_SUPPORT_A604 ) 165 response = MessageBox
167 _T(
"The message ID field is empty. If you continue, message status will not be available for this message. Do you want to continue?"),
168 _T(
"Message ID Is Empty"),
171 if( IDNO == response )
178 #if( FMI_SUPPORT_A604 ) 189 #if( FMI_SUPPORT_A611 ) 195 _T(
"A long text message is already in progress. Wait until it has completed before sending another."),
196 _T(
"Message Already in Progress"), MB_OK
204 if( dlg.DoModal() == IDCANCEL )
209 #if( FMI_SUPPORT_A604 ) 216 if( dlg.DoModal() == IDCANCEL )
221 #if( FMI_SUPPORT_A602 ) 232 #if( FMI_SUPPORT_LEGACY ) 233 case LEGACY_TEXT_MESSAGE_PROTOCOL:
234 mCom.sendLegacyTextMessage( messageText );
240 _T(
"The message type you have selected is not available."),
241 _T(
"Unsupported"), MB_OK
271 int aSelectedProtocol
274 switch( aSelectedProtocol )
276 #if( FMI_SUPPORT_A611 ) 282 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
290 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
294 #if( FMI_SUPPORT_A604 ) 300 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
308 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
312 #if( FMI_SUPPORT_A602 ) 318 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
FALSE );
326 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
334 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
TRUE );
338 #if( FMI_SUPPORT_LEGACY ) 339 case LEGACY_TEXT_MESSAGE_PROTOCOL:
344 GetDlgItem( IDC_MSGNEW_EDIT_MSG_ID )->EnableWindow(
FALSE );
362 BOOL formValid =
TRUE;
364 #if( !( SKIP_VALIDATION ) ) 366 #if( FMI_SUPPORT_A604 ) 378 #if( FMI_SUPPORT_A611 ) 391 GetDlgItem( IDOK )->EnableWindow(
TRUE );
395 GetDlgItem( IDOK )->EnableWindow(
FALSE );
#define IDC_MSGNEW_EDIT_MSG_ID
#define IDC_MSGNEW_LBL_MSG_ID
#define TEXT_MSG_BUFFER_MAX_SIZE
The maximum size of any text message, in bytes.
#define IDC_MSGNEW_LBL_CANRSP_HINT
BOOL OnInitDialog()
Initialize the dialog.
void updateDlgFields(int aSelectedProtocol)
Enable/disable controls as appropriate for the selected protocol.
#define LONG_TEXT_MSG_MAX_SIZE
Maximum number of bytes in an A611 Long Text Message.
MessageProtocolType mMessageProtocol
Index of the selected message protocol.
#define IDC_MSGNEW_EDIT_MESSAGE_TEXT
virtual void DoDataExchange(CDataExchange *aDataExchange)
Perform dialog data exchange and validation.
virtual ~CTxtMsgNewDlg()
Destructor.
afx_msg void OnCbnSelChangeMsgProtocol()
Selection Changed handler for the Protocol combo box.
void sendA602TextMessage(fmi_id_type aFmiPacketId, char *aMessageText, const MessageId &aMessageId)
Send a server to client text message, for all A602 FMI protocols.
bool sendA611LongTextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aMessageType)
Send an A611 server to client long text message.
afx_msg void OnBnClickedOk()
Click handler for the OK button.
FmiApplicationLayer & mCom
Pointer to the main app dialog.
#define IDC_MSGNEW_CHK_DISP_IMMED
#define IDC_MSGNEW_LBL_MSG_ID_HINT
Dialog allowing the user to select the canned responses that are allowed for a particular message...
#define IDC_MSGNEW_LBL_MSG_TEXT_HINT
#define IDC_MSGNEW_CBO_PROTOCOL
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 FMI_SUPPORT_A611
If true, app was built with support for A611 protocols.
uint8 mMessageType
Value to use on the message_type member of the A604 text message.
uint8 getIdSize() const
Return the size of the message ID.
#define TEXT_MSG_MAX_SIZE
Maximum payload of a single text message, in bytes.
afx_msg void OnEnChangeEditFields()
Edit Change handler for all edit boxes on the dialog.
BOOL mDisplayImmediately
If TRUE, the "Display Immediately" box is checked.
CString mMessageText
Contents of the Message Text edit box.
void sendA604TextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aMessageType=A604_MESSAGE_TYPE_NORMAL)
Send an A604 server to client open text message.
unsigned long int uint32
32-bit unsigned integer
CString mMessageId
Contents of the Message ID edit box.
Encapsulation of a message ID.
Modal dialog allowing the user to send a text message to the client.