Difference between revisions of "TPopupNotifier"

From Lazarus wiki
Jump to navigationJump to search
m
Line 1: Line 1:
>> [[LCL Components]] >> TPopupNotifier<br/>
+
This page explains how to use the '''TPopupNotifier''' component.  
 
 
This page explains how to use the TPopupNotifier component. When I mention to click on something, unless I explicitly say to right-click, you always left-click on the item in question.
 
  
 
===About===
 
===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.
 
'''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===
 
===Authors===
 
 
*[[User:Silentcoder|A.J. Venter]]
 
*[[User:Silentcoder|A.J. Venter]]
 
*[[User:Sekelsenmat|Felipe Monteiro de Carvalho]]
 
*[[User:Sekelsenmat|Felipe Monteiro de Carvalho]]
  
 
===License===
 
===License===
 
 
Modifyed LGPL just like Lazarus Component Library.
 
Modifyed LGPL just like Lazarus Component Library.
  
 
===Download===
 
===Download===
 
+
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.
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.
 
  
 
===System Requirements===
 
===System Requirements===
 
 
Currently works on the following widgetsets: win32, gtk (obsolete), gtk2 and Qt
 
Currently works on the following widgetsets: win32, gtk (obsolete), gtk2 and Qt
  
Depends only on the Lazarus Component Library.
+
Depends only on the [[LCL|Lazarus Component Library]].
  
 
===Usage===
 
===Usage===
 
 
# Drop a '''TPopupNotifier''' component on form. Set the icon image, header text and message text and optionally the colour.
 
# 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.
 
# Call '''TPopupNotifier.Show''' to show the message, or '''TPopupNotifer.Hide''' to hide it.
Line 33: Line 25:
  
 
====A note on the implementation====
 
====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:
 
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]]'''
 
# Icon: '''[[TPicture]]''', mapped to a '''[[TImage]]'''
 
# Header: [[TLabel]] ( sets +FsBold automatically)
 
# Header: [[TLabel]] ( sets +FsBold automatically)
Line 43: Line 33:
  
 
====More advanced features====
 
====More advanced features====
 
 
#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.
Line 59: Line 48:
  
 
===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.
  
 
{{LCL Components Footer |TImageList|}}
 
 
{{LCL Components}}
 
{{LCL Components}}
 
  
 
[[Category:Components]]
 
[[Category:Components]]

Revision as of 18:29, 16 July 2016

This page explains how to use the TPopupNotifier component.

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. It is available on the Common Controls tab on the component palette.

System Requirements

Currently works on the following widgetsets: win32, gtk (obsolete), gtk2 and Qt

Depends only on the Lazarus Component Library.

Usage

  1. Drop a TPopupNotifier component on form. Set the icon image, header text and message text and optionally the colour.
  2. 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:

  1. Icon: TPicture, mapped to a TImage
  2. Header: TLabel ( sets +FsBold automatically)
  3. 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

  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];

Demo program

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


