Version 6 of the Hello World application shows you how to do the following:
The main window for Version 6 of the Hello World application looks like this:
The following files contain the code used to create version 6:
| File | Type of Code |
|---|---|
| ahellow6.cpp | Source code for main procedure and AHelloWindow class |
| ahellow6.hpp | Class header file for AHelloWindow |
| ahellow6.h | Symbolic definitions file shared by all source files |
| adialog6.cpp | Source code for the ATextDialog class |
| adialog6.hpp | Class header file for ATextDialog |
| aearthw6.cpp | Source code for the AEarthWindow class |
| aearthw6.hpp | Class header file for AEarthWindow |
| anotebw6.cpp | Source code for the ANotebookWindow class |
| anotebw6.hpp | Class header file for ANotebookWindow |
| ahellow6.rc | Resource file |
| ahellow6.ico | Icon file |
| ahellow6.rtf and ahello6.hpj | Help source files for Windows help |
| ahello6.ipf | IPF help source files |
The following list describes the tasks performed by version 6 of the Hello World application that are not already described for previous versions. The tasks are as follows:
Refer to timehdr.cpp and timehdr.hpp in the ownhdr sample for an example of writing your own handler. This sample demonstrates writing your own handler by implementing a simple time handler that posts a WM_TIMER event and calls ATimeHandler::tick every second.
| Note: | The ownhdr sample demonstrates IHandler derivation; the timer functions might not handle all cases and might break in a multithreaded environment. |
Refer to the aearthw6.cpp and aearthw6.hpp files for ATwinkleTimeHandler. The ATwinkleTimeHandler uses the ITimer class to provide stars that twinkle.
Hello World version 6 also provides public functions for setting the date and time formats.
Hello World version 6 derives a new class, APopUpHandler, from IMenuHandler, and overrides the virtual function makePopUpMenu to provide pop-up menus for the hello and earthWindow static text windows. This version also demonstrates using static and dynamic pop-up menus.
This new menu item invokes the AHelloWindow::setHelloFont function that uses a modal IFontDialog to change the font in the AHelloWindow::hello static text window.
This new submenu contains Read, Open..., and Save menu items.
This new menu item invokes the AHelloWindow::openHelloSettings function that dynamically creates a nonmodal ANotebookWindow frame window. The nonmodal frame window lets you change AEarthWindow settings and date and time formats using check boxes, a slider, and radio buttons from a notebook window.
Refer to anotebw6.hpp and anotebw6.cpp to see how the new ANotebookWindow class is defined and implemented, and to ahellow6.cpp for an example of its use.
This new menu item invokes the AHelloWindow::saveHelloSettings function that saves the hello font and the changeable user settings to an IProfile class file. Hello World version 6 uses a message box to indicate that the save completed successfully.
This new menu item invokes the AHelloWindow::readHelloSettings function that reads the hello font and the changeable user settings from an IProfile class file. Hello World version 6 uses a message box to indicate that the read completed successfully.
Refer to the aearthw6.cpp and aearthw6.hpp files for more information.
![]()
Events and Event Handlers
Controls
Resources
![]()
Converting Application Resources
Adding Menus to your Application
Layout Using Canvas Controls
Creating and Using Text Controls
Using List and Slider Controls
Creating and Using Notebooks
Using Common Dialogs
![]()
IEvent
ICommandHandler
IFileDialog
IFontDialog
IHandler
IHelpWindow
IHelpHandler
IMenu
IMenuBar
INotebook