unit MyMessages;
interface
uses
Forms,
QStdCtrls,QExtCtrls, Graphics,
SysUtils, test;
type
TMyMessage =
Class
procedure CreateForm(Left,Top, Width, Height,Symbol : Integer;
Caption, Text :
String);
procedure ShowMMessage(Caption :
String; MMessage :
String);
overload;
procedure ShowMMessage(Caption :
String; MMessage : Integer);
overload;
procedure ShowMMessage(Caption :
String; MMessage : Real);
overload;
end;
implementation
procedure TMyMessage.CreateForm(Left,Top, Width, Height,Symbol : Integer;
Caption, Text :
String);
var Form : TForm;
begin
Form :=
nil;
Form := TForm.Create(Form);
Form.Left := Left-Width
div 2;
//Form.Width := Width;
Form.Top := Top+Height
div 2;
Form.Height := Height;
Form.Caption := Caption;
Form.Parent := Form1;
// Besch.WordWrap := true;
case Symbol
of
0 : ;
//Nichts
1 : ;
//Info
2 : ;
//Frage
3 : ;
//Ausruf
end;
Form.Canvas.Font.Color := clblack;
Form.Canvas.TextOut(30,30 , text);
Form.BorderStyle := bsdialog;
Form.Visible := true;
Form.SetFocus;
end;
procedure TMyMessage.ShowMMessage(Caption :
String; MMessage :
String);
begin
CreateForm((Screen.Width
div 2), 40, (Screen.Height), 100, 0, Caption, MMessage);
end;
procedure TMyMessage.ShowMMessage(Caption :
String; MMessage : Integer);
begin
CreateForm((Screen.Width
div 2), 40, (Screen.Height), 100, 0, Caption, IntToStr(MMessage));
end;
procedure TMyMessage.ShowMMessage(Caption :
String; MMessage : Real);
begin
CreateForm((Screen.Width
div 2), 40, (Screen.Height), 100, 0, Caption, FloatToStr(MMessage));
end;
end.