Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Carbide.c++ Tutorial 2 - Getting Input from user
This code example shows how to use the Carbide.c++ designer to create a single line data query input dialog. The example presents the user with an input dialog: once the user enters text and selects the OK softkey the entered text is displayed to the user.
The input dialog is in the Carbide.c++ designers's Notes and Dialogs section.
See this tutorial first in order to understand basics of creating and running an application: Helloworld tutorial
Step 1 - Start a new project
- Start with a new project using Carbide.c++ IDE.
- Call it dialogs ( or whatever you like).
Once you are done with all basic steps you will see this window.
Step 2 - Add Single Line Data Query
Now add the Single Line Data Query input dialog to the form.
When selected from control pane, it would appear as below.
Step 3 - Delete the default
Now delete the default text appearing in the text area of the dialog.
Step 4 - Add event handler
- Add one menu item in the options menu.
- Refer to the above mentioned hello-world tutorial.
- Call this menu item as "Get Input".
- Now add an event handler to the menu item.
In the event handler the add the code for
Step 5 - Generated Code
Notice that the IDE generated code for the function to show the data query dialog. Remember not to tamper with the code between the tags called "generated code" this may stop auto generation of code.
Step 6 - Executing the application
Now we are done with the code and design part. Run the application to text it in emulator and following should be the output.
Step 7 - Changing the properties
The properties of the dialog can be altered visually in GUI designer. Right click the dialog and then select "Show properties view" option.
This way we can develop the GUI based application using Carbide.C++ very quickly. Once the basic idea of using dialogs with the IDE is clear, one can go for other dialogs in the application.