SIMPOL Documentation

Chapter 22. Overview of Window and Dialog Types Provided with SIMPOL

This chapter will look at the various types and families of types supplied with SIMPOL. It will not go into excessive detail, but it will attempt to provide a clear view of the types, the hierarchy of types included by other types, and how each set of types was designed to be used. Types come in two varieties, those provided as C/C++ language components and those designed in SIMPOL itself. This section will also concentrate mainly on the GUI elements. For other parts, it may be useful to examine the source code to the libraries or check the Language Reference Guide. The types that will be discussed include both those from the C/C++-language based component WXWN, and also derived types built in the SIMPOL programming language. These include:

  • wxwindow

  • wxdialog

  • dataform1

  • printform1

  • report1

  • quickreport1

  • graphicreport

  • application

  • appwindow

wxwindow

The wxwindow type is used to create the main window for an application (usually), and might contain a menu bar, tool bar, status bar and even child windows. The wxwindow type is also used to create child windows. Here are some of the other types that are directly associated with the wxwindow:

  • wxmenubar

  • wxtoolbar

  • wxstatusbar

In addition to these types, there are also some functions that are important to working with top level windows:

  • wxprocess()

  • wxbreak()

A minimal program that presents a window with no content can be seen in the section called “Creating a Single Window”.

In order to respond to events, it is necessary to place the WX system into a state to respond to events. That is what the wxprocess() function does. It takes a time out value, which is typically set to .inf, the internal value for infinity. That means that unless it is forced to exit by some other method, the program will sit in that statement waiting for events forever. In the example, the task of exiting this state is fulfilled by the quit() function, which is called when the user clicks the close gadget for the window, selects Close from the system menu, or presses Alt+F4 (in Windows). That results in a call to the wxbreak() function, the sole purpose of which is to terminate a wxprocess() function.

[Note]Note

The program could also call the quit() function for some other reason, such as a menu selection, a form button press, etc. that would result in the program exiting.