Graphics Reference
In-Depth Information
end because the results of this step are pieces of code that operate behind the
visible user interface. Typically, GUI builder programs provide mechanisms for
supporting the registration of event service routines. For example, a GUI builder
displays a list of defined events for a particular GUI element. The developer has
the option of registering for an event by entering a service function name.
Similar types of support are also available for defining control variables. The
developer indicates to the GUI builder (e.g., by clicking on an appropriate prop-
erty sheet) that a control variable should be defined for a particular GUI element.
Based on the GUI element type (e.g., a button), the GUI builder typically pre-
determines the data type (e.g., CButton) for the control variable and prompt the
developer for the variable name.
Notice that in both cases, the developer entered program code fragments
(names of service functions and control variables) into the GUI builder program.
As mentioned, at the conclusion of the GUI builder program, information is saved
into some data files. It is important for the GUI builder to integrate these code
fragments with the rest of the event-driven program source code. There are two
different mechanisms for supporting this integration.
1. External linkage. Some GUI builders require the developer to enter the
entire event service routine program code directly into the GUI builder pro-
gram. The GUI builder then generates extra program modules in the form
of source code files that contain the event service routines. The developer
includes these source code files as part of the development project.
2. Internal direct code modification. Some GUI builders modify and in-
sert function prototypes and/or control variable declaration/initialization di-
rectly into the source files in the development project. The developer then
edits the same source file to enter event service routine program code.
The advantage of the external linkage mechanism is that the GUI builder has mini-
mal knowledge of the application source code. This provides a simple and flexible
development environment where the developer is free to organize the source code
structure, variable names, and so on, in any appropriate way. However, the exter-
nally generated programming module implies a loosely integrated environment.
For example, to modify the behavior of a GUI element, the application developer
must invoke the GUI builder, modify code fragments, and regenerate the external
program module.
The internal direct code modification mechanism, in contrast, provides a bet-
ter integrated environment where the GUI builder modifies the application pro-
gram source code directly. However, to support proper “direct code modifica-
tion,” the GUI builder must have intimate knowledge of, and often places severe
Search WWH ::




Custom Search