TPopupNotifier: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TPopupNotifier
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **TPopupNotifier**  is a platform independent 'balloon help' component for showing pop-up messages anywhere on the screen. The component is based on TForm and has built in support for icon's, header text, message text and custom colorisation. TPopupNotifier is available fron the [[Common Controls tab]] of the [[Component Palette]]. | |
| 2 | + | ||
| 3 | + | # Authors | |
| 4 | + | ||
| 5 | + | - A.J. Venter | |
| 6 | + | - Felipe Monteiro de Carvalho | |
| 7 | + | ||
| 8 | + | # License | |
| 9 | + | ||
| 10 | + | Modifyed LGPL just like Lazarus Component Library. | |
| 11 | + | ||
| 12 | + | # Download | |
| 13 | + | ||
| 14 | + | Can be found on your lazarus installation at lazarus/component/popupnotifier directory. It is available on Lazarus 0.9.17 or superior. It is available on the [[Common Controls tab]] on the component palette. | |
| 15 | + | ||
| 16 | + | # System Requirements | |
| 17 | + | ||
| 18 | + | Currently works on the following widgetsets: win32, gtk (obsolete), gtk2 and Qt | |
| 19 | + | ||
| 20 | + | Depends only on the [[LCL|Lazarus Component Library]]. | |
| 21 | + | ||
| 22 | + | # Usage | |
| 23 | + | ||
| 24 | + | 1. Drop a **TPopupNotifier** component on form. Set the icon image, header text and message text and optionally the colour. | |
| 25 | + | 2. Call **TPopupNotifier.Show** to show the message, or **TPopupNotifer.Hide** to hide it. | |
| 26 | + | ||
| 27 | + | ## A note on the implementation | |
| 28 | + | ||
| 29 | + | TPopupNotifier uses a wrapper component so that the TForm is not embedded into your application form. The actual data types behind it are: | |
| 30 | + | ||
| 31 | + | 1. Icon: **[[TPicture]]**, mapped to a **[[TImage]]** | |
| 32 | + | 2. Header: [[TLabel]] ( sets +FsBold automatically) | |
| 33 | + | 3. Message: TLabel sized to show multiline messages | |
| 34 | + | ||
| 35 | + | The close button is a custom canvas drawn component (there were good reasons we did this). | |
| 36 | + | ||
| 37 | + | ## More advanced features | |
| 38 | + | ||
| 39 | + | 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**; | |
| 40 | + | 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. | |
| 41 | + | 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. | |
| 42 | + | ||
| 43 | + | ## Showing multiline messages | |
| 44 | + | ||
| 45 | + | This code demonstrates the right way to show a multiline message (in this case from a [[TStringList]]). | |
| 46 | + | ||
| 47 | + | ``` pascal | |
| 48 | + | var | |
| 49 | + | I : Integer; | |
| 50 | + | Lines : TStringList; | |
| 51 | + | ... | |
| 52 | + | for I := 0 to Lines.Count - 1 do | |
| 53 | + | PopupNotifier1.Text := PopupNotifier1.Text + LineEnding + Lines[I]; | |
| 54 | + | ``` | |
| 55 | + | ||
| 56 | + | # Demo program | |
| 57 | + | ||
| 58 | + | There is a small demo program in the examples/popupnotifier directory, though simple it shows off nearly all the standard features. | |
| 59 | + | ||
| 60 | + | # See also | |
| 61 | + | ||
| 62 | + | - [[doc:lcl/popupnotifier/tpopupnotifier.html|TPopupNotifier doc]] | |
| 63 | + | ||
| 64 | + | --- | |
| 65 | + | *From the Free Pascal wiki, page "TPopupNotifier", as it stood on 2024-03-11 after a change by Kfilippenok, 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).* |
