Garmin Fleet Management Controller
2.19.0
|
Modeless dialog allowing the user to query and update Driver ID and Status on the client. More...
#include <CDriverIdAndStatusDlg.h>
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 | |
FmiApplicationLayer & | mCom |
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... | |
Modeless dialog allowing the user to query and update Driver ID and Status on the client.
Definition at line 25 of file CDriverIdAndStatusDlg.h.
CDriverIdAndStatusDlg::CDriverIdAndStatusDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent window |
aCom | Reference to the FMI communication controller |
Definition at line 55 of file CDriverIdAndStatusDlg.cpp.
|
virtual |
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The 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().
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
protected |
Handles the Cancel action.
Destroy the window, since this is a modeless dialog.
Definition at line 438 of file CDriverIdAndStatusDlg.cpp.
|
protected |
Event handler for the FMI_EVENT_DRIVER_ID_CHANGED event generated by FmiApplicationLayer.
Updates the driver ID text box.
aIndex | The index of the driver |
Definition at line 184 of file CDriverIdAndStatusDlg.cpp.
References FALSE.
Referenced by OnDriverStatusListChanged().
|
protected |
Event handler for the FMI_EVENT_DRIVER_STATUS_CHANGED event generated by FmiApplicationLayer.
Updates the driver status text box.
aIndex | The index of the driver |
Definition at line 211 of file CDriverIdAndStatusDlg.cpp.
References FALSE.
|
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().
|
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.
|
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().
|
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.
|
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.
|
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.
|
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.
|
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.
aEventId | The event ID |
aEventData | The event data |
aEventDataPtr | Pointer to more event data |
Implements EventListener.
Definition at line 29 of file CWndEventListener.cpp.
References EVENT_ID_CNT, and WM_EVENT.
|
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.
|
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.
Definition at line 105 of file CDriverIdAndStatusDlg.cpp.
References FALSE, FMI_DRIVER_COUNT, IDC_DRVRINFO_LBL_IDX, and TRUE.
|
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.
|
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().
|
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().
|
protected |
Reference to the FMI communication controller.
Definition at line 72 of file CDriverIdAndStatusDlg.h.
|
protected |
Contents of the "current driver ID" text box.
Definition at line 75 of file CDriverIdAndStatusDlg.h.
|
protected |
Contents of the "current driver status" text box.
Definition at line 78 of file CDriverIdAndStatusDlg.h.
|
protected |
The list box containing the driver statuses on the client.
Definition at line 84 of file CDriverIdAndStatusDlg.h.
|
protected |
|
protected |
Contents of the "update driver ID" edit box.
Definition at line 81 of file CDriverIdAndStatusDlg.h.
|
protected |
Contents of the ID edit box in the Set Driver Status List Item group.
Definition at line 90 of file CDriverIdAndStatusDlg.h.
|
protected |
Contents of the status text edit box in the Set Driver Status List Item group.
Definition at line 93 of file CDriverIdAndStatusDlg.h.
|
protected |
Index of the selected item in the mDriverStatusList (-1 if no item is selected)
Definition at line 87 of file CDriverIdAndStatusDlg.h.