TPopupNotifier/zh CN: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TPopupNotifier/zh CN
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **TPopupNotifier**  是一个独立于系统的“气球帮助”,可以在屏幕的任何位置弹出来. 改组件基于 TForm,内置了 图标、标题、消息、自定义颜色。 | |
| 2 | + | ||
| 3 | + | TPopupNotifier 在 [[Common Controls tab]] 的 [[Component Palette]]. | |
| 4 | + | ||
| 5 | + | # 作者大佬 | |
| 6 | + | ||
| 7 | + | - A.J. Venter | |
| 8 | + | - Felipe Monteiro de Carvalho | |
| 9 | + | ||
| 10 | + | # 授权 | |
| 11 | + | ||
| 12 | + | 修改的 LGPL ,和Lazarus的组件库一样 | |
| 13 | + | ||
| 14 | + | # 下载 | |
| 15 | + | ||
| 16 | + | 可以直接在Lazarus的0.9.17以上版本的控件中使用,直接在控件中搜索即可 | |
| 17 | + | ||
| 18 | + | # 系统需求 | |
| 19 | + | ||
| 20 | + | 支持的系统: win32, gtk (obsolete), gtk2 and Qt | |
| 21 | + | ||
| 22 | + | 仅取决于LCL控件库 [[LCL|Lazarus Component Library]]. | |
| 23 | + | ||
| 24 | + | # 用法 | |
| 25 | + | ||
| 26 | + | 1. 添加 **TPopupNotifier** 到窗体. 设置 icon Color Text Title 等属性。 | |
| 27 | + | 2. 调用 **TPopupNotifier.Show** 显示信息, 或者 **TPopupNotifer.Hide** 隐藏信息。 | |
| 28 | + | ||
| 29 | + | ## 实施说明 | |
| 30 | + | ||
| 31 | + | TPopupNotifier 使用了 wrapper 控件, 因此TForm不在程序的Form中. 实际的数据类型是: | |
| 32 | + | ||
| 33 | + | 1. Icon: **[[TPicture]]**, mapped to a **[[TImage]]** | |
| 34 | + | 2. Header: [[TLabel]] ( sets +FsBold automatically) | |
| 35 | + | 3. Message: TLabel sized to show multiline messages | |
| 36 | + | ||
| 37 | + | 关闭按钮是自绘的控件 (这里大佬自有大佬的原因,不用去深究). | |
| 38 | + | ||
| 39 | + | ## 高级功能 | |
| 40 | + | ||
| 41 | + | 1. 除了这些基础使用方法, 你还可以使用上述类型中的任何方法来处理消息. 例如:可以这样调用 **TPopupNotifier.Icon.LoadFromFile**; | |
| 42 | + | 2. TPopupNotifier 包含 **visible** 属性, 可以用来检测窗体时候显示, 设置此属性可以显示/隐藏本窗体. | |
| 43 | + | 3. TPopupNotifier 生成 **[[OnClose]]** 时间, 当窗体关闭时, 无论程序还是用户关闭, 如果关闭后需要执行什么任务就放在这里. 点击窗口任何位置都可以激活关闭事件。 | |
| 44 | + | ||
| 45 | + | ## 显示多行信息 | |
| 46 | + | ||
| 47 | + | 此处演示如何显示多行信息 (使用 [[TStringList]]). | |
| 48 | + | ||
| 49 | + | ``` pascal | |
| 50 | + | var | |
| 51 | + | I : Integer; | |
| 52 | + | Lines : TStringList; | |
| 53 | + | ... | |
| 54 | + | for I := 0 to Lines.Count - 1 do | |
| 55 | + | PopupNotifier1.Text := PopupNotifier1.Text + LineEnding + Lines[I]; | |
| 56 | + | ``` | |
| 57 | + | ||
| 58 | + | # 演示程序 | |
| 59 | + | ||
| 60 | + | 演示程序位置 examples/popupnotifier/demo, 虽然简单,但是展示了控件的所有功能。 | |
| 61 | + | ||
| 62 | + | # 参考资料 | |
| 63 | + | ||
| 64 | + | - [[doc:lcl/popupnotifier/tpopupnotifier.html|TPopupNotifier doc]] | |
| 65 | + | ||
| 66 | + | --- | |
| 67 | + | *From the Free Pascal wiki, page "TPopupNotifier/zh CN", as it stood on 2020-04-27 after a change by TyphonFinger, 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).* |
