Garmin Fleet Management Controller  2.19.0
CDriverIdAndStatusDlg Class Reference

Modeless dialog allowing the user to query and update Driver ID and Status on the client. More...

#include <CDriverIdAndStatusDlg.h>

+ Inheritance diagram for CDriverIdAndStatusDlg:

Public Member Functions

 CDriverIdAndStatusDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CDriverIdAndStatusDlg ()
 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 ()
 Click handler for the Delete (Driver Status Item) button. More...
 
afx_msg void OnBnClickedEditLogins ()
 Click handler for the Driver Logins button. More...
 
afx_msg void OnBnClickedOk ()
 Click handler for the OK (Close) button. More...
 
afx_msg void OnBnClickedRefreshDriverId ()
 Click handler for the Refresh (Driver ID) button. More...
 
afx_msg void OnBnClickedRefreshDriverStatus ()
 Click handler for the Refresh (Driver Status) button. More...
 
afx_msg void OnBnClickedSendDriverId ()
 Click handler for the Send (Driver ID) button. More...
 
afx_msg void OnBnClickedSendDriverStatus ()
 Click handler for the Send (Driver Status) button. More...
 
afx_msg void OnBnClickedSendDriverStatusItem ()
 Click handler for the Send (Driver Status Item) button. More...
 
afx_msg void OnCancel ()
 Handles the Cancel action. More...
 
afx_msg LPARAM OnDriverIdChanged (WPARAM aIndex, LPARAM)
 Event handler for the FMI_EVENT_DRIVER_ID_CHANGED event generated by FmiApplicationLayer. More...
 
afx_msg LPARAM OnDriverStatusChanged (WPARAM aIndex, LPARAM)
 Event handler for the FMI_EVENT_DRIVER_STATUS_CHANGED event generated by FmiApplicationLayer. More...
 
afx_msg LPARAM OnDriverStatusListChanged (WPARAM, LPARAM)
 Event handler for the FMI_EVENT_DRIVER_STATUS_LIST_CHANGED event generated by FmiApplicationLayer. More...
 
afx_msg void OnEnChangeEditDriverId ()
 Edit event handler for the Driver ID edit box. More...
 
afx_msg void OnEnChangeEditSet ()
 Edit handler for the Add/Update Status group. More...
 
afx_msg void OnEnKillfocusDriverIdEdit ()
 Kill Focus handler for the Driver ID edit box. More...
 
afx_msg void OnEnKillfocusStatusEdit ()
 Kill Focus handler for the Driver Status edit box. More...
 
afx_msg void OnEnSetfocusDriverIdEdit ()
 Set Focus handler for the Driver ID edit box. More...
 
afx_msg void OnEnSetfocusStatusEdit ()
 Set Focus handler for the Add/Update Status edit boxes. More...
 
afx_msg void OnIndexChanged ()
 Selection handler for the driver index combo. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
afx_msg void OnLbnSelchangeStatuslist ()
 Selection Changed event handler for the status list. More...
 
void PostNcDestroy ()
 Perform final cleanup after the dialog window is destroyed. More...
 
void updateListBox ()
 Update the driver status list box from the map of items owned by FmiApplicationLayer. More...
 

Protected Attributes

FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 
CString mCurrentDriverId
 Contents of the "current driver ID" text box. More...
 
CString mCurrentDriverStatus
 Contents of the "current driver status" text box. More...
 
CListBox mDriverStatusList
 The list box containing the driver statuses on the client. More...
 
int mIndex
 Selected driver index. More...
 
CString mNewDriverId
 Contents of the "update driver ID" edit box. More...
 
CString mNewDriverStatusId
 Contents of the ID edit box in the Set Driver Status List Item group. More...
 
CString mNewDriverStatusText
 Contents of the status text edit box in the Set Driver Status List Item group. More...
 
int mSelectedListIndex
 Index of the selected item in the mDriverStatusList (-1 if no item is selected) More...
 

Detailed Description

Modeless dialog allowing the user to query and update Driver ID and Status on the client.

Since
Protocol A604

Definition at line 25 of file CDriverIdAndStatusDlg.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
aParentThe parent window
aComReference to the FMI communication controller

Definition at line 55 of file CDriverIdAndStatusDlg.cpp.

CDriverIdAndStatusDlg::~CDriverIdAndStatusDlg ( )
virtual

Destructor.

Definition at line 74 of file CDriverIdAndStatusDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CDriverIdAndStatusDlg::DoDataExchange ( CDataExchange *  aDataExchange)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 83 of file CDriverIdAndStatusDlg.cpp.

