Calendar Control. Parameters of compilation
This document describes parameters defined to compile calendar control to get controls with various properties. Document is written for version 2.5 of control.
Source code of control is created so that it is possible to compile controls with various properties. Appearance (interface) and language of interface can be modified. Propeties of compiled control are determined by parameters of compilation in source code.
These parameters take into account existence of BeOS operating systems (of version 5.0.X) and Zeta which have differently looked controls and different means of localization. Existence of BeOS of versions 5.1 (Dano) was not taken into consideration because author didn't have possibility to test how control worked in these systems. To compile control in Dano use recomendations at the end of this text.
Group of parameters determining modified properties of control is written at the beginning of CalendarControl.cpp file (after information about version, author and license of control). See this code below:
// -------------------------------------------------------------------------------
// --------------- Parameters to compile controls (see Compile.html) -------------
// -------------------------------------------------------------------------------
// ----------------------------------- Languages ---------------------------------
//#define __LANG_LOCALE // to compile localized version (only for Zeta)
//#define __LANG_ENGLISH // to compile english version
//#define __LANG_RUSSIAN // to compile russian version
//#define __LANG_FRENCH // to compile french version
// If nothing is set then english version (if to compile in BeOS)
// or localized version (if to compile in Zeta) is compiled.
// ---------------------------------- Interfaces ---------------------------------
//#define __UNIVERSAL_INTERFACE // to compile with Zeta and BeOS interface
//#define __ZETA_INTERFACE // to compile only with Zeta interface
//#define __BEOS_INTERFACE // to compile only with BeOS interface
// If nothing is set then __UNIVERSAL_INTERFACE will be set if to compile in BeOS.
// But while compiling in Zeta only __ZETA_INTERFACE is set no matter
// what interface developer have defined indeed.
// -------------------------------------------------------------------------------
// ---------------------------- End of parameters --------------------------------
// -------------------------------------------------------------------------------
First four parameters defined by #define options determine language of interface of control (in order of listing): localized, english, russian or french. To specify language uncomment according parameter. If all parameters are not uncommented control will have default language. While compiling in BeOS default language is english. But if to compile control in Zeta, it by default will be localized with system means of this OS.
One can mention that attemt to make control fully localized in Zeta was not successfull because there aren't system translation for abbreviated days of week (they are remain english).
Don't define __LANG_LOCALE parameter while compiling in BeOS. This will be considered as error and english language will be set. The same may be said about defining some parameters at the same time. In this case only first of defined will be chosen.
Now look at second group of parameters (they determine appearance of control).
First parameter (__UNIVERSAL_INTERFACE) specify that code which allows to draw control it to look both like BeOS controls and Zeta controls will add to library with control. If it is defined then other two parameters will be defined also automatically. Final appearance of control while program is running depends upon interface flag of constructor's parameter of interface (even so that if program with control is started under BeOS control is looked like BeOS controls but if the same program runs under Zeta then control has appropriate appearance).
Second and third parameters (if __UNIVERSAL_INTERFACE is not defined) exlude one other. If to define one of them code drawing control only like controls in according OS will be added to library with control. In this case control will have the same appearance no matter in which OS program with it is running.
If library is compiled in BeOS all three parameters may be used. But if it is compiled in Zeta only __ZETA_INTERFACE will be set automatically and two other parameters will be undefined. It is made so because program or library compiled in Zeta can't work in BeOS (but otherwise is possible in most cases) and BeOS-like interface of control will not be used (may be only by developer's whim). So no sense to include code which only increase the size of library.
Operating system BeOS of versions 5.1 (Dano) have interface like Zeta interface and the same programs compiled in Dano don't work in BeOS 5.0.X. So while compiling calendar control in Dano it is recommended to define __ZETA_INTERFACE to specify appearance of control. And to determine interface language parameters used for compiling in BeOS (i.e. without __LANG_LOCALE) may be used in Dano also.