Modal Dialog boxes in BREW | developer.brewmp.com Modal Dialog boxes in BREW | developer.brewmp.com

Developer

Modal Dialog boxes in BREW

Forums:

Can we have modal dialog box in brew similar to windows mobile?

Regards
Abhilasha

Somebody can please throw light upon whether we can have something similar to modal dialog boxes in BREW?

Somebody can please throw light upon whether we can have something similar to modal dialog boxes in BREW?

See pages 36-38 in my presentation at BREW 2007 http://brew.qualcomm.com/brew_bnry/pdf/brew_2007/Prog-702_Blaukopf_v02.pdf
Unfortunately the slides are a bit limited without the video, which seems to be no longer available. Basically there are no modal dialogs. To get modal behaviour, ensure that the code that needs a modal response is running in a thread, then pop up the dialog and suspend the calling code until the response is ready.

See pages 36-38 in my presentation at BREW 2007 http://brew.qualcomm.com/brew_bnry/pdf/brew_2007/Prog-702_Blaukopf_v02.pdf
Unfortunately the slides are a bit limited without the video, which seems to be no longer available. Basically there are no modal dialogs. To get modal behaviour, ensure that the code that needs a modal response is running in a thread, then pop up the dialog and suspend the calling code until the response is ready.

Thanks Ben.
I tried to do following as suggested by you but unfortunately code is not behaving as expected.
bool SampleThread()
{
//Some Code
ISHELL_CreateDialog();
//Some code

And in Dialog start event I am suspending the thread.
I want to stop the code below ISHELL_Createdialog() but dialog start event is received after SampleThread function call.
Please let me know if I am doing something wrong.

Thanks Ben.
I tried to do following as suggested by you but unfortunately code is not behaving as expected.
bool SampleThread()
{
//Some Code
ISHELL_CreateDialog();
//Some code

And in Dialog start event I am suspending the thread.
I want to stop the code below ISHELL_Createdialog() but dialog start event is received after SampleThread function call.
Please let me know if I am doing something wrong.

I was using Widgets and Forms - I've not really ever used the OEM controls like ISHELL_CreateDialog, but the same principles should apply.
I don't really understand what you've done, but it sounds like you're trying to suspend the thread the dialog is running in. You want to suspend the thread that sets up the dialog, which allows BREW main thread to display the dialog, wait for user input, process user input - and then at that point unsuspend the original thread, now that the user input is ready.
It's complicated, and if you don't understand both how BREW threads work, and how your UI works (be that BUIW or OEM controls) then you are going to run into difficulties.

I was using Widgets and Forms - I've not really ever used the OEM controls like ISHELL_CreateDialog, but the same principles should apply.
I don't really understand what you've done, but it sounds like you're trying to suspend the thread the dialog is running in. You want to suspend the thread that sets up the dialog, which allows BREW main thread to display the dialog, wait for user input, process user input - and then at that point unsuspend the original thread, now that the user input is ready.
It's complicated, and if you don't understand both how BREW threads work, and how your UI works (be that BUIW or OEM controls) then you are going to run into difficulties.