//
// Save1Click
If Result = IDYES Then Save1Click(Sender);
//
If Result = IDCANCEL Then Exit;
end ;
// Memo,
If Memo.Lines.Count > 0 Then Memo.Clear;
// FileName SaveDialog
// ( )
SaveDialog.FileName:= ;
end ;
2. Open File. , Memo , , . New, :
New1Click(Sender);
FileOpen. Ok LoadFromFile;
New1Click(Sender); //
// FileName
OpenDialog.FileName:= ;
If OpenDialog.Execute Then //
begin
// ,
//
Memo.Lines.LoadFromFile(OpenDialog.FileName);
//
// ,
SaveDialog.FileName:= OpenDialog.FileName;
end ;
3. Save :
//
If SaveDialog.FileName <> Then
Begin
//
Memo.Lines.SaveToFile(SaveDialog.FileName);
//
Memo.Modified:= false;
End
//
else SaveAs1Click(Sender);
4. SaveAs ( ) :
If SaveDialog.Execute Then
Begin
Memo.Lines.SaveToFile(SaveDialog.FileName);
Memo.Modified:= false;
End;
5. ᒺ, Open Save.
6. Exit1, Close;
7. Cut Memo.CutToClipboard; Copy Memo.CopyToClipboard; Paste Memo.PasteFromClipboard; Select All Memo.SelectAll;
8. (File → Save All). .
3. About. ³ About (, , , , ). ³ About Ok.
1. About Help : AboutBox.ShowModal;
ShowModal . , .
|
|
2. About ( New Form ). About.
3. About. AboutBox, (Caption)
4. BorderStyle bsDialog ( ).
5. Label ( Standard) ( Font Label).
6. ( ) Image ( Additional). Picture ( \Program Files\ Common Files\ Borland Shared\ Images\ Icons). .
7. About BitBtn ( Additional). Kind bkOk. BitBtn .
8. About Bevel ( Additional). Bevel ᒺ . Shape bsFrame.
9. , About Uses About. : File Use Unit About.
4.
1. Delphi Hint , ShowHint true. ; , FileOpenBtn Hint ³. .
2. ϳ , |, , FileOpenBtn Hint ³ | . Hint, StatusBar .
, 䳿 OnHint, (Application) . ᒺ, .
䳿 OnCreate ( ) Editor ( OnCreate ᒺ) :
Application.OnHint:= DisplayHint;
, 䳿 OnHint ( ), (Application) DisplayHint.
DisplayHint. TEditor , :
procedure DisplayHint(Sender: TObject);
public.
DisplayHint. implementation DisplayHint, SimpleText StatusBar Hint:
|
|
procedure TEditor.DisplayHint(Sender: TObject);
Begin
StatusBar.SimpleText:= GetLongHint(Application.Hint);
End;
GetLongHint ( |) Hint.
1. ? , , ? ?
2. About. ? ? ? ? BitBtn?
3. ? - 䳿, ᒺ?
6
: .
: 㳺 Windows (Multiple Document Interface).
1.
1. .
2. MainForm, Picture Editor, 450, 575 , FormStyle fsMDIForm ( , MDI ).
3. MainMenu ( Standard) MainMenu. MainMenu , ( ), Insert From Template ( ). , , File Menu ( ) Window Menu ( ). File Print Print Setup, Window New Window, Hide Show. . .
4. MainUnit, PixEditor.
2. ()
1. ( New Form ).
2. Child, , clWhite, FormStyle fsMDIhild ( FormStyle ).
3. Image ( Additional). Image, Stretch true ( Image), Align alClient ( ).
4. ChildUnit.
5. (MainUnit) ChildUnit. , File Use Unit ChildUnit.
6. . Picture Editor () Child. , , / .
, .
, 䳿 OnClose ( 䳿 OnClose ᒺ Child) :
Action:= caFree;
caFree ( ) Action, 䳿 OnClose. , MDI Action caMinimize, .
|
|
.
7. , Child, Child .
, Child , Project Options, Forms. Child Autocreate forms ( ) Available forms ( ).
.