On-Line  www.XServer.ru - , , , ,  .
                                      
     XServer.ru




...




 

SDI

SDI (Single Document Interface) - , . Notepad, . 1.12, .
. -, .. , . . Wordpad (. . 1.5), OLE- . SDI-, ( ) Wordpad.

. 1.12. Notepad SDI-

, , ( . 1.13 Wordpad). Delphi FormStyle fsSizeToolWin fsToolWindow.
Delphi - , , , ... SDI-, .

. 1.13. Wordpad - SDI-

SDI-
SDI .
.


. , .

1. File/New Application, .


: Delphi SDI-. .

2. .

Caption Image Viewer
Name frmMain
ShowHint True

3. TPanel . .

Align alTop
Caption -

4. TSpeedButton TPanel spbtnLoad, spbtnStretch spbtnCenter. .

spbtnLoad.Hint Load
spbtnLoad.Left 8
spbtnLoad.Top 8
spbtnStretch.AllowAlIUp True
spbtnStretch.Grouplndex 1
spbtnStretch.Hint Stretch
spbtnStretch.Left 48
spbtnStretch.Top 8
spbtnCenter.AllowAlIUp True
spbtnCenter.Grouplndex 2
spbtnCenter.Hint Center
spbtnCenter.Left 80
spbtnCenter.Top 8

5. TPanel .

Align alClient
Caption -

6. Image Panel .

Align alClient
Name imgMain

7. TOpenDialog .

Filter Bitmaps (*.bmp)|*.bmp
Name opndlgLoad
Options [ofPathMustExist,ofFileMustExist]

Delphi TSpeedButton; IMAGES\BUTTONS. Glyph.


spbtnLoad.Glyph FLDROPEN.BMP
spbtnStretch.Glyph FONTSIZE.BMP
spbtnCenter.Glyph PICTURE.BMP

, File/Save Project As. Unit1 Main, - EgSDIApp.


, , . .
1. spbtnLoad, Delphi OnClick.
2. .

if opndlgLoad.Execute then
imgMain.Picture.LoadFromFile(opndlgLoad.FileName);

opndlgLoad.Execute . , True FileName . Cancel <Esc> False.
TImage Picture, TPicture. , . , LoadFromFile, .
Run/Run .
.
1. spbtnStretch, Delphi OnClick.
2. .

imgMain.Stretch:= spbtnStretch.Down;

TSpeedButton Down, True . Stretch TImage .
( spbtnCenter) :

imgMain.Center:= spbtnCenter.Down;

             



 
 |   |   |   |   |