References IDC_DRVRINFO_TXT_CURRENT_ID, and IDC_DRVRINFO_TXT_CURRENT_STATUS.

Referenced by ~CDriverIdAndStatusDlg().

void CDriverIdAndStatusDlg::OnBnClickedDelete ( )
protected

Click handler for the Delete (Driver Status Item) button.

Sends a Delete Driver Status List Item request to the client.

Definition at line 390 of file CDriverIdAndStatusDlg.cpp.

References TRUE.

void CDriverIdAndStatusDlg::OnBnClickedEditLogins ( )
protected

Click handler for the Driver Logins button.

Display the driver login dialog.

Definition at line 498 of file CDriverIdAndStatusDlg.cpp.

References IDD_DRIVER_LOGINS.

void CDriverIdAndStatusDlg::OnBnClickedOk ( )
protected

Click handler for the OK (Close) button.

Destroy the window, since this is a modeless dialog.

Definition at line 418 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnBnClickedRefreshDriverId ( )
protected

Click handler for the Refresh (Driver ID) button.

Sends a Driver ID Request to the client

Definition at line 311 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnBnClickedRefreshDriverStatus ( )
protected

Click handler for the Refresh (Driver Status) button.

Requests the current driver status from the client

Definition at line 329 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnBnClickedSendDriverId ( )
protected

Click handler for the Send (Driver ID) button.

Sends a Driver ID update to the client.

Definition at line 293 of file CDriverIdAndStatusDlg.cpp.

References TRUE.

void CDriverIdAndStatusDlg::OnBnClickedSendDriverStatus ( )
protected

Click handler for the Send (Driver Status) button.

Sends a Driver Status Update to the client

Definition at line 275 of file CDriverIdAndStatusDlg.cpp.

References TRUE.

void CDriverIdAndStatusDlg::OnBnClickedSendDriverStatusItem ( )
protected

Click handler for the Send (Driver Status Item) button.

Sends the driver status list item specified in the Add/Set Status group of edit boxes to the client using the Set Driver Status List Item protocol.

Definition at line 406 of file CDriverIdAndStatusDlg.cpp.

References TRUE.

void CDriverIdAndStatusDlg::OnCancel ( )
protected

Handles the Cancel action.

Destroy the window, since this is a modeless dialog.

Definition at line 438 of file CDriverIdAndStatusDlg.cpp.

afx_msg LPARAM CDriverIdAndStatusDlg::OnDriverIdChanged ( WPARAM  aIndex,
LPARAM   
)
protected

Event handler for the FMI_EVENT_DRIVER_ID_CHANGED event generated by FmiApplicationLayer.

Updates the driver ID text box.

Parameters
aIndexThe index of the driver

Definition at line 184 of file CDriverIdAndStatusDlg.cpp.

References FALSE.

Referenced by OnDriverStatusListChanged().

afx_msg LPARAM CDriverIdAndStatusDlg::OnDriverStatusChanged ( WPARAM  aIndex,
LPARAM   
)
protected

Event handler for the FMI_EVENT_DRIVER_STATUS_CHANGED event generated by FmiApplicationLayer.

Updates the driver status text box.

Parameters
aIndexThe index of the driver

Definition at line 211 of file CDriverIdAndStatusDlg.cpp.

References FALSE.

afx_msg LPARAM CDriverIdAndStatusDlg::OnDriverStatusListChanged ( WPARAM  ,
LPARAM   
)
protected

Event handler for the FMI_EVENT_DRIVER_STATUS_LIST_CHANGED event generated by FmiApplicationLayer.

Updates the driver status list.

Definition at line 170 of file CDriverIdAndStatusDlg.cpp.

References OnDriverIdChanged().

void CDriverIdAndStatusDlg::OnEnChangeEditDriverId ( )
protected

Edit event handler for the Driver ID edit box.

Enable or disable the Send (Driver ID) button. If the Driver ID is specified, enable the Send button, otherwise, disable it.

Definition at line 235 of file CDriverIdAndStatusDlg.cpp.

References FALSE, and TRUE.

void CDriverIdAndStatusDlg::OnEnChangeEditSet ( )
protected

Edit handler for the Add/Update Status group.

This function is called when either of the two edit boxes in the Add/Update Status group (ID and Status) are modified. Enables the Send button in this group if both edit boxes contain mIsValid data, disables the button otherwise.

