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:
Let us see more about the classes listed in the following bullet list:
wxFrame
class: This class represents main window. All other visual elements are displayed inside this class.wxMenuBar
class: This class shows the menu bar in our app.wxToolBar
class: This class shows a tool bar in our app.wxScrolledWindow
class: This class is used to display images. This class creates a resizable window to match window size.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:
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.
3.145.101.81