📄 exe.pas
字号:
2: BlinkImage.Visible:=True;
end;
end
end;
end;
{松开鼠标}
procedure TExeForm.BmpImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if AllowMoveFlag then
begin
copyback;
with Bmpimage.canvas do
begin
drawrect(HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1,bmpimage.canvas);
drawlittlerect(HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1,bmpimage.canvas);
end;
{移动对象}
case HotObjectNum of
0:{is Avi}
begin
with AviPanel do
begin
Left:=HotArea.x0;
Top:=HotArea.y0;
Width:=HotArea.x1-HotArea.x0;
Height:=HotArea.y1-HotArea.y0;
AviLeftEdit.Text:=IntToStr(Left);
AviTopEdit.Text:=IntToStr(Top);
AviWidthEdit.Text:=IntToStr(Width);
AviHeightEdit.Text:=IntToStr(Height);
end;
end;
1:{is Txt}
begin
with TxtMemo do
begin
Left:=HotArea.x0;
Top:=HotArea.y0;
Width:=HotArea.x1-HotArea.x0;
Height:=HotArea.y1-HotArea.y0;
TxtLeftEdit.Text:=IntToStr(Left);
TxtTopEdit.Text:=IntToStr(Top);
TxtWidthEdit.Text:=IntToStr(Width);
TxtHeightEdit.Text:=IntToStr(Height);
end;
end;
2:{is Blink}
begin
with BlinkImage do
begin
Left:=HotArea.x0;
Top:=HotArea.y0;
Width:=HotArea.x1-HotArea.x0;
Height:=HotArea.y1-HotArea.y0;
BlinkLeftEdit.Text:=IntToStr(Left);
BlinkTopEdit.Text:=IntToStr(Top);
BlinkWidthEdit.Text:=IntToStr(Width);
BlinkHeightEdit.Text:=IntToStr(Height);
end;
end;
end;
AllowMoveFlag:=False;
end;
end;
{移动鼠标}
procedure TExeForm.BmpImageMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
detax,detay:integer;
begin
BmpImage.Update;
if AllowMoveFlag then
begin
{画虚线}
CopyBack;
drawdashrect(HotArea.x0,HotArea.x0,HotArea.x0,HotArea.x0,Bmpimage.canvas);
detax:=x-lastx; detay:=y-lasty;
case HotDragAreaNum of
0:{整个移动}
begin
HotArea.x0:=HotArea.x0+detax; HotArea.y0:=HotArea.y0+detay;
HotArea.x1:=HotArea.x1+detax; HotArea.y1:=HotArea.y1+detay;
end;
1:{左上角}
begin
HotArea.x0:=HotArea.x0+detax; HotArea.y0:=HotArea.y0+detay;
end;
2:{左下角}
begin
HotArea.x0:=HotArea.x0+detax; HotArea.y1:=HotArea.y1+detay;
end;
3:{右下角}
begin
HotArea.x1:=HotArea.x1+detax; HotArea.y1:=HotArea.y1+detay;
end;
4:{右上角}
begin
HotArea.x1:=HotArea.x1+detax; HotArea.y0:=HotArea.y0+detay;
end;
end;
{画虚线}
drawdashrect(HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1,Bmpimage.canvas);
XLabel.Caption:='X is :'+IntToStr(X);
YLabel.Caption:='Y is :'+IntToStr(Y);
end
else
begin
HotDragAreaNum:=Mousepointinwhichrect(x,y,HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1);
{ 设置鼠标光标}
case HotDragAreaNum of
0:{整个区域}
Bmpimage.cursor:=crHandPoint;
1,3:{左上和右下}
Bmpimage.cursor:=crSizeNWSE;
2,4: {左下和右上}
Bmpimage.cursor:=crSizeNESW;
-1:{其他区域}
Bmpimage.cursor:=crdefault;
end;
end;
lastx:=x;lasty:=y;{保存旧的坐标}
XLabel.Caption:=IntToStr(X);
YLabel.Caption:=IntToStr(Y);
end;
//单击文字对象
procedure TExeForm.TxtMemoClick(Sender: TObject);
begin
TxtMemo.Visible:=False;
end;
procedure TExeForm.AviPanelClick(Sender: TObject);
begin
AviPanel.Visible:=True;
case HotObjectNum of
0:AviPanel.Visible:=False;
1:TxtMemo.Visible:=False;
end;
end;
//后翻
procedure TExeForm.NextButtonClick(Sender: TObject);
begin
if CurrentShowArrayNum<=ShowArrayTotalNum-1 then
begin
ClearShowThing;
CurrentShowArrayNum:=CurrentShowArrayNum+1;
ShowCurrentNowLine(ExeForm.CurrentShowArrayNum);
end
else
begin
MessageBeep(0);
MessageDlg('已经翻到最后一个 !', mtWarning,[mbOk], 0);
CurrentShowArrayNum:=ShowArrayTotalNum-1;
end;
StepComboBox.ItemIndex:=CurrentShowArrayNum;
end;
//前翻
procedure TExeForm.LastButtonClick(Sender: TObject);
begin
if CurrentShowArrayNum>0 then
begin
CurrentShowArrayNum:=CurrentShowArrayNum-1;
ClearShowThing;
ShowCurrentNowLine(ExeForm.CurrentShowArrayNum);
end
else
begin
MessageBeep(0);
MessageDlg('已经翻到第一个 !', mtWarning,[mbOk], 0);
CurrentShowArrayNum:=0;
end;
StepComboBox.ItemIndex:=CurrentShowArrayNum;
{ StepComboBox.ItemIndex:=0;}
end;
//添加
procedure TExeForm.AddButtonClick(Sender: TObject);
begin
ClearShowThing;
AddRecordFlag:=True;
CurrentShowArrayNum:=CurrentShowArrayNum+1;
end;
//删除
procedure TExeForm.DeleteButtonClick(Sender: TObject);
begin
ClearShowThing;
WorkMemo.Lines.Delete(CurrentShowArrayNum);
end;
//保存
procedure TExeForm.SaveButtonClick(Sender: TObject);
var
AddStr:String[255];
begin
AddStr:='';
if AddRecordFlag then
begin
if BmpCheckBox.Checked then
AddStr:='0'+','+BmpTitleEdit.Text+','+BmpFileEdit.Text+','+SmallBmpFileEdit.Text+';';
if AviCheckBox.Checked then
AddStr:=AddStr+'1'+','+AviFileEdit.Text+','+AviLeftEdit.Text+','+
AviTopEdit.Text+','+AviWidthEdit.Text+','+AviHeightEdit.Text+';';
if TxtCheckBox.Checked then
AddStr:=AddStr+'2'+','+TxtFileEdit.Text+','+TxtLeftEdit.Text+','+
TxtTopEdit.Text+','+TxtWidthEdit.Text+','+TxtHeightEdit.Text+';';
if BlinkCheckBox.Checked then
AddStr:=AddStr+'3'+','+'Blink'+','+BlinkLeftEdit.Text+','+BlinkTopEdit.Text+
','+BlinkWidthEdit.Text+','+BlinkHeightEdit.Text+';';
if WavCheckBox.Checked then
AddStr:=AddStr+'4'+','+WavEdit.Text+';';
WorkMemo.Lines.Add(AddStr);
end
else if InsertFlag then
begin
if BmpCheckBox.Checked then
AddStr:='0'+','+BmpTitleEdit.Text+','+BmpFileEdit.Text+','+SmallBmpFileEdit.Text+';';
if AviCheckBox.Checked then
AddStr:=AddStr+'1'+','+AviFileEdit.Text+','+AviLeftEdit.Text+','+
AviTopEdit.Text+','+AviWidthEdit.Text+','+AviHeightEdit.Text+';';
if TxtCheckBox.Checked then
AddStr:=AddStr+'2'+','+TxtFileEdit.Text+','+TxtLeftEdit.Text+','+
TxtTopEdit.Text+','+TxtWidthEdit.Text+','+TxtHeightEdit.Text+';';
if BlinkCheckBox.Checked then
AddStr:=AddStr+'3'+','+'Blink'+','+BlinkLeftEdit.Text+','+BlinkTopEdit.Text+','
+BlinkWidthEdit.Text+','+BlinkHeightEdit.Text+';';
if WavCheckBox.Checked then
AddStr:=AddStr+'4'+','+WavEdit.Text+';';
WorkMemo.Lines.Insert(CurrentShowArrayNum,AddStr);
end
else
begin
if BmpCheckBox.Checked then
AddStr:='0'+','+BmpTitleEdit.Text+','+BmpFileEdit.Text+','+SmallBmpFileEdit.Text+';';
if AviCheckBox.Checked then
AddStr:=AddStr+'1'+','+AviFileEdit.Text+','+AviLeftEdit.Text+','+
AviTopEdit.Text+','+AviWidthEdit.Text+','+AviHeightEdit.Text+';';
if TxtCheckBox.Checked then
AddStr:=AddStr+'2'+','+TxtFileEdit.Text+','+TxtLeftEdit.Text+','+
TxtTopEdit.Text+','+TxtWidthEdit.Text+','+TxtHeightEdit.Text+';';
if BlinkCheckBox.Checked then
AddStr:=AddStr+'3'+','+'Blink'+','+BlinkLeftEdit.Text+','+BlinkTopEdit.Text+','
+BlinkWidthEdit.Text+','+BlinkHeightEdit.Text+';';
if WavCheckBox.Checked then
AddStr:=AddStr+'4'+','+WavEdit.Text+';';
WorkMemo.Lines[CurrentShowArrayNum]:=AddStr;
end;
ExeMemoSaveDataFromWorkMemo(ExeMemo,WorkMemo);
InitShowArray;
if ExeForm.WorkMemo.Lines.Count<>0 then
begin
TranslateStr;
end;
ShowArrayTotalNum:=ShowArrayTotalNum+1;
InitStepComboBoxData;
AddRecordFlag:=False;
InsertFlag:=False;
end;
//插入
procedure TExeForm.InSertButtonClick(Sender: TObject);
begin
InsertFlag:=True;
ClearShowThing;
end;
//选闪烁页
procedure TExeForm.BlinkMenuItemClick(Sender: TObject);
begin
TabbedNotebook1.ActivePage:='闪烁';
CopyBack;
HotArea.x0:=BlinkImage.Left;
HotArea.y0:=BlinkImage.Top;
HotArea.x1:=BlinkImage.Left+BlinkImage.Width;
HotArea.y1:=BlinkImage.Top+BlinkImage.Height;
DrawRect(HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1,BmpImage.canvas);
DrawLittleRect(HotArea.x0,HotArea.y0,HotArea.x1,HotArea.y1,BmpImage.canvas);
HotObjectNum:=2;
BlinkLeftEdit.Text:=IntToStr(BlinkImage.Left);
BlinkTopEdit.Text:=IntToStr(BlinkImage.Top);
BlinkWidthEdit.Text:=IntToStr(BlinkImage.Width);
BlinkHeightEdit.Text:=IntToStr(BlinkImage.Height);
BlinkImage.Visible:=True;
end;
//单击闪烁对象
procedure TExeForm.BlinkImageClick(Sender: TObject);
begin
BlinkImage.Visible:=False;
end;
//插入WAV
procedure TExeForm.WavEditClick(Sender: TObject);
var
StrLength1,StrLength2:Integer;
begin
OpenDialog1.InitialDir:=MainForm.MainDir+MainForm.WavDir;
OpenDialog1.DefaultExt:='*.wav';
OpenDialog1.Filter:='Wav files (*.wav)|*.wav';
if OpenDialog1.Execute then
begin
StrLength1:=Length(MainForm.MainDir+MainForm.WavDir);
StrLength2:=Length(OpenDialog1.FileName);
WavEdit.Text:=(Copy(OpenDialog1.FileName,StrLength1+1,StrLength2-StrLength1+1));
WavMediaPlayer.DeviceType:=dtWaveAudio;
WavMediaPlayer.FileName:=OpenDialog1.FileName;
WavmediaPlayer.Open;
WavmediaPlayer.ReWind;
WavmediaPlayer.Play;
end;
end;
//选WAV页
procedure TExeForm.WavMenuItemClick(Sender: TObject);
begin
TabbedNotebook1.ActivePage:='声音';
end;
//装入小图
procedure TExeForm.SmallBmpFileEditClick(Sender: TObject);
var
Strlength1,Strlength2:Integer;
begin
OpenDialog1.InitialDir:=MainForm.MainDir+MainForm.BmpDir;
OpenDialog1.DefaultExt:='*.Bmp';
OpenDialog1.Filter:='Bmp files (*.bmp)|*.bmp';
if OpenDialog1.Execute then
begin
StrLength1:=Length(MainForm.MainDir+MainForm.BmpDir);
StrLength2:=Length(OpenDialog1.FileName);
SmallBmpFileEdit.Text:=(Copy(OpenDialog1.FileName,StrLength1+1,StrLength2-StrLength1+1));
SmallBmpImage.Picture.LoadFromFile(OpenDialog1.FileName);
SmallBmpImage.Visible:=True;
end;
end;
//步选
procedure TExeForm.StepComboBoxChange(Sender: TObject);
begin
ClearShowThing;
CurrentShowArrayNum:=StepComboBox.ItemIndex;
ShowCurrentNowLine(CurrentShowArrayNum);
end;
//窗体关闭
procedure TExeForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if WavMediaPlayer.Mode=mpPlaying then
WavMediaPlayer.Close;
if AviMediaPlayer.Mode=mpPlaying then
AviMediaPlayer.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -