All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

  #1  
Old 01-02-2005, 08:20 AM
arno5270 arno5270 is offline
Registered User
 
Join Date: Nov 2004
Posts: 3
arno5270 is on a distinguished road
Switching to other app causes dialog 'OK' event

Situation: I have an app (on the P900) that synchronizes data between the PDA and an external database. This app displays a dialog to allow the user to change settings. This dialog has two buttons: OK and Cancel (with the default IDs). The Cancel button is the default button. When the user presses the OK button, the synchronization process starts:

Code:
	button_id = dlg->ExecuteLD(dialog_resource);
	if ( button_id == EEikBidOk )
	{
		// Start the sync process
	}
No problem so far. However, when the user switches to another application while the dialog is shown, the dialog returns with button id EEikBidOk. Which causes the synchronization process to start...

I tried redefining the HandleForegroundEventL method, and set a flag when the application goes to the background, and only start the sync process when the application is in the foreground, but apparently this method gets called after the dialog returns...

Is there a way to detect if the dialog returned because the user actually pressed a button, or because the application was switched to the background?

-- arno
Ads

  #2  
Old 04-02-2005, 12:36 AM
drollercoaster
Guest
 
Posts: n/a
that's the default behaviour. i found this out only after a while! you have 2 options. either you implement an obscurely documented member that prevents the dialog from shutting down OR you define your own buttons that use other button ids. would be best to define your OWN button ids too.

the problem isn't that the OK button is pressed but more like that EEikBidOk is returned to OkToExitL() when the dialog is dismissed in the manner you described. by defining your own button ids, you can specifically check for your id of the OK button.
 

Bookmarks

Tags
app, dialog, event, switching

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Core - OPL Skeleton App for UIQ Coding Ewan UIQ 4 08-03-2004 08:57 PM
hi. would like help to find if app for 3650 nokia exists? nonym Nokia 3650, 3660, and 3620 5 13-10-2003 11:27 AM



All times are GMT. The time now is 03:19 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy