Sign in Join
Wiki copytemporary

MSEide+MSEgui/fr: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11**Information** : Le projet MSEide+MSEgui est continué par les [amis de Martin Schreiber](https://github.com/mse-org). Rejoignez-nous !
22
33La version la plus récente de MSEide+MSEgui peut-être téléchargée sur la page suivante : <https://github.com/mse-org/mseide-msegui>
44
55Biographie de † Martin Schreiber (en anglais) : <https://sites.google.com/view/martin-schreiber-biography/>
66
77# Introduction
88
99MSEide+MSEgui est un outil multiplateforme de développement entièrement écrit en Pascal. La bibliothèque MSEgui n'est pas compatible avec la VCL. La bibliothèque graphique est une interface à win32 et X11. Quoiqu'étant l'œuvre d'une seule personne (Martin Schreiber) l'EDI et la bibliothèque offrent de nombreuses fonctionnalités :
1010
1111- Encodage interne des caractère en UCS2.
1212- Outil d'internationalisation inclus.
1313- Docking forms.
1414- Embedded forms (similar to TFrame).
1515- Visual form inheritance.
1616- Liaison à xlib et à gdi32, sans dépendance à une autre bibliothèque.
1717- Composants pour la gestion de bases de données et composants visuels pour l'édition des données.
1818- Débogage intégré.
1919- Integrated report designer.
2020- Flexible and handy build system with switchable macros.
2121- Et d'autres choses encore...
2222
2323## Mais que faites-vous de Lazarus ?
2424
2525[Lazarus](http://www.lazarus.freepascal.org) est un EDI qui offre un haut degré de compatibilité avec la VCL (la bibliothèque de composants visuels de Delphi) et des applications avec un aspect différent sur de nombreuses plateformes. Cet aspect natif est important pour beaucoup de développeurs. Cependant, le parti pris de la compatibilité avec la VCL nécessite un travail compliqué d'interface avec les différents ensembles de composants visuels (GTK, Win32, Carbon, Qt). L'évolution de ces ensembles (par exemple le passage de GTK1 à GTK2) oblige à des réadaptations continuelles.
2626
2727[MSEide+MSEgui](http://sourceforge.net/projects/mseide-msegui/) n'a ni l'avantage de la compatibilité avec la VCL, ni un style différent pour chaque plateforme. La bibliothèque visuelle fait interface avec Win32 et X11. L'avantage de s'appuyer sur X11 est de pouvoir atteindre durablement un grand nombre de plateformes.
2828
2929Lazarus et MSEide+MSEgui poursuivent donc des objectifs différents. À vous de voir lequel correspond le mieux à vos attentes !
3030
3131## Pourquoi ce wiki
3232
3333La conception de MSEgui est une nouvelle approche. MSEgui apporte des solutions innovantes aux problèmes de toujours. La bibliothèque MSEgui est donc radicalement différente de la VCL/LCL/CLX. Passer de la VCL à MSEgui sera plus difficile que de passer [[Code Conversion Guide|de la VCL à la LCL]]. Ces pages de wiki ont pour but de vous guider dans vos premiers pas.
3434
3535# Installation
3636
3737- Dernière version publiée par Martin Schreiber : 4.6.2
3838- Page d'accueil : [Site de MSEide+MSEgui](http://mseide-msegui.sourceforge.net/)
3939- Téléchargement : [Sourceforge](http://sourceforge.net/projects/mseide-msegui/files/)
4040
4141- Version courante du projet continué par les amis de Martin Schreiber : 5.1.0
4242- Page d'accueil : [Nouveau site de MSEide+MSEgui](https://github.com/mse-org/mseide-msegui)
4343- Téléchargement : [Github](https://github.com/mse-org/mseide-msegui/releases)
4444
4545Les instructions pour l'installation se trouvent sur la page d'accueil.
4646
4747# Premières notions
4848
4949## Ouverture d'un projet
5050
5151Lancez l'EDI et utilisez le menu Project-\>Open pour ouvrir le projet de démonstration msegui/apps/demo/demo.prj. Le nom du projet s'affiche dans le titre de la fenêtre principale. Appuyez sur F9 et (pourvu que vous ayez suivi les consignes d'installation), admirez la rapidité du tandem formé par Free Pascal et MSEide.
5252
5353## Premiers pas dans le développement rapide d'applications
5454
5555Arrêtez l'application en cliquant sur le bouton Exit. Utilisez le menu Project-\>Source pour ouvrir le fichier demo.pas. Appuyez sur la touche Ctrl et simultanément cliquez sur le paramètre mainfo dans la ligne de code suivante :
5656
5757`application.createform(tmainfo,mainfo);`
5858
5959Le fichier main.pas s'ouvre automatiquement dans l'éditeur et le curseur se positionne à l'endroit où la variable mainfo est déclarée. Cliquez sur F12 pour passer de l'unité à la fiche et inversement. Tout ne sera pas aussi facile : c'est la raison d'être de la page que vous êtes en train de lire. Cliquez sur le bouton : l'éditeur de propriétés s'ouvre (inhabituel mais commode). Nous allons ajouter un deuxième bouton. Si nécessaire, affichons la palette de composants en utilisant l'item de menu View-\>Toolbar-\>Component Palette. Sélectionnons le composant tbutton sur l'onglet Widget (c'est le premier). Cliquons sur la forme pour placer le bouton. Renseignons la propriété caption de la manière habituelle. La création d'une procédure liée à un événement ne se fait pas de la manière accoutumée, par un double clic sur la propriét onexecute. Au lieu de cela, vous devez sélectionner la propriété onexecute dans l'éditeur de propriétés, taper le nom que vous vous avez choisi pour la procédure et appuyer sur Entrée. Le code de la procédure est automatiquement créé et le curseur se place à l'endroit de la définition. Utilisez la combinaison de touches Ctrl-Shift-flèche du bas (ou du haut) pour aller de la définition à l'implémentation. Ajoutez dans le corps de la procédure quelque chose comme writeln('Hello world'); puis appuyez sur F9. Le résultat de l'instruction writeln s'affiche dans la console cible de MSEide, que vous pouvez rendre visible par le menu View-\>Target Console.
6060
6161## Ajouter un menu
6262
6363### Création du menu
6464
65-Sélectionnez le composant `tmainmenu`, dans l'onglet <i>Gui</i> de la palette de composants, et déposez le composant sur la forme principale.
65+Sélectionnez le composant `tmainmenu`, dans l'onglet Gui de la palette de composants, et déposez le composant sur la forme principale.
6666
67-<figure>
68-<img src="tmainmenu1.png" title="tmainmenu1.png" />
69-<figcaption>tmainmenu1.png</figcaption>
70-</figure>
67+![](/wiki-images/8/8f/Tmainmenu1.png)
7168
72-Cliquez sur la forme principale (`mainfo`) pour que l'inspecteur d'objet affiche les propriétés de la forme principale. Utilisez la flèche à droite de la propriété <b>mainmenu</b>, pour sélectionner `tmainmenu1` comme menu principal de la forme principale.
69+Cliquez sur la forme principale (`mainfo`) pour que l'inspecteur d'objet affiche les propriétés de la forme principale. Utilisez la flèche à droite de la propriété mainmenu, pour sélectionner `tmainmenu1` comme menu principal de la forme principale.
7370
74-<figure>
75-<img src="tmainmenu2.png" title="tmainmenu2.png" />
76-<figcaption>tmainmenu2.png</figcaption>
77-</figure>
71+![](/wiki-images/d/d2/Tmainmenu2.png)
7872
7973### Création des items de menu
8074
81-Dans l'inspecteur d'objet, développez la branche <b>mainmenu</b>. Dans cette branche, développez la propriété <b>menu</b>. Changez la valeur de <b>submenu.count</b> : remplacez 0 par 1 (ou une valeur supérieure).
75+Dans l'inspecteur d'objet, développez la branche mainmenu. Dans cette branche, développez la propriété menu. Changez la valeur de submenu.count : remplacez 0 par 1 (ou une valeur supérieure).
8276
83-<figure>
84-<img src="tmainmenu3.png" title="tmainmenu3.png" />
85-<figcaption>tmainmenu3.png</figcaption>
86-</figure>
77+![](/wiki-images/2/29/Tmainmenu3.png)
8778
88-Développez la propriété <b>submenu.count</b>, qui affichera "Item 0". Dépliez "Item 0" et changez la valeur de la propriété <b>caption</b> : mettez par exemple "&File".
79+Développez la propriété submenu.count, qui affichera "Item 0". Dépliez "Item 0" et changez la valeur de la propriété caption : mettez par exemple "&File".
8980
90-<figure>
91-<img src="tmainmenu4.png" title="tmainmenu4.png" />
92-<figcaption>tmainmenu4.png</figcaption>
93-</figure>
81+![](/wiki-images/7/77/Tmainmenu4.png)
9482
95-Répétez ensuite la même procédure, en changeant la valeur de <b>submenu.count</b> pour "Item 0" : mettez par exemple 1.
83+Répétez ensuite la même procédure, en changeant la valeur de submenu.count pour "Item 0" : mettez par exemple 1.
9684
97-Développez la propriété <b>submenu.count</b> et changez la valeur de la propriété <b>caption</b> pour le nouvel "Item 0". Mettez par exemple "E&xit". Appuyez sur F9 : votre programme devrait avoir un menu *F*ile avec une entrée E*x*it.
85+Développez la propriété submenu.count et changez la valeur de la propriété caption pour le nouvel "Item 0". Mettez par exemple "E&xit". Appuyez sur F9 : votre programme devrait avoir un menu *F*ile avec une entrée E*x*it.
9886
99-<figure>
100-<img src="tmainmenu5.png" title="tmainmenu5.png" />
101-<figcaption>tmainmenu5.png</figcaption>
102-</figure>
87+![](/wiki-images/0/03/Tmainmenu5.png)
10388
10489### Autre méthode
10590
106-Une autre méthode consiste à cliquer avec le bouton droit de la souris, dans l'inspecteur d'objet, sur la propriété <b>submenu.count</b>, ou sur une propriété "Item n". Vous verrez apparaître un menu contextuel. Utilisez ce menu pour insérer, ajouter ou supprimer des items de menu.
91+Une autre méthode consiste à cliquer avec le bouton droit de la souris, dans l'inspecteur d'objet, sur la propriété submenu.count, ou sur une propriété "Item n". Vous verrez apparaître un menu contextuel. Utilisez ce menu pour insérer, ajouter ou supprimer des items de menu.
10792
10893Dès que vous avez plus d'un sous-menu, vous pouvez déplacer les items en les faisant glisser avec la souris. Commencez le mouvement de la souris sur la ligne "Item n".
10994
11095## Créer un projet à partir d'un modèle
11196
11297Pour créer un projet à partir d'un modèle (template), utilisez le menu Project-\>New-\>From Template. Pour une application graphique, choisissez "default.prj" ; pour une application console, choisissez "console.prj".
11398
11499# Vue d'ensemble
115100
116101MSEgui est une bibliothèque qui fournit les matériaux permettant de construire des applications avec interface graphique<sup>1</sup>.
117102
118103MSEide est un environnement de développement conçu pour la production de logiciels avec Free Pascal et MSEgui. MSEide peut aussi être utilisé pour produire des applications pour micro-contrôleurs, avec le compilateur GCC.
119104
120105La version courante de MSEide+MSEgui fonctionne sous i386-linux, x86-64-linux, arm-linux, x86-64-freebsd, i386-win32 and x86-64-win64. Les microprocesseurs supportés sont CPU32, ARM and AVR32. MSEgui n'est lié à aucune plateforme en particulier. Des plateformes supplémentaires peuvent être ajoutées, à condition d'implémenter les éléments dependants du système. Les modules de MSEgui propres à un système en particulier se trouvent dans les sous-répertoires du dossier lib/common/kernel.
121106
122107## Principaux objectifs recherchés au cours du développement
123108
124109- Une productivité accrue.
125110- Une apparence et des fonctionnalités identiques sur toutes les plateformes, sans précautions particulières de la part de l'utilisateur.
126111- Aussi peu de dépendances que possibles.
127112- Orthogonalité : il doit y avoir aussi peu d'interférences que possible entre les différents éléments du programme et aussi peu d'exceptions et de cas spéciaux que possible.
128113- Des composants hautement paramétrables.
129114- Travailler avec MSEide+MSEgui devrait être amusant.
130115
131116## Architecture
132117
133-MSEgui ne dépend <u>d'aucune bibliothèque externe de composants</u>. MSEgui communique directement avec l'interface graphique du système d'exploitation, X11 via Xlib sous Linux et GDI sous Windows.
118+MSEgui ne dépend d'aucune bibliothèque externe de composants. MSEgui communique directement avec l'interface graphique du système d'exploitation, X11 via Xlib sous Linux et GDI sous Windows.
134119
135-Les éléments individuels de la bibliothèque n'emploient <u>aucune ressource du système d'exploitation</u>. Seule la fenêtre principale est connue du système d'exploitation. Le traitement des événements externes (clavier, souris, contrôle du focus) se fait à l'intérieur de MSEgui, en Pascal.
120+Les éléments individuels de la bibliothèque n'emploient aucune ressource du système d'exploitation. Seule la fenêtre principale est connue du système d'exploitation. Le traitement des événements externes (clavier, souris, contrôle du focus) se fait à l'intérieur de MSEgui, en Pascal.
136121
137122La classe de base pour les éléments de la bibliothèque est la classe `twidget`. Il n'y a aucune distinction entre les éléments graphiques simples et ceux qui peuvent recevoir le focus (comme c'est le cas avec Delphi). Tous les widgets MSEgui disposent de toutes les fonctionnalités de la classe `twidget`.
138123
139124La classe `twidget` a deux propriétés remarquables qui sont d'une part `twidget.frame` et d'autre part `twidget.face`. Quand ces deux propriétés ne sont pas utilisées, elles ont la valeur **nil**, de façon à ne consommer aucune ressource.
140125
141126La propriété `twidget.frame` est responsable du cadre qui entoure la surface utile de l'élément. L'apparence du cadre est modifiable. Ce peut être un simple cadre 3D, rapide à dessiner, aussi bien qu'une construction complexe basée sur des images. Le cadre comprend aussi des éléments qui peuvent être utilisés pour faire des barres de défilement, des boutons et des labels.
142127
143128La propriété `twidget.face` dessine l'arrière-plan de la surface utile d'un élément. Des dégradés de couleur et des images peuvent être utilisés. Une transparence partielle est possible.
144129
145-Setting the properties of frame and face can be centralised by using <u>`tframecomp`</u> and <u>`tfacecomp`</u>, which can be selected into `tframe` and `tface` as templates.
130+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.
146131
147-The next level of centralization is <u>`tskincontroller`</u>, 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.
132+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.
148133
149-<u>The control of the widget functions</u> (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.
134+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.
150135
151-The type <u>`msestring`</u> 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.
136+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.
152137
153138In text files the utf-8, ASCII or the local encoding is used - MSEide+MSEgui does not use utf-16 files.
154139
155-The <u>MSEgui database components</u> 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.
140+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.
156141
157-<u>Specialized data edit widgets</u> 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.
142+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.
158143
159144The `t*edit` widgets can be inserted into a `twidgetgrid` and in that way form a column of the appropriate data format.
160145
161-For <u>viewing and editing of data fields</u> a `tdbwidgetgrid` togeather with a set of `tdb*editwidget`s can be used. Worth mentioning are also different lookup components and a `tlookupbuffer`, a fast associative data memory.
146+For viewing and editing of data fields a `tdbwidgetgrid` togeather with a set of `tdb*editwidget`s can be used. Worth mentioning are also different lookup components and a `tlookupbuffer`, a fast associative data memory.
162147
163-The basic component of the MSEgui's <u>database environment</u> 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.
148+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.
164149
165150`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.
166151
167-Further, there are <u>SQL script components</u> 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.
152+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.
168153
169-MSEide supports <u>'visual form inheritance'</u>, Submodule (Delphi TFrame equivalent) and allows the assignment of components of other forms or modules to component properties at design time.
154+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.
170155
171-<u>Internationalization</u> 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.
156+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.
172157
173158<sup>1</sup>) This chapter is based on a translation of a German text provided by Martin Schreiber.
174159
175160# Tips: MSEide
176161
177162## Larger fonts
178163
179164Some may find the standard menu font a bit small. The standard font for the main menu of an MSEgui application is the font defined by the stf_menu stock font. You can change a stock font value with a startup parameter, \<fontheight\> is given in pixels.
180165
181166`--FONTALIAS=<alias>,<fontname>[,<fontheight>[,<fontwidth>[,<options>]]]`
182167
183168So if you start the mseide like this, you can get a larger menu font:
184169
185170` mseide --FONTALIAS=stf_menu,sans,16`
186171
187172In order to increase the base font size for all stock fonts use
188173
189174` mseide --FONTALIAS=stf_default,,16`
190175
191176## Shortcuts
192177
193178Common
194179
195180- **Ctrl+F4** - Close
196181- **Ctrl+S** - Save
197182- **Ctrl+E** - Select page
198183- **F11** - Toggle Form/Inspector
199184- **F12** - Toggle Form/Unit
200185- **Shift+Ctrl+\[0..9\]** - Bookmark 0..9
201186- **Ctrl+\[0..9\]** - Go to bookmark 0..9
202187- **Ctrl+LeftClick** - Go to var(class, method, unit) declaration
203188- **Shift+Ctrl+Up** - Go to method declaration
204189- **Shift+Ctrl+Down** - Go to method implementation
205190- **Shift+Ctrl+Space** - Show procedure header
206191
207192Debug
208193
209194- **F7** - Step
210195- **F8** - Next
211196- **F9** - Continue
212197- **Shift+F7** - Finish
213198- **Shift+Ctrl+F8** - Next instruction
214199- **Shift+Ctrl+F7** - Step instruction
215200- **F5** - Toggle breakpoint
216201- **Shift+F5** - Toggle breakpoint enabled/disabled
217202- **Ctrl+B** - Breakpoints on/off
218203- **Ctrl+W** - Watches on/off
219204
220205Editor
221206
222207- **Ctrl+Z** - Undo
223208- **Ctrl+X** - Cut
224209- **Ctrl+C** - Copy
225210- **Ctrl+V** - Paste
226211- **Ctrl+F** - Find
227212- **F3** - Search again
228213- **Ctrl+L** - Go to line.
229214- **Ctrl+I** - Indent block
230215- **Ctrl+U** - Unindent
231216
232217## Print from IDE
233218
234219You need [Ghostscript](https://ghostscript.com/).
235220
236221## Recent opened files or projects
237222
238223The last opened projects are in the dropdown list of 'Project'-'Open'-'Name'. The last opened files are in the dropdown list of 'File'-'Open'-'Name'.
239224
240225## Menu Editing
241226
242227- Use submenu.count to set the wanted menu items count.
243228- Right click on submenu.count or on a menu item "Item X" to display a context-sensitive menu that allows to insert,append or delete a submenu entry
244229- Use drag and drop on a submenu entry to move the the item in the array.
245230
246231## New Panels in the IDE
247232
248233Example, you want to have the watch, stack and cpu window in a window:
249234
250235- select the menu item **View**-**Panels**-**New Panel**.
251236- select the menu item **View**-**Watches**.
252237- drag the Watches window by the grip (not the window title!) in the new panel.
253238- same with Stack and CPU window.
254239- to split horizontal drag one of the grip of the inserted widgets to the left border of the panel.
255240- to split vertical drag one of the grip of the inserted widgets to the bottom border of the panel.
256241- to use tabs drag one of the grip of the inserted widgets to the centre of the panel.
257242
258243## Design Tab-Order
259244
260245Main way in **MSEide** is set the tab order after all widgets are placed in the form with the popup menu function "Set Tab Order". Select a widget in the container where you wish to set the tab oder, click right, click "Set Tab Order", click row 0, click "Start", click the widget in the container which should get tab order 0, click the widget which should get tab order 1..
261246
262247An alternative is to drag and drop the rows to the desired position. The first row corresponds to the tab order 0 the second to the 1 and so on.
263248
264249### Creating a new event handler
265250
266251Select the event you want in the **Object Inspector**, then type name of the new event handler. IDE create a new procedure(declaration and implementation) in the source code. If you double-click the name of the event handler in the **Object Inspector**, source editor opens with the cursor at begin of your handler implementation.
267252
268253# Trucs et astuces
269254
270255## Contrôle à onglets
271256
272257- Déposez un contrôle **ttabwidget** sur la fiche. Vous avez alors un conteneur (*ttabwidget1*) pour vos pages.
273258- Déposez autant de contrôles **ttabpage** que vous le souhaitez sur *ttabwidget1*.
274259
275260## Séparateur
276261
277262Supposons que nous ayons deux widgets (widgetLeft, widgetRight) entre lesquels nous souhaitons un séparateur horizontal. (Le séparateur sera positionné à la verticale, mais la séparation sera horizontale, n'est-ce pas ?)
278263
279264- Ajoutez un TSplitter sur la fiche et donnez-lui la taille que vous souhaitez.
280265- Donnez à la propriété **linkleft** de *tsplitter1* la valeur **widgetLeft**, et à la propriété **linkright** la valeur **widgetRight**. Nos deux widgets sont désormais collés au séparateur.
281266- Donnez à la propriété **spo_hmove** la valeur **True**. C'est tout.
282267- Si vous souhaitez conserver une proportion entre la largeur de *widgetLeft* et celle de *widgetRight* lorsque la forme est redimensionnée, donnez à la propriété **so_hprop** la valeur **True**.
283268- Pour un séparateur vertical, utilisez les propriétés **linktop**, **linkbottom**, **spo_vmove**, **spo_vprop**.
284269
285270## Switch-off auto-scrolling of the form(widget)
286271
287272Change the **container - frame - sbhorz - options - sbo_showauto** property of the form to **False**.
288273
289274## Read/write data in the twidgetgrid
290275
291276- **editwidget.value** -\> value of the actual row
292277- **editwidget\[rowindex\]** or **editwidget.gridvalue\[rowindex\]** -\> value of the addressed row
293278- **editwidget.gridvalues** the whole column as a dynamic array.
294279
295280## First events
296281
297282**OnCreate** is called before loaded procedures of the components of the form are called, **OnLoaded** is called after loaded procedures of the components of the form are called. Many components do initializations in loaded procedures, event properties are inactive before procedure loaded of the component is called.
298283
299284## MDI
300285
301286MDI - application can be created using TDockFormWidget or TDockPanel (as MDI-area) and TDockForm (as ancestor for you MDI-child window). There are examples:
302287
303288- How to use TDockForm with custom MDI-buttons <http://brefi.narod.ru/mdi_example2.tar.gz> or in *\$MSESOURCES/contributed/ivankob/examples*
304289- Simple MDI-controller (create, switch, ... the child windows) <http://mihafpc.narod.ru/MDISample.tar.gz> or in *\$MSESOURCES/contributed/miha*
305290
306291## Drawing
307292
308293### Redraw form the additional thread
309294
310295Use a **tthreadcomp** (tab **Gui**) to do the long time procedure. If you need to access widgets and other gui variables from the additional thread, call **application.lock** before and **aplication.unlock** after accessing the main event thread elements.
311296
312297### Force repaint
313298
314299- **twidget.invalidate** to invalidate an individual widget
315300- **twidget.rootwidget.invalidate** to invalidate the window
316301- **application.invalidate** to invalidate all windows (=forms) in the application
317302
318303### Draw text
319304
320305There are two methods to draw texts in MSEgui:
321306
322307- Simple text positioning by baseline position of start of the first character with **tcanvas.drawstring**.
323308- With the drawtext procedures of **msedrawstring.pas**.
324309
325310### Widgets canvas
326311
327312No twidget has a canvas. The canvas used for painting is normally one of the canvas of twindow, it can also be an canvas of a tbitmap or a tprinter or... MSEgui uses one canvas to paint a whole window with all widgets. *tcanvas.font* is initialized by **twidget.getfont**, *canvas.color* by **twidget.actualcolor** before calling **twidget.dopaint**, see **twidget.paint** procedure in msegui.pas.
328313
329314### Theming (Frames & Faces)
330315
331316Every twidget has a property **frame** and **face**. If they are deactivated (\<disabled\> in object inspector) they are only an nil pointer and need no more resources. Activate them by clicking on the ellipse button in the right object inspector column in the row face respective frame.
332317
333318The **face** property defines the background of the client area of the widget.
334319
335320It is a combination of a fade and a bitmap. Both of them can be semitransparent. The bitmap can be stretched and/or tiled. Example: you want to create a button with a fade as face.
336321
337322- place a *tbutton* on the form.
338323- in object inspector activate property face.
339324- set *face.fade.color.count* to 2.
340325- click on the **+** at *color.count*.
341326- in item 0 select cl_gray.
342327- in item 1 select cl_ltgray, now you have a left to write fade from gray to light gray.
343328- change *face.fade.direction* to *gd_up* or *gd_down*, you get a convex resp. concave fade.
344329
345330If you want, you can blend an additional structure over the fade:
346331
347332- select the wanted pattern image in *face.image*.
348333- activate *face.image.alignment* al_tiled.
349334- adjust *face.image.transparency* to your needs, \$000000 = opaque, \$ffffff = fully transparent. The number defines the transparency of the three color channels (\$RRGGBB).
350335
351336To centralise the face look use an **tfacecomp** (tab *Gui*) and select the facecomp in *template* of the *face* properties.
352337
353338The **frame** property defines the look of an additional frame around the component and shows a possible caption at the widget. Example: you want an lowered frame around and a caption right of the button.
354339
355340- activate property *frame*.
356341- set *frame.levelo* to -1.
357342- set *frame.leveli* to 1.
358343- enter the caption text in *frame.caption*.
359344- set *frame.captionpos* to cp_right.
360345
361346To centralise the frame look use an **tframecomp** (tab *Gui*) and select the framecomp in *template* of the *frame* properties.
362347
363348### Desktop colors in the MSE application
364349
365350Default values of the mapped colors stored in the array **msegraphics.defaultmapped**. For change it's values you can use function **msegraphics.setcolormapvalue** [Win32 and KDE example](http://www.freepascal.org/wiki/index.php/User:Miha) (*\$MSESOURCES/contributed/miha/GuiStyle.pas*)
366351
367352# Application examples and screenshots
368353
369354## A Firebird application
370355
371356The following screen shots are taken from an MSEgui Firebird database application. The programmer writes he has customized the look and feel of his application in about 30 minutes with a tfacecomp and two tframecomp. He states that the look and feel is identical on Linux and Windows.
372357
373-<figure>
374-<img src="mse_dbwidgetgrid1.jpg" title="mse_dbwidgetgrid1.jpg" />
375-<figcaption>mse_dbwidgetgrid1.jpg</figcaption>
376-</figure>
358+![](/wiki-images/a/a7/Mse_dbwidgetgrid1.jpg)
377359
378-<figure>
379-<img src="mse_dbwidgetgrid2.jpg" title="mse_dbwidgetgrid2.jpg" />
380-<figcaption>mse_dbwidgetgrid2.jpg</figcaption>
381-</figure>
360+![](/wiki-images/e/ea/Mse_dbwidgetgrid2.jpg)
382361
383362Linux version: ![](/wiki-images/c/c0/Mse_form1.jpg)
384363
385364Windows version: ![](/wiki-images/8/8a/Mse_form1w.jpg)
386365
387366Linux version: ![](/wiki-images/a/ab/Mse_button1.jpg)
388367
389368Windows version: ![](/wiki-images/6/65/Mse_button1w.jpg)
390369
391370The report is designed and rendered with the built-in MSEide+MSEgui report designer and report generator.
392371
393-<figure>
394-<img src="mse_report1.jpg" title="mse_report1.jpg" />
395-<figcaption>mse_report1.jpg</figcaption>
396-</figure>
372+![](/wiki-images/2/2e/Mse_report1.jpg)
397373
398374Two MDI forms with fade and flat frame.
399375
400-<figure>
401-<img src="mse_gripfade1.png" title="mse_gripfade1.png" />
402-<figcaption>mse_gripfade1.png</figcaption>
403-</figure>
376+![](/wiki-images/1/18/Mse_gripfade1.png)
404377
405378## An embedded system
406379
407380An embedded system for medical applications, in this case steam sterilizers, was realized with MSE-IDE & MSE-GUI for the control unit, nowadays also commonly called the "human machine interface", HMI.
408381
409-<figure>
410-<img src="MainScreen.png" title="Main Screen" />
411-<figcaption>Main Screen</figcaption>
412-</figure>
382+![](/wiki-images/d/d4/MainScreen.png)
413383
414384The control unit uses a touch panel a its display, therefore all active controls have to be made rather large to enable the personnel to handle them easily. The main screen consists of a few informational display fields and allows to select the implemented sterilizing processes by means of a menu consisting of several button components showing the process names along with a short description in a separate panel. The visibility of the buttons and their captions are defined during program loading by means of a configuration file. The informational fields display the devices' operating values in real time using a MSE system timer to collect the information from the PLC.\
415-\
385+
416386![Process Display](/wiki-images/2/2b/ProcessDisplay.png)
417387
418388After processing has been started, the display is switched to a different format showing the operating values in large digits on some numeric display field components on the left and a graphical representation of the process history on the right, again both as real time "live displays". If the diagram curves would reach the right panel border, the diagram would change to a scrolling mode, always showing the current state at the extreme right.\
419-\
389+
420390![State Display](/wiki-images/b/b2/StateDisplay.png)
421391
422392For diagnostic purposes, also a schematic state display is available. This shows a simplified schematic of the apparatus, along with real time animated symbols of the control elements, as there are valves and pumps, each displayed in a derived version of a timage component, created and placed dynamically on program load. Also shown are the most important process values as numerical displays, also dynamically placed. The schematic field really is the output of a separate program, running in parallel to the process display which provides the upper and lower parts of the screen display.\
423-\
393+
424394![Control Screen](/wiki-images/e/ec/ControlScreen.png)
425395
426396There is also a mode for setting several control and function parameters and to recall previous operational and diagnostic data. It is organised as a tabbed screen containing several run time parametrized menu pages and a couple of display field pages. Some of the pages allow access only after entering a pass code to prevent missuse of critical functions.\
427-\
397+
428398![Protocol Review](/wiki-images/a/aa/ProtocolReview.png)
429399
430400This is a screen displaying a graphical protocol of a previous process. The protocol is usually printed out immediately after termination, as required by the regulations. The printer output is generated as a postscript file, processed by ghostscript both for print out and for the on screen display shown, which uses the png format for loading into the display field.\
431-\
401+
432402![Attribution](/wiki-images/e/e0/Attribution.png)
433403
434404Of course, there is also an attribution display, showing program version, creator information and the tools used for the creation of the system, Free Pascal and MSE-IDE & MSE-GUI. As background, it uses a photography of one such apparatus as it is used in clinics displayed in an image component carrying several label fields used for the text. Above all of that sits a transparent button to close the picture.
435405
436406# Reference: MSEide
437407
438408- To move and resize components without gridsnap use shift+cursorkeys and ctrl+cursorkeys.
439409- There are many possibilities with properties twidget.frame and twidget.face, for instance tiled semitransparent bitmaps and color fades (all twidget descendants have these properties!).
440410
441411For client area of forms use tmseform.container.frame and tmseform.container.face, tmseform has additionally onpaint to do custom drawing.
442412
443413You can write your own widgets and override procedure dopaint or use teventwidget with onpaint,onresize,onmouseevent,onkeydown,onkeyup...
444414
445415`How to convert filenames to windows format? `\
446416`Unit msefileutils: `\
447417`function tosysfilepath(const path: filenamety): filenamety; `\
448418`procedure tosysfilepath1(var path: filenamety); `\
449419`Converts to filename format of actual OS. `\
450420`function tomsefilepath(const path: filenamety): filenamety; `\
451421`procedure tomsefilepath1(var path: filenamety); `\
452422`Converts from filename format of actual OS.`
453423
454424`Where is the MDI ???   `\
455425`In MSEgui we have tdockform and tdockpanel for that purpose. `\
456426`Have a look at property dragdock.`
457427
458428## MSEi18n
459429
460430# [[Reference: MSEgui]]
461431
462432[[Reference: MSEgui|On this page you can find a working in progress for documenting MSEGUI.]]
463433
464434# External links
465435
466436WARNING: MSE project is part now of mse-org: <https://github.com/mse-org>
467437
468438MSEide & MSEgui sources are here: <https://github.com/mse-org/mseide-msegui>
469439
470440Website: <http://mseide-msegui.sourceforge.net/>
471441
472442Community website: <http://www.msegui.com>
473443
474444Unofficial incomplete help pages started from Z505 at: <http://z505.com/cgi-bin/mse/idx.cgi?file=generalindex>
475445
476446Read the beginner's tutorial (in Russian) at: <http://freepascal.ru/article/mse/20060108181639/>
477447
478448Also: "MSEide+MSEgui. Draw lesson." (in Russian) <http://freepascal.ru/article/mse/20060205191314/>
479449
480450You can also find an English translation here: <http://www.geocities.com/yetanothergeek/mseide-tutorial-en/>
481451
482452This page in Russian: <http://freepascal.ru/wiki/index.php/MSEide%26MSEgui>
483453
484454MSElang, the future compiler for the MSEide+MSEgui project <https://gitlab.com/mseide-msegui/mselang/wikis/home>
485455
486456------------------------------------------------------------------------
487457
488458---
489459*From the Free Pascal wiki, page "MSEide+MSEgui/fr", as it stood on 2024-02-28 after a change by Roland57, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history