Difference between revisions of "TPopupNotifier"
m (→Demo program: typo) |
(code highlighting and category) |
||
Line 50: | Line 50: | ||
This code demonstrates the right way to show a multiline message (in this case from a TSTringList). | This code demonstrates the right way to show a multiline message (in this case from a TSTringList). | ||
− | + | <delphi>var | |
− | + | I : Integer; | |
− | + | Lines : TStringListç | |
− | + | ... | |
− | + | for I := 0 to Lines.Count - 1 do | |
− | + | PopupNotifier1.Text := PopupNotifier1.Text + LineEnding + Lines[I];</delphi> | |
===Demo program=== | ===Demo program=== | ||
There is a small demo program in the components/popupnotifier/demo directory, though simple it shows off nearly all the standard features. | There is a small demo program in the components/popupnotifier/demo directory, though simple it shows off nearly all the standard features. | ||
+ | |||
+ | [[Category:Components]] |
Revision as of 07:20, 4 October 2010
│
English (en) │
français (fr) │
中文(中国大陆) (zh_CN) │
About
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.
Authors
License
Modifyed LGPL just like Lazarus Component Library.
Download
Can be found on your lazarus installation at lazarus/component/popupnotifier directory. It is available on Lazarus 0.9.17 or superior.
System Requirements
Currently works on the following widgetsets: win32, gtk, gtk2
Depends only on the Lazarus Component Library.
Usage
- Drop a TPopupNotifier component on form. Set the icon image, header text and message text and optionally the colour.
- Call TPopupNotifier.Show to show the message, or TPopupNotifer.Hide to hide it.
A note on the implementation
TPopupNotifier uses a wrapper component so that the TForm is not embedded into your application form. The actual data types behind it are:
- Icon: TPicture, mapped to a TImage
- Header: TLabel ( sets +FsBold automatically)
- Message: TLabel sized to show multiline messages
The close button is a custom canvas drawn component (there were good reasons we did this).
More advanced features
- Appart 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 generates an OnClose event when the form is closed, whether by you or the user, this is usefull 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).
<delphi>var
I : Integer; Lines : TStringListç
... for I := 0 to Lines.Count - 1 do
PopupNotifier1.Text := PopupNotifier1.Text + LineEnding + Lines[I];</delphi>
Demo program
There is a small demo program in the components/popupnotifier/demo directory, though simple it shows off nearly all the standard features.