Garmin Fleet Management Controller  2.19.0
CCannedTxtMsgDlg Class Reference

Dialog allowing the user to manage the list of canned messages on the client. More...

#include <CCannedTxtMsgDlg.h>

+ Inheritance diagram for CCannedTxtMsgDlg:

Public Member Functions

 CCannedTxtMsgDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CCannedTxtMsgDlg ()
 [Brief description of the method] More...
 
void onEvent (EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow)
 Handles event callbacks by translating an EventId into a windows message. More...
 

Protected Member Functions

virtual void DoDataExchange (CDataExchange *aDataExchange)
 Perform dialog data exchange and validation. More...
 
afx_msg void OnBnClickedDelete ()
 Handles the Delete button clicked event. More...
 
afx_msg void OnBnClickedOk ()
 Button handler for the OK button. More...
 
afx_msg void OnBnClickedSend ()
 Button handler for the Send button. More...
 
afx_msg void OnCancel ()
 Handler for the Cancel action. More...
 
afx_msg LPARAM OnCannedMsgListChanged (WPARAM, LPARAM)
 Handler for the FMI_EVENT_CANNED_MSG_LIST_CHANGED event. More...
 
afx_msg void OnEnChangeEditBoxes ()
 Edit handler for the Message ID and Message Text boxes. More...
 
afx_msg void OnEnKillfocusMessageEdit ()
 Handles the kill focus event for the Message ID and Message Text edit boxes. More...
 
afx_msg void OnEnSetfocusMessageEdit ()
 Handles the set focus event for the Message ID and Message Text edit boxes. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
afx_msg void OnLbnKillfocusMsgList ()
 Handles the kill focus event for the Message list box. More...
 
afx_msg void OnLbnSelchangeMsglist ()
 Selection Changed handler for the Message List box. More...
 
afx_msg void OnLbnSetfocusList ()
 Handles the set focus event for the Message List box. More...
 
void PostNcDestroy ()
 Called by MFC after the window has been destroyed; performs final termination activities. More...
 
void updateListBox ()
 Update the canned message list box from the canned message map owned by FmiApplicationLayer. More...
 

Protected Attributes

CListBox mCannedMessageList
 Listbox containing the canned messages on the client. More...
 
FmiApplicationLayermCom
 Reference to the communication layer. More...
 
CString mMessageId
 The canned message ID entered by the user. More...
 
CString mMessageText
 The canned message text entered by the user. More...
 
int mSelectedIndex
 The index of the selected item in the list of messages. More...
 

Detailed Description

Dialog allowing the user to manage the list of canned messages on the client.

This dialog must be created modal.

Since
Protocol A604

Definition at line 24 of file CCannedTxtMsgDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 40 of file CCannedTxtMsgDlg.cpp.

CCannedTxtMsgDlg::~CCannedTxtMsgDlg ( )
virtual

[Brief description of the method]

[A longer description of the method]

Definition at line 56 of file CCannedTxtMsgDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CCannedTxtMsgDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 65 of file CCannedTxtMsgDlg.cpp.

References IDC_CANMSG_EDIT_ID, IDC_CANMSG_EDIT_TEXT, and IDC_CANMSG_LST_MESSAGES.

Referenced by ~CCannedTxtMsgDlg().

void CCannedTxtMsgDlg::OnBnClickedDelete ( )
protected

Handles the Delete button clicked event.

Initiates a Delete Canned Message protocol using via the FmiApplicationLayer.

Definition at line 193 of file CCannedTxtMsgDlg.cpp.

References TRUE.

void CCannedTxtMsgDlg::OnBnClickedOk ( )
protected

Button handler for the OK button.

Closes the window.

Definition at line 220 of file CCannedTxtMsgDlg.cpp.

void CCannedTxtMsgDlg::OnBnClickedSend ( )
protected

Button handler for the Send button.

Calls FmiApplicationLayer to initiate the Set Canned Message protocol, using the data in the Message ID and Message Text edit boxes.

Definition at line 208 of file CCannedTxtMsgDlg.cpp.

References TRUE.

void CCannedTxtMsgDlg::OnCancel ( )
protected

Handler for the Cancel action.

Closes the window.

Definition at line 229 of file CCannedTxtMsgDlg.cpp.

afx_msg LPARAM CCannedTxtMsgDlg::OnCannedMsgListChanged ( WPARAM  ,
LPARAM   
)
protected

Handler for the FMI_EVENT_CANNED_MSG_LIST_CHANGED event.

Updates the list box.

Returns
0, always

Definition at line 127 of file CCannedTxtMsgDlg.cpp.

void CCannedTxtMsgDlg::OnEnChangeEditBoxes ( )
protected

