Garmin Fleet Management Controller  2.19.0
CSpeedLimitAlertsDlg Class Reference

Dialog allowing the user to change speed limit alerts settings. More...

#include <CSpeedLimitAlertsDlg.h>

+ Inheritance diagram for CSpeedLimitAlertsDlg:

Public Member Functions

 CSpeedLimitAlertsDlg (CWnd *aParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CSpeedLimitAlertsDlg ()
 Destructor. More...
 
void onEvent (EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow)
 Handles event callbacks by translating an EventId into a windows message. More...
 

Private Member Functions

virtual void DoDataExchange (CDataExchange *aDataExchange)
 Perform dialog data exchange and validation. More...
 
void EnableFields (bool aValue)
 Enable/Disable dialog fields. More...
 
afx_msg void OnBnClickedSend ()
 Click handler for the Send button. More...
 
afx_msg void OnCbnSelchangeSpeedLimitCboMode ()
 Selection changed handler for the Mode combo box. More...
 
afx_msg LRESULT OnEventSpeedLimitSetResultFromClient (WPARAM aResultCode, LPARAM)
 Handler for the receipt event from Com. More...
 
BOOL OnInitDialog ()
 Initialize the dialog. More...
 
void SetResult (uint8 aResultCode)
 Set REsult text on the dialog. More...
 

Private Attributes

boolean mAlertUser
 Selection value of the alert user combo box. More...
 
FmiApplicationLayermCom
 Reference to the FMI communication controller that this dialog uses. More...
 
uint8 mMode
 Selection of the mode combo box. More...
 
float mThreshold
 Value of the threshold edit box. More...
 
uint8 mTimeOver
 Value of the time over edit box. More...
 
uint8 mTimeUnder
 Value of the time under edit box. More...
 

Detailed Description

Dialog allowing the user to change speed limit alerts settings.

Note
This dialog must be created modal.
Since
Protocol A608

Definition at line 21 of file CSpeedLimitAlertsDlg.h.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 27 of file CSpeedLimitAlertsDlg.cpp.

CSpeedLimitAlertsDlg::~CSpeedLimitAlertsDlg ( )
virtual

Destructor.

Definition at line 44 of file CSpeedLimitAlertsDlg.cpp.

References DoDataExchange().

Member Function Documentation

void CSpeedLimitAlertsDlg::DoDataExchange ( CDataExchange *  aDataExchange)
privatevirtual
void CSpeedLimitAlertsDlg::EnableFields ( bool  aValue)
private

Enable/Disable dialog fields.

Parameters
aValueEnable state

Definition at line 94 of file CSpeedLimitAlertsDlg.cpp.

References IDC_SPEED_LIMIT_CBO_ALERT_USER, IDC_SPEED_LIMIT_EDIT_THRESHOLD, IDC_SPEED_LIMIT_EDIT_TIME_OVER, and IDC_SPEED_LIMIT_EDIT_TIME_UNDER.

Referenced by DoDataExchange(), and OnCbnSelchangeSpeedLimitCboMode().

void CSpeedLimitAlertsDlg::OnBnClickedSend ( )
private

Click handler for the Send button.

Send speed limit alerts setup packet

Definition at line 108 of file CSpeedLimitAlertsDlg.cpp.

References mAlertUser, mCom, mMode, mThreshold, mTimeOver, mTimeUnder, and FmiApplicationLayer::sendSetSpeedLimitAlerts().

void CSpeedLimitAlertsDlg::OnCbnSelchangeSpeedLimitCboMode ( )
private

Selection changed handler for the Mode combo box.

Enables/Disables appropriate fields

Definition at line 120 of file CSpeedLimitAlertsDlg.cpp.

References EnableFields(), FALSE, mMode, OnEventSpeedLimitSetResultFromClient(), SPEED_LIMIT_MODE_CAR, SPEED_LIMIT_MODE_OFF, SPEED_LIMIT_MODE_TRUCK, 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 CSpeedLimitAlertsDlg::OnEventSpeedLimitSetResultFromClient ( WPARAM  aResultCode,
LPARAM   
)
private

Handler for the receipt event from Com.

Display result code

Parameters
aResultCodeThe result code from the client.
Returns
0, always

Definition at line 146 of file CSpeedLimitAlertsDlg.cpp.

References SetResult().

Referenced by OnCbnSelchangeSpeedLimitCboMode().

BOOL CSpeedLimitAlertsDlg::OnInitDialog ( )
private

Initialize the dialog.

This function is called when the window is created.

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

Definition at line 161 of file CSpeedLimitAlertsDlg.cpp.

References IDC_SPEED_LIMIT_CBO_ALERT_USER, IDC_SPEED_LIMIT_CBO_MODE, SetResult(), and TRUE.

void CSpeedLimitAlertsDlg::SetResult ( uint8  aResultCode)
private

Set REsult text on the dialog.

Display result code

Parameters
aResultCodeThe result code from the client.

Definition at line 177 of file CSpeedLimitAlertsDlg.cpp.

References IDC_SPEED_LIMIT_EDIT_RESULT, SPEED_LIMIT_RESULT_ERROR, SPEED_LIMIT_RESULT_MODE_UNSUPPORTED, and SPEED_LIMIT_RESULT_SUCCESS.

Referenced by OnEventSpeedLimitSetResultFromClient(), and OnInitDialog().

Member Data Documentation

boolean CSpeedLimitAlertsDlg::mAlertUser
private

Selection value of the alert user combo box.

Definition at line 76 of file CSpeedLimitAlertsDlg.h.

Referenced by DoDataExchange(), and OnBnClickedSend().

FmiApplicationLayer& CSpeedLimitAlertsDlg::mCom
private

Reference to the FMI communication controller that this dialog uses.

Definition at line 64 of file CSpeedLimitAlertsDlg.h.

Referenced by OnBnClickedSend().

uint8 CSpeedLimitAlertsDlg::mMode
private

Selection of the mode combo box.

Definition at line 67 of file CSpeedLimitAlertsDlg.h.

Referenced by DoDataExchange(), OnBnClickedSend(), and OnCbnSelchangeSpeedLimitCboMode().

float CSpeedLimitAlertsDlg::mThreshold
private

Value of the threshold edit box.

Definition at line 79 of file CSpeedLimitAlertsDlg.h.

Referenced by DoDataExchange(), and OnBnClickedSend().

uint8 CSpeedLimitAlertsDlg::mTimeOver
private

Value of the time over edit box.

Definition at line 70 of file CSpeedLimitAlertsDlg.h.

Referenced by DoDataExchange(), and OnBnClickedSend().

uint8 CSpeedLimitAlertsDlg::mTimeUnder
private

Value of the time under edit box.

Definition at line 73 of file CSpeedLimitAlertsDlg.h.

Referenced by DoDataExchange(), and OnBnClickedSend().


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