کمک در تکمیل ماشین حساب مهندسی گرافیکی
سلام دوستان ...
من تقریباَ محیط ماشین حساب رو درست کردم ولی نمیتونم کلید براش تعریف کنم که با موس کار کنه و عملیات رو انجام بده ...
اگر میتونید راهنمایی کنید ...
با تشکر ...
کد:
// graphic.cpp
#include "stdafx.h"
#include "winbgim.h"
#include "conio.h"
#include "math.h"
#include "iostream.h"
int main()
{
initwindow(600,800);//window size
setcolor(COLOR(182,168,193));
rectangle( 5 , 5 , 595 , 788);//ghab
setcolor(COLOR(182,168,193));
rectangle( 20 , 780 , 97 , 713);//0
rectangle( 20 , 698 , 97 , 631);//1
rectangle( 20 , 616 , 97 , 549);//4
rectangle( 20 , 534 , 97 , 467);//7
rectangle( 122 , 780 , 204 , 713);//00
rectangle( 122 , 698 , 204 , 631);//2
rectangle( 122 , 616 , 204 , 549);//5
rectangle( 122 , 534 , 204 , 467);//8
rectangle( 229 , 780 , 311 , 713);//.
rectangle( 229 , 698 , 311 , 631);//3
rectangle( 229 , 616 , 311 , 549);//6
rectangle( 229 , 534 , 311 , 467);//9
rectangle( 336 , 780 , 580 , 713);//mosavi
rectangle( 336 , 698 , 453 , 631);//jam
rectangle( 462 , 698 , 580 , 631);//tafrigh
rectangle( 336 , 616 , 453 , 549);//zarb
rectangle( 462 , 616 , 580 , 549);//taghsim
rectangle( 336 , 534 , 453 , 467);//jazr
rectangle( 462 , 534 , 580 , 467);//tavan
setcolor(COLOR(182,168,193));
circle (58.5 , 423.5 , 30);//sin
circle (128.5 , 423.5 , 30);//cos
circle (198.5 , 423.5 , 30);//tan
circle (268.5 , 423.5 , 30);//asin
circle (338.5 , 423.5 , 30);//acos
circle (408.5 , 423.5 , 30);//atan
circle (478.5 , 423.5 , 30);//log10
circle (548.5 , 423.5 , 30);//log
setcolor(COLOR(159,127,184));
moveto(430,720);//mosavi text
settextstyle( 7 , 0 , 6);//mosave text
outtext("=");//mosavi text
moveto(260,714);//. text
settextstyle( 7 , 0 , 6);//. text
outtext(".");//. text
moveto(145,735);//00 text
settextstyle( 7 , 0 , 3);//00 text
outtext("00");//00text
moveto(50,735);//0 text
settextstyle( 7 , 0 , 3);//0 text
outtext("0");//0text
moveto(42,645);//1 text
settextstyle( 7 , 0 , 5);//1 text
outtext("1");//1text
moveto(42,563);//4 text
settextstyle( 7 , 0 , 5);//4 text
outtext("4");//4text
moveto(42,483);//7 text
settextstyle( 7 , 0 , 5);//7 text
outtext("7");//7text
moveto(147,483);//8 text
settextstyle( 7 , 0 , 5);//8 text
outtext("8");//8text
moveto(147,563);//5 text
settextstyle( 7 , 0 , 5);//5 text
outtext("5");//5text
moveto(147,645);//2 text
settextstyle( 7 , 0 , 5);//2 text
outtext("2");//2text
moveto(251,645);//3 text
settextstyle( 7 , 0 , 5);//3 text
outtext("3");//3text
moveto(251,563);//6 text
settextstyle( 7 , 0 , 5);//6 text
outtext("6");//6text
moveto(251,483);//9 text
settextstyle( 7 , 0 , 5);//9 text
outtext("9");//9text
moveto(354,483);//pow text
settextstyle( 6 , 0 , 4);//pow text
outtext("Pow");//pow text
moveto(480,483);//sqrt text
settextstyle( 6 , 0 , 4);//sqrt text
outtext("Sqrt");//sqrt text
moveto(387,563);//taghsim text
settextstyle( 6 , 0 , 4);//taghsim text
outtext("/");//taghsim text
moveto(383,645);//+ text
settextstyle( 6 , 0 , 4);//+ text
outtext("+");//+ text
moveto(515,645);//- text
settextstyle( 6 , 0 , 4);//- text
outtext("-");//- text
moveto(512,568);//* text
settextstyle( 6 , 0 , 4);//* text
outtext("*");//* text
moveto(38,410);//sin text
settextstyle( 6 , 0 , 2);//sin text
outtext("Sin");//sin text
moveto(104,410);//cos text
settextstyle( 6 , 0 , 2);//cos text
outtext("Cos");//cos text
moveto(175,410);//tan text
settextstyle( 6 , 0 , 2);//tan text
outtext("Tan");//tan text
moveto(245,410);//asin text
settextstyle( 6 , 0 , 1);//asin text
outtext("asin");//asin text
moveto(313,410);//acos text
settextstyle( 6 , 0 , 1);//acos text
outtext("acos");//acos text
moveto(385,410);//atan text
settextstyle( 6 , 0 , 1);//atan text
outtext("atan");//atan text
moveto(457,410);//log text
settextstyle( 6 , 0 , 1);//log text
outtext("Log");//log text
moveto(523,410);//fabs text
settextstyle( 6 , 0 , 1);//fabs text
outtext("Fabs");//fabs text
getch();
closegraph();//azad kardane hafeze pas az etmame barname
return 0;
}