, Additional (. 30) Windows.
. 30. Additional
TBitBtn
Tutton. Glyph, , . Delphi , ( Images/Buttons).
TitBtn Tutton.
:
Glyph .
Kind .
Layout , .
NumGlyphs .
Style , . bsNew Windows 95/NT.
BitBtn , Borland Windows Custom Controls (BWCC). (. 31), Kind, ( Glyph).
. 31. BitBtn
. 31 , bkCustom bkHelp, mrXXX: bkOk mrOk, bkCancel mrCancel .. bkClose mrCancel, . bkHelp , HelpContext , .
TSpeedButton
SpeedButton Panel. , . , . , , , , , . SpeedButton Up (), Disabled (), Down () StayDown (). .
- ( ). GroupIndex:Integer, 0. AllowAllUp: True, , ; AllowAllUp=False, . Down, True, . , .
|
|
TMaskEdit
, , String. , Edit. EditText , Text , .
Delphi , . EditMask .
TStringGrid
. , , . , . . String.
TStringGrid TCustomGrid .
:
BorderStyle .
ColWidths[Index] Index.
DefaultColWidth .
DefaultRowHeight .
EditorMode / . , Options goAlwaysShowEditor goEditing.
FixedColor .
FixedCols .
FixedRows .
GridHeight .
GridLineWidth , .
GridWidth .
LeftCol ,
Options .
RowCount .
RowHeights[Index] Index.
Selection .
TabStops[Index] / Index Tab. , Options goTabs.
TopRow , .
VisibleColCount ,
VisibleRowCount , .
Cells. , : Cells [0,0]:= .
ColCount, RowCount. . Col Row .
Objects[Aol, ARow: Integer] , (ACol, ARow).
:
CellRect(ACol, ARow) ACol ARow.
MouseToCell(X, Y, ACol, ARow) ACol ARow (X, Y) .
C:
OnColumnMoved OnRowMoved .
|
|
OnDrawCell (Col, Row).
OnGetEditMask OnGetEditText . Value TditMask.
OnSelectCell .
OnSetEditText .
OnTopLeftChanged TopRow LeftCol .
StringGrid (. 32). .
, , .
:
procedure TForm1.FormActivate(Sender: TObject);
//
Const Medal: array [0..4] of String [20] =
(C, , , , , );
Country: array [0..11] of String [20] =
(, , , , ,
, , , , , );
Var i: Integer;
begin
For i:= 0 To 5 Do
Tabl.Cells [i,0]:= Medal [i];
For i:= 0 To 11 Do
Tabl.Cells [0,i]:= Country [i];
end;
procedure TForm1.Button1Click(Sender: TObject);
var
c,r:integer; { }
s:integer; { }
p:integer; { }
m:integer; { }
buf:array[0..6] of string; { }
i:integer; { . }
begin
for r:=1 to tabl.rowcount do { }
begin
s:=0;
{ - }
for c:=1 to 3 do
if tabl.cells[c,r] <>
then s:=s+StrToInt(tabl.cells[c,r])
else tabl.cells[c,r]:=0';
{ }
p:=7*StrToInt(tabl.cells[1,r])+6*StrToInt(tabl.cells[2,r])+5*StrToInt(tabl.cells[3,r]);
{ }
tabl.cells[4,r]:=IntToStr(s);
tabl.cells[5,r]:=IntToStr(p);
end;
{ }
for r:=1 to tabl.rowcount-1 do
begin
m:=r; { - r- }
for i:=r to tabl.rowcount-1 do
if StrToInt(tabl.cells[5,i])>StrToInt(tabl.cells[5,m])
then m:=i;
if r <> m then
begin { r- m- }
for c:=0 to 5 do
begin
buf[c]:=tabl.Cells[c,r];
tabl.Cells[c,r]:=tabl.Cells[c,m];
tabl.Cells[c,m]:=buf[c];
end;
end;
end;
end;
TDrawGrid
. TSringGrid . TStringGrid.
TImage
Delphi : , . Canvas , .
, , . Picture. , .
Picture . Picture Ticture. Ticture LoadFromFile, .
- Canvas , Image.
:
OnProgress . Stage (psStarting , psRunning , psEnding ). PercentDone . psStarting TProgressBar, psRunning , psEnding .
|
|
TShape
(. 33), :
stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle , , , , , . . Shape.
. 33. TShape
Brush Color Style. Color , Style . , , , :
Procedure TForm1.FormCreate(Sender: TObject);
Begin
With Shape1 Do
Begin
Shape:= stRectangle; //
Brush.Color:= clYellow; //
Brush.Style:= bsSolid; //
End;
End;
TBevel
, . Shape : , , , , , . Style .
TScrollBox
. , , .
TCheckListBox
, .
Checked[Index] c / Index. State[Index] Index:cbUnchecked ; cbCheked ; cbGrayed
OnClickCheck .
TSplitter
TSplitter , .
. Panel Splitter (. 34). Cursor Splitter crVSplit, Align alClient. Align Splitter alTop.
. 34. Splitter1 Panel1
OnMoved, .
Splitter . , Splitter. Splitter , ( ), Align (alTop ). , , .
TStaticText
StaticText , Label. Label StaticText TWinControl .
|
|
TChart
. . .
. . Series ThartSeries, . , Add .
. , AddX, AddY, AddXY ThartSeries. , OnActivate , . 35:
procedure TForm1.FormActivate(Sender: TObject);
Var y: array [1..10] Of Integer; x: integer;
begin
For x:= 1 To 10 Do
y[x]:= sqr(x);
For x:= 1 To 10 Do
Chart1.Series[0].addxy(x,y[x],,clRed);
end;