Anatomy of exercise app

Our image viewer app uses several C++ classes to open, display, and control display of image. The following screenshot highlights major classes that are responsible for user interaction:

Anatomy of exercise app

Let us see more about the classes listed in the following bullet list:

  • The wxFrame class: This class represents main window. All other visual elements are displayed inside this class.
  • The wxMenuBar class: This class shows the menu bar in our app.
  • The wxToolBar class: This class shows a tool bar in our app.
  • The wxScrolledWindow class: This class is used to display images. This class creates a resizable window to match window size.
  • The wxStatusBar class: This class shows a status bar at the bottom of our app. We'll be using this to display menu item help and other information.

A tree of the classes and their relationship with the wxFrame derived class is shown in the following diagram:

Anatomy of exercise app

In the preceding diagram wxMenuBar, wxToolBar, and wxStatusBar are derived classes and have been added directly to wxFrame derived class.

Whereas we need couple of extra classes for the wxScrolledWindow derived class. We have two intermediate classes, wxBoxSizer and wxGridSizer, for the wxScrolledWindow derived class. These classes are known as layout classes that help laying out child windows within a parent window. Note that layout classes are not visible to the user.

wxWidgets provides a class to load, manipulate multiple image formats via the wxImage class. This class is the engine of our app. The wxScrolledWindow class uses it to load and manipulate image file. wxPaintDC is the class that wxScrolledWindow uses to paint loaded image file on to itself.

With this introduction to the structure of our app we shall proceed with the development of our app.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.107.31