tvplanit: Some more improvements in vertical control positioning in event editor.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4955 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-14 12:41:22 +00:00
parent 91137d576a
commit 1c77c991c8
2 changed files with 520 additions and 492 deletions

View File

@ -1,11 +1,11 @@
object DlgEventEdit: TDlgEventEdit object DlgEventEdit: TDlgEventEdit
Left = 417 Left = 417
Height = 388 Height = 422
Top = 211 Top = 211
Width = 697 Width = 697
BorderStyle = bsToolWindow BorderStyle = bsToolWindow
Caption = 'Add / Edit Events' Caption = 'Add / Edit Events'
ClientHeight = 388 ClientHeight = 422
ClientWidth = 697 ClientWidth = 697
Constraints.MinHeight = 378 Constraints.MinHeight = 378
Constraints.MinWidth = 594 Constraints.MinWidth = 594
@ -16,13 +16,13 @@ object DlgEventEdit: TDlgEventEdit
object ButtonPanel: TPanel object ButtonPanel: TPanel
Left = 0 Left = 0
Height = 36 Height = 36
Top = 352 Top = 386
Width = 697 Width = 697
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 36 ClientHeight = 36
ClientWidth = 697 ClientWidth = 697
TabOrder = 2 TabOrder = 0
object ResourceNameLbl: TLabel object ResourceNameLbl: TLabel
Left = 8 Left = 8
Height = 16 Height = 16
@ -62,15 +62,26 @@ object DlgEventEdit: TDlgEventEdit
TabStop = False TabStop = False
end end
end end
object Panel1: TPanel
Left = 0
Height = 386
Top = 0
Width = 697
Align = alClient
BevelOuter = bvNone
BorderWidth = 8
ClientHeight = 386
ClientWidth = 697
TabOrder = 1
object AppointmentGroupBox: TGroupBox object AppointmentGroupBox: TGroupBox
Left = 8 Left = 8
Height = 218 Height = 224
Top = 5 Top = 8
Width = 679 Width = 681
Anchors = [akTop, akLeft, akRight] Align = alTop
Caption = 'Appointment' Caption = 'Appointment'
ClientHeight = 198 ClientHeight = 204
ClientWidth = 675 ClientWidth = 677
TabOrder = 0 TabOrder = 0
object DescriptionLbl: TLabel object DescriptionLbl: TLabel
Left = 5 Left = 5
@ -84,7 +95,7 @@ object DlgEventEdit: TDlgEventEdit
Left = 8 Left = 8
Height = 2 Height = 2
Top = 70 Top = 70
Width = 659 Width = 661
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
Shape = bsTopLine Shape = bsTopLine
end end
@ -92,7 +103,7 @@ object DlgEventEdit: TDlgEventEdit
Left = 8 Left = 8
Height = 2 Height = 2
Top = 160 Top = 160
Width = 659 Width = 661
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
Shape = bsTopLine Shape = bsTopLine
end end
@ -207,7 +218,7 @@ object DlgEventEdit: TDlgEventEdit
} }
end end
object SoundFinderBtn: TSpeedButton object SoundFinderBtn: TSpeedButton
Left = 312 Left = 328
Height = 22 Height = 22
Top = 167 Top = 167
Width = 23 Width = 23
@ -272,7 +283,7 @@ object DlgEventEdit: TDlgEventEdit
Left = 86 Left = 86
Height = 23 Height = 23
Top = 11 Top = 11
Width = 578 Width = 580
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
TabOrder = 0 TabOrder = 0
Text = 'DescriptionEdit' Text = 'DescriptionEdit'
@ -322,7 +333,7 @@ object DlgEventEdit: TDlgEventEdit
Left = 231 Left = 231
Height = 23 Height = 23
Top = 167 Top = 167
Width = 77 Width = 93
ItemHeight = 15 ItemHeight = 15
Style = csDropDownList Style = csDropDownList
TabOrder = 13 TabOrder = 13
@ -536,13 +547,22 @@ object DlgEventEdit: TDlgEventEdit
end end
object NotesMemo: TMemo object NotesMemo: TMemo
Left = 8 Left = 8
Height = 105 Height = 138
Top = 232 Top = 240
Width = 679 Width = 681
Anchors = [akTop, akLeft, akRight, akBottom] Align = alClient
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 1 TabOrder = 1
end end
object Bevel4: TBevel
Left = 8
Height = 8
Top = 232
Width = 681
Align = alTop
Shape = bsSpacer
end
end
object FileDialog: TOpenDialog object FileDialog: TOpenDialog
left = 320 left = 320
top = 256 top = 256

