diff --git a/components/tvplanit/source/vpedshape.lfm b/components/tvplanit/source/vpedshape.lfm index f67a8b8a4..811868513 100644 --- a/components/tvplanit/source/vpedshape.lfm +++ b/components/tvplanit/source/vpedshape.lfm @@ -2,52 +2,61 @@ object frmEditShape: TfrmEditShape Left = 772 Height = 243 Top = 248 - Width = 363 + Width = 426 HorzScrollBar.Page = 362 VertScrollBar.Page = 313 BorderStyle = bsDialog Caption = 'Edit Shape' ClientHeight = 243 - ClientWidth = 363 + ClientWidth = 426 OnCreate = FormCreate OnDestroy = FormDestroy Position = poScreenCenter ShowHint = True LCLVersion = '1.7' object btnOk: TButton - Left = 192 + AnchorSideBottom.Control = gbPen + AnchorSideBottom.Side = asrBottom + Left = 253 Height = 25 Top = 203 Width = 75 + Anchors = [akLeft, akBottom] Caption = 'OK' Default = True OnClick = btnOkClick TabOrder = 3 end object btnCancel: TButton - Left = 272 + AnchorSideBottom.Control = gbPen + AnchorSideBottom.Side = asrBottom + Left = 333 Height = 25 Top = 203 Width = 75 + Anchors = [akLeft, akBottom] + BorderSpacing.Right = 8 Cancel = True Caption = 'Cancel' OnClick = btnCancelClick TabOrder = 4 end object gbBrush: TGroupBox - Left = 186 + Left = 216 Height = 86 Top = 88 - Width = 165 + Width = 192 + BorderSpacing.Right = 8 Caption = ' Brush ' ClientHeight = 66 - ClientWidth = 161 + ClientWidth = 188 TabOrder = 2 object lblBrushStyle: TLabel Left = 8 Height = 15 Top = 35 Width = 28 + BorderSpacing.Left = 8 Caption = 'Style:' FocusControl = cbBrushStyle ParentColor = False @@ -56,7 +65,9 @@ object frmEditShape: TfrmEditShape Left = 52 Height = 23 Top = 32 - Width = 97 + Width = 129 + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 8 ItemHeight = 15 OnChange = cbBrushStyleChange OnDrawItem = cbBrushStyleDrawItem @@ -67,6 +78,7 @@ object frmEditShape: TfrmEditShape Height = 15 Top = 5 Width = 32 + BorderSpacing.Left = 8 Caption = 'Color:' FocusControl = cbBrushColor ParentColor = False @@ -75,8 +87,9 @@ object frmEditShape: TfrmEditShape Left = 52 Height = 22 Top = 1 - Width = 97 + Width = 124 Style = [cbStandardColors, cbExtendedColors, cbPrettyNames, cbCustomColors] + BorderSpacing.Right = 8 ItemHeight = 16 OnChange = cbBrushColorChange TabOrder = 1 @@ -86,16 +99,19 @@ object frmEditShape: TfrmEditShape Left = 8 Height = 140 Top = 88 - Width = 165 + Width = 192 + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 8 Caption = ' Pen ' ClientHeight = 120 - ClientWidth = 161 + ClientWidth = 188 TabOrder = 1 object lblPenStyle: TLabel Left = 8 Height = 15 Top = 35 Width = 28 + BorderSpacing.Left = 8 Caption = 'Style:' FocusControl = cbPenStyle ParentColor = False @@ -105,6 +121,7 @@ object frmEditShape: TfrmEditShape Height = 15 Top = 64 Width = 35 + BorderSpacing.Left = 8 Caption = 'Width:' FocusControl = edPenWidth ParentColor = False @@ -114,6 +131,7 @@ object frmEditShape: TfrmEditShape Height = 15 Top = 92 Width = 34 + BorderSpacing.Left = 8 Caption = 'Mode:' FocusControl = cbPenMode ParentColor = False @@ -122,7 +140,8 @@ object frmEditShape: TfrmEditShape Left = 52 Height = 23 Top = 32 - Width = 97 + Width = 124 + BorderSpacing.Right = 8 ItemHeight = 15 OnChange = cbPenStyleChange OnDrawItem = cbPenStyleDrawItem @@ -132,7 +151,9 @@ object frmEditShape: TfrmEditShape Left = 52 Height = 23 Top = 88 - Width = 97 + Width = 124 + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 8 ItemHeight = 15 TabOrder = 4 end @@ -160,8 +181,9 @@ object frmEditShape: TfrmEditShape Left = 52 Height = 22 Top = 1 - Width = 97 + Width = 124 Style = [cbStandardColors, cbExtendedColors, cbPrettyNames, cbCustomColors] + BorderSpacing.Right = 8 ItemHeight = 16 OnChange = cbPenColorChange TabOrder = 0 @@ -171,6 +193,7 @@ object frmEditShape: TfrmEditShape Height = 15 Top = 5 Width = 29 + BorderSpacing.Left = 8 Caption = 'Color' FocusControl = cbPenColor ParentColor = False @@ -180,66 +203,71 @@ object frmEditShape: TfrmEditShape Left = 8 Height = 67 Top = 8 - Width = 324 + Width = 400 + BorderSpacing.Right = 8 Caption = 'gbShapes' ClientHeight = 47 - ClientWidth = 320 + ClientWidth = 396 TabOrder = 0 object SpeedButton1: TSpeedButton Left = 12 Height = 32 - Top = 7 + Top = 4 Width = 32 + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 8 Down = True GroupIndex = 1 end object SpeedButton2: TSpeedButton Left = 49 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton3: TSpeedButton Left = 86 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton4: TSpeedButton Left = 123 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton5: TSpeedButton Left = 160 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton6: TSpeedButton Left = 197 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton7: TSpeedButton Left = 234 Height = 32 - Top = 7 + Top = 4 Width = 32 GroupIndex = 1 end object SpeedButton8: TSpeedButton Left = 271 Height = 32 - Top = 7 + Top = 4 Width = 32 + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 8 GroupIndex = 1 end end diff --git a/components/tvplanit/source/vpedshape.pas b/components/tvplanit/source/vpedshape.pas index 421cd61bf..a7dbff0ce 100644 --- a/components/tvplanit/source/vpedshape.pas +++ b/components/tvplanit/source/vpedshape.pas @@ -303,6 +303,10 @@ var DELTA: Integer = 8; VDIST: Integer = 4; begin + AutoSize := false; + gbPen.AutoSize := false; + gbBrush.AutoSize := false; + // 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 @@ -316,7 +320,7 @@ begin DELTA := round(DELTA * Screen.PixelsPerInch / DesignTimeDPI); VDIST := round(VDIST * Screen.PixelsPerInch / DesignTimeDPI); - // Horizontal alignment + { gbPen - hor } w := MaxValue([GetLabelWidth(lblPenColor), GetLabelWidth(lblPenStyle), GetLabelWidth(lblPenWidth), GetLabelWidth(lblPenMode)]) + 2 * DELTA; cbPenColor.Left := w; @@ -327,27 +331,55 @@ begin lblPenStyle.Left := cbPenColor.Left - GetLabelWidth(lblPenStyle) - DELTA; lblPenWidth.Left := cbPenColor.Left - GetLabelWidth(lblPenWidth) - DELTA; lblPenMode.Left := cbPenColor.Left - GetLabelWidth(lblPenMode) - DELTA; - gbPen.Width := RightOf(cbPenColor) + DELTA; udPenWidth.Left := RightOf(edPenWidth); + { gbPen - vert } + lblPenColor.Top := cbPenColor.Top + (cbPenColor.Height - lblPenColor.Height) div 2; + cbPenStyle.Top := BottomOf(cbPenColor) + VDIST; + lblPenstyle.Top := cbPenStyle.Top + (cbPenStyle.Height - lblPenStyle.Height) div 2; + 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; + + { gpPen - set size } + gbPen.AutoSize := true; + + { gbBrush - hor } w := MaxValue([GetLabelWidth(lblBrushColor), GetLabelWidth(lblBrushStyle)]) + 2*DELTA; cbBrushColor.Left := w; cbBrushStyle.Left := w; + cbBrushColor.Width := cbPenColor.Width; + cbBrushStyle.Width := cbPenStyle.Width; lblBrushColor.Left := cbBrushColor.Left - GetLabelWidth(lblBrushColor) - DELTA; lblBrushStyle.Left := cbBrushColor.Left - GetLabelWidth(lblBrushStyle) - DELTA; gbBrush.Left := RightOf(gbPen) + 16; - gbBrush.Width := RightOf(cbBrushColor) + DELTA; + { gbBrush - ver } + lblBrushColor.Top := lblPenColor.Top; + cbBrushStyle.Top := cbPenStyle.Top; + lblBrushStyle.Top := lblPenStyle.Top; + + { gbBrush - set size } + gbBrush.AutoSize := true; + + { Buttons - hor } btnOK.Width := Max(GetButtonWidth(btnOK), GetButtonWidth(btnCancel)); btnCancel.Width := btnOK.Width; - if btnOK.Width + DELTA + btnCancel.Width > gbBrush.Width then - gbBrush.Width := btnOK.Width + DELTA + btnCancel.Width; + if btnOK.Width + DELTA + btnCancel.Width > gbBrush.Width then begin + cbBrushColor.Width := cbBrushColor.Width + btnOK.Width + DELTA + btnCancel.Width - gbBrush.Width; + cbBrushStyle.Width := cbBrushColor.Width; + end; btnCancel.Left := RightOf(gbBrush) - btnCancel.Width; btnOK.Left := btnCancel.Left - DELTA - btnOK.Width; - ClientWidth := RightOf(gbBrush) + gbPen.Left; + { Buttons - vert } + btnOK.Top := BottomOf(gbPen) - btnOK.Height; + btnCancel.Top := btnOK.Top; - gbShapes.Width := ClientWidth - gbShapes.Left * 2; + { shapes - hor } + gbShapes.Width := RightOf(gbBrush) - gbShapes.Left; w := (gbShapes.ClientWidth - 11 * DELTA) div 8; for shape := Low(TVpShapeType) to High(TVpShapeType) do begin if shape = Low(TVpShapeType) then @@ -356,26 +388,7 @@ begin FShapeButtons[shape].Width := w; 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; - + AutoSize := true; end; procedure TfrmEditShape.SaveData(AShape: TVpPrintShape);