LCL (TimeEdit): Centered cell text in hours and minutes grid of TimePopupForm

git-svn-id: trunk@53996 -
This commit is contained in:
wp 2017-01-24 18:46:46 +00:00
parent d0311c6a2c
commit 24077d3218
2 changed files with 23 additions and 8 deletions

View File

@ -25,8 +25,8 @@ object TimePopupForm: TTimePopupForm
BevelOuter = bvNone
BorderWidth = 1
BorderStyle = bsSingle
ClientHeight = 183
ClientWidth = 292
ClientHeight = 181
ClientWidth = 290
Color = clWindow
ParentColor = False
TabOrder = 0
@ -35,7 +35,7 @@ object TimePopupForm: TTimePopupForm
Left = 1
Height = 43
Top = 1
Width = 290
Width = 288
Align = alTop
AutoFillColumns = True
BorderStyle = bsNone
@ -54,6 +54,7 @@ object TimePopupForm: TTimePopupForm
UseXORFeatures = True
OnDblClick = GridsDblClick
OnKeyDown = GridsKeyDown
OnPrepareCanvas = GridPrepareCanvas
ColWidths = (
24
24
@ -66,7 +67,7 @@ object TimePopupForm: TTimePopupForm
24
24
24
26
24
)
Cells = (
24
@ -148,7 +149,7 @@ object TimePopupForm: TTimePopupForm
Left = 1
Height = 59
Top = 61
Width = 290
Width = 288
Align = alTop
AutoFillColumns = True
BorderStyle = bsNone
@ -165,13 +166,14 @@ object TimePopupForm: TTimePopupForm
UseXORFeatures = True
OnDblClick = GridsDblClick
OnKeyDown = GridsKeyDown
OnPrepareCanvas = GridPrepareCanvas
ColWidths = (
48
48
48
48
48
50
48
)
Cells = (
12
@ -217,7 +219,7 @@ object TimePopupForm: TTimePopupForm
Left = 1
Height = 10
Top = 51
Width = 290
Width = 288
Align = alTop
BorderSpacing.Top = 7
Shape = bsTopLine
@ -231,7 +233,7 @@ object TimePopupForm: TTimePopupForm
Height = 22
Hint = 'Ctrl + >'
Top = 125
Width = 136
Width = 134
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 5
Caption = '>>'

View File

@ -35,6 +35,8 @@ type
MoreLessBtn: TBitBtn;
procedure GridsDblClick(Sender: TObject);
procedure GridsKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure GridPrepareCanvas(sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
procedure MoreLessBtnClick(Sender: TObject);
private
FClosed: Boolean;
@ -158,6 +160,17 @@ begin
end;
end;
procedure TTimePopupForm.GridPrepareCanvas(sender: TObject;
aCol, aRow: Integer; aState: TGridDrawState);
var
ts: TTextStyle;
begin
ts := (Sender as TStringGrid).Canvas.TextStyle;
ts.Layout := tlCenter;
ts.Alignment := taCenter;
(Sender as TStringGrid).Canvas.TextStyle := ts;
end;
procedure TTimePopupForm.MoreLessBtnClick(Sender: TObject);
var
OldMin: Integer;