Difference between revisions of "Win32TaskbarProgress/zh CN"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "{{Platform only|Windows}} =About= This is unit which contains the class to control the progressbar over the Windows 7+ taskbar button. The demo looks like this: Image:Win3...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Platform only|Windows}}
 
{{Platform only|Windows}}
=About=
+
=关于=
  
This is unit which contains the class to control the progressbar over the Windows 7+ taskbar button. The demo looks like this:
+
这是一个包含 控制进度条 的类的单元,用于控制 Windows 7+ 任务栏按钮的按钮。示例看起来像这样:
  
 
[[Image:Win32TaskbarProgressDemo.png]]
 
[[Image:Win32TaskbarProgressDemo.png]]
  
Taskbar button progress can have several styles:
+
任务栏按钮进度可以有以下几种样式:
  
* none (inactive)
+
* (非激活)
* green progress
+
* 绿色进度
* yellow progress (looks like paused state)
+
* 黄色进度 (看起来像暂停状态)
* red progress (looks like error state)
+
* 红色进度 (看起来像错误状态)
* marquee floating animation (progress value is ignored, it's constantly changing animation from min to max)
+
* 字幕浮动动画 (忽略进度值,它不断地从最大到最小的更改动画)
  
  
Author: Alexey Torgashin
+
作者: Alexey Torgashin
  
License: MIT
+
协议: MIT
  
=Usage=
+
=用法=
  
In the form's OnShow (or maybe OnCreate) create the object like this:
+
在窗体的 OnShow (或者 OnCreate) 中创建对象,像这样:
  
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
Line 33: Line 33:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
And then call properties of this object like this:
+
接下来,调用这个对象的属性,像这样:
  
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
   //to change state: none, green, yellow, red, floating
+
   //来更改状态: none, green, yellow, red, floating
 
   GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex);
 
   GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex);
 
   
 
   
   //to change progress value 0 to 100
+
   //来更改进度值:0 到 100
 
   GlobalTaskbarProgress.Progress:= Edit1.Value;
 
   GlobalTaskbarProgress.Progress:= Edit1.Value;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Author tried to init the object in the "initialization" part of win32taskbarprogress, but failed, maybe because Application.Handle is not inited so early.
+
作者尝试在 win32taskbarprogress 的 "initialization" 部分初始化对象,但是失败了,可能是因为 Application.Handle 不能这么早地被初始化
  
=Download=
+
=下载=
  
Unit file and demo project: https://github.com/Alexey-T/Win32TaskbarProgress
+
单元文件和示例工程: https://github.com/Alexey-T/Win32TaskbarProgress
 +
 
 +
= 贡献者和更改 =
 +
* 简体中文版本由 robsean 于 2020-12-29 创建。

Latest revision as of 08:22, 29 December 2020

Windows logo - 2012.svg

This article applies to Windows only.

See also: Multiplatform Programming Guide

关于

这是一个包含 控制进度条 的类的单元,用于控制 Windows 7+ 任务栏按钮的按钮。示例看起来像这样:

Win32TaskbarProgressDemo.png

任务栏按钮进度可以有以下几种样式:

  • 空 (非激活)
  • 绿色进度
  • 黄色进度 (看起来像暂停状态)
  • 红色进度 (看起来像错误状态)
  • 字幕浮动动画 (忽略进度值,它不断地从最大到最小的更改动画)


作者: Alexey Torgashin

协议: MIT

用法

在窗体的 OnShow (或者 OnCreate) 中创建对象,像这样:

uses
  win32taskbarprogress;

procedure TForm1.FormShow(Sender: TObject);
begin
  GlobalTaskbarProgress:= TWin7TaskProgressBar.Create;
end;

接下来,调用这个对象的属性,像这样:

  //来更改状态: none, green, yellow, red, floating
  GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex);
 
  //来更改进度值:0 到 100
  GlobalTaskbarProgress.Progress:= Edit1.Value;

作者尝试在 win32taskbarprogress 的 "initialization" 部分初始化对象,但是失败了,可能是因为 Application.Handle 不能这么早地被初始化

下载

单元文件和示例工程: https://github.com/Alexey-T/Win32TaskbarProgress

贡献者和更改

  • 简体中文版本由 robsean 于 2020-12-29 创建。