Children's mathematical arithmetic software in Delphi source code Show Untmath.pas Source code
Return
Download Children's mathematical arithmetic software in Delphi source code:
download Untmath.pas Source code
- Download Children's mathematical arithmetic software in Delphi source code Source code - Type:.pas
- unit Untmath;
- interface
- uses
- Windows, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls, Buttons,MMSystem, Menus, spin, jpeg ;
- type
- TFrmmath = class(TForm)
- SpinEdit1: TSpinEdit;
- pnl1: TPanel;
- pnl2: TPanel;
- lbl1: TLabel;
- lbl2: TLabel;
- pb1: TPaintBox;
- lbl3: TLabel;
- lbl4: TLabel;
- lbl5: TLabel;
- pb2: TPaintBox;
- pnl3: TPanel;
- rg3: TRadioGroup;
- pnl4: TPanel;
- btn2: TSpeedButton;
- img1: TImage;
- pm1: TPopupMenu;
- N1: TMenuItem;
- N2: TMenuItem;
- N3: TMenuItem;
- Image1: TImage;
- GroupBox1: TGroupBox;
- Label1: TLabel;
- Label2: TLabel;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- RadioButton3: TRadioButton;
- RadioButton4: TRadioButton;
- Bevel1: TBevel;
- procedure btn2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure rg3Click(Sender: TObject);
- procedure N1Click(Sender: TObject);
- procedure N3Click(Sender: TObject);
- procedure RadioButton1Click(Sender: TObject);
- private
- procedure getrandomds;
- procedure getrandom_adding(k:Integer;var i,j:Integer);
- procedure getrandom_subtract(k:Integer;var i,j:Integer);
- procedure getrandom_multiply(k:Integer;var i,j:Integer);
- procedure getrandom_divide(k:Integer;var i,j:Integer);
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Frmmath: TFrmmath;
- ds:Integer;
- yesbmp,nobmp,lightbmp:TBitmap ;
- rightsound,wrongsound:pchar;
- implementation
- uses Untfun ;
- {$R *.dfm}
- {$R windowsxp.res}
- {$R myres.RES}
- procedure TFrmmath.getrandomds;
- var
- i,j,k:Integer ;
- s,s1:string;
- begin
- Randomize;
- k:=random(6);
- rg3.Items.Strings[k]:=IntToStr(ds);
- s:='#'+IntToStr(ds)+'#';
- for i:=0 to k-1 do
- begin
- repeat
- Randomize;
- j:=1+Random(ds+6);
- s1:='#'+IntToStr(j)+'#';
- until Pos(s1,s)=0 ;
- rg3.Items.Strings[i]:=IntToStr(j);
- s:=s+s1;
- end;
- for i:=k+1 to 5 do
- begin
- repeat
- Randomize ;
- j:=1+Random(ds+6);
- s1:='#'+IntToStr(j)+'#';
- until Pos(s1,s)=0;
- rg3.Items.Strings[i]:=IntToStr(j);
- s:=s+s1;
- end;
- end;
- procedure TFrmmath.getrandom_adding(k:Integer;var i,j:Integer);
- begin
- Randomize;
- i:=1+random(k);
- j:=1+random(k);
- end;
- procedure TFrmmath.getrandom_divide(k:Integer;var i, j: Integer);
- begin
- repeat
- Randomize;
- i:=1+random(k);
- j:=1+random(k);
- until (i mod j=0) and (i<>j);
- end;
- procedure TFrmmath.getrandom_multiply(k:Integer;var i, j: Integer);
- begin
- Randomize;
- i:=1+random(k);
- j:=1+random(k);
- end;
- procedure TFrmmath.getrandom_subtract(k:Integer;var i, j: Integer);
- begin
- repeat
- Randomize;
- i:=1+random(k);
- j:=1+random(k);
- until i>=j;
- end;
- procedure TFrmmath.btn2Click(Sender: TObject);
- var
- i,j,k,p:Integer ;
- begin
- Image1.Picture :=nil ;
- K:=SpinEdit1.Value;
- if RadioButton1.Checked then
- begin
- getrandom_adding(k,i,j);
- ds:=i+j;
- end;
- if RadioButton2.Checked then
- begin
- getrandom_subtract(k,i,j); //
- ds:=i-j;
- end;
- if RadioButton3.Checked then
- begin
- getrandom_multiply(k,i,j);
- ds:=i*j;
- end;
- if RadioButton4.Checked then
- begin
- getrandom_divide(k,i,j);
- ds:=i div j;
- end;
- pb1.Repaint ;
- for p:=1 to i do
- begin
- if p<11 then
- pb1.Canvas.Draw(p*34,0,lightbmp)
- else
- pb1.Canvas.Draw((p-10)*34,34,lightbmp);
- end;
- pb2.Repaint ;
- for p:=1 to j do
- begin
- if p<11 then
- pb2.Canvas.Draw(p*34,0,lightbmp)
- else
- pb2.Canvas.Draw((p-10)*34,34,lightbmp);
- end;
- lbl1.Caption :=IntToStr(i);
- lbl3.Caption :=IntToStr(j);
- lbl5.Caption :='?';
- rg3.ItemIndex :=-1;
- getrandomds ;
- end;
- procedure TFrmmath.FormCreate(Sender: TObject);
- var
- stream:TStream;
- hResInfo,hres : THandle;
- begin
- yesbmp:=TBitmap.Create ;
- nobmp :=TBitmap.Create ;
- lightbmp :=TBitmap.Create ;
- yesbmp.LoadFromResourceName(HInstance,'yes') ;
- nobmp.LoadFromResourceName(HInstance,'no') ;
- stream :=TResourceStream .Create(HInstance,'light','bmp');
- lightbmp.LoadFromStream(stream);
- Stream.Free ;
- hResInfo:=FindResource(HInstance, 'right', 'WAVE');
- hRes := LoadResource(HInstance,hResInfo);
- if hRes > 32 then
- begin
- rightSound:=LockResource(hRes);
- end;
- hResInfo := FindResource(HInstance, 'wrong', 'WAVE');
- hRes := LoadResource(HInstance,hResInfo);
- if hRes > 32 then
- begin
- wrongSound:=LockResource(hRes);
- end;
- end;
- procedure TFrmmath.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- begin
- yesbmp.Free;
- nobmp .Free;
- lightbmp .Free;
- end;
- procedure TFrmmath.rg3Click(Sender: TObject);
- var
- s:string;
- begin
- s:=rg3.Items.Strings[rg3.ItemIndex];
- lbl5.Caption :=s;
- if StrToInt(s)=ds then
- begin
- Image1.Canvas.Draw(0,0,yesbmp);
- sndplaysound(rightsound,snd_async or snd_Memory);
- end
- else
- begin
- Image1.Canvas.Draw(0,0,nobmp);
- sndplaysound(wrongsound ,snd_async or snd_Memory);
- END;
- end;
- procedure TFrmmath.N1Click(Sender: TObject);
- begin
- if (Sender as TMenuItem).Checked =False then
- begin
- setwindowpos(handle,hwnd_topmost,left,top,width,height,swp_showwindow);
- (Sender as TMenuItem).Checked :=True;
- end
- else
- begin
- setwindowpos(handle,hwnd_notopmost,left,top,width,height,swp_showwindow);
- (Sender as TMenuItem).Checked :=False ;
- end;
- end;
- procedure TFrmmath.N3Click(Sender: TObject);
- begin
- creatdesktoplink('少儿数学软件(张永生完善版)');
- end;
- procedure TFrmmath.RadioButton1Click(Sender: TObject);
- begin
- case (Sender as TRadioButton).Tag of
- 0: lbl2.Caption :='+';
- 1: lbl2.Caption :='-';
- 2: lbl2.Caption :='×';
- 3: lbl2.Caption :='÷';
- end;
- end;
- end.
downloadUntmath.pas Source code
- Download Children's mathematical arithmetic software in Delphi source code Source code
Related Source Codes/Software:
Delphi screen touch cash register system source program - From the perspective of directory structure, this ... 2012-02-18
Delphi examples of using the Image control to display and draw text - The Delphi examples through the use of an Image co... 2012-02-18
Delphi kanji literacy software full version - Delphi pupils ' Chinese character recognition soft... 2012-02-18
Delphi uses the MMS protocol to download streaming media file - Delphi uses the MMS protocol to download streaming... 2012-02-18
Delphi implements a simple P2P chat program - This simple P2P chat software used to simple Serve... 2012-02-18
Image selection/editing plug-in v2.0 Delphi Edition - This is a DELPHI graphics you want to use a plugin... 2012-02-18
Magnificent Delphi implementation interface game Lander - Delphi complete source of legends of the game land... 2012-02-18
Delphi source code enterprise generic invoicing system - A common IT industry enters sells saves management... 2012-02-18
Stamp making software Delphi source code - The DELPHI software is very clever, you can achiev... 2012-02-18
Features of Delphi good teaching management system - A written in DLEPHI language teaching management ... 2012-02-18
Delphi car rental company business management system - A car rental company's business management systems... 2012-02-18
Delphi major revision of the human resources management system source code - RedHR owned a large OFFICE of human resources mana... 2012-02-18
DELPHI pawn industry management system source code - Pawn shop of an integrated business management sys... 2012-02-18
Cool interface Delphi chat software source code - Interface is really cool? This is a small LAN chat... 2012-02-18
Delphi shield Ctrl+Alt+Del reqijian method - Real shielding theory of Delphi is this: using a r... 2012-02-18
Classic RPG games with Delphi source code - The actual and Diablo game or scene is similar in ... 2012-02-18
35 Delphi7 Indy instance package - Application example demonstrates a lot of Indy Dem... 2012-02-18
Delphi transportation company business management system - A Delphi transportation company business managemen... 2012-02-18
Using Delphi to achieve control of the camera - This procedure describes how to use DELPHI AVICAP3... 2012-02-18
Cell of the report component for Delphi example source program - UFIDA table company developed a report component, ... 2012-02-18