tvplanit: Fix positioning of controls in event editor for gtk2

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5002 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-18 23:15:02 +00:00
parent 7119c27a3b
commit ccc86f27cf
2 changed files with 517 additions and 470 deletions

File diff suppressed because it is too large Load Diff

View File

@ -73,6 +73,9 @@ type
LocationLbl: TLabel; LocationLbl: TLabel;
NotesMemo: TMemo; NotesMemo: TMemo;
Panel1: TPanel; Panel1: TPanel;
PanelAlarm: TPanel;
PanelTimes: TPanel;
PanelDescription: TPanel;
StartDate: TDateEdit; StartDate: TDateEdit;
EndDate: TDateEdit; EndDate: TDateEdit;
RepeatUntil: TDateEdit; RepeatUntil: TDateEdit;
@ -214,10 +217,10 @@ begin
StartTime := TTimeEdit.Create(self); StartTime := TTimeEdit.Create(self);
{$ELSE} {$ELSE}
StartTime := TCombobox.Create(self); StartTime := TCombobox.Create(self);
StartTime.Width := 83;
StartTime.ItemIndex := -1; StartTime.ItemIndex := -1;
{$ENDIF} {$ENDIF}
StartTime.Parent := AppointmentGroupbox; StartTime.Width := 83;
StartTime.Parent := PanelTimes;
StartTime.Left := AlarmAdvanceType.Left; StartTime.Left := AlarmAdvanceType.Left;
StartTime.Top := StartDate.Top; StartTime.Top := StartDate.Top;
StartTime.TabOrder:= StartDate.TabOrder+ 1; StartTime.TabOrder:= StartDate.TabOrder+ 1;
@ -226,10 +229,10 @@ begin
EndTime := TTimeEdit.Create(self); EndTime := TTimeEdit.Create(self);
{$ELSE} {$ELSE}
EndTime := TCombobox.Create(self); EndTime := TCombobox.Create(self);
EndTime.Width := 93;
EndTime.ItemIndex := -1; EndTime.ItemIndex := -1;
{$ENDIF} {$ENDIF}
EndTime.Parent := AppointmentGroupbox; EndTime.Width := 83;
EndTime.Parent := PanelTimes;
EndTime.Left := AlarmAdvanceType.Left; EndTime.Left := AlarmAdvanceType.Left;
EndTime.Top := EndDate.Top; EndTime.Top := EndDate.Top;
EndTime.TabOrder := EndDate.TabOrder + 1; EndTime.TabOrder := EndDate.TabOrder + 1;
@ -245,7 +248,7 @@ begin
FCustomInterval := TVpRightAlignedEdit.Create(Self); FCustomInterval := TVpRightAlignedEdit.Create(Self);
with FCustomInterval do begin with FCustomInterval do begin
Parent := AppointmentGroupbox; Parent := PanelTimes;
Top := IntervalUpDown.Top + 1; Top := IntervalUpDown.Top + 1;
Left := IntervalUpDown.Left - 65; Left := IntervalUpDown.Left - 65;
Height := IntervalUpDown.Height - 1; Height := IntervalUpDown.Height - 1;
@ -628,6 +631,7 @@ end;
procedure TDlgEventEdit.PositionControls; procedure TDlgEventEdit.PositionControls;
const const
DELTA = 8; DELTA = 8;
VDELTA = 8;
VDIST = 5; VDIST = 5;
VBEVELDIST = 8; VBEVELDIST = 8;
var var
@ -646,7 +650,7 @@ begin
// Position controls according to label widths // Position controls according to label widths
w := MaxValue([GetLabelWidth(DescriptionLbl), GetLabelWidth(LocationLbl), GetLabelWidth(StartTimeLbl), GetLabelWidth(EndTimeLbl)]); w := MaxValue([GetLabelWidth(DescriptionLbl), GetLabelWidth(LocationLbl), GetLabelWidth(StartTimeLbl), GetLabelWidth(EndTimeLbl)]);
DescriptionEdit.Left := w + 2*DELTA; DescriptionEdit.Left := w + 2*DELTA;
DescriptionEdit.Width := AppointmentGroupbox.ClientWidth - DescriptionEdit.Left - DELTA; DescriptionEdit.Width := PanelDescription.ClientWidth - DescriptionEdit.Left - DELTA;
DescriptionLbl.Left := DescriptionEdit.Left - GetLabelWidth(DescriptionLbl) - DELTA; DescriptionLbl.Left := DescriptionEdit.Left - GetLabelWidth(DescriptionLbl) - DELTA;
LocationEdit.Left := DescriptionEdit.Left; LocationEdit.Left := DescriptionEdit.Left;
@ -705,15 +709,17 @@ begin
CategoryLbl.Left := Category.Left - DELTA - GetLabelWidth(CategoryLbl); CategoryLbl.Left := Category.Left - DELTA - GetLabelWidth(CategoryLbl);
// *** Vertical positions *** // *** Vertical positions ***
DescriptionEdit.Top := VDELTA;
DescriptionLbl.Top := DescriptionEdit.Top + (DescriptionEdit.Height - DescriptionLbl.Height) div 2; DescriptionLbl.Top := DescriptionEdit.Top + (DescriptionEdit.Height - DescriptionLbl.Height) div 2;
LocationEdit.Top := BottomOf(DescriptionEdit) + VDIST; LocationEdit.Top := BottomOf(DescriptionEdit) + VDIST;
LocationLbl.Top := LocationEdit.Top + (LocationEdit.Height - LocationLbl.Height) div 2; LocationLbl.Top := LocationEdit.Top + (LocationEdit.Height - LocationLbl.Height) div 2;
CategoryLbl.Top := LocationLbl.Top; CategoryLbl.Top := LocationLbl.Top;
Category.Top := LocationEdit.Top; Category.Top := LocationEdit.Top;
PanelDescription.ClientHeight := BottomOf(LocationEdit) + VDIST;
Bevel1.Top := BottomOf(LocationEdit) + VBEVELDIST; // Bevel1.Top := BottomOf(LocationEdit) + VBEVELDIST;
imgClock.Top := Bevel1.Top + 2 + VBEVELDIST; imgClock.Top := VDELTA; //Bevel1.Top + 2 + VBEVELDIST;
CbAllDay.Top := imgClock.Top; CbAllDay.Top := imgClock.Top;
imgRecurring.Top := imgClock.Top; imgRecurring.Top := imgClock.Top;
@ -731,10 +737,11 @@ begin
IntervalLbl.Top := RecurringLbl.Top; IntervalLbl.Top := RecurringLbl.Top;
RepeatUntil.Top := EndDate.Top; RepeatUntil.Top := EndDate.Top;
RecurrenceEndsLbl.Top := RepeatUntil.Top + (RepeatUntil.Height - RecurrenceEndsLbl.Height) div 2; RecurrenceEndsLbl.Top := RepeatUntil.Top + (RepeatUntil.Height - RecurrenceEndsLbl.Height) div 2;
PanelTimes.ClientHeight := BottomOf(EndDate) + VDELTA;
Bevel3.Top := VDELTA;
Bevel3.Height := PanelTimes.ClientHeight - 2*VDELTA;
Bevel2.Top := BottomOf(EndDate) + VBEVELDIST; imgAlarm.Top := VDELTA;
imgAlarm.Top := Bevel2.Top + 2 + VBEVELDIST;
AlarmAdvance.Top := imgAlarm.Top; AlarmAdvance.Top := imgAlarm.Top;
AdvanceUpdown.Top := AlarmAdvance.Top; AdvanceUpdown.Top := AlarmAdvance.Top;
AlarmSet.Top := AlarmAdvance.Top + (AlarmAdvance.Height - AlarmSet.Height) div 2; AlarmSet.Top := AlarmAdvance.Top + (AlarmAdvance.Height - AlarmSet.Height) div 2;
@ -742,8 +749,7 @@ begin
SoundFinderBtn.Height := AlarmAdvanceType.Height; SoundFinderBtn.Height := AlarmAdvanceType.Height;
SoundFinderBtn.Width := SoundFinderBtn.Height; SoundFinderBtn.Width := SoundFinderBtn.Height;
SoundFinderBtn.Top := AlarmAdvanceType.Top; SoundFinderBtn.Top := AlarmAdvanceType.Top;
PanelAlarm.ClientHeight := BottomOf(AlarmAdvance) + VDIST;
AppointmentGroupbox.ClientHeight := BottomOf(AlarmAdvance) + VBEVELDIST;
OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn)); OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn));
CancelBtn.Width := OKBtn.Width; CancelBtn.Width := OKBtn.Width;
@ -753,9 +759,11 @@ begin
OKBtn.Top := (ButtonPanel.ClientHeight - Panel1.BorderWidth - OKBtn.Height) div 2; OKBtn.Top := (ButtonPanel.ClientHeight - Panel1.BorderWidth - OKBtn.Height) div 2;
CancelBtn.Top := OKBtn.Top; CancelBtn.Top := OKBtn.Top;
// NotesMemo.Top := BottomOf(AppointmentGroupbox) + VBEVELDIST; NotesMemo.Top := BottomOf(AppointmentGroupbox) + Bevel4.Height;
NotesMemo.Width := AppointmentGroupbox.Width;
NotesMemo.Left := AppointmentGroupbox.Left;
// ClientHeight := BottomOf(NotesMemo) + VBEVELDIST + ButtonPanel.Height; ClientHeight := AppointmentGroupbox.Height + Bevel4.Height + NotesMemo.Height + ButtonPanel.Height;
end; end;