View topic - Open a dialog from a string

Open a dialog from a string

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

Open a dialog from a string

Postby David Porta » Wed Sep 20, 2006 1:54 pm

Hello,

I need to open a dialog from a string that is comming from a database. The
only tink that is stored in the database is the name of the widget...my
problem is how to know the value of the ABM_Window1 variable in runtime.

A simple example would be an input text where the user writes Window1 and a
button with a callback that would call the ApCreateModule(ABM_Window1)

My first solution is to create an array with the strings and the ABM_
variables but this is not very automatic to program since I have to maintain
this array for every new Window I create.

Thanks

David
David Porta
 

Re: Open a dialog from a string

Postby Misha Nefedov » Wed Sep 20, 2006 2:02 pm

I do prefer your way of doing things, because I think it will catch some
errors if you have windows removed or renamed, but you can try this way too:
1. Create just one empty dialog (window), let's say ABM_dialog.
2. Create a picture module, that will contain all of your dialogs.
3. In the picture module -- create all your widgets -- please make sure that
all of them have a PtContainer or PtPane in the root. Let's say you create a
PtPane with a warning message in it -- Warning_PIC, and another one with an
error in it -- Error_PIC.
4. By using ApOpenDBase*() open your picture module.
5. When time comes, open your ABM_dialog -- in the setup function create the
required contents based on the name you need, use the
ApCreateDBWidgetFamily(). You will have to pass 'Warning_PIC' or
'Error_PIC'.

Regards,
-Misha.

"David Porta" <DavidPorta@NoSpam.es> wrote in message
news:eergj0$gb3$1@inn.qnx.com...
Hello,

I need to open a dialog from a string that is comming from a database. The
only tink that is stored in the database is the name of the widget...my
problem is how to know the value of the ABM_Window1 variable in runtime.

A simple example would be an input text where the user writes Window1 and
a button with a callback that would call the ApCreateModule(ABM_Window1)

My first solution is to create an array with the strings and the ABM_
variables but this is not very automatic to program since I have to
maintain this array for every new Window I create.

Thanks

David

Misha Nefedov
 


Return to qnx.gui

Who is online

Users browsing this forum: No registered users and 2 guests