Garmin Fleet Management Controller  2.19.0
CStopListDlg Class Reference

Modeless dialog allowing the user to manage the A603 stops on the client device. More...

#include <CStopListDlg.h>

+ Inheritance diagram for CStopListDlg:

Public Member Functions

 CStopListDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CStopListDlg ()
 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 OnBnClickedNewStop ()
 Click handler for the New Stop button. More...
 
afx_msg void OnBnClickedOk ()
 Click handler for the OK button. More...
 
afx_msg void OnBnClickedSend ()
 Click handler for the Send button. More...
 
afx_msg void OnBnClickedSort ()
 Click handler for the Sort button. More...
 
afx_msg void OnCancel ()
 Handler for the Cancel action. More...
 
afx_msg void OnCbnSelChangeUpdateOption ()
 Selection Change handler for the Update Stop combo box. More...
 
afx_msg void OnEnChangeMoveTo ()
 Edit handler for the Move To text box. More...
 
afx_msg LRESULT OnEventEtaReceived (WPARAM, LPARAM)
 Handle an ETA Received event from FmiApplicationLayer. More...
 
afx_msg LRESULT OnEventStopListChanged (WPARAM, LPARAM)
 Handler for the Stop List Changed event. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
void PostNcDestroy ()
 Perform final cleanup. More...
 

Protected Attributes

FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
CString mEta
 Text in the ETA edit box. More...
 
CString mMoveTo
 Text in the "Move To" edit box. More...
 
int mSelectedStopIndex
 Index of the selected stop in the stop list. More...
 
CString mSelectedStopStatus
 Text description of the selected stop's status. More...
 
int mSelectedUpdateIndex
 Index of the selected item in the Update Stop combo box. More...
 
CListBox mStopListBox
 The list box control containing the A603 stops. More...
 

Detailed Description

Modeless dialog allowing the user to manage the A603 stops on the client device.

CStopListDlg allows the user to view and manipulate the A603 stops on the client device. The user also has the option to create a new stop and to sort the stop list.

Definition at line 25 of file CStopListDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 41 of file CStopListDlg.cpp.

CStopListDlg::~CStopListDlg ( )
virtual

Destructor.

Definition at line 59 of file CStopListDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CStopListDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 68 of file CStopListDlg.cpp.

References IDC_STOPLIST_LST_SELECT_STOP, IDC_STOPLIST_TXT_ETA, and IDC_STOPLIST_TXT_STATUS.

Referenced by ~CStopListDlg().

void CStopListDlg::OnBnClickedNewStop ( )
protected

Click handler for the New Stop button.

Open the New Stop modal dialog.

Definition at line 291 of file CStopListDlg.cpp.

void CStopListDlg::OnBnClickedOk ( )
protected

Click handler for the OK button.

Destroy the window, since this is a modeless dialog.

Definition at line 313 of file CStopListDlg.cpp.

void CStopListDlg::OnBnClickedSend ( )
protected

Click handler for the Send button.

Send a stop update or request using the Stop Status protocol.

Since
Protocol A603

Definition at line 263 of file CStopListDlg.cpp.

References INVALID16, REQUEST_MOVE_STOP, and TRUE.

void CStopListDlg::OnBnClickedSort ( )
protected

Click handler for the Sort button.

Initiate the Stop Sort Request protocol.

Since
Protocol A604

Definition at line 303 of file CStopListDlg.cpp.

void CStopListDlg::OnCancel ( )
protected

Handler for the Cancel action.

Destroy the window, since this is a modeless dialog.

Definition at line 322 of file CStopListDlg.cpp.

void CStopListDlg::OnCbnSelChangeUpdateOption ( )
protected

Selection Change handler for the Update Stop combo box.

If the option selected is Move To, enable the Move To edit box and Send button; otherwise disable them.

Since
Protocol A603

Definition at line 213 of file CStopListDlg.cpp.

References FALSE, IDC_STOPLIST_LBL_MOVETO, REQUEST_MOVE_STOP, and TRUE.

void CStopListDlg::OnEnChangeMoveTo ( )
protected

Edit handler for the Move To text box.

If a valid index is entered into the Move To edit box, enable the Send button.

Since
Protocol A603

Definition at line 238 of file CStopListDlg.cpp.

References FALSE, and TRUE.

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.

afx_msg LRESULT CStopListDlg::OnEventEtaReceived ( WPARAM  ,
LPARAM   
)
protected

Handle an ETA Received event from FmiApplicationLayer.

Update the contents of the ETA text box with the ETA time received from the client.

Since
Protocol A603

Definition at line 344 of file CStopListDlg.cpp.

References FALSE.

afx_msg LRESULT CStopListDlg::OnEventStopListChanged ( WPARAM  ,
LPARAM   
)
protected

Handler for the Stop List Changed event.

Update the stop list, the status of the selected stop, and, if the selected stop is active, show the ETA text box.

Since
Protocol A603

Definition at line 129 of file CStopListDlg.cpp.

References FALSE, StopListItem::getStopStatus(), IDC_STOPLIST_LBL_ETA, IDC_STOPLIST_TXT_ETA, INVALID32, STOP_STATUS_ACTIVE, STOP_STATUS_DELETED, STOP_STATUS_DONE, STOP_STATUS_READ, STOP_STATUS_UNREAD, and TRUE.

BOOL CStopListDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initializes the stop list based on the map owned by the FmiApplicationLayer, and sets the initial window position.

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

Definition at line 91 of file CStopListDlg.cpp.

References FALSE, IDC_STOPLIST_BTN_SORT, IDC_STOPLIST_GRP_UPDATE_STOP, IDC_STOPLIST_LBL_ETA, IDC_STOPLIST_LBL_MOVETO, IDC_STOPLIST_LBL_SELECT_STOP, IDC_STOPLIST_LBL_STATUS, IDC_STOPLIST_LST_SELECT_STOP, IDC_STOPLIST_TXT_ETA, IDC_STOPLIST_TXT_STATUS, and TRUE.

void CStopListDlg::PostNcDestroy ( )
protected

Perform final cleanup.

Enable the View Stops button on the main window.

Definition at line 331 of file CStopListDlg.cpp.

References EVENT_STOP_LIST_DLG_CLOSED, and Event::post().

Member Data Documentation

FmiApplicationLayer& CStopListDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 61 of file CStopListDlg.h.

CString CStopListDlg::mEta
protected

Text in the ETA edit box.

Definition at line 81 of file CStopListDlg.h.

CString CStopListDlg::mMoveTo
protected

Text in the "Move To" edit box.

Definition at line 78 of file CStopListDlg.h.

int CStopListDlg::mSelectedStopIndex
protected

Index of the selected stop in the stop list.

Definition at line 65 of file CStopListDlg.h.

CString CStopListDlg::mSelectedStopStatus
protected

Text description of the selected stop's status.

Definition at line 71 of file CStopListDlg.h.

int CStopListDlg::mSelectedUpdateIndex
protected

Index of the selected item in the Update Stop combo box.

See also
stop_status_status_enum (valid values are the REQUEST_* enums)

Definition at line 75 of file CStopListDlg.h.

CListBox CStopListDlg::mStopListBox
protected

The list box control containing the A603 stops.

Definition at line 68 of file CStopListDlg.h.


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