-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuAvaliacao.pas
76 lines (66 loc) · 1.78 KB
/
uAvaliacao.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
unit uAvaliacao;
interface
uses
Windows, Messages, SysUtils, StdCtrls, Controls, Classes,
Graphics, Forms, Dialogs, ExtCtrls, uIconClassic;
type
TfrmAvaliacao = class(TForm)
btnSend: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
memRateDescrip: TMemo;
rgRate: TRadioGroup;
Bevel1: TBevel;
procedure rgRateChange(Sender: TObject);
procedure btnSendClick(Sender: TObject);
end;
var
frmAvaliacao: TfrmAvaliacao;
implementation
uses
ShellAPI;
{$R *.dfm}
procedure TfrmAvaliacao.rgRateChange(
Sender: TObject);
begin
if rgRate.ItemIndex <> -1 then
btnSend.Enabled := True;
end;
procedure TfrmAvaliacao.btnSendClick(Sender: TObject);
var
ABody, ASubj: string;
procedure AdjustMessageBody(ASearchStr, AReplaceStr: string);
var
APos: integer;
begin
APos := Pos(ASearchStr,ABody);
while APos <> 0 do
begin
Delete(ABody,APos, Length(ASearchStr));
Insert(AReplaceStr,ABody, APos);
APos := Pos(ASearchStr,ABody);
end;
end;
begin
Screen.Cursor := crHourGlass;
try
ASubj := ChangeFileExt(ExtractFileName(Application.ExeName),'')+' - 2006 (BETA)';
ABody := 'Pontuação: ' + IntToStr(rgRate.ItemIndex + 1);
if memRateDescrip.Text <> '' then
ABody := ABody + #13#10#13#10 +'Descrição:'#13#10 + memRateDescrip.Text;
AdjustMessageBody('%', '$prc$');
AdjustMessageBody('$prc$', '%25');
AdjustMessageBody(#13#10, '%0D%0A');
AdjustMessageBody('&', '%26');
AdjustMessageBody(' ', '%20');
ShellExecute(Handle, PChar('OPEN'), PChar('mailto:' + frmIconClassic.MccsAboutDinamic.Email + '?subject=' +
ASubj + '&body=' + ABody) , nil, nil, SW_SHOWMAXIMIZED);
finally
Screen.Cursor := crDefault;
Close;
end;
end;
end.