From a35403bb3fd3678ee385d7d11819917dade70715 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 3 Oct 2022 22:26:21 +0000 Subject: [PATCH] tvplanit: Improved layout of printformat element editor in VpEdElem git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8512 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/languages/vpsr.de.po | 2 +- components/tvplanit/source/vpedelem.lfm | 809 ++++++++++++----------- components/tvplanit/source/vpedelem.lrj | 30 +- components/tvplanit/source/vpedelem.pas | 90 ++- 4 files changed, 517 insertions(+), 414 deletions(-) diff --git a/components/tvplanit/languages/vpsr.de.po b/components/tvplanit/languages/vpsr.de.po index 2be03f1bc..2ef97a0fa 100644 --- a/components/tvplanit/languages/vpsr.de.po +++ b/components/tvplanit/languages/vpsr.de.po @@ -336,7 +336,7 @@ msgstr "Täglich" #: vpsr.rsdayinclbl msgid "Day increment:" -msgstr "Datumsänderung" +msgstr "Datumsänderung:" #: vpsr.rsdayincunits msgid "Day increment units" diff --git a/components/tvplanit/source/vpedelem.lfm b/components/tvplanit/source/vpedelem.lfm index b5868691a..216c7f9c4 100644 --- a/components/tvplanit/source/vpedelem.lfm +++ b/components/tvplanit/source/vpedelem.lfm @@ -1,366 +1,23 @@ object frmEditElement: TfrmEditElement Left = 288 - Height = 466 + Height = 446 Top = 321 - Width = 473 + Width = 455 HorzScrollBar.Page = 378 VertScrollBar.Page = 444 AutoSize = True BorderStyle = bsDialog Caption = 'Edit Element' - ClientHeight = 466 - ClientWidth = 473 + ClientHeight = 446 + ClientWidth = 455 OnCreate = FormCreate OnShow = FormShow Position = poScreenCenter - object gbVisual: TGroupBox - Left = 12 - Height = 144 - Top = 215 - Width = 449 - Align = alTop - AutoSize = True - BorderSpacing.Left = 12 - BorderSpacing.Top = 12 - BorderSpacing.Right = 12 - Caption = ' Visual ' - ClientHeight = 124 - ClientWidth = 445 - Font.Style = [fsBold] - ParentFont = False - TabOrder = 3 - object rgMeasurement: TRadioGroup - AnchorSideLeft.Control = rgRotation - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = gbVisual - Left = 104 - Height = 116 - Top = 0 - Width = 106 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 16 - BorderSpacing.Bottom = 8 - BorderSpacing.InnerBorder = 4 - Caption = ' Measurement ' - ChildSizing.LeftRightSpacing = 16 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 96 - ClientWidth = 102 - ItemIndex = 1 - Items.Strings = ( - 'Pixels' - 'Percent' - 'Inches' - 'cm' - ) - OnClick = rgMeasurementClick - ParentFont = False - TabOrder = 1 - end - object rgRotation: TRadioGroup - AnchorSideLeft.Control = gbVisual - AnchorSideTop.Control = gbVisual - Left = 8 - Height = 116 - Top = 0 - Width = 80 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 8 - BorderSpacing.InnerBorder = 4 - Caption = ' Rotation ' - ChildSizing.LeftRightSpacing = 16 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 96 - ClientWidth = 76 - ItemIndex = 0 - Items.Strings = ( - '0' - '90' - '180' - '270' - ) - ParentFont = False - TabOrder = 0 - end - object HeightWidthPanel: TPanel - AnchorSideLeft.Control = TopLeftPanel - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = rgMeasurement - AnchorSideTop.Side = asrCenter - AnchorSideBottom.Side = asrBottom - Left = 334 - Height = 54 - Top = 31 - Width = 99 - AutoSize = True - BorderSpacing.Left = 16 - BorderSpacing.Top = 10 - BorderSpacing.Right = 12 - BevelOuter = bvNone - ClientHeight = 54 - ClientWidth = 99 - ParentFont = False - TabOrder = 2 - object LblHeight: TLabel - AnchorSideTop.Control = edHeight - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = edHeight - Left = 0 - Height = 15 - Top = 4 - Width = 39 - Anchors = [akTop, akRight] - BorderSpacing.Right = 8 - Caption = 'Height:' - Color = clDefault - FocusControl = edHeight - ParentColor = False - end - object edHeight: TEdit - AnchorSideTop.Control = BevelHeightWidth - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = udHeight - AnchorSideBottom.Control = BevelHeightWidth - Left = 47 - Height = 23 - Top = 0 - Width = 40 - Anchors = [akRight, akBottom] - OnEnter = PosEditEnter - OnExit = PosEditExit - TabOrder = 0 - Text = '0.00' - end - object udHeight: TUpDown - AnchorSideTop.Control = edHeight - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = HeightWidthPanel - AnchorSideRight.Side = asrBottom - Left = 87 - Height = 23 - Top = 0 - Width = 12 - Anchors = [akTop, akRight] - Associate = edHeight - Min = 0 - OnClick = UpDownClick - Position = 0 - TabOrder = 1 - end - object LblWidth: TLabel - AnchorSideTop.Control = edWidth - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = edWidth - Left = 4 - Height = 15 - Top = 35 - Width = 35 - Anchors = [akTop, akRight] - BorderSpacing.Right = 8 - Caption = 'Width:' - Color = clDefault - FocusControl = edWidth - ParentColor = False - end - object edWidth: TEdit - AnchorSideTop.Control = BevelHeightWidth - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = udWidth - Left = 47 - Height = 23 - Top = 31 - Width = 40 - Anchors = [akTop, akRight] - OnEnter = PosEditEnter - OnExit = PosEditExit - TabOrder = 2 - Text = '0.00' - end - object udWidth: TUpDown - AnchorSideTop.Control = edWidth - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = HeightWidthPanel - AnchorSideRight.Side = asrBottom - Left = 87 - Height = 23 - Top = 31 - Width = 12 - Anchors = [akTop, akRight] - Associate = edWidth - Min = 0 - OnClick = UpDownClick - Position = 0 - TabOrder = 3 - end - object BevelHeightWidth: TBevel - AnchorSideLeft.Control = HeightWidthPanel - AnchorSideTop.Control = HeightWidthPanel - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = HeightWidthPanel - AnchorSideRight.Side = asrBottom - Left = 0 - Height = 8 - Top = 23 - Width = 99 - Anchors = [akTop, akLeft, akRight] - end - end - object TopLeftPanel: TPanel - AnchorSideLeft.Control = rgMeasurement - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = rgMeasurement - AnchorSideTop.Side = asrCenter - Left = 226 - Height = 54 - Top = 31 - Width = 92 - AutoSize = True - BorderSpacing.Left = 16 - BevelOuter = bvNone - ClientHeight = 54 - ClientWidth = 92 - ParentFont = False - TabOrder = 3 - object BevelTopLeft: TBevel - AnchorSideTop.Control = TopLeftPanel - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = TopLeftPanel - AnchorSideRight.Side = asrBottom - Left = 0 - Height = 8 - Top = 23 - Width = 92 - Anchors = [akTop, akLeft, akRight] - end - object LblTop: TLabel - AnchorSideTop.Control = edTop - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = edTop - Left = 2 - Height = 15 - Top = 4 - Width = 22 - Anchors = [akTop, akRight] - BorderSpacing.Left = 1 - BorderSpacing.Right = 8 - Caption = 'Top:' - Color = clDefault - FocusControl = edTop - ParentColor = False - end - object edTop: TEdit - AnchorSideRight.Control = udTop - AnchorSideBottom.Control = BevelTopLeft - Left = 32 - Height = 23 - Top = 0 - Width = 48 - Anchors = [akRight, akBottom] - OnEnter = PosEditEnter - OnExit = PosEditExit - TabOrder = 0 - Text = '0.00' - end - object udTop: TUpDown - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = TopLeftPanel - AnchorSideRight.Side = asrBottom - Left = 80 - Height = 23 - Top = 0 - Width = 12 - Anchors = [akTop, akRight] - Associate = edTop - Min = 0 - OnClick = UpDownClick - Position = 0 - TabOrder = 1 - end - object udLeft: TUpDown - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = edLeft - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = TopLeftPanel - AnchorSideRight.Side = asrBottom - Left = 80 - Height = 23 - Top = 31 - Width = 12 - Anchors = [akTop, akRight] - Associate = edLeft - Min = 0 - OnClick = UpDownClick - Position = 0 - TabOrder = 2 - end - object edLeft: TEdit - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = udLeft - Left = 32 - Height = 23 - Top = 31 - Width = 48 - Anchors = [akTop, akRight] - OnEnter = PosEditEnter - OnExit = PosEditExit - TabOrder = 3 - Text = '0.00' - end - object LblLeft: TLabel - AnchorSideTop.Control = edLeft - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = edLeft - Left = 1 - Height = 15 - Top = 35 - Width = 23 - Anchors = [akTop, akRight] - BorderSpacing.Left = 1 - BorderSpacing.Right = 8 - Caption = 'Left:' - Color = clDefault - FocusControl = edLeft - ParentColor = False - end - end - object chkVisible: TCheckBox - AnchorSideLeft.Control = TopLeftPanel - AnchorSideRight.Control = TopLeftPanel - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = rgMeasurement - AnchorSideBottom.Side = asrBottom - Left = 266 - Height = 19 - Top = 97 - Width = 52 - Alignment = taLeftJustify - Anchors = [akRight, akBottom] - Caption = 'Visible' - ParentFont = False - TabOrder = 4 - end - end object gbCaption: TGroupBox Left = 12 Height = 54 - Top = 371 - Width = 449 + Top = 351 + Width = 431 Align = alTop AutoSize = True BorderSpacing.Left = 12 @@ -369,7 +26,7 @@ object frmEditElement: TfrmEditElement BorderSpacing.Bottom = 6 Caption = ' Caption ' ClientHeight = 34 - ClientWidth = 445 + ClientWidth = 427 Font.Style = [fsBold] ParentFont = False TabOrder = 4 @@ -393,7 +50,7 @@ object frmEditElement: TfrmEditElement AnchorSideTop.Side = asrCenter AnchorSideRight.Control = gbCaption AnchorSideRight.Side = asrBottom - Left = 378 + Left = 360 Height = 25 Top = 1 Width = 59 @@ -413,7 +70,7 @@ object frmEditElement: TfrmEditElement Left = 43 Height = 23 Top = 2 - Width = 331 + Width = 313 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 8 BorderSpacing.Top = 2 @@ -428,7 +85,7 @@ object frmEditElement: TfrmEditElement Left = 12 Height = 23 Top = 8 - Width = 449 + Width = 431 Align = alTop AutoSize = True BorderSpacing.Left = 12 @@ -437,7 +94,7 @@ object frmEditElement: TfrmEditElement BorderSpacing.Bottom = 8 BevelOuter = bvNone ClientHeight = 23 - ClientWidth = 449 + ClientWidth = 431 TabOrder = 0 object lblName: TLabel AnchorSideTop.Control = edName @@ -456,7 +113,7 @@ object frmEditElement: TfrmEditElement Left = 42 Height = 23 Top = 0 - Width = 407 + Width = 389 Align = alRight Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Left = 4 @@ -467,7 +124,7 @@ object frmEditElement: TfrmEditElement Left = 12 Height = 51 Top = 152 - Width = 451 + Width = 433 Align = alTop AutoSize = True BorderSpacing.Left = 12 @@ -475,7 +132,7 @@ object frmEditElement: TfrmEditElement BorderSpacing.Right = 10 BevelOuter = bvNone ClientHeight = 51 - ClientWidth = 451 + ClientWidth = 433 TabOrder = 2 object gbDayOffset: TGroupBox AnchorSideTop.Control = DayOffsetPanel @@ -530,14 +187,14 @@ object frmEditElement: TfrmEditElement AnchorSideLeft.Side = asrBottom AnchorSideRight.Control = DayOffsetPanel AnchorSideRight.Side = asrBottom - Left = 108 + Left = 112 Height = 51 Top = 0 - Width = 343 + Width = 321 Anchors = [akTop, akLeft, akRight] AutoFill = True AutoSize = True - BorderSpacing.Left = 12 + BorderSpacing.Left = 16 Caption = ' Day Offset Unit ' ChildSizing.LeftRightSpacing = 6 ChildSizing.TopBottomSpacing = 6 @@ -548,7 +205,7 @@ object frmEditElement: TfrmEditElement ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 4 ClientHeight = 31 - ClientWidth = 339 + ClientWidth = 317 Columns = 4 ItemIndex = 0 Items.Strings = ( @@ -562,45 +219,45 @@ object frmEditElement: TfrmEditElement end end object ButtonPanel: TPanel - Left = 0 + Left = 12 Height = 25 - Top = 433 - Width = 461 + Top = 413 + Width = 431 Align = alTop - AutoSize = True + BorderSpacing.Left = 12 BorderSpacing.Top = 8 BorderSpacing.Right = 12 BorderSpacing.Bottom = 8 BevelOuter = bvNone ClientHeight = 25 - ClientWidth = 461 + ClientWidth = 431 TabOrder = 5 object btnShape: TButton - AnchorSideLeft.Control = ButtonPanel - Left = 12 + Left = 0 Height = 25 Top = 0 Width = 67 + Align = alLeft AutoSize = True - BorderSpacing.Left = 12 Caption = 'Shape...' Enabled = False OnClick = btnShapeClick TabOrder = 0 end object btnOk: TButton - Left = 324 + Left = 323 Height = 25 Top = 0 - Width = 71 + Width = 42 Align = alRight + AutoSize = True BorderSpacing.Right = 4 Caption = 'OK' OnClick = btnOkClick TabOrder = 1 end object btnCancel: TButton - Left = 399 + Left = 369 Height = 25 Top = 0 Width = 62 @@ -615,7 +272,7 @@ object frmEditElement: TfrmEditElement Left = 12 Height = 97 Top = 43 - Width = 451 + Width = 433 Align = alTop AutoSize = True BorderSpacing.Left = 12 @@ -623,13 +280,13 @@ object frmEditElement: TfrmEditElement BorderSpacing.Right = 10 BevelOuter = bvNone ClientHeight = 97 - ClientWidth = 451 + ClientWidth = 433 TabOrder = 1 object rgItemType: TRadioGroup Left = 0 Height = 97 Top = 0 - Width = 451 + Width = 433 Align = alClient AutoFill = True BorderSpacing.InnerBorder = 4 @@ -643,7 +300,7 @@ object frmEditElement: TfrmEditElement ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 ClientHeight = 77 - ClientWidth = 447 + ClientWidth = 429 Columns = 3 ItemIndex = 0 Items.Strings = ( @@ -662,12 +319,408 @@ object frmEditElement: TfrmEditElement TabOrder = 0 end end + object PositionPanel: TPanel + Left = 12 + Height = 124 + Top = 215 + Width = 443 + Align = alTop + AutoSize = True + BorderSpacing.Left = 12 + BorderSpacing.Top = 12 + BevelOuter = bvNone + ClientHeight = 124 + ClientWidth = 443 + TabOrder = 3 + object rgRotation: TRadioGroup + AnchorSideLeft.Control = PositionPanel + AnchorSideTop.Control = PositionPanel + Left = 0 + Height = 116 + Top = 0 + Width = 85 + AutoFill = True + AutoSize = True + BorderSpacing.Bottom = 8 + BorderSpacing.InnerBorder = 4 + Caption = ' Rotation ' + ChildSizing.LeftRightSpacing = 16 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 96 + ClientWidth = 81 + ItemIndex = 0 + Items.Strings = ( + '0°' + '90°' + '180°' + '270°' + ) + ParentFont = False + TabOrder = 0 + end + object gbPosition: TGroupBox + AnchorSideLeft.Control = rgRotation + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = rgRotation + AnchorSideBottom.Control = rgRotation + AnchorSideBottom.Side = asrBottom + Left = 101 + Height = 116 + Top = 0 + Width = 330 + Anchors = [akTop, akLeft, akBottom] + AutoSize = True + BorderSpacing.Left = 16 + BorderSpacing.Right = 12 + Caption = 'Position' + ClientHeight = 96 + ClientWidth = 326 + TabOrder = 1 + object TopLeftPanel: TPanel + AnchorSideLeft.Control = gbPosition + AnchorSideTop.Control = gbPosition + Left = 16 + Height = 54 + Top = 4 + Width = 92 + AutoSize = True + BorderSpacing.Left = 16 + BorderSpacing.Top = 4 + BevelOuter = bvNone + ClientHeight = 54 + ClientWidth = 92 + ParentFont = False + TabOrder = 0 + object BevelTopLeft: TBevel + AnchorSideTop.Control = TopLeftPanel + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = TopLeftPanel + AnchorSideRight.Side = asrBottom + Left = 0 + Height = 8 + Top = 23 + Width = 92 + Anchors = [akTop, akLeft, akRight] + end + object LblTop: TLabel + AnchorSideTop.Control = edTop + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edTop + Left = 2 + Height = 15 + Top = 4 + Width = 22 + Anchors = [akTop, akRight] + BorderSpacing.Left = 1 + BorderSpacing.Right = 8 + Caption = 'Top:' + Color = clDefault + FocusControl = edTop + ParentColor = False + end + object edTop: TEdit + AnchorSideRight.Control = udTop + AnchorSideBottom.Control = BevelTopLeft + Left = 32 + Height = 23 + Top = 0 + Width = 48 + Anchors = [akRight, akBottom] + OnEnter = PosEditEnter + OnExit = PosEditExit + TabOrder = 0 + Text = '0.00' + end + object udTop: TUpDown + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = TopLeftPanel + AnchorSideRight.Side = asrBottom + Left = 80 + Height = 23 + Top = 0 + Width = 12 + Anchors = [akTop, akRight] + Associate = edTop + Min = 0 + OnClick = UpDownClick + Position = 0 + TabOrder = 1 + end + object udLeft: TUpDown + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = edLeft + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = TopLeftPanel + AnchorSideRight.Side = asrBottom + Left = 80 + Height = 23 + Top = 31 + Width = 12 + Anchors = [akTop, akRight] + Associate = edLeft + Min = 0 + OnClick = UpDownClick + Position = 0 + TabOrder = 3 + end + object edLeft: TEdit + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = udLeft + Left = 32 + Height = 23 + Top = 31 + Width = 48 + Anchors = [akTop, akRight] + OnEnter = PosEditEnter + OnExit = PosEditExit + TabOrder = 2 + Text = '0.00' + end + object LblLeft: TLabel + AnchorSideTop.Control = edLeft + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edLeft + Left = 1 + Height = 15 + Top = 35 + Width = 23 + Anchors = [akTop, akRight] + BorderSpacing.Left = 1 + BorderSpacing.Right = 8 + Caption = 'Left:' + Color = clDefault + FocusControl = edLeft + ParentColor = False + end + end + object HeightWidthPanel: TPanel + AnchorSideLeft.Control = TopLeftPanel + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = TopLeftPanel + AnchorSideBottom.Side = asrBottom + Left = 124 + Height = 54 + Top = 4 + Width = 99 + AutoSize = True + BorderSpacing.Left = 16 + BorderSpacing.Right = 12 + BevelOuter = bvNone + ClientHeight = 54 + ClientWidth = 99 + ParentFont = False + TabOrder = 1 + object LblHeight: TLabel + AnchorSideTop.Control = edHeight + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edHeight + Left = 0 + Height = 15 + Top = 4 + Width = 39 + Anchors = [akTop, akRight] + BorderSpacing.Right = 8 + Caption = 'Height:' + Color = clDefault + FocusControl = edHeight + ParentColor = False + end + object edHeight: TEdit + AnchorSideTop.Control = BevelHeightWidth + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = udHeight + AnchorSideBottom.Control = BevelHeightWidth + Left = 47 + Height = 23 + Top = 0 + Width = 40 + Anchors = [akRight, akBottom] + OnEnter = PosEditEnter + OnExit = PosEditExit + TabOrder = 0 + Text = '0.00' + end + object udHeight: TUpDown + AnchorSideTop.Control = edHeight + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = HeightWidthPanel + AnchorSideRight.Side = asrBottom + Left = 87 + Height = 23 + Top = 0 + Width = 12 + Anchors = [akTop, akRight] + Associate = edHeight + Min = 0 + OnClick = UpDownClick + Position = 0 + TabOrder = 1 + end + object LblWidth: TLabel + AnchorSideTop.Control = edWidth + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = edWidth + Left = 4 + Height = 15 + Top = 35 + Width = 35 + Anchors = [akTop, akRight] + BorderSpacing.Right = 8 + Caption = 'Width:' + Color = clDefault + FocusControl = edWidth + ParentColor = False + end + object edWidth: TEdit + AnchorSideTop.Control = BevelHeightWidth + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = udWidth + Left = 47 + Height = 23 + Top = 31 + Width = 40 + Anchors = [akTop, akRight] + OnEnter = PosEditEnter + OnExit = PosEditExit + TabOrder = 2 + Text = '0.00' + end + object udWidth: TUpDown + AnchorSideTop.Control = edWidth + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = HeightWidthPanel + AnchorSideRight.Side = asrBottom + Left = 87 + Height = 23 + Top = 31 + Width = 12 + Anchors = [akTop, akRight] + Associate = edWidth + Min = 0 + OnClick = UpDownClick + Position = 0 + TabOrder = 3 + end + object BevelHeightWidth: TBevel + AnchorSideLeft.Control = HeightWidthPanel + AnchorSideTop.Control = HeightWidthPanel + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = HeightWidthPanel + AnchorSideRight.Side = asrBottom + Left = 0 + Height = 8 + Top = 23 + Width = 99 + Anchors = [akTop, akLeft, akRight] + end + end + object chkVisible: TCheckBox + AnchorSideLeft.Control = BevelTopLeft1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Side = asrBottom + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = gbPosition + AnchorSideBottom.Side = asrBottom + Left = 93 + Height = 19 + Top = 73 + Width = 52 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 4 + Caption = 'Visible' + ParentFont = False + TabOrder = 2 + end + object Panel2: TPanel + AnchorSideLeft.Control = HeightWidthPanel + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = gbPosition + AnchorSideBottom.Control = gbPosition + AnchorSideBottom.Side = asrBottom + Left = 255 + Height = 94 + Top = 0 + Width = 59 + Anchors = [akTop, akLeft, akBottom] + AutoSize = True + BorderSpacing.Left = 32 + BorderSpacing.Right = 12 + BorderSpacing.Bottom = 2 + Caption = 'Panel2' + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsHomogenousChildResize + ChildSizing.ShrinkVertical = crsHomogenousChildResize + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 94 + ClientWidth = 59 + TabOrder = 3 + object rbPixels: TRadioButton + Left = 0 + Height = 24 + Top = 0 + Width = 59 + Caption = 'Pixels' + OnChange = MeasurementUnitChange + TabOrder = 0 + end + object rbPercent: TRadioButton + Left = 0 + Height = 24 + Top = 24 + Width = 59 + Caption = 'Percent' + Checked = True + OnChange = MeasurementUnitChange + TabOrder = 1 + TabStop = True + end + object rbInches: TRadioButton + Left = 0 + Height = 24 + Top = 48 + Width = 59 + Caption = 'Inches' + OnChange = MeasurementUnitChange + TabOrder = 2 + end + object rbCentimeters: TRadioButton + Left = 0 + Height = 22 + Top = 72 + Width = 59 + Caption = 'cm' + OnChange = MeasurementUnitChange + TabOrder = 3 + end + end + object BevelTopLeft1: TBevel + AnchorSideLeft.Control = TopLeftPanel + AnchorSideRight.Control = HeightWidthPanel + AnchorSideRight.Side = asrBottom + Left = 16 + Height = 8 + Top = 64 + Width = 207 + Anchors = [akTop, akLeft, akRight] + Shape = bsSpacer + end + end + end object FontDialog1: TFontDialog Font.Height = -11 Font.Name = 'MS Sans Serif' MinFontSize = 0 MaxFontSize = 0 - Left = 536 - Top = 304 + Left = 192 + Top = 352 end end diff --git a/components/tvplanit/source/vpedelem.lrj b/components/tvplanit/source/vpedelem.lrj index 2356528d9..f126c9a33 100644 --- a/components/tvplanit/source/vpedelem.lrj +++ b/components/tvplanit/source/vpedelem.lrj @@ -1,17 +1,5 @@ {"version":1,"strings":[ {"hash":9518596,"name":"tfrmeditelement.caption","sourcebytes":[69,100,105,116,32,69,108,101,109,101,110,116],"value":"Edit Element"}, -{"hash":218805680,"name":"tfrmeditelement.gbvisual.caption","sourcebytes":[32,86,105,115,117,97,108,32],"value":" Visual "}, -{"hash":228085632,"name":"tfrmeditelement.rgmeasurement.caption","sourcebytes":[32,77,101,97,115,117,114,101,109,101,110,116,32],"value":" Measurement "}, -{"hash":176733536,"name":"tfrmeditelement.rgrotation.caption","sourcebytes":[32,82,111,116,97,116,105,111,110,32],"value":" Rotation "}, -{"hash":247455546,"name":"tfrmeditelement.lblheight.caption","sourcebytes":[72,101,105,103,104,116,58],"value":"Height:"}, -{"hash":209200,"name":"tfrmeditelement.edheight.text","sourcebytes":[48,46,48,48],"value":"0.00"}, -{"hash":98548410,"name":"tfrmeditelement.lblwidth.caption","sourcebytes":[87,105,100,116,104,58],"value":"Width:"}, -{"hash":209200,"name":"tfrmeditelement.edwidth.text","sourcebytes":[48,46,48,48],"value":"0.00"}, -{"hash":374330,"name":"tfrmeditelement.lbltop.caption","sourcebytes":[84,111,112,58],"value":"Top:"}, -{"hash":209200,"name":"tfrmeditelement.edtop.text","sourcebytes":[48,46,48,48],"value":"0.00"}, -{"hash":209200,"name":"tfrmeditelement.edleft.text","sourcebytes":[48,46,48,48],"value":"0.00"}, -{"hash":5422458,"name":"tfrmeditelement.lblleft.caption","sourcebytes":[76,101,102,116,58],"value":"Left:"}, -{"hash":218757493,"name":"tfrmeditelement.chkvisible.caption","sourcebytes":[86,105,115,105,98,108,101],"value":"Visible"}, {"hash":142271120,"name":"tfrmeditelement.gbcaption.caption","sourcebytes":[32,67,97,112,116,105,111,110,32],"value":" Caption "}, {"hash":95221696,"name":"tfrmeditelement.lblcaptiontext.caption","sourcebytes":[84,101,120,116,58,32],"value":"Text: "}, {"hash":224751950,"name":"tfrmeditelement.btncaptionfont.caption","sourcebytes":[70,111,110,116,46,46,46],"value":"Font..."}, @@ -22,5 +10,21 @@ {"hash":243697310,"name":"tfrmeditelement.btnshape.caption","sourcebytes":[83,104,97,112,101,46,46,46],"value":"Shape..."}, {"hash":1339,"name":"tfrmeditelement.btnok.caption","sourcebytes":[79,75],"value":"OK"}, {"hash":77089212,"name":"tfrmeditelement.btncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, -{"hash":257887424,"name":"tfrmeditelement.rgitemtype.caption","sourcebytes":[73,116,101,109,32,84,121,112,101,32],"value":"Item Type "} +{"hash":257887424,"name":"tfrmeditelement.rgitemtype.caption","sourcebytes":[73,116,101,109,32,84,121,112,101,32],"value":"Item Type "}, +{"hash":176733536,"name":"tfrmeditelement.rgrotation.caption","sourcebytes":[32,82,111,116,97,116,105,111,110,32],"value":" Rotation "}, +{"hash":111192878,"name":"tfrmeditelement.gbposition.caption","sourcebytes":[80,111,115,105,116,105,111,110],"value":"Position"}, +{"hash":374330,"name":"tfrmeditelement.lbltop.caption","sourcebytes":[84,111,112,58],"value":"Top:"}, +{"hash":209200,"name":"tfrmeditelement.edtop.text","sourcebytes":[48,46,48,48],"value":"0.00"}, +{"hash":209200,"name":"tfrmeditelement.edleft.text","sourcebytes":[48,46,48,48],"value":"0.00"}, +{"hash":5422458,"name":"tfrmeditelement.lblleft.caption","sourcebytes":[76,101,102,116,58],"value":"Left:"}, +{"hash":247455546,"name":"tfrmeditelement.lblheight.caption","sourcebytes":[72,101,105,103,104,116,58],"value":"Height:"}, +{"hash":209200,"name":"tfrmeditelement.edheight.text","sourcebytes":[48,46,48,48],"value":"0.00"}, +{"hash":98548410,"name":"tfrmeditelement.lblwidth.caption","sourcebytes":[87,105,100,116,104,58],"value":"Width:"}, +{"hash":209200,"name":"tfrmeditelement.edwidth.text","sourcebytes":[48,46,48,48],"value":"0.00"}, +{"hash":218757493,"name":"tfrmeditelement.chkvisible.caption","sourcebytes":[86,105,115,105,98,108,101],"value":"Visible"}, +{"hash":90721266,"name":"tfrmeditelement.panel2.caption","sourcebytes":[80,97,110,101,108,50],"value":"Panel2"}, +{"hash":91286579,"name":"tfrmeditelement.rbpixels.caption","sourcebytes":[80,105,120,101,108,115],"value":"Pixels"}, +{"hash":113810436,"name":"tfrmeditelement.rbpercent.caption","sourcebytes":[80,101,114,99,101,110,116],"value":"Percent"}, +{"hash":84188867,"name":"tfrmeditelement.rbinches.caption","sourcebytes":[73,110,99,104,101,115],"value":"Inches"}, +{"hash":1693,"name":"tfrmeditelement.rbcentimeters.caption","sourcebytes":[99,109],"value":"cm"} ]} diff --git a/components/tvplanit/source/vpedelem.pas b/components/tvplanit/source/vpedelem.pas index a245de8dd..cef8e5ca2 100644 --- a/components/tvplanit/source/vpedelem.pas +++ b/components/tvplanit/source/vpedelem.pas @@ -49,26 +49,32 @@ type TfrmEditElement = class(TForm) BevelHeightWidth: TBevel; BevelTopLeft: TBevel; + BevelTopLeft1: TBevel; btnCancel: TButton; btnOk: TButton; btnShape: TButton; edName: TEdit; gbDayOffset: TGroupBox; + gbPosition: TGroupBox; lblName: TLabel; Panel1: TPanel; DayOffsetPanel: TPanel; ButtonPanel: TPanel; ItemTypePanel: TPanel; HeightWidthPanel: TPanel; + Panel2: TPanel; + PositionPanel: TPanel; + rbPixels: TRadioButton; + rbPercent: TRadioButton; + rbInches: TRadioButton; + rbCentimeters: TRadioButton; TopLeftPanel: TPanel; rgDayOffsetUnit: TRadioGroup; rgItemType: TRadioGroup; - gbVisual: TGroupBox; LblTop: TLabel; LblLeft: TLabel; LblHeight: TLabel; LblWidth: TLabel; - rgMeasurement: TRadioGroup; rgRotation: TRadioGroup; edTop: TEdit; edLeft: TEdit; @@ -89,14 +95,14 @@ type procedure btnCancelClick(Sender: TObject); procedure btnOkClick(Sender: TObject); procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); procedure rgItemTypeClick(Sender: TObject); procedure btnShapeClick(Sender: TObject); - procedure FormShow(Sender: TObject); procedure btnCaptionFontClick(Sender: TObject); procedure edCaptionTextChange(Sender: TObject); - procedure rgMeasurementClick(Sender: TObject); procedure PosEditExit(Sender: TObject); procedure PosEditEnter(Sender: TObject); + procedure MeasurementUnitChange(Sender: TObject); procedure UpDownClick(Sender: TObject; Button: TUDBtnType); private procedure PositionControls; @@ -106,8 +112,8 @@ type TheShape: TVpPrintShape; TheCaption: TVpPrintCaption; CurEdit: TEdit; - MaxSpin: Integer; + function GetUnitIndex: Integer; procedure SaveData(AnElement: TVpPrintFormatElementItem); procedure SetData(AnElement: TVpPrintFormatElementItem); procedure SetItemType(Index: Integer); @@ -122,6 +128,7 @@ type implementation uses + Math, VpMisc, VpEdShape; {$IFDEF LCL} @@ -149,14 +156,31 @@ begin lblCaptionText.Enabled := False; btnCaptionFont.Enabled := False; - for i:=0 to rgDayOffsetUnit.ComponentCount-1 do - TRadioButton(rgDayOffsetUnit.Components[i]).ParentFont := false; + for i:=0 to rgDayOffsetUnit.ControlCount-1 do + TRadioButton(rgDayOffsetUnit.Controls[i]).ParentFont := false; rgDayOffsetUnit.Font.Style := [fsBold]; - for i:=0 to rgItemType.ComponentCount-1 do - TRadioButton(rgItemType.Components[i]).ParentFont := false; + for i:=0 to rgItemType.ControlCount-1 do + TRadioButton(rgItemType.Controls[i]).ParentFont := false; rgItemType.Font.Style := [fsBold]; + for i:=0 to rgRotation.ControlCount-1 do + TRadioButton(rgRotation.Controls[i]).ParentFont := false; + rgItemType.Font.Style := [fsBold]; + + for i:= 0 to gbPosition.ControlCount-1 do + begin + if gbPosition.Controls[i] is TLabel then + TLabel(gbPosition.Controls[i]).ParentFont := false + else if gbPosition.Controls[i] is TEdit then + TEdit(gbPosition.Controls[i]).ParentFont := false + else if gbPosition.Controls[i] is TCheckbox then + TCheckbox(gbPosition.Controls[i]).ParentFont := false + else if gbPosition.Controls[i] is TPanel then + TPanel(gbPosition.Controls[i]).ParentFont := false; + end; + gbPosition.Font.Style := [fsBold]; + SetCaptions; end; @@ -210,11 +234,30 @@ begin SaveData(AnElement); end; +function TfrmEditElement.GetUnitIndex: Integer; +begin + if rbPixels.Checked then + Result := 0 + else if rbPercent.Checked then + Result := 1 + else if rbInches.Checked then + Result := 2 + else if rbCentimeters.Checked then + Result := 3 + else + raise Exception.Create('GetUnitIndex: unknown control'); +end; + procedure TfrmEditElement.PosEditEnter(Sender: TObject); begin CurEdit := (Sender as TEdit); end; +procedure TfrmEditElement.MeasurementUnitChange(Sender: TObject); +begin + SetMaxSpin(GetUnitIndex); +end; + procedure TfrmEditElement.PosEditExit(Sender: TObject); var ed: TEdit; @@ -241,11 +284,6 @@ begin SetItemType(rgItemType.ItemIndex); end; -procedure TfrmEditElement.rgMeasurementClick(Sender: TObject); -begin - SetMaxSpin(rgMeasurement.ItemIndex); -end; - procedure TfrmEditElement.SaveData(AnElement: TVpPrintFormatElementItem); begin AnElement.ElementName := edName.Text; @@ -261,7 +299,7 @@ begin AnElement.DayOffsetUnits := TVpDayUnits(rgDayOffsetUnit.ItemIndex); AnElement.Rotation := TVpRotationAngle(rgRotation.ItemIndex); - AnElement.Measurement := TVpItemMeasurement(rgMeasurement.ItemIndex); + AnElement.Measurement := TVpItemMeasurement(GetUnitIndex); AnElement.Visible := chkVisible.Checked; end; @@ -289,12 +327,10 @@ begin rgDayOffsetUnit.Items[2] := RSMonths; rgDayOffsetUnit.Items[3] := RSYears; - gbVisual.Caption := RSVisualCaption; rgRotation.Caption := RSRotationCaption; - rgMeasurement.Caption := RSMeasurementCaption; - rgMeasurement.Items[0] := RSPixels; - rgMeasurement.Items[1] := RSPercent; - rgMeasurement.Items[2] := RSInches; + rbPixels.Caption := RSPixels; + rbPercent.Caption := RSPercent; + rbInches.Caption := RSInches; lblLeft.Caption := RSLeft; lblTop.Caption := RSTop; lblWidth.Caption := RSWidth; @@ -321,6 +357,11 @@ begin BevelTopLeft.Shape := bsSpacer; BevelHeightWidth.Shape := bsSpacer; + + rgRotation.Constraints.MinWidth := gbDayOffset.Width; + btnShape.Constraints.MinWidth := MaxValue([btnShape.Width, btnOK.Width, btnCancel.Width]); + btnOK.Constraints.MinWidth := btnShape.Constraints.MinWidth; + btnCancel.Constraints.MinWidth := btnShape.Constraints.MinWidth; end; procedure TfrmEditElement.SetData(AnElement : TVpPrintFormatElementItem); @@ -335,8 +376,13 @@ begin rgDayOffsetUnit.ItemIndex := Ord(AnElement.DayOffsetUnits); rgRotation.ItemIndex := Ord(AnElement.Rotation); - rgMeasurement.ItemIndex := Ord(AnElement.Measurement); - SetMaxSpin(rgMeasurement.ItemIndex); + case AnElement.Measurement of + imAbsolutePixel: rbPixels.Checked := true; + imPercent: rbPercent.Checked := true; + imInches: rbInches.Checked := true; + imCentimeters: rbCentimeters.Checked := true; + end; + SetMaxSpin(Ord(AnElement.Measurement)); edTop.Text := EvalFmt(AnElement.Top); udTop.Position := Trunc(AnElement.Top);