LCL Components
Component Tab Components
Standard TMainMenu • TPopupMenu • TButton • TLabel • TEdit • TMemo • TToggleBox • TCheckBox • TRadioButton • TListBox • TComboBox • TScrollBar • TGroupBox • TRadioGroup • TCheckGroup • TPanel • TFrame • TActionList
Additional TBitBtn • TSpeedButton • TStaticText • TImage • TShape • TBevel • TPaintBox • TNotebook • TLabeledEdit • TSplitter • TTrayIcon • TControlBar • TFlowPanel • TMaskEdit • TCheckListBox • TScrollBox • TApplicationProperties • TStringGrid • TDrawGrid • TPairSplitter • TColorBox • TColorListBox • TValueListEditor
Common Controls TTrackBar • TProgressBar • TTreeView • TListView • TStatusBar • TToolBar • TCoolBar • TUpDown • TPageControl • TTabControl • THeaderControl • TImageList • TPopupNotifier • TDateTimePicker
Dialogs TOpenDialog • TSaveDialog • TSelectDirectoryDialog • TColorDialog • TFontDialog • TFindDialog • TReplaceDialog • TTaskDialog • TOpenPictureDialog • TSavePictureDialog • TCalendarDialog • TCalculatorDialog • TPrinterSetupDialog • TPrintDialog • TPageSetupDialog
Data Controls TDBNavigator • TDBText • TDBEdit • TDBMemo • TDBImage • TDBListBox • TDBLookupListBox • TDBComboBox • TDBLookupComboBox • TDBCheckBox • TDBRadioGroup • TDBCalendar • TDBGroupBox • TDBGrid • TDBDateTimePicker
Data Access TDataSource • TCSVDataSet • TSdfDataSet • TBufDataset • TFixedFormatDataSet • TDbf • TMemDataset
System TTimer • TIdleTimer • TLazComponentQueue • THTMLHelpDatabase • THTMLBrowserHelpViewer • TAsyncProcess • TProcessUTF8 • TProcess • TSimpleIPCClient • TSimpleIPCServer • TXMLConfig • TEventLog • TServiceManager • TCHMHelpDatabase • TLHelpConnector
Misc TColorButton • TSpinEdit • TFloatSpinEdit • TArrow • TCalendar • TEditButton • TFileNameEdit • TDirectoryEdit • TDateEdit • TTimeEdit • TCalcEdit • TFileListBox • TFilterComboBox • TComboBoxEx • TCheckComboBox • TButtonPanel • TShellTreeView • TShellListView • TXMLPropStorage • TINIPropStorage • TJSONPropStorage • TIDEDialogLayoutStorage • TMRUManager • TStrHolder
LazControls TCheckBoxThemed • TDividerBevel • TExtendedNotebook • TListFilterEdit • TListViewFilterEdit • TLvlGraphControl • TShortPathEdit • TSpinEditEx • TFloatSpinEditEx • TTreeFilterEdit • TExtendedTabControl •
RTTI TTIEdit • TTIComboBox • TTIButton • TTICheckBox • TTILabel • TTIGroupBox • TTIRadioGroup • TTICheckGroup • TTICheckListBox • TTIListBox • TTIMemo • TTICalendar • TTIImage • TTIFloatSpinEdit • TTISpinEdit • TTITrackBar • TTIProgressBar • TTIMaskEdit • TTIColorButton • TMultiPropertyLink • TTIPropertyGrid • TTIGrid
SQLdb TSQLQuery • TSQLTransaction • TSQLScript • TSQLConnector • TMSSQLConnection • TSybaseConnection • TPQConnection • TPQTEventMonitor • TOracleConnection • TODBCConnection • TMySQL40Connection • TMySQL41Connection • TMySQL50Connection • TMySQL51Connection • TMySQL55Connection • TMySQL56Connection • TMySQL57Connection • TSQLite3Connection • TIBConnection • TFBAdmin • TFBEventMonitor • TSQLDBLibraryLoader
Pascal Script TPSScript • TPSScriptDebugger • TPSDllPlugin • TPSImport_Classes • TPSImport_DateUtils • TPSImport_ComObj • TPSImport_DB • TPSImport_Forms • TPSImport_Controls • TPSImport_StdCtrls • TPSCustomPlugin
SynEdit TSynEdit • TSynCompletion • TSynAutoComplete • TSynMacroRecorder • TSynExporterHTML • TSynPluginSyncroEdit • TSynPasSyn • TSynFreePascalSyn • TSynCppSyn • TSynJavaSyn • TSynPerlSyn • TSynHTMLSyn • TSynXMLSyn • TSynLFMSyn • TSynDiffSyn • TSynUNIXShellScriptSyn • TSynCssSyn • TSynPHPSyn • TSynTeXSyn • TSynSQLSyn • TSynPythonSyn • TSynVBSyn • TSynAnySyn • TSynMultiSyn • TSynBatSyn • TSynIniSyn • TSynPoSyn
Chart TChart • TListChartSource • TRandomChartSource • TUserDefinedChartSource • TCalculatedChartSource • TDbChartSource • TChartToolset • TChartAxisTransformations • TChartStyles • TChartLegendPanel • TChartNavScrollBar • TChartNavPanel • TIntervalChartSource • TDateTimeIntervalChartSource • TChartListBox • TChartExtentLink • TChartImageList
IPro TIpFileDataProvider • TIpHtmlDataProvider • TIpHttpDataProvider • TIpHtmlPanel
Virtual Controls TVirtualDrawTree • TVirtualStringTree • TVTHeaderPopupMenu