Edit handler for the Message ID and Message Text boxes.

If either box is empty, disables the Send button; if both ID and text are specified, enables the Send button.

Definition at line 138 of file CCannedTxtMsgDlg.cpp.

References FALSE, IDC_CANMSG_BTN_SEND, and TRUE.

void CCannedTxtMsgDlg::OnEnKillfocusMessageEdit ( )
protected

Handles the kill focus event for the Message ID and Message Text edit boxes.

Restores the default ID to the OK button so that it is activated if the user presses the Enter key.

Definition at line 267 of file CCannedTxtMsgDlg.cpp.

void CCannedTxtMsgDlg::OnEnSetfocusMessageEdit ( )
protected

Handles the set focus event for the Message ID and Message Text edit boxes.

Sets the default ID to the Send button so that it is activated if the user presses the Enter key.

Definition at line 256 of file CCannedTxtMsgDlg.cpp.

References IDC_CANMSG_BTN_SEND.

void CWndEventListener::onEvent ( EventId  aEventId,
uint32  aEventData,
void *  aEventDataPtr,
BOOL  handleNow 
)
virtualinherited

Handles event callbacks by translating an EventId into a windows message.

Casts this to a CWnd then posts a Windows message to it. The use of dynamic_cast is used as an alternative to the "dreaded diamond" caused by C++ multiple inheritance.

Parameters
aEventIdThe event ID
aEventDataThe event data
aEventDataPtrPointer to more event data
Note
Interested parties receive these events as Windows messages, i.e., ON_MESSAGE( aEventId, CallbackFunction ). aEventData is the WPARAM, and aEventDataPtr is the LPARAM.

Implements EventListener.

Definition at line 29 of file CWndEventListener.cpp.

References EVENT_ID_CNT, and WM_EVENT.

BOOL CCannedTxtMsgDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initializes the response list and sets the window position.

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

Definition at line 82 of file CCannedTxtMsgDlg.cpp.

References TRUE.

void CCannedTxtMsgDlg::OnLbnKillfocusMsgList ( )
protected

Handles the kill focus event for the Message list box.

Restores the default ID to the OK button so that it is activated if the user presses the Enter key.

Definition at line 287 of file CCannedTxtMsgDlg.cpp.

void CCannedTxtMsgDlg::OnLbnSelchangeMsglist ( )
protected

Selection Changed handler for the Message List box.

Fills in the Message ID and Message Text fields of the dialog with the information from the selected list item, for easy editing.

Definition at line 157 of file CCannedTxtMsgDlg.cpp.

References FALSE, and IDC_CANMSG_LST_MESSAGES.

void CCannedTxtMsgDlg::OnLbnSetfocusList ( )
protected

Handles the set focus event for the Message List box.

Sets the default ID to the Delete button so that it is activated if the user presses the Enter key.

Definition at line 277 of file CCannedTxtMsgDlg.cpp.

References IDC_CANMSG_BTN_DELETE.

void CCannedTxtMsgDlg::PostNcDestroy ( )
protected

Called by MFC after the window has been destroyed; performs final termination activities.

This dialog is a "monitor", so it is modeless. When it gets the destroy message it must re-enable the main button to open this dialogs (the button is disabled when the dialog is opened to prevent several of the same type from being created), and delete itself since the pointer to it is not maintained by the parent.

Definition at line 244 of file CCannedTxtMsgDlg.cpp.

References EVENT_FMI_CANNED_MESSAGE_DLG_CLOSED, and Event::post().

void CCannedTxtMsgDlg::updateListBox ( )
protected

Update the canned message list box from the canned message map owned by FmiApplicationLayer.

Definition at line 94 of file CCannedTxtMsgDlg.cpp.

References FileBackedMap< T >::begin(), and FileBackedMap< T >::end().

Member Data Documentation

CListBox CCannedTxtMsgDlg::mCannedMessageList
protected

Listbox containing the canned messages on the client.

Definition at line 59 of file CCannedTxtMsgDlg.h.

FmiApplicationLayer& CCannedTxtMsgDlg::mCom
protected

Reference to the communication layer.

Definition at line 71 of file CCannedTxtMsgDlg.h.

CString CCannedTxtMsgDlg::mMessageId
protected

The canned message ID entered by the user.

Definition at line 62 of file CCannedTxtMsgDlg.h.

CString CCannedTxtMsgDlg::mMessageText
protected

The canned message text entered by the user.

Definition at line 65 of file CCannedTxtMsgDlg.h.

int CCannedTxtMsgDlg::mSelectedIndex
protected

The index of the selected item in the list of messages.

Definition at line 68 of file CCannedTxtMsgDlg.h.


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