Definition at line 350 of file CDriverIdAndStatusDlg.cpp.

References FALSE, TRUE, and UTIL_data_is_uint32().

void CDriverIdAndStatusDlg::OnEnKillfocusDriverIdEdit ( )
protected

Kill Focus handler for the Driver ID edit box.

Set the default button back to the CLose button so that it will be activated when the user presses Enter.

Definition at line 467 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnEnKillfocusStatusEdit ( )
protected

Kill Focus handler for the Driver Status edit box.

Set the default button back to the CLose button so that it will be activated when the user presses Enter.

Definition at line 488 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnEnSetfocusDriverIdEdit ( )
protected

Set Focus handler for the Driver ID edit box.

Set the default button to the Send (Driver ID) button so that it will be activated when the user presses Enter.

Definition at line 457 of file CDriverIdAndStatusDlg.cpp.

void CDriverIdAndStatusDlg::OnEnSetfocusStatusEdit ( )
protected

Set Focus handler for the Add/Update Status edit boxes.

Set the default button to the Send (Driver Status Item) button so that it will be activated when the user presses Enter.

Definition at line 478 of file CDriverIdAndStatusDlg.cpp.

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.

void CDriverIdAndStatusDlg::OnIndexChanged ( )
protected

Selection handler for the driver index combo.

Changes the other controls to display appropriate info

Definition at line 427 of file CDriverIdAndStatusDlg.cpp.

References TRUE.

BOOL CDriverIdAndStatusDlg::OnInitDialog ( )
protected

Initialize the dialog.

This function is called when the window is created. It initializes the status list and requests the current driver id and status from the client.

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

Definition at line 105 of file CDriverIdAndStatusDlg.cpp.

References FALSE, FMI_DRIVER_COUNT, IDC_DRVRINFO_LBL_IDX, and TRUE.

void CDriverIdAndStatusDlg::OnLbnSelchangeStatuslist ( )
protected

Selection Changed event handler for the status list.

This function fills in the status id and status text fields of the dialog with the information of the selected message in the message list, for easy editing. It also enables the Delete button when an item is selected.

Definition at line 251 of file CDriverIdAndStatusDlg.cpp.

References FALSE, ClientListItem::getCurrentName(), and TRUE.

void CDriverIdAndStatusDlg::PostNcDestroy ( )
protected

Perform final cleanup after the dialog window is destroyed.

Definition at line 446 of file CDriverIdAndStatusDlg.cpp.

References EVENT_FMI_DRIVER_ID_AND_STATUS_DLG_CLOSED, and Event::post().

void CDriverIdAndStatusDlg::updateListBox ( )
protected

Update the driver status list box from the map of items owned by FmiApplicationLayer.

Definition at line 139 of file CDriverIdAndStatusDlg.cpp.

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

Member Data Documentation

FmiApplicationLayer& CDriverIdAndStatusDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 72 of file CDriverIdAndStatusDlg.h.

CString CDriverIdAndStatusDlg::mCurrentDriverId
protected

Contents of the "current driver ID" text box.

Definition at line 75 of file CDriverIdAndStatusDlg.h.

CString CDriverIdAndStatusDlg::mCurrentDriverStatus
protected

Contents of the "current driver status" text box.

Definition at line 78 of file CDriverIdAndStatusDlg.h.

CListBox CDriverIdAndStatusDlg::mDriverStatusList
protected

The list box containing the driver statuses on the client.

Definition at line 84 of file CDriverIdAndStatusDlg.h.

int CDriverIdAndStatusDlg::mIndex
protected

Selected driver index.

Since
Protocol A607

Definition at line 97 of file CDriverIdAndStatusDlg.h.

CString CDriverIdAndStatusDlg::mNewDriverId
protected

Contents of the "update driver ID" edit box.

Definition at line 81 of file CDriverIdAndStatusDlg.h.

CString CDriverIdAndStatusDlg::mNewDriverStatusId
protected

Contents of the ID edit box in the Set Driver Status List Item group.

Definition at line 90 of file CDriverIdAndStatusDlg.h.

CString CDriverIdAndStatusDlg::mNewDriverStatusText
protected

Contents of the status text edit box in the Set Driver Status List Item group.

Definition at line 93 of file CDriverIdAndStatusDlg.h.

int CDriverIdAndStatusDlg::mSelectedListIndex
protected

Index of the selected item in the mDriverStatusList (-1 if no item is selected)

Definition at line 87 of file CDriverIdAndStatusDlg.h.


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