.


:




:

































 

 

 

 





5x5 Alt+A

, , , . 5x5 Alt+A Default true, ShortCut ( ) Alt+A.

4. :

| |

| |

|

| |

|

|

|

|

, , .

Ctrl+A | m -

Ctrl+B | k

Ctrl+C | l -

Ctrl+D

ShortCut . Caption , Ctrl+C, ', . Break mbBreak, m mbBarBreak.

5. Memo1. (Font) Courier, . Button1, 1- , : Form2->Show();

1- Form2.

6. Unit1.cpp ():

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

extern int r[50][50],a[50][50],n,m;

extern AnsiString s[50][50],s1[50];

//---------------------------------------------------------------------------

void form()

{ int i,j;

for(i=0;i<n;i++)

for(j=0;j<m;j++)

r[i][j]=random(10);

Form1->Memo1->SetFocus();

Form1->Memo1->Clear();

for(i=0;i<n;i++){

s1[i]="";

for(j=0;j<m;j++){

s[i][j]=" "+IntToStr(r[i][j]);

s1[i]+=s[i][j];}

Form1->Memo1->Lines->Add(s1[i]);}

}

//---------------------------------------------------------------------------

void transp()

{

int i,j;

for(i=0;i<n;i++)

for(j=0;j<m;j++)

a[j][i]=r[i][j];

i=n;n=m;m=i;

Form1->Memo1->SetFocus();

Form1->Memo1->Clear();

for(i=0;i<n;i++){

s1[i]="";

for(j=0;j<m;j++){

s[i][j]=" "+IntToStr(a[i][j]);

s1[i]+=s[i][j];}

Form1->Memo1->Lines->Add(s1[i]);}

}

7. 5x5 Alt+A :

n=m=5;

form();

8. :

n=m=5;

int i,j;

for(i=0;i<n;i++)

for(j=0;j<m;j++)

if(i==j)r[i][j]=1;

else r[i][j]=0;

Memo1->SetFocus();

Memo1->Clear();

for(i=0;i<n;i++){

s1[i]="";

for(j=0;j<m;j++){

s[i][j]=" "+IntToStr(r[i][j]);

s1[i]+=s[i][j];}

Memo1->Lines->Add(s1[i]);}

9. Ctrl+D :

transp();

10. | | Form2 1- . Unit2. MainMenu1, ( Form2-> MainMenu1) :

4x5

11. 1- Button1, , :

Form1->Show();

Form1. Form2->Show(); Form1->Show();

Unit1.cpp 1- Unit2.h #include Unit2.h 1- Unit2.cpp Unit1.h: #include Unit1.h.

. ( ) Ctrl+F12. ( ) Shift+F12. | ( ) F12.

12. Unit2.cpp ():

__fastcall TForm2::TForm2(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

int r[50][50],a[50][50],n,m;

AnsiString s[50][50],s1[50];

void form();

void transp();

13. 4x5 :

n=4; m=5;

form();

14. . , .

15. Form2->MainMenu1 GroupIndex =3, RadioItem = true, AutoCheck = true. . , .

16. GroupIndex =2, GroupIndex =2, GroupIndex =4.

17. . , 1- ( ).

18. MainMenu1 1- AutoMerge true. . , 1- 1- , GroupIndex =2.

19. , , GroupIndex =1. . , 1- .

20. MainMenu1 1- AutoMerge false, .

 

. . , , , . , .

PopupMenu. , PopupMenu . : , , , . PopupMenu, , PopupMenu, .

, PopupMenu, . . , .

 

. 5x5 Alt+A Ctrl+D.

1. PopupMenu1 ( Form1-> PopupMenu1). MainMenu1 .

2. ( Shift , Ctrl , ). , Ctrl+C. , . , , Ctrl+V. ( !) . , , ( ), .

3. PopupMenu Form1 Memo1 PopupMenu1.

4. 5x5 Alt+A : n=m=5;

form();

5. Ctrl+D :

transp();

6. . , , Memo1.

 

HotKey, Win32, , , . , ShortCut.

HotKey, Alt+A. ShortCut - . ,

MOpen->ShortCut = HotKey1->HotKey;

MOpen , HotKey1.

HotKey 1- .

 

1. | | Form3 2- . Unit3.

2. 1- .

Form3->ShowModal();

2- .. , 2- . , 1- Unit2.cpp 2- Unit3.h

#include Unit3.h.

Unit3.cpp Unit2.cpp, Unit3 Unit2: #include Unit2.h.

3. 2- ListBox, , Button1, , Win32 HotKey1, . HotKey1 (Alt+A) HotKey. OK. Label. ListBox1 , ListBox2 , HotKey1 .

ListBox1 , ListBox2 , . HotKey1 , . OK 2- .

4. :

void __fastcall TForm3::FormShow(TObject *Sender)

{

/* ListBox1

OnShow Form3 */

 

ListBox1->Clear();

for(int i=0; i<Form2->MainMenu1->Items->Count; i++)

ListBox1->Items->Add(Form2->MainMenu1->Items->Items[i]->Caption);

ListBox1->ItemIndex=0;

// ListBox2

ListBox1Click(Sender);

}

//---------------------------------------------------------------------------

void __fastcall TForm3::ListBox1Click(TObject *Sender)

{

/* ListBox2

MainMenu1->Items->Items[ListBox1->ItemIndex],

ListBox1

OnShow Form3 */

ListBox2->Clear();

for(int i=0; i<Form2->MainMenu1->Items->Items[

ListBox1->ItemIndex]->Count; i++)

ListBox2->Items->Add(Form2->MainMenu1->Items->Items[

ListBox1->ItemIndex]->Items[i]->Caption);

ListBox2->ItemIndex=0;

// ListBox2Click

ListBox2Click(Sender);

}

//---------------------------------------------------------------------------

void __fastcall TForm3::ListBox2Click(TObject *Sender)

{

/* ListBox2

HotKey1*/

HotKey1->HotKey= Form2->MainMenu1->Items->Items[

ListBox1->ItemIndex]->Items[

ListBox2->ItemIndex]->ShortCut;

}

//---------------------------------------------------------------------------

void __fastcall TForm3::Button1Click(TObject *Sender)

{

/*

2- */

Form2->MainMenu1->Items->Items[

ListBox1->ItemIndex]->Items[ListBox2->ItemIndex]->ShortCut

=HotKey1->HotKey;

Close();

}

//---------------------------------------------------------------------------

 

OnShow Form2 ListBox1 . Form2->MainMenu1->Items->Count-1. Count .

ListBox1 ListBox2. Form2->MainMenu1->Items->Items[ ListBox1->ItemIndex]->Items[i]. Form2->MainMenu1->Items->Items[ListBox1->ItemIndex] , ListBox1. . Items[i] i. ListBox2Click, HotKey1.

5. . . 2- . ListBox2 HotKey1 . , HotKey1 . HotKey1 , . OK 2- .





:


: 2015-10-01; !; : 513 |


:

:

, .
==> ...

1576 - | 1370 -


© 2015-2024 lektsii.org - -

: 0.053 .