commit 02865843931421a17357c954fcf8abc4f1f15f51 Author: aNNiMON Date: Sat Mar 2 18:17:55 2024 +0200 Initial diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d969f6b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.exe +*.obj diff --git a/1/Project1.bpr b/1/Project1.bpr new file mode 100644 index 0000000..6aa1bc4 --- /dev/null +++ b/1/Project1.bpr @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/1/Project1.cpp b/1/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/1/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/1/Project1.res b/1/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/1/Project1.res differ diff --git a/1/Unit1.cpp b/1/Unit1.cpp new file mode 100644 index 0000000..4412031 --- /dev/null +++ b/1/Unit1.cpp @@ -0,0 +1,91 @@ +//--------------------------------------------------------------------------- + +#include +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +int x=20,y=40; +// +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +/*void __fastcall TForm1::circle(int x, int y, int r) { + Canvas->Ellipse(x,y,x+r,y+r); +}*/ +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + TRect aRect = Rect(0,0,ClientWidth,236); + //for(int i=0; i<;i+= + Canvas->Brush->Color=0xffffce; + Canvas->FillRect(aRect); + Canvas->Brush->Color=0x006d9c; + aRect = Rect(0,236,ClientWidth,ClientHeight); + Canvas->FillRect(aRect); + Canvas->MoveTo(0,236); + Canvas->LineTo(700,236); + Canvas->Pen->Color=0xaf79af; + Canvas->Brush->Color=0xaf79af; + Canvas->Ellipse(135,90,145,100); + Canvas->Ellipse(345,198,371,224); + Canvas->Ellipse(245,178,275,204); + Canvas->Pen->Color=0x78af79; + Canvas->Brush->Color=0x78af79; + Canvas->Ellipse(328,178,358,202); + Canvas->Ellipse(180,105,210,135); + Canvas->Pen->Color=0xff0fff; + Canvas->Brush->Color=0xff0fff; + Canvas->Ellipse(237,198,267,228); + Canvas->Ellipse(325,180,355,210); + Canvas->Ellipse(200,120,220,140); + Canvas->Pen->Color=0xffaf79; + Canvas->Brush->Color=0xffaf79; + Canvas->Ellipse(210,110,390,185); + Canvas->Ellipse(240,180,270,210); + Canvas->Pen->Color=0x9c9a00; + Canvas->Brush->Color=0x9c9a00; + Canvas->Ellipse(380,110,410,140); + Canvas->Ellipse(140,60,200,120); + Canvas->Pen->Color=0x00ffff; + Canvas->Brush->Color=0x00ffff; + Canvas->Ellipse(150,80,160,90); + Canvas->Ellipse(340,205,370,235); + Canvas->Ellipse(225,205,255,235); + /*Canvas->Pen->Color=0xff0000; + Canvas->MoveTo(x,y); + Canvas->LineTo(x,y); + Canvas->Font->Color=0x00ff00; + Canvas->TextOutA(23,14,"x= "+IntToStr(x)+" y= "+IntToStr(y));*/ +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + /*if(Key==Key_W) { + y--; + } + if(Key==Key_S) { + y++; + } + Canvas->Refresh(); */ +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key) +{ + /*if(Key==Key_w) { + y--; + } + if(Key==Key_s) { + y++; + } + Canvas->Refresh(); */ +} +//--------------------------------------------------------------------------- diff --git a/1/Unit1.ddp b/1/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/1/Unit1.ddp differ diff --git a/1/Unit1.dfm b/1/Unit1.dfm new file mode 100644 index 0000000..0f4bf5a --- /dev/null +++ b/1/Unit1.dfm @@ -0,0 +1,19 @@ +object Form1: TForm1 + Left = 231 + Top = 404 + Width = 696 + Height = 480 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + OnPaint = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/1/Unit1.h b/1/Unit1.h new file mode 100644 index 0000000..63e5529 --- /dev/null +++ b/1/Unit1.h @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift); + void __fastcall FormKeyPress(TObject *Sender, char &Key); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/2/Project2.bpr b/2/Project2.bpr new file mode 100644 index 0000000..23a33bc --- /dev/null +++ b/2/Project2.bpr @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/2/Project2.cpp b/2/Project2.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/2/Project2.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/2/Project2.res b/2/Project2.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/2/Project2.res differ diff --git a/2/Unit1.cpp b/2/Unit1.cpp new file mode 100644 index 0000000..f2c83d2 --- /dev/null +++ b/2/Unit1.cpp @@ -0,0 +1,81 @@ +//--------------------------------------------------------------------------- + +#include +#include "Math.h" +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + +float function(int i) { + + return (0.1*sqrt(12*i)+log10(i+7)); +} + +int step = 15; + +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + + int w2 = ClientWidth/2; + int h2 = ClientHeight/2; + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=0xffffff; + Canvas->FillRect(aRect); + Canvas->Pen->Color=0x00; + // OX + Canvas->MoveTo(0,h2); + Canvas->LineTo(ClientWidth,h2); + Canvas->MoveTo(ClientWidth-10,h2-3); + Canvas->LineTo(ClientWidth,h2); + Canvas->LineTo(ClientWidth-10,h2+3); + // OY + Canvas->MoveTo(w2,0); + Canvas->LineTo(w2,ClientHeight); + Canvas->MoveTo(w2-3,10); + Canvas->LineTo(w2,0); + Canvas->LineTo(w2+3,10); + // + Canvas->MoveTo(w2+10+step,h2-2); + Canvas->LineTo(w2+10+step,h2+2); + Canvas->MoveTo(w2-2,h2-10-step); + Canvas->LineTo(w2+2,h2-10-step); + // + int ht = Canvas->TextHeight("0"); + int wt = Canvas->TextWidth("X"); + Canvas->TextOutA(w2+2,h2-ht,"0"); + Canvas->TextOutA(ClientWidth-12,h2-ht-2,"X"); + Canvas->TextOutA(w2+6,2,"Y"); + Canvas->TextOutA(w2+7+step,h2-ht,"1"); + Canvas->TextOutA(w2+2,h2-step-2*ht,"1"); + // + Canvas->MoveTo(w2,h2+function(0)); + Canvas->Pen->Color=0x0000ff; + for(int i=1; iLineTo(i*step+w2,-function(i)*step+h2); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if(((int)Key)==VK_LEFT) { + step -= 10; + FormPaint(this); + } + if(((int)Key)==VK_RIGHT) { + step += 10; + FormPaint(this); + } +} +//--------------------------------------------------------------------------- diff --git a/2/Unit1.ddp b/2/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/2/Unit1.ddp differ diff --git a/2/Unit1.dfm b/2/Unit1.dfm new file mode 100644 index 0000000..0809333 --- /dev/null +++ b/2/Unit1.dfm @@ -0,0 +1,19 @@ +object Form1: TForm1 + Left = 254 + Top = 287 + Width = 696 + Height = 480 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnPaint = FormPaint + OnResize = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/2/Unit1.h b/2/Unit1.h new file mode 100644 index 0000000..b4919c9 --- /dev/null +++ b/2/Unit1.h @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif + \ No newline at end of file diff --git a/3/Project1.bpr b/3/Project1.bpr new file mode 100644 index 0000000..32b8bd0 --- /dev/null +++ b/3/Project1.bpr @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/3/Project1.cpp b/3/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/3/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/3/Project1.res b/3/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/3/Project1.res differ diff --git a/3/Unit1.cpp b/3/Unit1.cpp new file mode 100644 index 0000000..a7499c1 --- /dev/null +++ b/3/Unit1.cpp @@ -0,0 +1,94 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +TPoint p[149],vodor[233]; + +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +/* +192,84,233,124,244,112,262,106,285,105,309,108,325,118,329,124,358,78,352,142,349,176, +338,210,316,223,282,231,255,227,233,212,225,188,221,162,191,82,220,160,225,188,231,209, +208,238,197,288,195,335,190,365,222,366,225,315,237,267,232,346,233,376,245,383,278,384, +318,381,340,381,355,370,356,340,352,288,347,262,360,291,365,334,366,361,400,360,399,344, +391,291,380,246,351,205,340,200,352,206,362,221,389,185,643,107,486,185,672,133,492,213, +665,164,489,246,667,201,469,293,434,278,394,306,399,359,390,362,395,364,391,369,390,370, +393,382,385,369,385,379,381,369,378,377,375,368,371,377,374,361,367,360,365,323,359,289, +346,262,353,296,356,366,355,371,341,381,246,384,232,375,236,267,224,312,222,362,217,365, +216,372,213,375,212,386,208,377,208,388,204,376,202,388,200,377,196,388,196,372,198,366, +191,364,196,329,194,325,137,282,110,306,1,236,77,254,1,198,77,232,2,131,84,204,9,81, +183,198,207,236 +*/ +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + int t1[] = {107,272,120,282,126,292,126,297,120,302,110,309,137,304,140,297,139,283,133,272,128,269,105,273,117,279,134,275,140,281,124,287,125,297,140,291,139,303,158,307,201,302,229,288,219,277,209,265,218,251,192,247,157,257,128,268,148,260,141,248,188,228,195,228,197,244,198,247,190,247,188,248,183,231,174,233,180,250,170,253,166,238,159,239,164,255,156,258,151,246,156,259,160,255,197,247,220,250,238,251,252,255,260,263,262,266,241,270,263,271,263,274,259,278,230,288,215,294,217,305,212,310,210,317,205,321,205,300,209,298,213,310,216,295,231,287,213,266,221,250,234,251,226,256,234,258,238,254,234,251,234,251,234,251,234,251}; + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=13748736; + Canvas->FillRect(aRect); + int vod[] = { + 497,443,498,396,498,371,502,350,511,333,527,321,540,312,563,300,578,290,589,276,597,266,605,255,607,245,614,219,618,198,624,179,632,169,634,164,636,158,618,201,616,199,616,189,611,161,605,148,599,139,594,134,590, + 129,590,129,612,159,617,206,605,252,588,210,533,165,557,185,557,158,560,145,570,136,573,133,559,148,567,150,576,149,580,147,563,147,558,151,557,153,556,160,556,168,549,151,541,145,538,142,550,153,557,167,556,186, + 550,179,531,183,522,188,509,202,525,187,493,185,496,185,512,184,512,187,524,186,533,184,551,181,538,168,509,171, + 537,169,526,150,536,172,586,209,599,236,605,255,613,228,654,206,632,218,644,188,681,162,660,175,657,113,658,145,627,121,644,137,647,122,645,133,659,145,674,116,675,92,675,113,658,147,661,178,641,192,663,192,643, + 193,635,213,671,224,638,216,613,228,652,240,612,229,589,282,651,266,576,289,546, + 244,567,273,569,224,569,243,533,216,567,241,568,275,510,255,536,263,514,238,535,264,511,282,524,271,477,266,502,270,479,250,494,264,487,232,492,246,502,231,493,245,496,269,527,273,521,290,534,260,544,266,533,236, + 542,263,529,258,519,226,528,259,566,274,578,288,615,275,629,246,616,275,556,305,625,316,665,291,621,314,554,305,588,311,617,335,649,328,615,334,590,311,574,310,590,346,602,334,590,343,608,366,615,347,609,366,598, + 355,587,382,613,394,588,381,594,367,569,367,570,375,577,367,581,387,583,368,593,367,596,351,586,333,572,343,582,334,574,307,548,306,509,338,503,359,480,310,377,243,431,277,402,179,414,221,454,150,430,193,413,145, + 361,116,414,146,381,145,399,144,383,166,396,143,412,142,430,192,417,219,366,195,399,212,382,186,388,176,383,187,398,211,414,217,411,168,415,221,425,256,393,234,426,262,429,275,360,282,427,276,381,280,362,253,382, + 279,416,278,388,313,417,277,442,284,460,294,429,305,457,295,456,263,459,294,458,263,471,230,458,265,446,230,456,279,465,298,482,313,499,356,494,373,496,440,493,439,491,372,496,354,494,435 + }; + Canvas->Pen->Width=1; + Canvas->Pen->Color=8954880; + Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]); + for(int j=0; j<15; j++) { + for(int i=0; i<=466; i+=2) { + vodor[i/2].x = 80*j-vod[i]/2; + vodor[i/2].y = (j%2==20?260:260)+vod[i+1]/(j%2==0?2:1.6); + } + Canvas->Polyline(vodor,232); + } + Canvas->Pen->Color=0; + Canvas->MoveTo(p[0].x=t1[0],p[0].y=t1[1]); + for(int i=0; i<=150; i+=2) { + p[i/2].x = t1[i]; + p[i/2].y = t1[i+1]; + } + Canvas->Polyline(p,75); + Canvas->Pen->Width=3; + Canvas->Pen->Color=8954880; + Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]); + for(int i=0; i<=466; i+=2) { + vodor[i/2].x = vod[i]; + vodor[i/2].y = vod[i+1]; + } + Canvas->Polyline(vodor,232); + Canvas->Pen->Width=1; + Canvas->Pen->Color=0; + Canvas->MoveTo(p[0].x=t1[0]/3.2,p[0].y=t1[1]/3.2); + for(int i=0; i<=150; i+=2) { + p[i/2].x = 370+(-t1[i])/3.2; + p[i/2].y = 200+(t1[i+1])/4.2; + } + Canvas->Polyline(p,75); + randomize(); + /*or(int j=0; j<3; j++) { + for(int i=0; i<=150; i+=2) { + p[i/2].x = random(600)-100+(-t1[i])/3.2; + p[i/2].y = random(600)+(t1[i+1])/4.2; + } + Canvas->Polyline(p,75); + } */ + +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/3/Unit1.ddp b/3/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/3/Unit1.ddp differ diff --git a/3/Unit1.dfm b/3/Unit1.dfm new file mode 100644 index 0000000..bde7ef0 --- /dev/null +++ b/3/Unit1.dfm @@ -0,0 +1,17 @@ +object Form1: TForm1 + Left = 233 + Top = 519 + Width = 696 + Height = 480 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnPaint = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/3/Unit1.h b/3/Unit1.h new file mode 100644 index 0000000..8617a45 --- /dev/null +++ b/3/Unit1.h @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif + \ No newline at end of file diff --git a/4/Project1.bpr b/4/Project1.bpr new file mode 100644 index 0000000..93fa750 --- /dev/null +++ b/4/Project1.bpr @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/4/Project1.cpp b/4/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/4/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/4/Project1.res b/4/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/4/Project1.res differ diff --git a/4/Unit1.cpp b/4/Unit1.cpp new file mode 100644 index 0000000..84ad13e --- /dev/null +++ b/4/Unit1.cpp @@ -0,0 +1,132 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#include +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +const int S = 60; //- +const int N = 60; // +const float L = 0.5; // +const int U = 5; // +float a[N]; +int colormode; +bool bl = true; +int r=0,g=255,b=128; +int mode = 0; +float x, y, tx, ty, k, d, len; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ + +} +void color() { + if(mode==0) { + r--; + if(r<=30) mode++; + }else if(mode==1) { + g++; + if(g>=255) mode++; + }else if(mode==2) { + b++; + if(b>=255) mode++; + }else if(mode==3) { + r--; g--; + if(r<=30 || g<=30) mode++; + }else if(mode==4) { + g++; b--; + if(g>=255 || b<=30) { + mode=0; + } + }//else +} +//--------------------------------------------------------------------------- +float frand() { + randomize(); + return (float) ((float)random(100)/100); +} +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + int width = ClientWidth; + int height = ClientHeight; + if (width > height) { + len = (float) (height / L / N); + } else { + len = (float) (width / L / N); + } + randomize(); + if(random(4)==2) colormode = random(12); + // + color(); + // + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=(TColor) 0;//random(0xffffff); + Canvas->FillRect(aRect); + Canvas->Pen->Color=(TColor) RGB(r,g,b);//random(0x999999)+0x444444; + // + k = (float) (abs(frand() * 360) * M_PI / 180); + float r50 = (float) (abs(frand() * 50)); + d = (float) (M_PI * 2 / S); + if (r50 < 2) { + k = (float) (abs(frand() * 1440) * M_PI / 180); + } + a[0] = (float) (a[0] + sin(k)/U); + for(int i = 1; iPen->Color=(TColor)RGB((255 - 255 * i / N), 255 * i / N, 0); break; + case 1: Canvas->Pen->Color=(TColor)RGB(b, 255, (255 - 255 * i / N)); break; + case 2: Canvas->Pen->Color=(TColor)RGB(255, (255 - 255 * i / N), 0); break; + case 3: Canvas->Pen->Color=(TColor)RGB(r, (255 - 255 * i / N), 255); break; + case 4: Canvas->Pen->Color=(TColor)RGB((255 - 255 * i / N), 255, 0); break; + case 5: Canvas->Pen->Color=(TColor)RGB((255 - 255 * i / N), (255 - 255 * i / N), 255); break; + case 6: Canvas->Pen->Color=(TColor)RGB((255 - 255 * i / N), 255, 255); break; + case 7: Canvas->Pen->Color=(TColor)RGB(0, 255, (255 - 255 * i / N)); break; + case 8: Canvas->Pen->Color=(TColor)RGB(255, g, (255 - 255 * i / N)); break; + case 9: Canvas->Pen->Color=(TColor)RGB(255, (255 - 255 * i / N), (255 - 255 * i / N)); break; + case 10: Canvas->Pen->Color=(TColor)RGB(r, (255 - 255 * i / N), 0); break; + case 11: Canvas->Pen->Color=(TColor)RGB(255, (255 - 255 * i / N), 255); break; + case 12: Canvas->Pen->Color=(TColor)RGB((255 - 255 * i / N), 0, 255); break; + } + + //Canvas->Brush->Color=Canvas->Pen->Color; + //Canvas->FillRect(Rect(x,y,tx,ty)); + //Canvas->Arc(x,y,tx,ty,x+ty,y+tx,x+tx,y+ty); + //Canvas->Ellipse(x,y,x+tx,y+ty); + Canvas->MoveTo(x,y); + Canvas->LineTo(x=tx,y=ty); + } + } + // + Sleep(50); + if(!bl) FormPaint(this); +} +//------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + bl = !bl; + FormPaint(this); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + /*bl = !b1; + FormPaint(this); */ +} +//--------------------------------------------------------------------------- + diff --git a/4/Unit1.ddp b/4/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/4/Unit1.ddp differ diff --git a/4/Unit1.dfm b/4/Unit1.dfm new file mode 100644 index 0000000..17ed4eb --- /dev/null +++ b/4/Unit1.dfm @@ -0,0 +1,20 @@ +object Form1: TForm1 + Left = 254 + Top = 379 + Width = 696 + Height = 480 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnMouseDown = FormMouseDown + OnMouseUp = FormMouseUp + OnPaint = FormPaint + OnResize = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/4/Unit1.h b/4/Unit1.h new file mode 100644 index 0000000..4ec248f --- /dev/null +++ b/4/Unit1.h @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif + \ No newline at end of file diff --git a/5/Project1.bpr b/5/Project1.bpr new file mode 100644 index 0000000..32b8bd0 --- /dev/null +++ b/5/Project1.bpr @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/5/Project1.cpp b/5/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/5/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/5/Project1.res b/5/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/5/Project1.res differ diff --git a/5/Unit1.cpp b/5/Unit1.cpp new file mode 100644 index 0000000..d9b690a --- /dev/null +++ b/5/Unit1.cpp @@ -0,0 +1,162 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +TPoint p[149],vodor[233]; +int fx1,fx2,fy1,fy2;// +int x1 = 76; +int x2 = 300; +int st1 = 1; +int st2 = 2; +int df1,df2;// +int vod[] = { + 497,443,498,396,498,371,502,350,511,333,527,321,540,312,563,300,578,290,589,276,597,266,605,255,607,245,614,219,618,198,624,179,632,169,634,164,636,158,618,201,616,199,616,189,611,161,605,148,599,139,594,134,590, + 129,590,129,612,159,617,206,605,252,588,210,533,165,557,185,557,158,560,145,570,136,573,133,559,148,567,150,576,149,580,147,563,147,558,151,557,153,556,160,556,168,549,151,541,145,538,142,550,153,557,167,556,186, + 550,179,531,183,522,188,509,202,525,187,493,185,496,185,512,184,512,187,524,186,533,184,551,181,538,168,509,171, + 537,169,526,150,536,172,586,209,599,236,605,255,613,228,654,206,632,218,644,188,681,162,660,175,657,113,658,145,627,121,644,137,647,122,645,133,659,145,674,116,675,92,675,113,658,147,661,178,641,192,663,192,643, + 193,635,213,671,224,638,216,613,228,652,240,612,229,589,282,651,266,576,289,546, + 244,567,273,569,224,569,243,533,216,567,241,568,275,510,255,536,263,514,238,535,264,511,282,524,271,477,266,502,270,479,250,494,264,487,232,492,246,502,231,493,245,496,269,527,273,521,290,534,260,544,266,533,236, + 542,263,529,258,519,226,528,259,566,274,578,288,615,275,629,246,616,275,556,305,625,316,665,291,621,314,554,305,588,311,617,335,649,328,615,334,590,311,574,310,590,346,602,334,590,343,608,366,615,347,609,366,598, + 355,587,382,613,394,588,381,594,367,569,367,570,375,577,367,581,387,583,368,593,367,596,351,586,333,572,343,582,334,574,307,548,306,509,338,503,359,480,310,377,243,431,277,402,179,414,221,454,150,430,193,413,145, + 361,116,414,146,381,145,399,144,383,166,396,143,412,142,430,192,417,219,366,195,399,212,382,186,388,176,383,187,398,211,414,217,411,168,415,221,425,256,393,234,426,262,429,275,360,282,427,276,381,280,362,253,382, + 279,416,278,388,313,417,277,442,284,460,294,429,305,457,295,456,263,459,294,458,263,471,230,458,265,446,230,456,279,465,298,482,313,499,356,494,373,496,440,493,439,491,372,496,354,494,435 + }; + int t1[] = {2,44,15,54,21,64,21,69,15,74,5,81,32,76,35,69,34,55,28,44,23,41,0,45,12,51,29,47, + 35,53,19,59,20,69,35,63,34,75,53,79,96,74,124,60,114,49,104,37,113,23,87,19,52, + 29,23,40,43,32,36,20,83,0,90,0,92,16,93,19,85,19,83,20,78,3,69,5,75,22,65,25,61, + 10,54,11,59,27,51,30,46,18,51,31,55,27,92,19,115,22,133,23,147,27,155,35,157,38, + 136,42,158,43,158,46,154,50,125,60,110,66,112,77,107,82,105,89,100,93,100,72,104, + 70,108,82,111,67,126,59,108,38,116,22,129,23,121,28,129,30,133,26,129,23,129,23,129,23}; + +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ + fx1 = 190; + fy1 = 210; + x2 = ClientWidth-240; + fy2 = ClientHeight-340; + df1 = 3; + df2 = 1; +} +//--------------------------------------------------------------------------- +void vodorosli1() { + Form1->Canvas->Pen->Width=1; + Form1->Canvas->Pen->Color=(TColor)8954880; + Form1->Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]); + for(int j=0; j<15; j++) { + for(int i=0; i<=466; i+=2) { + vodor[i/2].x = 80*j-vod[i]/2; + vodor[i/2].y = (j%2==20?260:260)+vod[i+1]/(j%2==0?2:1.6); + } + Form1->Canvas->Polyline(vodor,232); + } +} +void vodorosli2() { + Form1->Canvas->Pen->Width=3; + Form1->Canvas->Pen->Color=(TColor)8954880; + Form1->Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]); + for(int i=0; i<=466; i+=2) { + vodor[i/2].x = vod[i]; + vodor[i/2].y = vod[i+1]; + } + Form1->Canvas->Polyline(vodor,232); +} +void change1() { + switch(df1) { + case 1: x1-=st1; fy1-=st1; break; + case 2: fy1-=st1; break; + case 3: x1+=st1; fy1-=st1; break; + case 4: x1-=st1; break; + case 6: x1+=st1; break; + case 7: x1+=st1; fy1-=st1; break; + case 8: fy1+=st1; break; + case 9: x1+=st1; fy1+=st1; break; + } + if(x1<10) {x1=10; df1 = random(9);} + else if (x1>(Form1->ClientWidth-160)) {x1 = Form1->ClientWidth-160; df1 = random(9);} + if(fy1<0) {fy1=0; df1 = random(9);} + else if (fy1>(Form1->ClientHeight-50)) {fy1 = Form1->ClientHeight-50; df1 = random(9);} +} + +void change2() { + switch(df2) { + case 1: x2-=st2; fy2-=st2; break; + case 2: fy2-=st2; break; + case 3: x2+=st2; fy2-=st2; break; + case 4: x2-=st2; break; + case 6: x2+=st2; break; + case 7: x2+=st2; fy2-=st2; break; + case 8: fy2+=st2; break; + case 9: x2+=st2; fy2+=st2; break; + } + if(x2<10) {x2=10; df2 = random(9);} + else if (x2>(Form1->ClientWidth-50)) {x2 = Form1->ClientWidth-50; df2 = random(9);} + if(fy2<0) {fy2=0; df2 = random(9);} + else if (fy2>(Form1->ClientHeight-20)) {fy2 = Form1->ClientHeight-20; df2 = random(9);} +} + +void fish1() { + Form1->Canvas->Pen->Width=1; + Form1->Canvas->Pen->Color=(TColor)0; + int dir = 0; + if(df1==3 || df1==6 || df1==9) dir = 158; + Form1->Canvas->MoveTo(p[0].x=t1[0]+x1,p[0].y=t1[1]+fy1); + for(int i=0; i<=150; i+=2) { + p[i/2].x = (dir!=0?t1[i]:-t1[i]+158)+x1; + p[i/2].y = t1[i+1]+fy1; + } + Form1->Canvas->Polyline(p,75); + change1(); +} + +void fish2() { + Form1->Canvas->Pen->Width=1; + Form1->Canvas->Pen->Color=(TColor)0; + int dir = 0; + if(df2==1 || df2==4 || df2==7) dir = 158; + Form1->Canvas->MoveTo(p[0].x=t1[0]/3.2+x2,p[0].y=t1[1]/3.2+fy2); + for(int i=0; i<=150; i+=2) { + p[i/2].x = (dir==0?t1[i]:dir-t1[i])/3.2+x2; + p[i/2].y = (t1[i+1])/4.2+fy2; + } + Form1->Canvas->Polyline(p,75); + change2(); +} + +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=(TColor)13748736; + Canvas->FillRect(aRect); + vodorosli1(); + fish1(); + vodorosli2(); + fish2(); + //Canvas->Brush->Color=8343874; + // + randomize(); + Canvas->TextOutA(250,2,IntToStr(x1)); + if(random(6)==2) { + df1 = random(9); + } + if(random(6)==3) { + df2 = random(9); + } + if(random(6)==4) { + //st1 = 3-st1; + } + if(random(6)==5) { + //st2 = 3-st2; + } + Sleep(100); + FormPaint(this); +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/5/Unit1.ddp b/5/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/5/Unit1.ddp differ diff --git a/5/Unit1.dfm b/5/Unit1.dfm new file mode 100644 index 0000000..ae07f09 --- /dev/null +++ b/5/Unit1.dfm @@ -0,0 +1,16 @@ +object Form1: TForm1 + Left = 241 + Top = 212 + Width = 696 + Height = 480 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnPaint = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/5/Unit1.h b/5/Unit1.h new file mode 100644 index 0000000..8617a45 --- /dev/null +++ b/5/Unit1.h @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif + \ No newline at end of file diff --git a/ColorChooser/Project2.bpr b/ColorChooser/Project2.bpr new file mode 100644 index 0000000..404bd6a --- /dev/null +++ b/ColorChooser/Project2.bpr @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/ColorChooser/Project2.cpp b/ColorChooser/Project2.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/ColorChooser/Project2.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/ColorChooser/Project2.res b/ColorChooser/Project2.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/ColorChooser/Project2.res differ diff --git a/ColorChooser/Unit1.cpp b/ColorChooser/Unit1.cpp new file mode 100644 index 0000000..0f4e6d6 --- /dev/null +++ b/ColorChooser/Unit1.cpp @@ -0,0 +1,143 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +bool up = true; +int mode = 0; +int r=255,g=255,b=255; + +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::FormPaint(TObject *Sender) +{ int h2 = ClientHeight/2; + int w = ClientWidth; + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=(TColor)0xffffff; + Canvas->FillRect(aRect); + //Blue + TRect b1 = Rect(20,20,120,h2); + Canvas->Brush->Color=(TColor)0; + Canvas->FillRect(b1); + b1 = Rect(20,h2-((b*(h2-20)/255)),120,h2); + Canvas->Brush->Color=clBlue; + Canvas->Pen->Color=clBlue; + Canvas->FillRect(b1); + //Green + TRect g1 = Rect(140,20,240,h2); + Canvas->Brush->Color=(TColor)0; + Canvas->FillRect(g1); + g1 = Rect(140,h2-((g*(h2-20)/255)),240,h2); + Canvas->Brush->Color=(TColor)0x00FF00; + Canvas->Pen->Color=(TColor)0x00FF00; + Canvas->FillRect(g1); + //Red + TRect r1 = Rect(260,20,360,h2); + Canvas->Brush->Color=(TColor)0; + Canvas->FillRect(r1); + r1 = Rect(260,h2-((r*(h2-20)/255)),360,h2); + Canvas->Brush->Color=clRed; + Canvas->Pen->Color=clRed; + Canvas->FillRect(r1); + //Cursor + if(mode==0) b1 = Rect(20,20,120,h2); + else if(mode==1) b1 = Rect(140,20,240,h2); + else if(mode==2) b1 = Rect(260,20,360,h2); + Canvas->Pen->Color=clRed; + Canvas->MoveTo(b1.Left,b1.Bottom); + Canvas->LineTo(b1.right,b1.Bottom); + Canvas->Pen->Color=clGreen; + Canvas->MoveTo(b1.Left,b1.Bottom+1); + Canvas->LineTo(b1.right,b1.Bottom+1); + Canvas->Pen->Color=clBlue; + Canvas->MoveTo(b1.Left,b1.Bottom+2); + Canvas->LineTo(b1.right,b1.Bottom+2); + //BGR + TRect all = Rect(0,h2+10,w,h2*2); + Canvas->Brush->Color=(TColor)(b<<16)|(g<<8)|r; + Canvas->FillRect(all); + //Text + Canvas->Brush->Color=clWhite; + Canvas->Font->Color=clRed; + Canvas->TextOutA(23,ClientHeight-30,"bgr= 0x"+IntToHex((b<<16)|(g<<8)|r,6)); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if(((int)Key)==VK_LEFT) { + mode--; + if(mode<0) mode=2; + } + if(((int)Key)==VK_RIGHT) { + mode++; + if(mode>2) mode=0; + } + if(((int)Key)==VK_UP) { + if(mode==0) b++; + else if(mode==1) g++; + else if(mode==2) r++; + if(b>255) b=0; + if(g>255) g=0; + if(r>255) r=0; + } + if(((int)Key)==VK_DOWN) { + if(mode==0) b--; + else if(mode==1) g--; + else if(mode==2) r--; + if(b<0) b=255; + if(g<0) g=255; + if(r<0) r=255; + } + FormPaint(this); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, + int X, int Y) +{ + if(up) return; + int h2 = ClientHeight/2; + //B + if((X>=20) && (X<=120) && (Y>=20) && (Y<=h2)) { + b = 255-(Y-20)*255/(h2-20); + mode = 0; + } + //G + if((X>=140) && (X<=240) && (Y>=20) && (Y<=h2)) { + g = 255-(Y-20)*255/(h2-20); + mode = 1; + } + //R + if((X>=260) && (X<=360) && (Y>=20) && (Y<=h2)) { + r = 255-(Y-20)*255/(h2-20); + mode = 2; + } + FormPaint(this); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + up = false; +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + up = true; +} +//--------------------------------------------------------------------------- + diff --git a/ColorChooser/Unit1.ddp b/ColorChooser/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/ColorChooser/Unit1.ddp differ diff --git a/ColorChooser/Unit1.dfm b/ColorChooser/Unit1.dfm new file mode 100644 index 0000000..4d11006 --- /dev/null +++ b/ColorChooser/Unit1.dfm @@ -0,0 +1,22 @@ +object Form1: TForm1 + Left = 202 + Top = 114 + Width = 380 + Height = 480 + Caption = 'ColorChoser by aNNiMON' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnMouseDown = FormMouseDown + OnMouseMove = FormMouseMove + OnMouseUp = FormMouseUp + OnPaint = FormPaint + OnResize = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/ColorChooser/Unit1.h b/ColorChooser/Unit1.h new file mode 100644 index 0000000..0052355 --- /dev/null +++ b/ColorChooser/Unit1.h @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift); + void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift, + int X, int Y); + void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif + \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..daf22ea --- /dev/null +++ b/main.cpp @@ -0,0 +1,126 @@ +#include +#include +#include +#include + +using namespace std; + +const int n = 20; //- +float a,b; +float X[n], Y[n]; // + +// +void SetColor(int text, int background) +{ + HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdOut, (WORD)((background << 4) | text)); +} + +// +void startApp() { + system("CLS");// + SetColor(2,0);// + cout << "---------------------------------" << endl; + cout << "- Author: Victor aNNiMON Melnik -" << endl; + cout << "---------------------------------" << endl; + SetColor(15,0);// +} + +// a b +void enterAandB() { + cout << endl << "Enter a: "; + cin >> a; + cout << "Enter b: "; + cin >> b; + if(a>b) { + float tmp = a; + a = b; + b = tmp; + } +} + +// X +void calculateX(bool view) { + if(view) cout << "Calculating "<1) Y[i]=pow(X[i],4)+((2*(X[i]*X[i])+3)/(M_PI*X[i]))*sin(X[i])+0.47; + else Y[i]=X[i]*sin(pow(X[i],1/3))+((2*log(fabs(X[i])+1)+1)/(1+2*(cos(X[i]-M_PI/6)* + cos(X[i]-M_PI/6)))); + if(view) cout<'3')) { + cin >> m; + } + switch(m) { + case '0': + viewX=viewY=false; + break; + case '1': + viewX=true; + viewY=false; + break; + case '2': + viewX=false; + viewY=true; + break; + case '3': + viewX=viewY=true; + break; + } + SetColor(2,0);// + calculateX(viewX); + SetColor(2,0);// + calculateY(viewY); +} + +// +void getAnswer(float a, float b) { + int num = 0; + SetColor(14,0);// + for(int i=0; i=a) && (Y[i]<=b)) { + cout << i << ", "; + num++; + } + } + if(num>0) { + cout << " are belong to ["< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/Крестики-Нолики/Project1.cpp b/Крестики-Нолики/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/Крестики-Нолики/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/Крестики-Нолики/Project1.res b/Крестики-Нолики/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/Крестики-Нолики/Project1.res differ diff --git a/Крестики-Нолики/Unit1.cpp b/Крестики-Нолики/Unit1.cpp new file mode 100644 index 0000000..9a2b84d --- /dev/null +++ b/Крестики-Нолики/Unit1.cpp @@ -0,0 +1,98 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +int keyy; +bool isZero = false; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void drawZeroOrX(int x, int y) { + if(isZero) { + Form1->Canvas->Ellipse( + x*(Form1->ClientWidth/3), y*(Form1->ClientHeight/3), + x*(Form1->ClientWidth/3)+(Form1->ClientWidth/3), y*(Form1->ClientHeight/3)+(Form1->ClientHeight/3) + ); + }else{ + Form1->Canvas->MoveTo(x*(Form1->ClientWidth/3), y*(Form1->ClientHeight/3)); + Form1->Canvas->LineTo(x*(Form1->ClientWidth/3)+(Form1->ClientWidth/3), y*(Form1->ClientHeight/3)+(Form1->ClientHeight/3)); + Form1->Canvas->MoveTo(x*(Form1->ClientWidth/3)+(Form1->ClientWidth/3), y*(Form1->ClientHeight/3)); + Form1->Canvas->LineTo(x*(Form1->ClientWidth/3), y*(Form1->ClientHeight/3)+(Form1->ClientHeight/3)); + } + isZero=!isZero; +} + +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=(TColor)0xffffff; + Canvas->FillRect(aRect); + for(int i=1; i<3; i++) { + Canvas->MoveTo(i*ClientWidth/3,0); + Canvas->LineTo(i*ClientWidth/3,ClientHeight); + } + for(int i=1; i<3; i++) { + Canvas->MoveTo(0, i*ClientHeight/3); + Canvas->LineTo(ClientWidth,i*ClientHeight/3); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + //UL + if((XClientWidth/3) && (X<2*ClientWidth/3) && (Y2*ClientWidth/3) && (YClientHeight/3) && (Y<2*ClientHeight/3)) { + drawZeroOrX(0,1); + } + //SS + else if((X>ClientWidth/3) && (X<2*ClientWidth/3) && (Y>ClientHeight/3) && (Y<2*ClientHeight/3)) { + drawZeroOrX(1,1); + } + //SR + else if((X>2*ClientWidth/3) && (Y>ClientHeight/3) && (Y<2*ClientHeight/3)) { + drawZeroOrX(2,1); + } + //DL + if((X2*ClientHeight/3)) { + drawZeroOrX(0,2); + } + //DS + else if((X>ClientWidth/3) && (X<2*ClientWidth/3) && (Y>2*ClientHeight/3)) { + drawZeroOrX(1,2); + } + //DR + else if((X>2*ClientWidth/3) && (Y>2*ClientHeight/3)) { + drawZeroOrX(2,2); + } + Canvas->TextOutA(2,3,IntToStr(keyy)); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + keyy = (int) Key; + //if(((int)Key)==VK_LEFT) drawZeroOrX(0,0); +} +//--------------------------------------------------------------------------- diff --git a/Крестики-Нолики/Unit1.ddp b/Крестики-Нолики/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/Крестики-Нолики/Unit1.ddp differ diff --git a/Крестики-Нолики/Unit1.dfm b/Крестики-Нолики/Unit1.dfm new file mode 100644 index 0000000..5dbb5ff --- /dev/null +++ b/Крестики-Нолики/Unit1.dfm @@ -0,0 +1,20 @@ +object Form1: TForm1 + Left = 208 + Top = 273 + Width = 696 + Height = 480 + Caption = #1050#1088#1077#1089#1090#1080#1082#1080'-'#1053#1086#1083#1080#1082#1080' by aNNiMON' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnMouseUp = FormMouseUp + OnPaint = FormPaint + OnResize = FormPaint + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/Крестики-Нолики/Unit1.h b/Крестики-Нолики/Unit1.h new file mode 100644 index 0000000..fdea0e2 --- /dev/null +++ b/Крестики-Нолики/Unit1.h @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/Редактор/Project1.bpr b/Редактор/Project1.bpr new file mode 100644 index 0000000..c6c5001 --- /dev/null +++ b/Редактор/Project1.bpr @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/Редактор/Project1.cpp b/Редактор/Project1.cpp new file mode 100644 index 0000000..dec5b3e --- /dev/null +++ b/Редактор/Project1.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Unit1.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/Редактор/Project1.res b/Редактор/Project1.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/Редактор/Project1.res differ diff --git a/Редактор/Project1.str b/Редактор/Project1.str new file mode 100644 index 0000000..c7cecc0 Binary files /dev/null and b/Редактор/Project1.str differ diff --git a/Редактор/Unit1.cpp b/Редактор/Unit1.cpp new file mode 100644 index 0000000..a8d8381 --- /dev/null +++ b/Редактор/Unit1.cpp @@ -0,0 +1,142 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Unit1.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +int x=0, y=0; +int step = 5; +bool sp = false; +bool down = false; +bool shtrix = false; +int color = 0x0000ff; +int jir = 2; +bool md = false; +int ip = 0; +TPoint p[1000]; + +void __fastcall TForm1::FormPaint(TObject *Sender) +{ + TRect aRect = Rect(0,0,ClientWidth,ClientHeight); + Canvas->Brush->Color=0xffffff; + Canvas->FillRect(aRect); + Canvas->Pen->Width=jir; + //Canvas->Pen->Mode= + Canvas->Pen->Style=shtrix?psDot:psSolid; + Canvas->Pen->Color=0x0000ff; + Canvas->Brush->Color=0x00ff00; + if(md) for(int i=0; iMoveTo(p[i].x-1,p[i].y-1); + //Canvas->LineTo(p[i].x+1,p[i].y+1); + Canvas->Pixels[p[i].x][p[i].y]=clRed; + + }else Canvas->Polygon(p, ip);//Canvas->Polyline(p,ip); + Canvas->Pen->Color=0xff0000; + Canvas->MoveTo(x,y); + Canvas->LineTo(x,y); + Canvas->Font->Color=0xff0000; + Canvas->TextOutA(23,ClientHeight-30,"x= "+IntToStr(x)+" y= "+IntToStr(y)); + Canvas->TextOutA(123,ClientHeight-30,"step= "+IntToStr(step)); + Canvas->TextOutA(223,ClientHeight-30,": "+IntToStr(ip)); +} + +void zz(int j, int x, int y) { + for(int i=j; i<1000; i++) { + p[i].x = x; + p[i].y = y; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if(((int)Key)==VK_LEFT) { + x -= step; + } + if(((int)Key)==VK_RIGHT) { + x += step; + } + if(((int)Key)==VK_UP) { + y -= step; + } + if(((int)Key)==VK_DOWN) { + y += step; + } + if(((int)Key)==VK_F3) { + step--; + } + if(((int)Key)==VK_F4) { + step++; + } + if(((int)Key)==32) { + zz(ip++,x,y); + //p[ip].x = x; + //p[ip].y = y; + //ip++; + } + if(((int)Key)==13) { + md=!md; + } + if(((int)Key)==VK_BACK) { + zz(ip--,p[ip].x,p[ip].y); + } + if(((int)Key)==VK_ADD) { + jir++; + } + if(((int)Key)==VK_SUBTRACT) { + jir--; + if(jir<=0) jir=1; + } + if(((int)Key)==VK_DELETE) { + zz(ip=0,0,0); + } + if(((int)Key)==VK_HOME) { + Form1->Edit1->Visible=!Form1->Edit1->Visible; + Form1->Edit1->Text="array[1.."+IntToStr(ip)+"]of PointType=\n("; + for(int i=0; iEdit1->Text=Form1->Edit1->Text+ + "(x:"+IntToStr(p[i].x)+"; y:"+IntToStr(p[i].y)+"),"; + if (i%5 == 4) Form1->Edit1->Text=Form1->Edit1->Text+"\n"; + } + Form1->Edit1->Text = Form1->Edit1->Text+"\n);"; + } + FormPaint(this); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + down = false; + zz(ip++,x=X,y=Y); + FormPaint(this); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, + int X, int Y) +{ + if(down) { + zz(ip,x=X,y=Y); + FormPaint(this); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + down = true; +} + + diff --git a/Редактор/Unit1.ddp b/Редактор/Unit1.ddp new file mode 100644 index 0000000..cdc0ee8 Binary files /dev/null and b/Редактор/Unit1.ddp differ diff --git a/Редактор/Unit1.dfm b/Редактор/Unit1.dfm new file mode 100644 index 0000000..d090e6d --- /dev/null +++ b/Редактор/Unit1.dfm @@ -0,0 +1,30 @@ +object Form1: TForm1 + Left = 78 + Top = 583 + Width = 658 + Height = 519 + Caption = 'Editor by aNNiMON' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnMouseDown = FormMouseDown + OnMouseMove = FormMouseMove + OnMouseUp = FormMouseUp + OnPaint = FormPaint + PixelsPerInch = 96 + TextHeight = 13 + object Edit1: TEdit + Left = 520 + Top = 24 + Width = 113 + Height = 89 + ReadOnly = True + TabOrder = 0 + Visible = False + end +end diff --git a/Редактор/Unit1.h b/Редактор/Unit1.h new file mode 100644 index 0000000..ef72f1b --- /dev/null +++ b/Редактор/Unit1.h @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- + +#ifndef Unit1H +#define Unit1H +//--------------------------------------------------------------------------- +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TEdit *Edit1; + void __fastcall FormPaint(TObject *Sender); + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift); + void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift, + int X, int Y); + void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif