Difference between revisions of "TPopupNotifier/fr"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "{{TPopupNotifier}} '''TPopupNotifier''' image:tpopupnotifier.png est composant indépendant de la plate-forme 'Ballon d'aide' pour l'affichage de messages pop-up partout...")
 
Line 21: Line 21:
  
 
= Usage =
 
= Usage =
# Drop a '''TPopupNotifier''' component on form. Set the icon image, header text and message text and optionally the colour.
+
# Déposez un composant '''TPopupNotifier''' sur la fiche. Définissez l'image de l'icône, le texte d'entête et le texte de message et facultativement la couleur.
# Call '''TPopupNotifier.Show''' to show the message, or '''TPopupNotifer.Hide''' to hide it.
+
# Appelez '''TPopupNotifier.Show''' pour montrer le message, ou '''TPopupNotifer.Hide''' pour le masquer.
  
==A note on the implementation==
+
== Une note sur l'implémentation ==
TPopupNotifier uses a wrapper component so that the TForm is not embedded into your application form. The actual data types behind it are:
+
TPopupNotifier utilise un composant enveloppe (''wrapper component'') de telle façon que le TForm ne soit pas incorporé dans votre fiche d'application. Les types de donnée actuels cela sont :
# Icon: '''[[TPicture]]''', mapped to a '''[[TImage]]'''
+
# Icon : '''[[TPicture/fr|TPicture]]''', mappé vers un '''[[TImage/fr|TImage]]'''.
# Header: [[TLabel]] ( sets +FsBold automatically)
+
# Header : [[TLabel/fr|TLabel]] (définit +FsBold automatiquement)
# Message: TLabel sized to show multiline messages
+
# Message : TLabel dimensionné pour montrer plusieurs lignes.
  
The close button is a custom canvas drawn component (there were good reasons we did this).
+
Le bouton Fermer est un composant à dessin personnalisé sur le canvas (il y a de bonnes raisons à faire comme cela).
  
==More advanced features==
+
== Plus de fonctionnalités avancées ==
 +
* * * A FINIR * * *
 
#Apart from these basics, you can use any of the methods from the above datatypes to manipulate messages. For example you can call '''TPopupNotifier.Icon.LoadFromFile''';
 
#Apart from these basics, you can use any of the methods from the above datatypes to manipulate messages. For example you can call '''TPopupNotifier.Icon.LoadFromFile''';
 
#TPopupNotifier has a '''visible''' property, which can be used to check if the form is currently shown or not, setting it's value will also hide/show the form as appropriate.
 
#TPopupNotifier has a '''visible''' property, which can be used to check if the form is currently shown or not, setting it's value will also hide/show the form as appropriate.

Revision as of 07:01, 28 September 2017

English (en) français (fr) 中文(中国大陆)‎ (zh_CN)

TPopupNotifier tpopupnotifier.png est composant indépendant de la plate-forme 'Ballon d'aide' pour l'affichage de messages pop-up partout sur l'écran. Le composant est construit à partir d'un TForm, pour prendre en charge une icône, un texte d'entête, un texte de message et la colorisation personnalisée. Le composant TPopupNotifier est disponible depuis l'onglet Common Controls de la palette de composants.

Auteurs

Licence

LGPL modifiée comme pour la Lazarus Component Library.

Téléchargement

Peut être trouvé dans votre installation Lazarus dans le répertoire lazarus/component/popupnotifier et disponible depuis Lazarus 0.9.17.

Can be found on your lazarus installation at lazarus/component/popupnotifier directory. It is available on Lazarus 0.9.17 or superior.

Prérequis du système

Fonctionne actuellement dans les environnements graphiques : win32, gtk (obsolète), gtk2 et Qt.

Ne dépend que la Lazarus Component Library (LCL).

Usage

  1. Déposez un composant TPopupNotifier sur la fiche. Définissez l'image de l'icône, le texte d'entête et le texte de message et facultativement la couleur.
  2. Appelez TPopupNotifier.Show pour montrer le message, ou TPopupNotifer.Hide pour le masquer.

Une note sur l'implémentation

TPopupNotifier utilise un composant enveloppe (wrapper component) de telle façon que le TForm ne soit pas incorporé dans votre fiche d'application. Les types de donnée actuels cela sont :

  1. Icon : TPicture, mappé vers un TImage.
  2. Header : TLabel (définit +FsBold automatiquement)
  3. Message : TLabel dimensionné pour montrer plusieurs lignes.

Le bouton Fermer est un composant à dessin personnalisé sur le canvas (il y a de bonnes raisons à faire comme cela).

Plus de fonctionnalités avancées

* * * A FINIR * * *
  1. Apart from these basics, you can use any of the methods from the above datatypes to manipulate messages. For example you can call TPopupNotifier.Icon.LoadFromFile;
  2. TPopupNotifier has a visible property, which can be used to check if the form is currently shown or not, setting it's value will also hide/show the form as appropriate.
  3. TPopupNotifier generates an OnClose event when the form is closed, whether by you or the user, this is useful if you wish something to happen as soon as the form is closed. Clicking anywhere on the form has the same close effect as clicking the close-button itself.

Showing multiline messages

This code demonstrates the right way to show a multiline message (in this case from a TStringList).

var 
  I : Integer;
  Lines : TStringListç
...
for I := 0 to Lines.Count - 1 do
  PopupNotifier1.Text := PopupNotifier1.Text + LineEnding + Lines[I];

Programme de démo

There is a small demo program in the components/popupnotifier/demo directory, though simple it shows off nearly all the standard features.

Voir aussi