unit_state2.pas
来自「至于这小软件的用途」· PAS 代码 · 共 133 行
PAS
133 行
unit Unit_State;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, Spin, XPMan,Unit_Common;
type
TFrm_State = class(TForm)
RadioGroup1: TRadioGroup;
lbl1: TLabel;
Edit1: TEdit;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
Label3: TLabel;
CheckBox1: TCheckBox;
Button2: TButton;
Button3: TButton;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
TrackBar1: TTrackBar;
SpinEdit1: TSpinEdit;
XPManifest1: TXPManifest;
procedure Button2Click(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure ComboBox2Select(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_State: TFrm_State;
VarSpinEdit1:Integer;
implementation
uses Unit_Main;
{$R *.dfm}
procedure TFrm_State.Button2Click(Sender: TObject);
begin
//图片来源(0金管家,1本地)
ImgWhere:=RadioGroup1.ItemIndex;
//最大图片长度(1-1600)
if SpinEdit1.Value>1600 then ImgLarge:=1600
else if SpinEdit1.Value<1 then ImgLarge:=1
else ImgLarge:=SpinEdit1.Value;
//主窗体透明度0-255
Alphafrm:=TrackBar1.Position*255 div 20;
//播放方式(0顺序,1随机)
case ComboBox1.Items.IndexOf(ComboBox1.Text) of
0:ImgViewType:=0;
1:ImgViewType:=1;
end;
//图片切换时间(0,1,5,30,60)
case ComboBox2.Items.IndexOf(ComboBox2.Text) of
0:ImgChangeTime:=1;
1:ImgChangeTime:=5;
2:ImgChangeTime:=10;
3:ImgChangeTime:=30;
4:ImgChangeTime:=60;
5:ImgChangeTime:=0;
end;
//窗口位置(0镶入,1正常,2浮动)
case ComboBox3.Items.IndexOf(ComboBox3.Text) of
0:ImgFrmlayer:=0;
1:ImgFrmlayer:=1;
2:ImgFrmlayer:=2;
end;
//本地文件夹,默认为我的文档/图像
ImgLocalFolder:=Edit1.Text;
Frm_Main.ChangeState;
Frm_State.Hide;
end;
procedure TFrm_State.TrackBar1Change(Sender: TObject);
begin
Label4.Caption:='窗体透明度(0-100):'+inttostr(TrackBar1.Position*5);
end;
procedure TFrm_State.ComboBox2Select(Sender: TObject);
begin
//ComboBox2.Text:=ComboBox2.Items.Names[1];
end;
procedure TFrm_State.FormShow(Sender: TObject);
begin
//图片来源(0金管家,1本地)
RadioGroup1.ItemIndex:=ImgWhere;
//主窗体透明度0-255
TrackBar1.Position:=Alphafrm*20 div 255;
//最大图片长度(1-1600)
SpinEdit1.Value:=ImgLarge;
//本地文件夹,默认为我的文档/图像
Edit1.Text:=ImgLocalFolder;
//播放方式(0顺序,1随机)
ComboBox1.ItemIndex:=ImgViewType;
//图片切换时间(0,1,5,30,60)
case ImgChangeTime of
1:ComboBox2.ItemIndex:=0;
5:ComboBox2.ItemIndex:=1;
10:ComboBox2.ItemIndex:=2;
30:ComboBox2.ItemIndex:=3;
60:ComboBox2.ItemIndex:=4;
0:ComboBox2.ItemIndex:=5;
end;
//窗口位置(0镶入,1正常,2浮动)
ComboBox3.ItemIndex:=ImgFrmlayer;
//鼠标穿透 true false
if ImgMouseIn then
CheckBox1.State:=cbChecked
else
CheckBox1.State:=cbUnchecked;
end;
procedure TFrm_State.Button3Click(Sender: TObject);
begin
Frm_State.Hide;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?