FreeLaunch
82 строки · 2.8 Кб
1{
2##########################################################################
3# FreeLaunch is a free links manager for Microsoft Windows #
4# #
5# Copyright (C) 2023 Alexey Tatuyko <feedback@ta2i4.ru> #
6# Copyright (C) 2019 Mykola Petrivskiy #
7# Copyright (C) 2010 Joker-jar <joker-jar@yandex.ru> #
8# #
9# This file is part of FreeLaunch. #
10# #
11# FreeLaunch is free software: you can redistribute it and/or modify #
12# it under the terms of the GNU General Public License as published by #
13# the Free Software Foundation, either version 3 of the License, or #
14# (at your option) any later version. #
15# #
16# FreeLaunch is distributed in the hope that it will be useful, #
17# but WITHOUT ANY WARRANTY; without even the implied warranty of #
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
19# GNU General Public License for more details. #
20# #
21# You should have received a copy of the GNU General Public License #
22# along with FreeLaunch. If not, see <http://www.gnu.org/licenses/>. #
23##########################################################################
24}
25
26unit RenameTabFormModule;
27
28interface
29
30uses
31Winapi.Windows, Winapi.Messages,
32System.SysUtils, System.Variants, System.Classes,
33Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
34FLLanguage;
35
36type
37TRenameTabForm = class(TForm)
38GroupBox1: TGroupBox;
39TabNameEdit: TEdit;
40Label1: TLabel;
41OKButton: TButton;
42CancelButton: TButton;
43procedure FormShow(Sender: TObject);
44private
45
46public
47class function Execute(ACaption: string): string;
48end;
49
50implementation
51
52uses
53FLaunchMainFormModule;
54
55{$R *.dfm}
56
57class function TRenameTabForm.Execute(ACaption: string): string;
58begin
59with TRenameTabForm.Create(Application.MainForm) do
60try
61Result := ACaption;
62TabNameEdit.Text := ACaption;
63if ShowModal = mrOk then
64Result := TabNameEdit.Text;
65finally
66Free;
67end;
68end;
69
70procedure TRenameTabForm.FormShow(Sender: TObject);
71begin
72if AlwaysOnTop then FormStyle := fsStayOnTop;
73//--Loading language
74OKButton.Caption := Language.BtnOk;
75CancelButton.Caption := Language.BtnCancel;
76Caption := Language.TabRename;
77Label1.Caption := Caption + ':';
78TabNameEdit.SelectAll;
79TabNameEdit.SetFocus;
80end;
81
82end.
83