You are hereDocumentation / 1. Basic Concept / 1.2 Architecture overview

1.2 Architecture overview


MSEgui requires no external component libraries - it communicates directly with the graphical interface of the operating system, X11 via Xlib on Linux and gdi32 under Windows.

For the individual GUI elements no operating system resources are required - only the main windows are known to the operating system. The entire processing of external events (keyboard, mouse, focus control ...) happens within MSEgui on a Pascal level.

The base class for GUI elements is a twidget. There is no distinction between simple graphic elements and elements which can receive input focus, as is the case in Delphi. All MSEgui widgets have the full functionality of a twidget at their disposal.

Important features of twidget are twidget.frame and twidget.face. When frame or face are not used, they are represented by NIL pointer, in this way using almost no resources.

twidget.frame is responsible for the frame around the working area of the element. The appearance of the frame is higly adjustable - it can be a simple and quickly drawable 3D frame, as well as a complex and slower composite construct, based on images. There are also other frame elements, that can build scroll bars, buttons and labels.

twidget.face draws the background of the working area of a desktop GUI element - color gradients and images in various forms can be shown, while partial transparency is also possible.

Setting the properties of frame and face can be centralised by using tframecomp and tfacecomp, which can be selected into tframe and tface as templates.

The next level of centralization is tskincontroller, through which program-wide settings can be made. In order to achieve that, tskinkontroller assigns to the GUI elements the appropriate tframcomp and tfacecomp templates.

The control of the widget functions (focusin, focusout, ...) is done by virtual procedures and functions and not through messages. The MSEgui message function has other tasks. Also a Corba-style interface is used - for the safe connection between the various components and the automatic disconnection through destroy, a tobjectlinker is used.

The type msestring is used in MSEgui for storing text. At the moment, msestring equals WideString. However, the reference counted FPC WideString (UnicodeString) is planned to be used under Windows, as soon as it becomes available in one of the future FPC releases.

In text files the utf-8, ASCII or the local encoding is used - MSEide+MSEgui does not use utf-16 files.

The MSEgui database components provide the conversion from the local encoding or the utf-8 (adjustable) to WideString for the data buffering. For file operations, a set of MSEgui's own functions with WideString interface exists. An MSEgui application can therefore work consistently with WideStrings, which is a significant relief for some tasks.

Specialized data edit widgets for the basic data types (integer, real, tdatetime, ...) are available in MSEgui (tintegeredit, trealedit, tdatetimeedit, ...). The main event property of these widgets is onsetvalue, which can be used for reacting upon user input.

The t*edit widgets can be inserted into a twidgetgrid and in that way form a column of the appropriate data format.

For viewing and editing of data fields a tdbwidgetgrid togeather with a set of tdb*editwidgets can be used. Worth mentioning are also different lookup components and a tlookupbuffer, a fast associative data memory.

The basic component of the MSEgui's database environment is tmsebufdataset, from which tmsesqlquery is derived. MSEgui DB is a fork of the FPC SQLDB system, where TBufDataset and large parts of TSQLQuery and the connection components have been completely rewritten.

tmsebufdataset offers local indices, calculated and internalcalc-fields, a mode with an interrupted database connection, an in-memory mode where no database connectivity is necessary and can keep a local journal, in order to later reconect a previously disconnected database connection. tmsebufdataset stores texts as WideStrings of variable length.

Further, there are SQL script components and tsqlresult for quick queries without the TDataset overhead. Persistent TField instances are either kept within tmsesqlquery, where they can be edited in the object inspector via tmsesqlquery.controller.fields, or they can be inserted into forms or modules as as individual components from the 'DBf' component palette.

MSEide supports 'visual form inheritance', Submodule (Delphi TFrame equivalent) and allows the assignment of components of other forms or modules to component properties at design time.

Internationalization is done via resource modules that are loadable at runtime. The MSEi18n, a tool that supports the import and export of texts in spreadsheet programs is available for editing - therefore facilitating a translation by nonprogrammers.

1) This chapter is based on a translation of a German text provided by Martin Schreiber.