Mata-i grasa _|_
RST  

Go Back   RST > >> 1337 Zone << > Programare

Programare Coltul programatorilor

Reply
Old 01-07-2009, 05:47 PM   #1 (permalink)
Registered Users
Bautor de palinca
 
c0smyn's Avatar
 
Join Date: Jul 2008
Location: Cluj/Resita
Posts: 137
Rep Power: 3
c0smyn se balangane pe drum
Send a message via Yahoo to c0smyn
c0smyn is offline

Default [Borland Delphi] Folosirea mesajelor intr-un mod mult mai simplu


hotel regim hotelier
hotel yahoo domain
Un mod mult mai simplu pentru a folosi sistemul de mesaje in Borland Delphi
Puneti acest cod sub " {$R *.dfm} "

Code:
procedure ArataMesaj(mesaj: string; titlu: string; tip: Integer);
var
eroare,informatie,exclamatie,intrebare,normal: boolean;
begin
if tip > 5 then exit
else
if tip < 1 then exit;

eroare := false;
informatie := false;
exclamatie := false;
normal := false;
intrebare := false;

{Setare tip mesaj} //begin
  if tip = 1 then eroare := true;
  if tip = 2 then informatie := true;
  if tip = 3 then exclamatie := true;
  if tip = 4 then normal := true;
  if tip = 5 then intrebare := true;
{Setare tip mesaj} //end;

if eroare = true then
  MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONERROR)
else
if informatie = true then
  MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONINFORMATION)
else
if exclamatie = true then
  MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONEXCLAMATION)
else
if normal = true then
  MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK)
else
if intrebare = true then
  MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONQUESTION);
end;
Noua comanda va fi ArataMesaj(string,string,integer);

Exemplu:
Code:
ArataMesaj('Nu imi place scoala!','Rst Center',2);
"Nu imi place scoala" - reprezinta mesajul care v`a fi afisat
"Rst Center" - reprezinta titlul mesajului
"2" - reprezinta tipul de mesaj (2 = mesaj de tip informatie)

Tipurile de mesaj:

1 - Mesaj eroare
2 - Mesaj informatie
3 - Mesaj exclamatie
4 - Mesaj normal
5 - Mesaj intrebare

Enjoy
  Reply With Quote
Sponsored Links
Re: [Borland Delphi] Folosirea mesajelor intr-un mod mult mai simplu
Old 07-02-2009, 04:45 PM   #2 (permalink)
mp4
Registered user
Bautor de ceai
 
Join Date: Dec 2008
Posts: 8
Rep Power: 0
mp4 se balangane pe drum
mp4 is offline
Default

folositor
Bravo cosmin.
  Reply With Quote
Reply

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump




Copywr0ng (c) 2009 Miercuri catre Joi - RST
All logos and trademarks in this site are property of their respective

Hosted by powerhost.ro