You've already forked lazarus-ccr
tvplanit: Fix vertical arrangement of controls in event editor at > 96 dpi
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4947 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -13,7 +13,7 @@ object DlgEventEdit: TDlgEventEdit
|
|||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.7'
|
||||||
object Panel1: TPanel
|
object ButtonPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 36
|
Height = 36
|
||||||
Top = 352
|
Top = 352
|
||||||
@ -86,6 +86,7 @@ object DlgEventEdit: TDlgEventEdit
|
|||||||
Top = 70
|
Top = 70
|
||||||
Width = 659
|
Width = 659
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
Shape = bsTopLine
|
||||||
end
|
end
|
||||||
object Bevel2: TBevel
|
object Bevel2: TBevel
|
||||||
Left = 8
|
Left = 8
|
||||||
@ -93,6 +94,7 @@ object DlgEventEdit: TDlgEventEdit
|
|||||||
Top = 160
|
Top = 160
|
||||||
Width = 659
|
Width = 659
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
Shape = bsTopLine
|
||||||
end
|
end
|
||||||
object CategoryLbl: TLabel
|
object CategoryLbl: TLabel
|
||||||
Left = 403
|
Left = 403
|
||||||
|
@ -65,7 +65,7 @@ type
|
|||||||
StartDate: TDateEdit;
|
StartDate: TDateEdit;
|
||||||
EndDate: TDateEdit;
|
EndDate: TDateEdit;
|
||||||
RepeatUntil: TDateEdit;
|
RepeatUntil: TDateEdit;
|
||||||
Panel1: TPanel;
|
ButtonPanel: TPanel;
|
||||||
OKBtn: TButton;
|
OKBtn: TButton;
|
||||||
CancelBtn: TButton;
|
CancelBtn: TButton;
|
||||||
ResourceNameLbl: TLabel;
|
ResourceNameLbl: TLabel;
|
||||||
@ -613,9 +613,13 @@ end;
|
|||||||
procedure TDlgEventEdit.PositionControls;
|
procedure TDlgEventEdit.PositionControls;
|
||||||
const
|
const
|
||||||
DELTA = 8;
|
DELTA = 8;
|
||||||
|
VDIST = 5;
|
||||||
|
VBEVELDIST = 8;
|
||||||
var
|
var
|
||||||
w: Integer;
|
w: Integer;
|
||||||
begin
|
begin
|
||||||
|
// *** Horizontal positions ***
|
||||||
|
|
||||||
// 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;
|
||||||
@ -672,10 +676,55 @@ begin
|
|||||||
end;
|
end;
|
||||||
SoundFinderBtn.Left := AlarmAdvanceType.Left + AlarmAdvanceType.Width + 2;
|
SoundFinderBtn.Left := AlarmAdvanceType.Left + AlarmAdvanceType.Width + 2;
|
||||||
|
|
||||||
Width := IntervalUpdown.Left + IntervalUpdown.Width + DELTA + Width - AppointmentGroupbox.ClientWidth;
|
Width := RightOf(IntervalUpdown) + DELTA + Width - AppointmentGroupbox.ClientWidth;
|
||||||
|
|
||||||
Category.Left := DescriptionEdit.Left + DescriptionEdit.Width - category.Width;
|
Category.Left := DescriptionEdit.Left + DescriptionEdit.Width - category.Width;
|
||||||
CategoryLbl.Left := Category.Left - DELTA - GetLabelWidth(CategoryLbl);
|
CategoryLbl.Left := Category.Left - DELTA - GetLabelWidth(CategoryLbl);
|
||||||
|
|
||||||
|
// *** Vertical positions ***
|
||||||
|
DescriptionLbl.Top := DescriptionEdit.Top + (DescriptionEdit.Height - DescriptionLbl.Height) div 2;
|
||||||
|
LocationEdit.Top := BottomOf(DescriptionEdit) + VDIST;
|
||||||
|
LocationLbl.Top := LocationEdit.Top + (LocationEdit.Height - LocationLbl.Height) div 2;
|
||||||
|
CategoryLbl.Top := LocationLbl.Top;
|
||||||
|
Category.Top := LocationEdit.Top;
|
||||||
|
|
||||||
|
Bevel1.Top := BottomOf(LocationEdit) + VBEVELDIST;
|
||||||
|
|
||||||
|
imgClock.Top := Bevel1.Top + 2 + VBEVELDIST;
|
||||||
|
CbAllDay.Top := imgClock.Top;
|
||||||
|
imgRecurring.Top := imgClock.Top;
|
||||||
|
|
||||||
|
StartDate.Top := BottomOf(CbAllDay) + VDIST;
|
||||||
|
StartTime.Top := StartDate.Top;
|
||||||
|
StartTimeLbl.Top := StartDate.Top + (StartDate.Height - StartTimeLbl.Height) div 2;
|
||||||
|
EndDate.Top := BottomOf(StartDate) + VDIST;
|
||||||
|
EndTime.Top := EndDate.Top;
|
||||||
|
EndTimeLbl.Top := EndDate.Top + (EndDate.Height - EndTimeLbl.Height) div 2;
|
||||||
|
RecurringType.Top := StartDate.Top;
|
||||||
|
edtUnusedPlaceHolder.Top := RecurringType.Top;
|
||||||
|
FCustomInterval.Top := RecurringType.Top;
|
||||||
|
IntervalUpDown.Top := FCustomInterval.Top;
|
||||||
|
RecurringLbl.Top := RecurringType.Top - 4 - RecurringLbl.Height;
|
||||||
|
IntervalLbl.Top := RecurringLbl.Top;
|
||||||
|
RepeatUntil.Top := EndDate.Top;
|
||||||
|
RecurrenceEndsLbl.Top := RepeatUntil.Top + (RepeatUntil.Height - RecurrenceEndsLbl.Height) div 2;
|
||||||
|
|
||||||
|
Bevel2.Top := BottomOf(EndDate) + VBEVELDIST;
|
||||||
|
|
||||||
|
imgAlarm.Top := Bevel2.Top + 2 + VBEVELDIST;
|
||||||
|
AlarmAdvance.Top := imgAlarm.Top;
|
||||||
|
AdvanceUpdown.Top := AlarmAdvance.Top;
|
||||||
|
AlarmSet.Top := AlarmAdvance.Top + (AlarmAdvance.Height - AlarmSet.Height) div 2;
|
||||||
|
AlarmAdvanceType.Top := AlarmAdvance.Top;
|
||||||
|
SoundFinderBtn.Height := AlarmAdvanceType.Height;
|
||||||
|
SoundFinderBtn.Width := SoundFinderBtn.Height;
|
||||||
|
SoundFinderBtn.Top := AlarmAdvanceType.Top;
|
||||||
|
|
||||||
|
AppointmentGroupbox.ClientHeight := BottomOf(AlarmAdvance) + VBEVELDIST;
|
||||||
|
|
||||||
|
NotesMemo.Top := BottomOf(AppointmentGroupbox) + VBEVELDIST;
|
||||||
|
|
||||||
|
ClientHeight := BottomOf(NotesMemo) + VBEVELDIST + ButtonPanel.Height;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@ function WidthOf(const R : TRect) : Integer;
|
|||||||
{- return the width of the TRect}
|
{- return the width of the TRect}
|
||||||
function RightOf(AControl: TControl): Integer;
|
function RightOf(AControl: TControl): Integer;
|
||||||
{- returns the right edge of a control }
|
{- returns the right edge of a control }
|
||||||
|
function BottomOf(AControl: TControl): Integer;
|
||||||
|
{- returns the bottom edge of a control }
|
||||||
|
|
||||||
function GetDisplayString(Canvas : TCanvas; const S : string;
|
function GetDisplayString(Canvas : TCanvas; const S : string;
|
||||||
MinChars, MaxWidth : Integer) : string;
|
MinChars, MaxWidth : Integer) : string;
|
||||||
@ -605,6 +607,11 @@ begin
|
|||||||
Result := AControl.Left + AControl.Width;
|
Result := AControl.Left + AControl.Width;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function Bottomof(AControl: TControl): Integer;
|
||||||
|
begin
|
||||||
|
Result := AControl.Top + AControl.Height;
|
||||||
|
end;
|
||||||
|
|
||||||
function SameDate(dt1, dt2: TDateTime): Boolean;
|
function SameDate(dt1, dt2: TDateTime): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := trunc(dt1) = trunc(dt2);
|
Result := trunc(dt1) = trunc(dt2);
|
||||||
|
Reference in New Issue
Block a user