You've already forked lazarus-ccr
tvplanit: Improvement of vertical alignment in various forms
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4956 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9,6 +9,9 @@
|
|||||||
<Title Value="demo"/>
|
<Title Value="demo"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
</General>
|
</General>
|
||||||
<i18n>
|
<i18n>
|
||||||
<EnableI18N Value="True"/>
|
<EnableI18N Value="True"/>
|
||||||
@ -65,6 +68,9 @@
|
|||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<Linking>
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseExternalDbgSyms Value="True"/>
|
||||||
|
</Debugging>
|
||||||
<Options>
|
<Options>
|
||||||
<Win32>
|
<Win32>
|
||||||
<GraphicApplication Value="True"/>
|
<GraphicApplication Value="True"/>
|
||||||
|
@ -25,9 +25,9 @@ object MainForm: TMainForm
|
|||||||
Height = 532
|
Height = 532
|
||||||
Top = 48
|
Top = 48
|
||||||
Width = 780
|
Width = 780
|
||||||
ActivePage = TabSettings
|
ActivePage = TabEvents
|
||||||
Align = alClient
|
Align = alClient
|
||||||
TabIndex = 4
|
TabIndex = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object TabEvents: TTabSheet
|
object TabEvents: TTabSheet
|
||||||
Caption = 'Events'
|
Caption = 'Events'
|
||||||
|
@ -108,6 +108,7 @@ type
|
|||||||
FActiveView: Integer;
|
FActiveView: Integer;
|
||||||
FVisibleDays: Integer;
|
FVisibleDays: Integer;
|
||||||
procedure PopulateLanguages;
|
procedure PopulateLanguages;
|
||||||
|
procedure PositionControls;
|
||||||
procedure SetActiveView(AValue: Integer);
|
procedure SetActiveView(AValue: Integer);
|
||||||
procedure SetLanguage(ALang: String); overload;
|
procedure SetLanguage(ALang: String); overload;
|
||||||
procedure SetLanguage(AIndex: Integer); overload;
|
procedure SetLanguage(AIndex: Integer); overload;
|
||||||
@ -487,6 +488,38 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.PositionControls;
|
||||||
|
var
|
||||||
|
w: Integer;
|
||||||
|
begin
|
||||||
|
// Settings page
|
||||||
|
w := MaxValue([
|
||||||
|
GetLabelWidth(LblLanguage),
|
||||||
|
GetLabelWidth(LblTimeFormat),
|
||||||
|
GetLabelWidth(LblFirstDayOfWeek),
|
||||||
|
GetLabelWidth(LblAddressBuilder)
|
||||||
|
]);
|
||||||
|
CbLanguages.Left := 24 + w + 8;
|
||||||
|
CbTimeFormat.Left := CbLanguages.Left;
|
||||||
|
CbFirstDayOfWeek.Left := CbLanguages.Left;
|
||||||
|
CbAddressBuilder.Left := CbLanguages.Left;
|
||||||
|
LblLanguage.Left := CbLanguages.Left - 8 - GetLabelWidth(LblLanguage);
|
||||||
|
LblTimeFormat.Left := CbTimeFormat.Left - 8 - GetLabelWidth(LblTimeFormat);
|
||||||
|
LblFirstDayOfWeek.Left := CbFirstDayOfWeek.Left - 8 - GetLabelWidth(LblFirstDayOfWeek);
|
||||||
|
LblAddressBuilder.Left := CbAddressBuilder.Left - 8 - GetLabelWidth(LblAddressBuilder);
|
||||||
|
|
||||||
|
CbAllowInplaceEditing.Left := CbLanguages.Left + CbLanguages.Width + 32;
|
||||||
|
w := GetLabelWidth(LblDrawingStyle);
|
||||||
|
lblDrawingStyle.Left := CbAllowInplaceEditing.Left;
|
||||||
|
CbDrawingStyle.Left := LblDrawingStyle.Left + w + 8;
|
||||||
|
|
||||||
|
// Planner pages
|
||||||
|
DaysTrackbar.Left := GetLabelWidth(LblVisibleDays) + LblVisibleDays.Left + 8;
|
||||||
|
LblGranularity.Left := DaysTrackbar.Left + DaysTrackbar.Width + 32;
|
||||||
|
CbGranularity.Left := LblGranularity.Left + GetLabelWidth(LblGranularity) + 8;
|
||||||
|
RbHideCompletedTasks.Left := RbAllTasks.Left + RbAllTasks.Width + 48;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.RbAllTasksChange(Sender: TObject);
|
procedure TMainForm.RbAllTasksChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
VpTaskList1.DisplayOptions.ShowAll := RbAllTasks.Checked;
|
VpTaskList1.DisplayOptions.ShowAll := RbAllTasks.Checked;
|
||||||
@ -725,23 +758,6 @@ begin
|
|||||||
CbDrawingStyle.Items.Add(RS3d);
|
CbDrawingStyle.Items.Add(RS3d);
|
||||||
CbDrawingStyle.Items.Add(RSBorderless);
|
CbDrawingStyle.Items.Add(RSBorderless);
|
||||||
|
|
||||||
DaysTrackbar.Left := GetLabelWidth(LblVisibleDays) + LblVisibleDays.Left + 8;
|
|
||||||
LblGranularity.Left := DaysTrackbar.Left + DaysTrackbar.Width + 32;
|
|
||||||
CbGranularity.Left := LblGranularity.Left + GetLabelWidth(LblGranularity) + 8;
|
|
||||||
w := MaxValue([GetLabelWidth(LblLanguage), GetLabelWidth(LblTimeFormat), GetLabelWidth(LblFirstDayOfWeek)]);
|
|
||||||
CbLanguages.Left := 24 + w + 8;
|
|
||||||
LblLanguage.Left := CbLanguages.Left - 8 - GetLabelWidth(LblLanguage);
|
|
||||||
CbTimeFormat.Left := CbLanguages.Left;
|
|
||||||
LblTimeFormat.Left := CbTimeFormat.Left - 8 - GetLabelWidth(LblTimeFormat);
|
|
||||||
CbFirstDayOfWeek.Left := CbLanguages.Left;
|
|
||||||
LblFirstDayOfWeek.Left := CbFirstDayOfWeek.Left - 8 - GetLabelWidth(LblFirstDayOfWeek);
|
|
||||||
CbAddressBuilder.Left := CbLanguages.Left;
|
|
||||||
LblAddressBuilder.Left := CbAddressBuilder.Left - 8 - GetLabelWidth(LblAddressBuilder);
|
|
||||||
CbAllowInplaceEditing.Left := CbLanguages.Left + CbLanguages.Width + 32;
|
|
||||||
LblDrawingStyle.Left := CbAllowInplaceEditing.Left;
|
|
||||||
CbDrawingStyle.Left := LblDrawingStyle.Left + GetLabelWidth(LblDrawingStyle) + 8;
|
|
||||||
RbHideCompletedTasks.Left := RbAllTasks.Left + RbAllTasks.Width + 48;
|
|
||||||
|
|
||||||
// Next settings work correctly only for Windows.
|
// Next settings work correctly only for Windows.
|
||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
UpdateFormatSettings(ALang);
|
UpdateFormatSettings(ALang);
|
||||||
@ -759,6 +775,8 @@ begin
|
|||||||
VpWeekView1.WeekStartsOn := firstWeekDay;
|
VpWeekView1.WeekStartsOn := firstWeekDay;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
PositionControls;
|
||||||
|
|
||||||
SetActiveView(1001);
|
SetActiveView(1001);
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
|
@ -390,16 +390,16 @@ var
|
|||||||
OldFont: TFont;
|
OldFont: TFont;
|
||||||
FieldTop: Integer;
|
FieldTop: Integer;
|
||||||
delta: Integer;
|
delta: Integer;
|
||||||
corr: Integer; // difference between form's client width and tabsheet width
|
corr: Integer; // difference between form's client width and tabsheet width
|
||||||
editHeight: Integer; // Height of an edit control
|
editHeight: Integer; // Height of an edit control
|
||||||
vDist: Integer; // Vertical distance between edits
|
vDist: Integer = 4; // Vertical distance between edits
|
||||||
hBorder: Integer; // Distance between container border and label
|
hBorder: Integer = 8; // Distance between container border and label
|
||||||
dist: Integer; // distance between label and edit/combo
|
dist: Integer = 4; // distance between label and edit/combo
|
||||||
|
|
||||||
begin
|
begin
|
||||||
dist := round(4 * Screen.PixelsPerInch / DesignTimeDPI);
|
dist := round(dist * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
vdist := round(2 * Screen.PixelsPerInch / DesignTimeDPI);
|
vdist := round(vdist * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
hBorder := round(8 * Screen.PixelsPerInch / DesignTimeDPI);
|
hBorder := round(hBorder * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
editHeight := LastNameEdit.Height * Screen.PixelsPerInch div DesignTimeDPI;
|
editHeight := LastNameEdit.Height * Screen.PixelsPerInch div DesignTimeDPI;
|
||||||
|
|
||||||
{ Note: The resizing algorithm is dependent upon the labels having their
|
{ Note: The resizing algorithm is dependent upon the labels having their
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
object frmEditElement: TfrmEditElement
|
object frmEditElement: TfrmEditElement
|
||||||
Left = 691
|
Left = 691
|
||||||
Height = 479
|
Height = 453
|
||||||
Top = 226
|
Top = 226
|
||||||
Width = 413
|
Width = 413
|
||||||
HorzScrollBar.Page = 378
|
HorzScrollBar.Page = 378
|
||||||
VertScrollBar.Page = 444
|
VertScrollBar.Page = 444
|
||||||
BorderStyle = bsDialog
|
BorderStyle = bsDialog
|
||||||
Caption = 'Edit Element'
|
Caption = 'Edit Element'
|
||||||
ClientHeight = 479
|
ClientHeight = 453
|
||||||
ClientWidth = 413
|
ClientWidth = 413
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
@ -83,7 +83,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
object btnOk: TButton
|
object btnOk: TButton
|
||||||
Left = 240
|
Left = 240
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 440
|
Top = 416
|
||||||
Width = 75
|
Width = 75
|
||||||
Caption = 'OK'
|
Caption = 'OK'
|
||||||
Default = True
|
Default = True
|
||||||
@ -91,9 +91,9 @@ object frmEditElement: TfrmEditElement
|
|||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
object btnCancel: TButton
|
object btnCancel: TButton
|
||||||
Left = 320
|
Left = 325
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 440
|
Top = 416
|
||||||
Width = 75
|
Width = 75
|
||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Cancel'
|
Caption = 'Cancel'
|
||||||
@ -110,7 +110,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
object btnShape: TButton
|
object btnShape: TButton
|
||||||
Left = 12
|
Left = 12
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 440
|
Top = 416
|
||||||
Width = 75
|
Width = 75
|
||||||
Caption = 'Shape...'
|
Caption = 'Shape...'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@ -314,17 +314,17 @@ object frmEditElement: TfrmEditElement
|
|||||||
end
|
end
|
||||||
object gbCaption: TGroupBox
|
object gbCaption: TGroupBox
|
||||||
Left = 12
|
Left = 12
|
||||||
Height = 69
|
Height = 56
|
||||||
Top = 352
|
Top = 352
|
||||||
Width = 388
|
Width = 388
|
||||||
Caption = ' Caption '
|
Caption = ' Caption '
|
||||||
ClientHeight = 49
|
ClientHeight = 36
|
||||||
ClientWidth = 384
|
ClientWidth = 384
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object lblCaptionText: TLabel
|
object lblCaptionText: TLabel
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 12
|
Top = 10
|
||||||
Width = 27
|
Width = 27
|
||||||
Caption = 'Text: '
|
Caption = 'Text: '
|
||||||
FocusControl = edCaptionText
|
FocusControl = edCaptionText
|
||||||
@ -333,7 +333,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
object btnCaptionFont: TButton
|
object btnCaptionFont: TButton
|
||||||
Left = 312
|
Left = 312
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 7
|
Top = 5
|
||||||
Width = 67
|
Width = 67
|
||||||
Caption = 'Font...'
|
Caption = 'Font...'
|
||||||
OnClick = btnCaptionFontClick
|
OnClick = btnCaptionFontClick
|
||||||
@ -342,7 +342,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
object edCaptionText: TEdit
|
object edCaptionText: TEdit
|
||||||
Left = 52
|
Left = 52
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 8
|
Top = 6
|
||||||
Width = 253
|
Width = 253
|
||||||
OnChange = edCaptionTextChange
|
OnChange = edCaptionTextChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -369,7 +369,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
Left = 62
|
Left = 62
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 11
|
Width = 12
|
||||||
Associate = edOffset
|
Associate = edOffset
|
||||||
Min = 0
|
Min = 0
|
||||||
Position = 0
|
Position = 0
|
||||||
@ -382,7 +382,7 @@ object frmEditElement: TfrmEditElement
|
|||||||
Font.Name = 'MS Sans Serif'
|
Font.Name = 'MS Sans Serif'
|
||||||
MinFontSize = 0
|
MinFontSize = 0
|
||||||
MaxFontSize = 0
|
MaxFontSize = 0
|
||||||
left = 176
|
left = 144
|
||||||
top = 288
|
top = 432
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -299,8 +299,9 @@ const
|
|||||||
GROUPBOX_CORRECTION = 16;
|
GROUPBOX_CORRECTION = 16;
|
||||||
GROUPBOX_DISTANCE = 16;
|
GROUPBOX_DISTANCE = 16;
|
||||||
var
|
var
|
||||||
i, w: Integer;
|
i, w, h: Integer;
|
||||||
cnv: TControlCanvas;
|
cnv: TControlCanvas;
|
||||||
|
rb: TRadioButton;
|
||||||
begin
|
begin
|
||||||
cnv := TControlCanvas.Create;
|
cnv := TControlCanvas.Create;
|
||||||
try
|
try
|
||||||
@ -352,6 +353,7 @@ begin
|
|||||||
udLeft.Left := udTop.Left;
|
udLeft.Left := udTop.Left;
|
||||||
lblTop.Left := edTop.Left - GetLabelWidth(lblTop) - DELTA;
|
lblTop.Left := edTop.Left - GetLabelWidth(lblTop) - DELTA;
|
||||||
lblLeft.Left := edTop.Left - GetLabelWidth(lblLeft) - DELTA;
|
lblLeft.Left := edTop.Left - GetLabelWidth(lblLeft) - DELTA;
|
||||||
|
chkVisible.Left := edLeft.Left;
|
||||||
|
|
||||||
edHeight.Left := (gbVisual.ClientWidth + RightOf(rgMeasurement) + w ) div 2 - udHeight.Width - edHeight.Width;
|
edHeight.Left := (gbVisual.ClientWidth + RightOf(rgMeasurement) + w ) div 2 - udHeight.Width - edHeight.Width;
|
||||||
edWidth.Left := edHeight.Left;
|
edWidth.Left := edHeight.Left;
|
||||||
@ -384,14 +386,42 @@ begin
|
|||||||
edCaptionText.Width := btnCaptionFont.Left - DELTA - edCaptionText.Left;
|
edCaptionText.Width := btnCaptionFont.Left - DELTA - edCaptionText.Left;
|
||||||
|
|
||||||
// Buttons at the bottom
|
// Buttons at the bottom
|
||||||
|
w := Max(GetButtonWidth(btnOK), GetButtonWidth(btnCancel));
|
||||||
|
btnOK.Width := w;
|
||||||
|
btnCancel.Width := w;
|
||||||
|
{
|
||||||
cnv.Font.Assign(btnOK.Font);
|
cnv.Font.Assign(btnOK.Font);
|
||||||
w := Max(cnv.TextWidth(btnOK.Caption), cnv.TextWidth(btnCancel.Caption));
|
w := Max(cnv.TextWidth(btnOK.Caption), cnv.TextWidth(btnCancel.Caption));
|
||||||
btnOK.Width := w + BUTTON_CORRECTION;
|
btnOK.Width := w + BUTTON_CORRECTION;
|
||||||
btnCancel.Width := btnOK.Width;
|
btnCancel.Width := btnOK.Width;
|
||||||
|
}
|
||||||
btnCancel.Left := RightOf(gbCaption) - btnCancel.Width;
|
btnCancel.Left := RightOf(gbCaption) - btnCancel.Width;
|
||||||
btnOK.Left := btnCancel.Left - DELTA - btnOK.Width;
|
btnOK.Left := btnCancel.Left - DELTA - btnOK.Width;
|
||||||
btnShape.Width := cnv.TextWidth(btnShape.Caption) + BUTTON_CORRECTION;
|
btnShape.Width := cnv.TextWidth(btnShape.Caption) + BUTTON_CORRECTION;
|
||||||
|
|
||||||
|
// Height
|
||||||
|
gbDayOffset.ClientHeight := edOffset.Height + DELTA*2;
|
||||||
|
rgDayOffsetUnit.Height := gbDayOffset.Height;
|
||||||
|
|
||||||
|
rb := TRadioButton.Create(self);
|
||||||
|
try
|
||||||
|
rb.Parent := self;
|
||||||
|
h := rb.Height;
|
||||||
|
finally
|
||||||
|
rb.Free;
|
||||||
|
end;
|
||||||
|
rgRotation.Height := 4*h + 28;
|
||||||
|
rgMeasurement.Height := rgRotation.Height;
|
||||||
|
gbVisual.ClientHeight := BottomOf(rgMeasurement) + DELTA;
|
||||||
|
|
||||||
|
gbCaption.Top := BottomOf(gbVisual) + DELTA;
|
||||||
|
gbCaption.ClientHeight := BottomOf(edCaptionText) + DELTA;
|
||||||
|
|
||||||
|
btnOK.Top := BottomOf(gbCaption) + DELTA;
|
||||||
|
btnCancel.Top := btnOK.Top;
|
||||||
|
btnShape.Top := btnOK.Top;
|
||||||
|
|
||||||
|
ClientHeight := BottomOf(btnOK) + DELTA;
|
||||||
finally
|
finally
|
||||||
cnv.Free;
|
cnv.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -105,7 +105,7 @@ object frmEditFormat: TfrmEditFormat
|
|||||||
Left = 158
|
Left = 158
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 68
|
Top = 68
|
||||||
Width = 16
|
Width = 12
|
||||||
Associate = edIncrement
|
Associate = edIncrement
|
||||||
Max = 365
|
Max = 365
|
||||||
Min = 0
|
Min = 0
|
||||||
|
@ -62,6 +62,7 @@ type
|
|||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
procedure PositionControls;
|
||||||
procedure SetCaptions;
|
procedure SetCaptions;
|
||||||
protected
|
protected
|
||||||
procedure SaveData(AFormat: TVpPrintFormatItem);
|
procedure SaveData(AFormat: TVpPrintFormatItem);
|
||||||
@ -136,12 +137,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmEditFormat.SetCaptions;
|
procedure TfrmEditFormat.SetCaptions;
|
||||||
const
|
|
||||||
DELTA = 8;
|
|
||||||
MARGIN = 16;
|
|
||||||
var
|
|
||||||
cnv: TControlCanvas;
|
|
||||||
w: Integer;
|
|
||||||
begin
|
begin
|
||||||
Caption := RSEditFormatCaption;
|
Caption := RSEditFormatCaption;
|
||||||
LblName.Caption := RSNameLbl;
|
LblName.Caption := RSNameLbl;
|
||||||
@ -155,31 +150,58 @@ begin
|
|||||||
btnOK.Caption := RSOKBtn;
|
btnOK.Caption := RSOKBtn;
|
||||||
btnCancel.Caption := RSCancelBtn;
|
btnCancel.Caption := RSCancelBtn;
|
||||||
|
|
||||||
|
PositionControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmEditFormat.PositionControls;
|
||||||
|
var
|
||||||
|
delta: integer = 8;
|
||||||
|
margin: Integer = 16;
|
||||||
|
vdist: Integer = 4;
|
||||||
|
var
|
||||||
|
w, h: Integer;
|
||||||
|
dummyRB: TRadioButton;
|
||||||
|
begin
|
||||||
|
delta := Round(delta * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
margin := Round(margin * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
vdist := Round(vdist * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
|
||||||
w := MaxValue([GetLabelWidth(LblName), GetLabelWidth(LblDescription), GetLabelWidth(LblIncrement)]);
|
w := MaxValue([GetLabelWidth(LblName), GetLabelWidth(LblDescription), GetLabelWidth(LblIncrement)]);
|
||||||
edName.Left := MARGIN + w + DELTA;
|
edName.Left := margin + w + delta;
|
||||||
edDescription.Left := edName.Left;
|
edDescription.Left := edName.Left;
|
||||||
edDescription.Width := edName.Width;
|
edDescription.Width := edName.Width;
|
||||||
edIncrement.Left := edName.Left;
|
edIncrement.Left := edName.Left;
|
||||||
udIncrement.Left := edIncrement.Left + edIncrement.Width;
|
udIncrement.Left := edIncrement.Left + edIncrement.Width;
|
||||||
LblName.Left := edName.Left - GetLabelWidth(LblName) - DELTA;
|
LblName.Left := edName.Left - GetLabelWidth(LblName) - delta;
|
||||||
LblDescription.Left := edDescription.Left - GetLabelWidth(lblDescription) - DELTA;
|
LblDescription.Left := edDescription.Left - GetLabelWidth(lblDescription) - delta;
|
||||||
lblIncrement.Left := edIncrement.Left - GetLabelWidth(lblIncrement) - DELTA;
|
lblIncrement.Left := edIncrement.Left - GetLabelWidth(lblIncrement) - delta;
|
||||||
|
|
||||||
ClientWidth := MARGIN + w + DELTA + edName.Width + MARGIN;
|
ClientWidth := MARGIN + w + delta + edName.Width + margin;
|
||||||
rgDayIncrement.Width := ClientWidth - 2*MARGIN;
|
rgDayIncrement.Width := ClientWidth - 2*margin;
|
||||||
|
|
||||||
cnv := TControlCanvas.Create;
|
w := Max(GetButtonWidth(btnOK), GetButtonWidth(btnCancel));
|
||||||
try
|
btnOK.Width := w;
|
||||||
cnv.Control := btnOK;
|
btnCancel.Width := w;
|
||||||
cnv.Font.Assign(btnOK.Font);
|
btnCancel.Left := RightOf(rgDayIncrement) - btnCancel.Width;
|
||||||
w := Max(cnv.TextWidth(RSOKBtn), cnv.TextWidth(RSCancelBtn));
|
btnOK.Left := btnCancel.Left - delta - btnOK.Width;
|
||||||
finally
|
|
||||||
cnv.Free;
|
edDescription.Top := BottomOf(edName) + vDist;
|
||||||
end;
|
lblDescription.Top := edDescription.Top + (edDescription.Height - lblDescription.Height) div 2;
|
||||||
btnOK.Width := w + 16;
|
edIncrement.Top := BottomOf(edDescription) + vDist;
|
||||||
btnCancel.Width := w + 16;
|
udIncrement.Top := edIncrement.Top;
|
||||||
btnCancel.Left := ClientWidth - MARGIN - btnCancel.Width;
|
lblIncrement.top := edIncrement.Top + (edIncrement.Height - lblIncrement.Height) div 2;
|
||||||
btnOK.Left := btnCancel.Left - 8 - btnOK.Width;
|
rgDayIncrement.Top := BottomOf(edIncrement) + vDist + vDist;
|
||||||
|
|
||||||
|
DummyRB := TRadioButton.Create(self);
|
||||||
|
DummyRB.Parent := self;
|
||||||
|
h := DummyRB.Height;
|
||||||
|
DummyRB.Free;
|
||||||
|
|
||||||
|
rgdayIncrement.Height := h + 2*LblName.Height;
|
||||||
|
btnOK.Top := Bottomof(rgDayIncrement) + vDist;
|
||||||
|
btnCancel.Top := btnOK.Top;
|
||||||
|
|
||||||
|
ClientHeight := Bottomof(btnOK) + vDist*2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmEditFormat.SetData(AFormat: TVpPrintFormatItem);
|
procedure TfrmEditFormat.SetData(AFormat: TVpPrintFormatItem);
|
||||||
|
@ -54,7 +54,7 @@ object frmPrnFormat: TfrmPrnFormat
|
|||||||
OnClick = btnMoveElementUpClick
|
OnClick = btnMoveElementUpClick
|
||||||
end
|
end
|
||||||
object btnMoveElementDn: TSpeedButton
|
object btnMoveElementDn: TSpeedButton
|
||||||
Left = 305
|
Left = 304
|
||||||
Height = 22
|
Height = 22
|
||||||
Top = 403
|
Top = 403
|
||||||
Width = 23
|
Width = 23
|
||||||
|
@ -103,6 +103,7 @@ type
|
|||||||
LastX, LastY: Integer;
|
LastX, LastY: Integer;
|
||||||
DragItem: Integer;
|
DragItem: Integer;
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
|
procedure PositionControls;
|
||||||
procedure SetCaptions;
|
procedure SetCaptions;
|
||||||
procedure SetDrawingStyle(const v: TVpDrawingStyle);
|
procedure SetDrawingStyle(const v: TVpDrawingStyle);
|
||||||
|
|
||||||
@ -167,7 +168,7 @@ end;
|
|||||||
procedure TfrmPrnFormat.EnableMoveButtons;
|
procedure TfrmPrnFormat.EnableMoveButtons;
|
||||||
begin
|
begin
|
||||||
btnMoveElementUp.Enabled := lbElements.ItemIndex > 0;
|
btnMoveElementUp.Enabled := lbElements.ItemIndex > 0;
|
||||||
btnMoveElementDn.Enabled := lbElements.ItemIndex < lbElements.Items.Count - 1;
|
btnMoveElementDn.Enabled := (lbElements.ItemIndex > -1) and (lbElements.ItemIndex < lbElements.Items.Count - 1);
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
procedure TfrmPrnFormat.FormShow(Sender: TObject);
|
procedure TfrmPrnFormat.FormShow(Sender: TObject);
|
||||||
@ -647,9 +648,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmPrnFormat.SetCaptions;
|
procedure TfrmPrnFormat.SetCaptions;
|
||||||
var
|
|
||||||
cnv: TControlCanvas;
|
|
||||||
w: Integer;
|
|
||||||
begin
|
begin
|
||||||
Caption := RSPrintFormatDesigner;
|
Caption := RSPrintFormatDesigner;
|
||||||
LblFormats.Caption := RSFormats;
|
LblFormats.Caption := RSFormats;
|
||||||
@ -666,6 +664,48 @@ begin
|
|||||||
btnLoadFile.Caption := RSLoadFileBtn;
|
btnLoadFile.Caption := RSLoadFileBtn;
|
||||||
btnSaveFile.Caption := RSSaveFileBtn;
|
btnSaveFile.Caption := RSSaveFileBtn;
|
||||||
|
|
||||||
|
PositionControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmPrnFormat.PositionControls;
|
||||||
|
var
|
||||||
|
w: Integer;
|
||||||
|
dist: Integer;
|
||||||
|
btndist: Integer;
|
||||||
|
begin
|
||||||
|
dist := round(8 * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
btnDist := btnEditFormat.Top - BottomOf(btnNewFormat);
|
||||||
|
|
||||||
|
w := MaxValue([GetButtonWidth(btnNewFile), GetButtonWidth(btnLoadFile), GetButtonWidth(btnSaveFile)]);
|
||||||
|
btnNewFile.Width := w;
|
||||||
|
btnLoadFile.Width := w;
|
||||||
|
btnSaveFile.Width := w;
|
||||||
|
btnLoadFile.Left := RightOf(btnNewFile) + dist;
|
||||||
|
btnSaveFile.Left := RightOf(btnLoadFile) + dist;
|
||||||
|
|
||||||
|
w := MaxValue([GetButtonWidth(btnNewFormat), GetButtonWidth(btnEditFormat), GetButtonWidth(btnDeleteFormat)]);
|
||||||
|
btnNewFormat.Left := RightOf(lbFormats) + dist;
|
||||||
|
btnEditFormat.Left := btnNewFormat.Left;
|
||||||
|
btnDeleteFormat.Left := btnNewFormat.Left;
|
||||||
|
btnNewElement.Left := btnNewFormat.Left;
|
||||||
|
btnEditElement.Left := btnNewFormat.Left;
|
||||||
|
btnDeleteElement.Left := btnNewFormat.Left;
|
||||||
|
|
||||||
|
LblPrintOrder.Left := BtnNewFormat.Left + (BtnNewFormat.Width - GetLabelWidth(LblPrintOrder)) div 2;
|
||||||
|
btnMoveElementUp.Left := BtnNewFormat.Left + (BtnNewFormat.Width - btnMoveElementUp.Width) div 2;
|
||||||
|
btnMoveElementDn.Left := btnMoveElementUp.Left;
|
||||||
|
LblPrintOrder.Top := BottomOf(BtnDeleteElement) + btndist;
|
||||||
|
btnMoveElementUp.Top := BottomOf(LblPrintOrder) + Round(8 * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
btnMoveElementDn.Top := BottomOf(BtnMoveElementUp) + Round(8 * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
|
||||||
|
PrintPreviewPanel.Left := BtnNewFormat.Left + BtnNewFormat.Width + dist;
|
||||||
|
|
||||||
|
ClientWidth := PrintPreviewPanel.Left + PrintPreviewPanel.Width + 8;
|
||||||
|
end;
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
w := 0;
|
w := 0;
|
||||||
cnv := TControlCanvas.Create;
|
cnv := TControlCanvas.Create;
|
||||||
try
|
try
|
||||||
@ -698,6 +738,7 @@ begin
|
|||||||
BtnNewElement.Width := w;
|
BtnNewElement.Width := w;
|
||||||
BtnEditElement.Width := w;
|
BtnEditElement.Width := w;
|
||||||
BtnDeleteElement.Width := w;
|
BtnDeleteElement.Width := w;
|
||||||
|
|
||||||
LblPrintOrder.Left := BtnNewFormat.Left + (BtnNewFormat.Width - GetLabelWidth(LblPrintOrder)) div 2;
|
LblPrintOrder.Left := BtnNewFormat.Left + (BtnNewFormat.Width - GetLabelWidth(LblPrintOrder)) div 2;
|
||||||
btnMoveElementUp.Left := BtnNewFormat.Left + (BtnNewFormat.Width - btnMoveElementUp.Width) div 2;
|
btnMoveElementUp.Left := BtnNewFormat.Left + (BtnNewFormat.Width - btnMoveElementUp.Width) div 2;
|
||||||
btnMoveElementDn.Left := btnMoveElementUp.Left;
|
btnMoveElementDn.Left := btnMoveElementUp.Left;
|
||||||
@ -709,6 +750,7 @@ begin
|
|||||||
cnv.Free;
|
cnv.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
procedure TfrmPrnFormat.SetDrawingStyle(const v: TVpDrawingStyle);
|
procedure TfrmPrnFormat.SetDrawingStyle(const v: TVpDrawingStyle);
|
||||||
begin
|
begin
|
||||||
|
@ -22,7 +22,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Caption = 'OK'
|
Caption = 'OK'
|
||||||
Default = True
|
Default = True
|
||||||
OnClick = btnOkClick
|
OnClick = btnOkClick
|
||||||
TabOrder = 2
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object btnCancel: TButton
|
object btnCancel: TButton
|
||||||
Left = 272
|
Left = 272
|
||||||
@ -32,7 +32,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Cancel'
|
Caption = 'Cancel'
|
||||||
OnClick = btnCancelClick
|
OnClick = btnCancelClick
|
||||||
TabOrder = 3
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object gbBrush: TGroupBox
|
object gbBrush: TGroupBox
|
||||||
Left = 186
|
Left = 186
|
||||||
@ -42,7 +42,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Caption = ' Brush '
|
Caption = ' Brush '
|
||||||
ClientHeight = 66
|
ClientHeight = 66
|
||||||
ClientWidth = 161
|
ClientWidth = 161
|
||||||
TabOrder = 1
|
TabOrder = 2
|
||||||
object lblBrushStyle: TLabel
|
object lblBrushStyle: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 15
|
Height = 15
|
||||||
@ -54,13 +54,12 @@ object frmEditShape: TfrmEditShape
|
|||||||
end
|
end
|
||||||
object cbBrushStyle: TComboBox
|
object cbBrushStyle: TComboBox
|
||||||
Left = 52
|
Left = 52
|
||||||
Height = 22
|
Height = 23
|
||||||
Top = 32
|
Top = 32
|
||||||
Width = 97
|
Width = 97
|
||||||
ItemHeight = 16
|
ItemHeight = 15
|
||||||
OnChange = cbBrushStyleChange
|
OnChange = cbBrushStyleChange
|
||||||
OnDrawItem = cbBrushStyleDrawItem
|
OnDrawItem = cbBrushStyleDrawItem
|
||||||
Style = csOwnerDrawFixed
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object lblBrushColor: TLabel
|
object lblBrushColor: TLabel
|
||||||
@ -91,7 +90,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Caption = ' Pen '
|
Caption = ' Pen '
|
||||||
ClientHeight = 120
|
ClientHeight = 120
|
||||||
ClientWidth = 161
|
ClientWidth = 161
|
||||||
TabOrder = 0
|
TabOrder = 1
|
||||||
object lblPenStyle: TLabel
|
object lblPenStyle: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 15
|
Height = 15
|
||||||
@ -121,14 +120,13 @@ object frmEditShape: TfrmEditShape
|
|||||||
end
|
end
|
||||||
object cbPenStyle: TComboBox
|
object cbPenStyle: TComboBox
|
||||||
Left = 52
|
Left = 52
|
||||||
Height = 22
|
Height = 23
|
||||||
Top = 32
|
Top = 32
|
||||||
Width = 97
|
Width = 97
|
||||||
ItemHeight = 16
|
ItemHeight = 15
|
||||||
OnChange = cbPenStyleChange
|
OnChange = cbPenStyleChange
|
||||||
OnDrawItem = cbPenStyleDrawItem
|
OnDrawItem = cbPenStyleDrawItem
|
||||||
Style = csOwnerDrawFixed
|
TabOrder = 1
|
||||||
TabOrder = 0
|
|
||||||
end
|
end
|
||||||
object cbPenMode: TComboBox
|
object cbPenMode: TComboBox
|
||||||
Left = 52
|
Left = 52
|
||||||
@ -136,13 +134,13 @@ object frmEditShape: TfrmEditShape
|
|||||||
Top = 88
|
Top = 88
|
||||||
Width = 97
|
Width = 97
|
||||||
ItemHeight = 15
|
ItemHeight = 15
|
||||||
TabOrder = 1
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object udPenWidth: TUpDown
|
object udPenWidth: TUpDown
|
||||||
Left = 98
|
Left = 98
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 60
|
Top = 60
|
||||||
Width = 11
|
Width = 12
|
||||||
Associate = edPenWidth
|
Associate = edPenWidth
|
||||||
Min = 0
|
Min = 0
|
||||||
Position = 0
|
Position = 0
|
||||||
@ -166,7 +164,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Style = [cbStandardColors, cbExtendedColors, cbPrettyNames, cbCustomColors]
|
Style = [cbStandardColors, cbExtendedColors, cbPrettyNames, cbCustomColors]
|
||||||
ItemHeight = 16
|
ItemHeight = 16
|
||||||
OnChange = cbPenColorChange
|
OnChange = cbPenColorChange
|
||||||
TabOrder = 4
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object lblPenColor: TLabel
|
object lblPenColor: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
@ -186,7 +184,7 @@ object frmEditShape: TfrmEditShape
|
|||||||
Caption = 'gbShapes'
|
Caption = 'gbShapes'
|
||||||
ClientHeight = 47
|
ClientHeight = 47
|
||||||
ClientWidth = 320
|
ClientWidth = 320
|
||||||
TabOrder = 4
|
TabOrder = 0
|
||||||
object SpeedButton1: TSpeedButton
|
object SpeedButton1: TSpeedButton
|
||||||
Left = 12
|
Left = 12
|
||||||
Height = 32
|
Height = 32
|
||||||
|
@ -297,13 +297,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
procedure TfrmEditShape.PositionControls;
|
procedure TfrmEditShape.PositionControls;
|
||||||
const
|
|
||||||
DELTA = 8;
|
|
||||||
var
|
var
|
||||||
w: Integer;
|
w, h: Integer;
|
||||||
cnv: TControlCanvas;
|
|
||||||
shape: TVpShapeType;
|
shape: TVpShapeType;
|
||||||
|
delta: Integer;
|
||||||
|
vdist: 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 icons).
|
||||||
|
h := cbPenStyle.ItemHeight;
|
||||||
|
cbPenStyle.Style := csOwnerDrawFixed;
|
||||||
|
cbPenStyle.ItemHeight := h+1;
|
||||||
|
cbBrushStyle.Style := csOwnerDrawFixed;
|
||||||
|
cbBrushStyle.ItemHeight := h+1;
|
||||||
|
|
||||||
|
delta := round(8 * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
vdist := round(4 * Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
|
||||||
|
// Horizontal alignment
|
||||||
w := MaxValue([GetLabelWidth(lblPenColor), GetLabelWidth(lblPenStyle),
|
w := MaxValue([GetLabelWidth(lblPenColor), GetLabelWidth(lblPenStyle),
|
||||||
GetLabelWidth(lblPenWidth), GetLabelWidth(lblPenMode)]) + 2 * DELTA;
|
GetLabelWidth(lblPenWidth), GetLabelWidth(lblPenMode)]) + 2 * DELTA;
|
||||||
cbPenColor.Left := w;
|
cbPenColor.Left := w;
|
||||||
@ -324,15 +337,7 @@ begin
|
|||||||
gbBrush.Left := RightOf(gbPen) + 16;
|
gbBrush.Left := RightOf(gbPen) + 16;
|
||||||
gbBrush.Width := RightOf(cbBrushColor) + DELTA;
|
gbBrush.Width := RightOf(cbBrushColor) + DELTA;
|
||||||
|
|
||||||
cnv := TControlCanvas.Create;
|
btnOK.Width := Max(GetButtonWidth(btnOK), GetButtonWidth(btnCancel));
|
||||||
try
|
|
||||||
cnv.Control := btnOK;
|
|
||||||
cnv.Font.Assign(btnOK.Font);
|
|
||||||
btnOK.Width := MaxValue([cnv.TextWidth(btnOK.Caption), cnv.TextWidth(btnCancel.Caption)]) + 16;
|
|
||||||
finally
|
|
||||||
cnv.Free;
|
|
||||||
end;
|
|
||||||
|
|
||||||
btnCancel.Width := btnOK.Width;
|
btnCancel.Width := btnOK.Width;
|
||||||
if btnOK.Width + DELTA + btnCancel.Width > gbBrush.Width then
|
if btnOK.Width + DELTA + btnCancel.Width > gbBrush.Width then
|
||||||
gbBrush.Width := btnOK.Width + DELTA + btnCancel.Width;
|
gbBrush.Width := btnOK.Width + DELTA + btnCancel.Width;
|
||||||
@ -349,6 +354,27 @@ begin
|
|||||||
FShapeButtons[shape].Left := RightOf(FShapeButtons[pred(shape)]) + DELTA;
|
FShapeButtons[shape].Left := RightOf(FShapeButtons[pred(shape)]) + DELTA;
|
||||||
FShapeButtons[shape].Width := w;
|
FShapeButtons[shape].Width := w;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Vertical alignment
|
||||||
|
lblPenColor.Top := cbPenColor.Top + (cbPenColor.Height - lblPenColor.Height) div 2;
|
||||||
|
lblBrushColor.Top := lblPenColor.Top;
|
||||||
|
cbPenStyle.Top := BottomOf(cbPenColor) + vdist;
|
||||||
|
cbBrushStyle.Top := cbPenStyle.Top;
|
||||||
|
lblPenstyle.Top := cbPenStyle.Top + (cbPenStyle.Height - lblPenStyle.Height) div 2;
|
||||||
|
lblBrushStyle.Top := lblPenStyle.Top;
|
||||||
|
edPenWidth.Top := BottomOf(cbPenStyle) + vDist;
|
||||||
|
udPenWidth.Top := edPenWidth.Top;
|
||||||
|
lblPenWidth.Top := edPenWidth.Top + (edPenWidth.Height - lblPenWidth.Height) div 2;
|
||||||
|
cbPenMode.Top := BottomOf(edPenWidth) + vDist;
|
||||||
|
lblPenMode.Top := cbPenMode.Top + (cbPenMode.Height - lblPenMode.Height) div 2;
|
||||||
|
gbPen.ClientHeight := BottomOf(cbPenMode) + delta;
|
||||||
|
gbBrush.ClientHeight := BottomOf(cbBrushStyle) + delta;
|
||||||
|
|
||||||
|
btnOK.Top := BottomOf(gbPen) - btnOK.Height;
|
||||||
|
btnCancel.Top := btnOK.Top;
|
||||||
|
|
||||||
|
ClientHeight := BottomOf(btnOK) + delta;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmEditShape.SaveData(AShape: TVpPrintShape);
|
procedure TfrmEditShape.SaveData(AShape: TVpPrintShape);
|
||||||
|
@ -44,7 +44,7 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TVpPrintFormatEditDialog = class (TVpBaseDialog)
|
TVpPrintFormatEditDialog = class(TVpBaseDialog)
|
||||||
private
|
private
|
||||||
FControlLink: TVpControlLink;
|
FControlLink: TVpControlLink;
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
|
@ -434,6 +434,7 @@ begin
|
|||||||
maxlen := Max(maxlen, cnv.TextWidth(fmts.Items[i].FormatName));
|
maxlen := Max(maxlen, cnv.TextWidth(fmts.Items[i].FormatName));
|
||||||
VpPrintFormatCombobox1.Width := maxlen + 30;
|
VpPrintFormatCombobox1.Width := maxlen + 30;
|
||||||
cboxZoom.Left := VpPrintFormatCombobox1.Left + VpPrintFormatCombobox1.Width + 8;
|
cboxZoom.Left := VpPrintFormatCombobox1.Left + VpPrintFormatCombobox1.Width + 8;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
cnv.Free;
|
cnv.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -64,6 +64,7 @@ type
|
|||||||
procedure Change(Sender: TObject);
|
procedure Change(Sender: TObject);
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
procedure PositionControls;
|
||||||
procedure SetControls;
|
procedure SetControls;
|
||||||
public
|
public
|
||||||
ReturnCode: TVpEditorReturnCode;
|
ReturnCode: TVpEditorReturnCode;
|
||||||
@ -99,6 +100,7 @@ implementation
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
Math,
|
||||||
vpSR, vpMisc;
|
vpSR, vpMisc;
|
||||||
|
|
||||||
function ExecuteResourceDlg(Resource: TVpResource): Boolean;
|
function ExecuteResourceDlg(Resource: TVpResource): Boolean;
|
||||||
@ -208,12 +210,33 @@ begin
|
|||||||
OKBtn.Caption := RSOKBtn;
|
OKBtn.Caption := RSOKBtn;
|
||||||
CancelBtn.Caption := RSCancelBtn;
|
CancelBtn.Caption := RSCancelBtn;
|
||||||
|
|
||||||
DescriptionEdit.Left := lblDescription.Left + GetLabelWidth(lblDescription) + 8;
|
PositionControls;
|
||||||
DescriptionEdit.Width := imgResources.Left - 16 - DescriptionEdit.Left;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
procedure TResEditForm.PositionControls;
|
||||||
|
var
|
||||||
|
Delta: Integer;
|
||||||
|
begin
|
||||||
|
delta := round(8 *Screen.PixelsPerInch / DesignTimeDPI);
|
||||||
|
|
||||||
|
DescriptionEdit.Left := lblDescription.Left + GetLabelWidth(lblDescription) + Delta;
|
||||||
|
DescriptionEdit.Width := imgResources.Left - delta - delta - DescriptionEdit.Left;
|
||||||
|
DescriptionEdit.Top := imgResources.Top + (imgResources.Height - DescriptionEdit.Height) div 2;
|
||||||
|
lblDescription.Top := DescriptionEdit.Top + (DescriptionEdit.Height - lblDescription.Height) div 2;
|
||||||
|
|
||||||
|
lblNotes.Top := BottomOf(DescriptionEdit) + delta;
|
||||||
|
NotesMemo.Top := BottomOf(lblNotes) + delta div 2;
|
||||||
|
NotesMemo.Height := tabResource.ClientHeight - NotesMemo.Top - NotesMemo.Left;
|
||||||
|
|
||||||
|
OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn));
|
||||||
|
CancelBtn.Width := OKBtn.Width;
|
||||||
|
CancelBtn.Left := pnlBottom.ClientWidth - lblDescription.Left - CancelBtn.Width;
|
||||||
|
OKBtn.Left := CancelBtn.Left - OKBtn.Width - delta - (ClientWidth - tabResource.ClientWidth);
|
||||||
|
OKBtn.Top := (pnlBottom.ClientHeight - OKBtn.Height) div 2;
|
||||||
|
CancelBtn.Top := OKBtn.Top;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TResEditForm.OKBtnClick(Sender: TObject);
|
procedure TResEditForm.OKBtnClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if ResourceChanged then
|
if ResourceChanged then
|
||||||
|
Reference in New Issue
Block a user