View File

@ -59,9 +59,11 @@ type
TDlgEventEdit = class(TForm) TDlgEventEdit = class(TForm)
AlarmAdvance: TEdit; AlarmAdvance: TEdit;
Bevel4: TBevel;
LocationEdit: TEdit; LocationEdit: TEdit;
LocationLbl: TLabel; LocationLbl: TLabel;
NotesMemo: TMemo; NotesMemo: TMemo;
Panel1: TPanel;
StartDate: TDateEdit; StartDate: TDateEdit;
EndDate: TDateEdit; EndDate: TDateEdit;
RepeatUntil: TDateEdit; RepeatUntil: TDateEdit;
@ -199,8 +201,6 @@ end;
{ TDlgEventEdit } { TDlgEventEdit }
procedure TDlgEventEdit.FormCreate(Sender: TObject); procedure TDlgEventEdit.FormCreate(Sender: TObject);
var
h: Integer;
begin begin
{$IFDEF LCL} {$IFDEF LCL}
StartTime := TTimeEdit.Create(self); StartTime := TTimeEdit.Create(self);
@ -247,14 +247,6 @@ begin
TabOrder := edtUnusedPlaceholder.TabOrder; TabOrder := edtUnusedPlaceholder.TabOrder;
end; end;
IntervalUpDown.Associate := FCustomInterval; IntervalUpDown.Associate := FCustomInterval;
// This is needed as workaround for the combobox height at higher dpi.
// We design it with Style csDropdown where the height is correct, and then
// use the corresponding, correct ItemHeight after switching to csOwnerDrawFixed
// (which is needed to draw the color boxes).
h := Category.ItemHeight;
Category.Style := csOwnerDrawFixed;
Category.ItemHeight := h;
end; end;
{=====} {=====}
@ -621,8 +613,16 @@ const
VDIST = 5; VDIST = 5;
VBEVELDIST = 8; VBEVELDIST = 8;
var var
w: Integer; w, h: Integer;
begin begin
// This is needed as workaround for the combobox height at higher dpi.
// We design it with Style csDropdown where the height is correct, and then
// use the corresponding, correct ItemHeight after switching to csOwnerDrawFixed
// (which is needed to draw the color boxes).
h := Category.ItemHeight;
Category.Style := csOwnerDrawFixed;
Category.ItemHeight := h+1;
// *** Horizontal positions *** // *** Horizontal positions ***
// Position controls according to label widths // Position controls according to label widths
@ -727,9 +727,17 @@ begin
AppointmentGroupbox.ClientHeight := BottomOf(AlarmAdvance) + VBEVELDIST; AppointmentGroupbox.ClientHeight := BottomOf(AlarmAdvance) + VBEVELDIST;
NotesMemo.Top := BottomOf(AppointmentGroupbox) + VBEVELDIST; OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn));
CancelBtn.Width := OKBtn.Width;
CancelBtn.Left := ButtonPanel.ClientWidth - ResourcenameLbl.Left - CancelBtn.Width;
OKBtn.Left := CancelBtn.Left - DELTA - OKBtn.Width;
ResourceNameLbl.Top := (ButtonPanel.ClientHeight - Panel1.BorderWidth - ResourceNameLbl.Height) div 2;
OKBtn.Top := (ButtonPanel.ClientHeight - Panel1.BorderWidth - OKBtn.Height) div 2;
CancelBtn.Top := OKBtn.Top;
ClientHeight := BottomOf(NotesMemo) + VBEVELDIST + ButtonPanel.Height; // NotesMemo.Top := BottomOf(AppointmentGroupbox) + VBEVELDIST;
// ClientHeight := BottomOf(NotesMemo) + VBEVELDIST + ButtonPanel.Height;
end; end;