Showing posts with label Borland delphi7. Show all posts
Showing posts with label Borland delphi7. Show all posts

Wednesday, April 6, 2011

create animated text running from top to bottom with delphi 7

Okay .. now we will discuss about creating animated text runs from the top down with delphi7,, as we discussed yesterday, about the text runs from bottom to top...

Create a 'Form' as shown below :


Click on 'timer1', then change it property..
timer1  |           interval             |    5          | 

Double click on 'timer1', then copy red text below...

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label1.Top:=label1.Top+1;
if label1.Top>=panel1.height then
label1.Top:=0-panel1.width;
end;

then click run or F9 to try the program ..

if still not understand with this text running,, please leave a comment ..


good luck.......

Tuesday, March 29, 2011

Create animated text running from bottom to top with Delphi7

in this post we are still discussing about creating animations with Delphi 7,, ie animated text running from bottom to top, perhaps,, in the previous post, we have discussed about the animation-animation basic,,, which, if developed will to be a Reliable program .. or maybe we could modify it to be a useful application ...

create animated text running from bottom to top
Create a 'Form' as shown below :

Click on 'timer1', then change it property..
timer1  |           interval             |    5          |



Double click on 'timer1', then copy red text below...

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label1.Top:=label1.Top-1;
if(label1.Top+label1.Height)<=0 then label1.Top:=panel1.Height;
end;


ok...now, to try this program,, click 'Run menu' or 'F9'

good luck..........

Sunday, March 27, 2011

Create animation text bouncing from top to bottom with delphi 7

In a previous post, we had discussed about making an animated bouncing text from left to right, which, the text moves from the right .. and then back again, and so on .. and now we will create an animated bouncing text from top to bottom,,
  
ok,,, open delphi7 applications, and create a 'form' as shown below

on the 'object inspector', change the propert (click on the component, and then look at the object inspector)
----------------------------------------------------------------------------------------------------------------
timer1 
interval               --->    5    
---------------------------------------------------------------------------------------------------------------- 
double click on 'form', and copy the program in red below
procedure TForm1.FormCreate(Sender: TObject);
begin
atas:=true;
end;



 and, double click on 'timer1', then copy the program in red below
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if label1.top<=0 then atas:=false;
if (label1.Top+label1.Height)>= panel1.Height then atas:=true;
if atas=true then
label1.Top:=label1.Top-1
else
label1.Top:=label1.Top+1;
end;

end.
 

try the program ... click 'run' or F9. and see the result.. 
if errors, usually occurs on the program,,
good luck...... 

Create animation text bouncing from the left to right with delphi7

on this occasion, we will try to discuss how to make animations with delphi7, namely, the banner moves to the left and right, making this animation, we just use a simple program, but, with this simple program, we can develop it into a program  that is reliable , hopefully



open the Delphi application, make 'form' as shown below:

on the 'object inspector', change the propert (click on the component, and then look at the object inspector)
 
----------------------------------------------------------------------------------------------------------------
on form.                        
position              --->   popscreencenter      
borderstyle        --->   bsnone                        


on component
panel1  
bevelliner           --->    bvlowered      
caption               --->     kosong           

label1             
transparent       --->     true                 

timer1 
interval               --->    5       
---------------------------------------------------------------------------------------------------------------

on 'unit.pas', add the code 'kiri: boolean;'


  
double click on the 'form', then copy the program in red below ..
 
procedure TForm1.FormCreate(Sender: TObject);
begin
kiri:=true;
end;

double click on component 'timer1', then copy the program in red below ..
procedure TForm1.Timer1Timer(Sender: TObject);
begin
//membuat batas arah kiri dan kanan
if label1.left <=0 then kiri:=false;
if label1.left+label1.width>panel1.width then
kiri:=true;
//membuat tulisan bergerak kiri ke kanan
if kiri=true then
label1.left:=label1.left-1
else
label1.left:=label1.left+1;
end;

end.

to try the program ... click 'run' or F9. and see the result.. 
if errors, usually occurs on the program,,

 good luck......

