22 ON_BN_CLICKED( IDOK, OnBnClickedOk )
23 #if( FMI_SUPPORT_A603 ) 30 #if( FMI_SUPPORT_A604 ) 40 CStopListDlg::CStopListDlg
46 #if( FMI_SUPPORT_A603 ) 47 , mSelectedStopIndex( 0 )
48 , mSelectedStopStatus( _T(
"") )
49 , mSelectedUpdateIndex( 0 )
69 CDataExchange * aDataExchange
72 CDialog::DoDataExchange( aDataExchange );
74 #if( FMI_SUPPORT_A603 ) 78 DDX_CBIndex( aDataExchange, IDC_STOPLIST_CBO_UPDATE_STOP, mSelectedUpdateIndex );
79 DDX_Text( aDataExchange, IDC_STOPLIST_EDIT_MOVETO, mMoveTo );
93 CDialog::OnInitDialog();
95 SetWindowPos( NULL, 700, 35, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
98 OnEventStopListChanged( 0, NULL );
101 #if( !FMI_SUPPORT_A603 ) 107 GetDlgItem( IDC_STOPLIST_BTN_SEND )->EnableWindow(
FALSE );
111 GetDlgItem( IDC_STOPLIST_EDIT_MOVETO )->EnableWindow(
FALSE );
112 GetDlgItem( IDC_STOPLIST_CBO_UPDATE_STOP )->EnableWindow(
FALSE );
115 #if( !FMI_SUPPORT_A604 ) 122 #if( FMI_SUPPORT_A603 ) 132 if( !mCom.mStopIndexInList.empty() )
136 int selectedIndex = mStopListBox.GetCurSel();
137 int topIndex = mStopListBox.GetTopIndex();
138 if( selectedIndex == -1 )
142 mStopListBox.ResetContent();
143 uint32 stopId = mCom.mStopIndexInList[i];
146 mStopListBox.AddString( mCom.mA603Stops.get( stopId ).getCurrentName() );
148 stopId = mCom.mStopIndexInList[i];
154 if( mCom.mA603Stops.contains( mCom.mStopIndexInList[selectedIndex] ) )
156 StopListItem& item = mCom.mA603Stops.get( mCom.mStopIndexInList[selectedIndex] );
162 mSelectedStopStatus.Format( _T(
" Active") );
163 OnEventEtaReceived( 0, NULL );
167 mSelectedStopStatus.Format( _T(
" Done") );
170 mSelectedStopStatus.Format( _T(
" Unread Inactive") );
173 mSelectedStopStatus.Format( _T(
" Read Inactive") );
176 mSelectedStopStatus.Format( _T(
" Deleted") );
179 mSelectedStopStatus.Format( _T(
"") );
198 mStopListBox.SetCurSel( selectedIndex );
199 mStopListBox.SetTopIndex( topIndex );
202 mStopListBox.ResetContent();
219 GetDlgItem( IDC_STOPLIST_EDIT_MOVETO )->EnableWindow(
TRUE );
224 GetDlgItem( IDC_STOPLIST_BTN_SEND )->EnableWindow(
TRUE );
225 mMoveTo.Format( _T(
"") );
227 GetDlgItem( IDC_STOPLIST_EDIT_MOVETO )->EnableWindow(
FALSE );
243 _ttoi( mMoveTo ) < mStopListBox.GetCount() &&
244 _ttoi( mMoveTo ) >= 0 )
246 GetDlgItem( IDC_STOPLIST_BTN_SEND )->EnableWindow(
TRUE );
250 GetDlgItem( IDC_STOPLIST_BTN_SEND )->EnableWindow(
FALSE );
253 GetDlgItem( IDC_STOPLIST_BTN_SEND )->EnableWindow(
TRUE );
267 if( mStopListBox.GetCurSel() != -1 )
275 uint32 selectedStopId = mCom.mStopIndexInList[mSelectedStopIndex];
281 mCom.sendStopMoveRequest( moveTo, (
uint16)mSelectedStopIndex );
297 #if( FMI_SUPPORT_A604 ) 305 mCom.sendStopSortRequest();
333 CDialog::PostNcDestroy();
348 MultiByteToWideChar( mCom.mClientCodepage, 0, mCom.mEtaTime, -1, etaTime, 13 );
350 mEta.Format( _T(
" %s"), etaTime );
#define INVALID16
Placeholder for an invalid 16-bit value.
virtual void DoDataExchange(CDataExchange *aDataExchange)
Perform dialog data exchange and validation.
#define IDC_STOPLIST_CBO_UPDATE_STOP
#define IDC_STOPLIST_BTN_NEW_STOP
afx_msg LRESULT OnEventStopListChanged(WPARAM, LPARAM)
Handler for the Stop List Changed event.
Modeless dialog allowing the user to manage the A603 stops on the client device.
#define IDC_STOPLIST_BTN_SEND
afx_msg void OnBnClickedOk()
Click handler for the OK button.
BOOL OnInitDialog()
Initialize the dialog.
afx_msg LRESULT OnEventEtaReceived(WPARAM, LPARAM)
Handle an ETA Received event from FmiApplicationLayer.
virtual ~CStopListDlg()
Destructor.
afx_msg void OnCancel()
Handler for the Cancel action.
Data structure to hold details of an A603 stop that the server needs to keep.
#define IDC_STOPLIST_LBL_ETA
#define IDC_STOPLIST_LST_SELECT_STOP
afx_msg void OnBnClickedSend()
Click handler for the Send button.
afx_msg void OnBnClickedSort()
Click handler for the Sort button.
afx_msg void OnBnClickedNewStop()
Click handler for the New Stop button.
Modal dialog allowing the user to send a new stop to the client.
#define INVALID32
Placeholder for an invalid 32-bit value.
#define IDC_STOPLIST_BTN_SORT
#define IDC_STOPLIST_GRP_UPDATE_STOP
Serial communication controller for Garmin and FMI packets.
unsigned short int uint16
16-bit unsigned integer
afx_msg void OnCbnSelChangeUpdateOption()
Selection Change handler for the Update Stop combo box.
#define IDC_STOPLIST_LBL_SELECT_STOP
#define IDC_STOPLIST_EDIT_MOVETO
#define IDC_STOPLIST_LBL_MOVETO
#define IDC_STOPLIST_LBL_STATUS
uint16 stop_status_status_type
Enumeration for Stop Status protocol.
afx_msg void OnEnChangeMoveTo()
Edit handler for the Move To text box.
stop_status_status_type getStopStatus() const
Get the stop status.
#define IDC_STOPLIST_TXT_ETA
#define IDC_STOPLIST_TXT_STATUS
void PostNcDestroy()
Perform final cleanup.
#define WM_EVENT(_event)
Translation from an application event to the corresponding Windows message.
unsigned long int uint32
32-bit unsigned integer
static void post(EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE)
Posts a message to all windows that have registered to get events.