Garmin Fleet Management Controller  2.19.0
CManageCannedResponseDlg Class Reference

Dialog allowing the user to manage canned responses. More...

#include <CManageCannedResponseDlg.h>

+ Inheritance diagram for CManageCannedResponseDlg:

Public Member Functions

 CManageCannedResponseDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CManageCannedResponseDlg ()
 Destructor. 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 ()
 Button handler for the Delete button. 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 OnCannedRespListChanged (WPARAM, LPARAM)
 Handler for FMI_EVENT_CANNED_RESP_LIST_CHANGED event. More...
 
afx_msg void OnEnChangeRspBoxes ()
 Edit handler for the Response ID and Response Text boxes. More...
 
afx_msg void OnEnKillfocusResponseEdit ()
 Handles the kill focus event for the Response ID and Response Text edit boxes. More...
 
afx_msg void OnEnSetfocusResponseEdit ()
 Handles the set focus event for the Response ID and Response Text edit boxes. More...
 
BOOL OnInitDialog ()
 This function is called when the window is created. More...
 
afx_msg void OnLbnKillfocusResponselist ()
 Handles the kill focus event for the Response List box. More...
 
afx_msg void OnLbnSelchangeResponselist ()
 Selection Changed handler for the Response List box. More...
 
afx_msg void OnLbnSetfocusResponselist ()
 Handles the set focus event for the Response List. More...
 
void PostNcDestroy ()
 Called by MFC after the window has been destroyed; performs final termination activities. More...
 
void updateListBox ()
 Update the canned response list box from the canned response map owned by FmiApplicationLayer. More...
 

Protected Attributes

FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
CListBox mListBox
 List box control containing the canned responses. More...
 
CString mResponseId
 DDX member: the contents of the Response ID edit box. More...
 
CString mResponseText
 DDX member: the contents of the Response Text edit box. More...
 
int mSelectedResponseIndex
 Index of the list box item currently selected. More...
 

Detailed Description

Dialog allowing the user to manage canned responses.

This dialog allows the user to manage the global list of canned responses available for messages. Particular responses for a message are selected in the CSelectCannedResponseDlg.

Note
This dialog must always be created modeless.
Since
Protocol A604

Definition at line 26 of file CManageCannedResponseDlg.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
aParentThe parent window.
aComReference to the FMI communication controller

Definition at line 40 of file CManageCannedResponseDlg.cpp.

CManageCannedResponseDlg::~CManageCannedResponseDlg ( )
virtual

Destructor.

Definition at line 55 of file CManageCannedResponseDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CManageCannedResponseDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 64 of file CManageCannedResponseDlg.cpp.

References IDC_CANRESP_EDIT_ID, IDC_CANRESP_EDIT_TEXT, and IDC_CANRESP_LST_RESPONSES.

Referenced by ~CManageCannedResponseDlg().

void CManageCannedResponseDlg::OnBnClickedDelete ( )
protected

Button handler for the Delete button.

Calls FmiApplicationLayer to initiate the Delete Canned Response protocol.

Definition at line 127 of file CManageCannedResponseDlg.cpp.

References TRUE.

void CManageCannedResponseDlg::OnBnClickedOk ( )
protected

Button handler for the OK button.

Closes the window.

Definition at line 227 of file CManageCannedResponseDlg.cpp.

void CManageCannedResponseDlg::OnBnClickedSend ( )
protected

Button handler for the Send button.

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

Definition at line 153 of file CManageCannedResponseDlg.cpp.

References TRUE.

void CManageCannedResponseDlg::OnCancel ( )
protected

Handler for the Cancel action.

Closes the window.

Definition at line 237 of file CManageCannedResponseDlg.cpp.

afx_msg LPARAM CManageCannedResponseDlg::OnCannedRespListChanged ( WPARAM  ,
LPARAM   
)
protected

Handler for FMI_EVENT_CANNED_RESP_LIST_CHANGED event.

Updates the list box

Returns
0, always

Definition at line 141 of file CManageCannedResponseDlg.cpp.

void CManageCannedResponseDlg::OnEnChangeRspBoxes ( )
protected

Edit handler for the Response ID and Response 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 166 of file CManageCannedResponseDlg.cpp.

References FALSE, IDC_CANRESP_BTN_SEND, and TRUE.

void CManageCannedResponseDlg::OnEnKillfocusResponseEdit ( )
protected

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

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

Definition at line 273 of file CManageCannedResponseDlg.cpp.

void CManageCannedResponseDlg::OnEnSetfocusResponseEdit ( )
protected

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

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

Definition at line 262 of file CManageCannedResponseDlg.cpp.

References IDC_CANRESP_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 CManageCannedResponseDlg::OnInitDialog ( )
protected

This function is called when the window is created.

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

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

Definition at line 82 of file CManageCannedResponseDlg.cpp.

References TRUE.

void CManageCannedResponseDlg::OnLbnKillfocusResponselist ( )
protected

Handles the kill focus event for the Response List box.

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

Definition at line 293 of file CManageCannedResponseDlg.cpp.

void CManageCannedResponseDlg::OnLbnSelchangeResponselist ( )
protected

Selection Changed handler for the Response List box.

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

Definition at line 186 of file CManageCannedResponseDlg.cpp.

References FALSE, and IDC_CANRESP_LST_RESPONSES.

void CManageCannedResponseDlg::OnLbnSetfocusResponselist ( )
protected

Handles the set focus event for the Response List.

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

Definition at line 283 of file CManageCannedResponseDlg.cpp.

References IDC_CANRESP_BTN_DELETE.

void CManageCannedResponseDlg::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 dialog (the button is disabled when the dialog is opened to prevent more than one from being created)

Definition at line 250 of file CManageCannedResponseDlg.cpp.

References EVENT_FMI_CANNED_RESPONSE_DLG_CLOSED, and Event::post().

void CManageCannedResponseDlg::updateListBox ( )
protected

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

Definition at line 97 of file CManageCannedResponseDlg.cpp.

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

Member Data Documentation

FmiApplicationLayer& CManageCannedResponseDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 63 of file CManageCannedResponseDlg.h.

CListBox CManageCannedResponseDlg::mListBox
protected

List box control containing the canned responses.

Definition at line 66 of file CManageCannedResponseDlg.h.

CString CManageCannedResponseDlg::mResponseId
protected

DDX member: the contents of the Response ID edit box.

Definition at line 72 of file CManageCannedResponseDlg.h.

CString CManageCannedResponseDlg::mResponseText
protected

DDX member: the contents of the Response Text edit box.

Definition at line 75 of file CManageCannedResponseDlg.h.

int CManageCannedResponseDlg::mSelectedResponseIndex
protected

Index of the list box item currently selected.

Definition at line 69 of file CManageCannedResponseDlg.h.


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