Saturday, March 26, 2011

Create animations with Delphi 7

okay, now we will discuss about creating animations with delphi7 .. actually this animation,,, just a simple animation, but this is the basic stage to make the next animation,,,, and now, we will try to make animations with delphi7,,,

steps :
1. select menu>>>file>>>new>>>form.



2. select label (like letter A ).

3.  then, put on the form that we created earlier.


4. then, select the timer, system>>>timer.

Then, place it on form before.

5. select standar>>>button (that read "OK").

6. Put in the form, and the caption change to "start"


7. then type the program as below. 

------------------------------------------------------------------------------------------------
      {$R *.dfm}
      procedure delay(lama:word);
      var 
      temp:dword; 
      begin 
      temp:=gettickcount; 
      repeat 
      application.processmessage; 
      until(gettickcount-temp)>=lama; 
      end;

------------------------------------------------------------------------------------------------
 
its type must be located under "{$R *.dfm}"


8. Then, double click on the timer ( wich is shaped clock located in the aearlier form).
     type the program under
 
------------------------------------------------------------------------------------------------
     procedure Tform.timer1timer(sender:Tobject)
     begin
     label1.caption:='M';delay(50);
     label2.caption:='E';delay(50);
     label3.caption:='R';delay(50);
     label4.caption:='A';delay(50);
     label5.caption:='H';delay(50);
     label1.caption:='';delay(50);
     label2.caption:='';delay(50);
     label3.caption:='';delay(50);
     label4.caption:='';delay(50);
     label5.caption:='';delay(50);
     end;
     end.
 ------------------------------------------------------------------------------------------------


9. Change enabled>>>false. 

10. And run application by clicking on the menu run>>>run

 if are errors, usually located on the program type, you can also change the color and other forms
according to your taste...

good luck.............

Tuesday, March 15, 2011

create software with Delphi 7,, so that the computer / laptop shutdown automatically by determining the time

This simple software allows you to turn off the computer automatically by setting the time we give,,, for example by entering the number 3, then the computer turns off for 3 minutes ...
ok,, this time we will discuss how to make this software, using programming languages ​​delphi7 ..



   now, create a form like the image below


the picture above using
--->2 button button
--->An edit text
--->First timer

and other features that may I add just for variety,,, hehehe .....
but the point is, know the program to shut down the computer by setting time, ..

First, typing this program .. ..

---------------------------------------------------------------------------------------------------------- 
setShutDownPrivilege function: Boolean;
var
     TTokenHnd: THandle;
     TTokenPvg: TTokenPrivileges;
     cbtpPrevious: DWORD;
     rTTokenPvg: TTokenPrivileges;
     pcbtpPreviousRequired: DWORD;
     tpResult: Boolean;

const
     SE_SHUTDOWN_NAME = 'SeShutdownPrivilege';
begin
   Result: = false;

   if Win32Platform = VER_PLATFORM_WIN32_NT then
     begin
       if OpenProcessToken (GetCurrentProcess (), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TTokenHnd) then
         begin
           tpResult: = lookupPrivilegeValue (nil, SE_SHUTDOWN_NAME, TTokenPvg.Privileges [0]. Luid);
           TTokenPvg.PrivilegeCount: = 1;
           TTokenPvg.Privileges [0]. Attributes: = SE_PRIVILEGE_ENABLED;
           cbtpPrevious: = sizeof (rTTokenPvg);
           pcbtpPreviousRequired: = 0;
           then if tpResult
             Result: = windows.AdjustTokenPrivileges (TTokenHnd, False, TTokenPvg, cbtpPrevious, rTTokenPvg, pcbtpPreviousRequired);
         end;
     end;
end;

function Power (pwFlags: Cardinal): Boolean;
begin
   if Win32Platform = VER_PLATFORM_WIN32_NT then
     setShutDownPrivilege;
     Result: = ExitWindowsEx (pwFlags, 0);
end;
program listings for button1 (active) ..
procedure TForm1.Button1Click (Sender: TObject);
var
   time: integer;
begin
if edit1.text =''then
begin
application.MessageBox ('enter a sleep timer on off time', 'information', mb_iconinformation);
edit1.SetFocus;
end
else
begin
time: = strtoint (edit1.text) * 60 000;
off.Interval: = time;
off.Enabled: = true;
button1.Enabled: = false;
edit1.Enabled: = false;
edit1.Color: = clmenubar;
WindowState: = wsMinimized;
end;
end;

---------------------------------------------------------------------------------------------------------- 
 
 
program listings for Timer1 ...
---------------------------------------------------------------------------------------------------------- 
procedure TForm1.offTimer(Sender: TObject);
begin

Power (EWX_SHUTDOWN or EWX_FORCE);
end;
 
---------------------------------------------------------------------------------------------------------- 

 
program listings for button 2 (Cancel)
---------------------------------------------------------------------------------------------------------- 
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Enabled:=true;
edit1.Color:=clwindow;
off.Enabled:=false;
edit1.SetFocus;
edit1.Text:='';
button1.Enabled:=true;

end; 

---------------------------------------------------------------------------------------------------------- 



or if you want to just try .. please download the
http://www.ziddu.com/download/14198761/Sleep_Timer.exe.html
 
good luck.......................... 

Monday, March 14, 2011

Making a simple Software with Delphi7

This simple program created with Delphi7, to find out while the natural strains of the disease in someone with a checkbox to check-existing checkbox on the form.

Program form that has been completed is made (Form1).




Program listings on the check button (button1).

procedure TForm1.Button1Click (Sender: TObject);
begin
button1.Enabled: = false;
If c1.checked and c2.checked and c3.checked and c4.checked and c5.checked and c6.checked and c7.checked and c8.checked and c9.checked and c10.checked and c11.checked then
begin
     l3.Caption: = 'Cacar';
     l4.Caption: = '
Bronchitis khronik';
     l5.Caption: = 'Maningitis';
     l6.Caption: = 'Anemia';
     l7.Caption: = 'tipus';
     label2.Visible: = true;
end
 
else If c1.checked and c2.checked and c4.checked and c5.checked and c6.checked and c7.checked and c9.checked then
begin
     l3.Caption: = 'Cacar';
     l4.Caption: = 'Bronchitis Khronik';
     l5.Caption: = 'Maningitis';
     l6.Caption: = 'Anemia';
     label2.Visible: = true;
end
else If c1.checked and c2.checked and c4.checked and c5.checked then
begin
     l3.Caption: = 'Cacar';
     l4.Caption: = 'Bronchitis Khronik';
     label2.Visible: = true;
end
else If c1.checked and c2.checked and c3.checked and c7.checked and c8.checked and c9.checked then
begin
     l3.Caption: = 'Cacar';
     l6.Caption: = 'Anemia';
     label2.Visible: = true;
end
else
If c1.checked and c2.checked and c3.checked then
begin
      l3.Caption: = 'Smallpox';
end
else if
     c4.checked and c5.checked then
begin
     l4.Caption: = 'Bronchitis khronik';
end
else if
     c6.checked and c3.checked then
begin
     l5.Caption: = 'Maningitis';
end
else if
     c7.checked and c8.checked and c9.checked then
begin
     l6.Caption: = 'Anemia';
end
else If c10.checked and c11.checked and c8.checked and c3.checked then
begin
     l7.Caption: = 'tipus';
end
end;

procedure TForm1.Button2Click (Sender: TObject);
begin
button1.Enabled: = true;
c1.Checked: = false;
c2.Checked: = false;
c3.Checked: = false;
c4.Checked: = false;
c5.Checked: = false;
c6.Checked: = false;
c7.Checked: = false;
c8.Checked: = false;
c9.Checked: = false;
c10.Checked: = false;
c11.Checked: = false;
   l3.Caption :='';
   l4.Caption :='';
   l5.Caption :='';
   l6.Caption :='';
   l7.Caption :='';
   label2.Visible: = false;
end;




 nformation button serves to call form2, form2 which contains information about the program. (shown below)
 Exit button to exit the programs that are running....