jvcllaz: Improved cross-platform layout of TimeLineDemo. Fix some issues in TJvTimeLine.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6959 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-27 16:34:26 +00:00
parent 7e09fbeea1
commit 1208e21319
4 changed files with 259 additions and 146 deletions

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="TimeLineDemo"/> <Title Value="TimeLineDemo"/>
<Scaled Value="True"/> <Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>

View File

@ -1,12 +1,12 @@
object TimelineMainForm: TTimelineMainForm object TimelineMainForm: TTimelineMainForm
Left = 357 Left = 357
Height = 607 Height = 640
Top = 104 Top = 104
Width = 731 Width = 752
ActiveControl = TimeLine1 ActiveControl = TimeLine1
Caption = 'Test program for TJvTimeLine' Caption = 'Test program for TJvTimeLine'
ClientHeight = 607 ClientHeight = 640
ClientWidth = 731 ClientWidth = 752
Color = clSilver Color = clSilver
Constraints.MinHeight = 500 Constraints.MinHeight = 500
Constraints.MinWidth = 700 Constraints.MinWidth = 700
@ -14,23 +14,24 @@ object TimelineMainForm: TTimelineMainForm
Font.Color = clWindowText Font.Color = clWindowText
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.9.0.0' LCLVersion = '2.1.0.0'
Scaled = False Scaled = False
object Splitter1: TSplitter object Splitter1: TSplitter
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 3 Height = 3
Top = 0 Top = 0
Width = 731 Width = 752
Align = alTop Align = alTop
ResizeAnchor = akTop ResizeAnchor = akTop
end end
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 23 Height = 23
Top = 584 Top = 617
Width = 731 Width = 752
Panels = < Panels = <
item item
Width = 50 Width = 50
@ -39,36 +40,19 @@ object TimelineMainForm: TTimelineMainForm
end end
object TimeLine1: TJvTimeLine object TimeLine1: TJvTimeLine
Left = 0 Left = 0
Height = 293 Height = 358
Top = 3 Top = 3
Width = 731 Width = 752
Align = alClient Align = alClient
Color = clCream Color = clCream
HelperYears = False DragCursor = crDefault
PopupMenu = PopupMenu1 FirstVisibleDate = 35400
ParentShowHint = False
ShowHint = True
Font.CharSet = ANSI_CHARSET Font.CharSet = ANSI_CHARSET
Font.Color = clMaroon Font.Color = clMaroon
TabStop = True HelperYears = False
TabOrder = 0 HorzSupports = True
OnMouseDown = TimeLine1MouseDown
OnMouseMove = TimeLine1MouseMove
OnClick = TimeLine1Click
DragCursor = crDefault
OnDragOver = TimeLine1DragOver
OnDragDrop = TimeLine1DragDrop
YearFont.CharSet = ANSI_CHARSET
YearFont.Color = clPurple
YearFont.Height = -29
YearFont.Name = 'Lucida Sans Unicode'
YearFont.Style = [fsBold]
YearWidth = 600
ShowDays = True
ShowItemHint = True
ShowMonthNames = False
FirstVisibleDate = 35400
Images = ImageList1 Images = ImageList1
ItemHeight = 40
Items = < Items = <
item item
Left = 53 Left = 53
@ -144,37 +128,37 @@ object TimelineMainForm: TTimelineMainForm
end end
item item
Left = 233 Left = 233
Top = 211 Top = 251
Caption = ' Simons birthday' Caption = ' Simons birthday'
Color = 8404992 Color = 8404992
Date = 35539 Date = 35539
Hint = 'Simons birthday' Hint = 'Simons birthday'
ImageIndex = 8 ImageIndex = 8
Level = 2 Level = 3
TextColor = 16777088 TextColor = 16777088
Width = 85 Width = 85
end end
item item
Left = 361 Left = 361
Top = 171 Top = 291
Caption = ' Elias birthday' Caption = ' Elias birthday'
Color = clMaroon Color = clMaroon
Date = 35617 Date = 35617
Hint = 'Elias birthday' Hint = 'Elias birthday'
ImageIndex = 8 ImageIndex = 8
Level = 1 Level = 4
TextColor = clWhite TextColor = clWhite
Width = 70 Width = 70
end end
item item
Left = 206 Left = 206
Top = 171 Top = 291
Caption = ' Majas birthday' Caption = ' Majas birthday'
Color = 8388863 Color = 8388863
Date = 35523 Date = 35523
Hint = 'Majas birthday' Hint = 'Majas birthday'
ImageIndex = 8 ImageIndex = 8
Level = 1 Level = 4
TextColor = clWhite TextColor = clWhite
Width = 85 Width = 85
end end
@ -238,44 +222,77 @@ object TimelineMainForm: TTimelineMainForm
Level = 1 Level = 1
TextColor = clAqua TextColor = clAqua
end> end>
ItemHeight = 40 PopupMenu = PopupMenu1
HorzSupports = True ParentShowHint = False
ShowDays = True
ShowHint = True
ShowItemHint = True
ShowMonthNames = False
SupportsColor = clSilver SupportsColor = clSilver
OnItemClick = TimeLine1ItemClick TabOrder = 0
TabStop = True
YearFont.CharSet = ANSI_CHARSET
YearFont.Color = clPurple
YearFont.Height = -29
YearFont.Name = 'Lucida Sans Unicode'
YearFont.Style = [fsBold]
YearWidth = 600
OnClick = TimeLine1Click
OnDragDrop = TimeLine1DragDrop
OnDragOver = TimeLine1DragOver
OnDrawItem = TimeLine1DrawItem OnDrawItem = TimeLine1DrawItem
OnSaveItem = TimeLine1SaveItem OnItemClick = TimeLine1ItemClick
OnLoadItem = TimeLine1LoadItem
OnItemMoved = TimeLine1ItemMoved OnItemMoved = TimeLine1ItemMoved
OnLoadItem = TimeLine1LoadItem
OnMouseDown = TimeLine1MouseDown
OnMouseMove = TimeLine1MouseMove
OnSaveItem = TimeLine1SaveItem
end end
object Panel2: TPanel object Panel2: TPanel
Left = 0 Left = 0
Height = 288 Height = 256
Top = 296 Top = 361
Width = 731 Width = 752
Align = alBottom Align = alBottom
AutoSize = True
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 288 ClientHeight = 256
ClientWidth = 731 ClientWidth = 752
Color = clForm Color = clForm
ParentColor = False ParentColor = False
TabOrder = 2 TabOrder = 2
object Label6: TLabel object Label6: TLabel
Left = 8 AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = GroupBox3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnSave
Left = 12
Height = 30 Height = 30
Top = 216 Top = 216
Width = 565 Width = 565
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 10
BorderSpacing.Right = 8
BorderSpacing.Bottom = 10
Caption = 'Scrolling is done one month at a time: hold down the Ctrl key when clicking to skip ahead one year instead.'#13#10'Right-click any item to see its actions, check and uncheck boxes to see the properties at work.' Caption = 'Scrolling is done one month at a time: hold down the Ctrl key when clicking to skip ahead one year instead.'#13#10'Right-click any item to see its actions, check and uncheck boxes to see the properties at work.'
ParentColor = False ParentColor = False
WordWrap = True WordWrap = True
end end
object GroupBox1: TGroupBox object GroupBox1: TGroupBox
Left = 8 AnchorSideLeft.Control = Panel2
Height = 193 AnchorSideTop.Control = GroupBox3
Top = 16 AnchorSideBottom.Control = GroupBox3
Width = 196 AnchorSideBottom.Side = asrBottom
Left = 12
Height = 198
Top = 8
Width = 212
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 12
Caption = ' New item: ' Caption = ' New item: '
ClientHeight = 173 ClientHeight = 178
ClientWidth = 192 ClientWidth = 208
Constraints.MinWidth = 212
TabOrder = 0 TabOrder = 0
object lblCaption: TLabel object lblCaption: TLabel
AnchorSideLeft.Control = GroupBox1 AnchorSideLeft.Control = GroupBox1
@ -318,7 +335,7 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = Bevel1 AnchorSideLeft.Control = Bevel1
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblImIndex AnchorSideTop.Control = lblImIndex
Left = 104 Left = 112
Height = 15 Height = 15
Top = 64 Top = 64
Width = 30 Width = 30
@ -330,10 +347,15 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = Bevel1 AnchorSideLeft.Control = Bevel1
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnColor AnchorSideTop.Control = btnColor
Left = 104 AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 112
Height = 25 Height = 25
Top = 134 Top = 133
Width = 75 Width = 84
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Right = 12
Caption = '&Add' Caption = '&Add'
OnClick = btnAddClick OnClick = btnAddClick
TabOrder = 5 TabOrder = 5
@ -342,16 +364,15 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = lblCaption AnchorSideLeft.Control = lblCaption
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox1 AnchorSideTop.Control = GroupBox1
AnchorSideRight.Control = GroupBox1 AnchorSideRight.Control = btnAdd
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 65 Left = 65
Height = 23 Height = 23
Top = 2 Top = 2
Width = 115 Width = 131
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 12
TabOrder = 0 TabOrder = 0
Text = 'New item' Text = 'New item'
end end
@ -383,21 +404,22 @@ object TimelineMainForm: TTimelineMainForm
end end
object edLevel: TEdit object edLevel: TEdit
AnchorSideLeft.Control = lblLevel AnchorSideLeft.Control = lblLevel
AnchorSideTop.Control = CbImgIndex
AnchorSideRight.Control = udLevel AnchorSideRight.Control = udLevel
Left = 104 Left = 112
Height = 23 Height = 23
Top = 81 Top = 83
Width = 61 Width = 69
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
TabOrder = 1 TabOrder = 1
Text = '0' Text = '0'
end end
object udLevel: TUpDown object udLevel: TUpDown
AnchorSideRight.Control = edCaption AnchorSideRight.Control = btnAdd
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 165 Left = 181
Height = 23 Height = 23
Top = 81 Top = 83
Width = 15 Width = 15
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
Associate = edLevel Associate = edLevel
@ -405,16 +427,20 @@ object TimelineMainForm: TTimelineMainForm
Min = 0 Min = 0
Position = 0 Position = 0
TabOrder = 2 TabOrder = 2
Wrap = False
end end
object btnColor: TButton object btnColor: TButton
AnchorSideLeft.Control = GroupBox1
AnchorSideRight.Control = Bevel1 AnchorSideRight.Control = Bevel1
Left = 13 AnchorSideBottom.Control = GroupBox1
AnchorSideBottom.Side = asrBottom
Left = 16
Height = 25 Height = 25
Top = 134 Top = 133
Width = 75 Width = 80
Anchors = [akTop, akRight] Anchors = [akLeft, akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 16 BorderSpacing.Left = 16
BorderSpacing.Bottom = 20
Caption = 'Color...' Caption = 'Color...'
OnClick = btnColorClick OnClick = btnColorClick
TabOrder = 3 TabOrder = 3
@ -422,7 +448,7 @@ object TimelineMainForm: TTimelineMainForm
object Bevel1: TBevel object Bevel1: TBevel
AnchorSideLeft.Control = GroupBox1 AnchorSideLeft.Control = GroupBox1
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
Left = 88 Left = 96
Height = 50 Height = 50
Top = 64 Top = 64
Width = 16 Width = 16
@ -434,11 +460,11 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Bevel1 AnchorSideRight.Control = Bevel1
Left = 12 Left = 12
Height = 24 Height = 22
Top = 81 Top = 83
Width = 76 Width = 84
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2 BorderSpacing.Top = 4
DropDownCount = 24 DropDownCount = 24
Images = ImageList1 Images = ImageList1
ItemHeight = 16 ItemHeight = 16
@ -447,13 +473,21 @@ object TimelineMainForm: TTimelineMainForm
end end
end end
object GroupBox2: TGroupBox object GroupBox2: TGroupBox
Left = 240 AnchorSideLeft.Control = GroupBox1
Height = 193 AnchorSideLeft.Side = asrBottom
Top = 16 AnchorSideTop.Control = GroupBox3
Width = 256 AnchorSideBottom.Control = GroupBox3
AnchorSideBottom.Side = asrBottom
Left = 248
Height = 198
Top = 8
Width = 258
Anchors = [akTop, akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 24
Caption = ' Options: ' Caption = ' Options: '
ClientHeight = 173 ClientHeight = 178
ClientWidth = 252 ClientWidth = 254
TabOrder = 1 TabOrder = 1
object chkMonths: TCheckBox object chkMonths: TCheckBox
AnchorSideLeft.Control = GroupBox2 AnchorSideLeft.Control = GroupBox2
@ -505,13 +539,14 @@ object TimelineMainForm: TTimelineMainForm
TabOrder = 3 TabOrder = 3
end end
object chkAutosize: TCheckBox object chkAutosize: TCheckBox
AnchorSideLeft.Control = Bevel2 AnchorSideLeft.Control = chkWidthAs
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox2 AnchorSideTop.Control = GroupBox2
Left = 128 Left = 121
Height = 19 Height = 19
Top = 2 Top = 2
Width = 65 Width = 65
BorderSpacing.Left = 16
BorderSpacing.Top = 2 BorderSpacing.Top = 2
Caption = 'Autosi&ze' Caption = 'Autosi&ze'
OnClick = chkAutosizeClick OnClick = chkAutosizeClick
@ -521,7 +556,7 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = chkAutosize AnchorSideLeft.Control = chkAutosize
AnchorSideTop.Control = chkAutosize AnchorSideTop.Control = chkAutosize
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 128 Left = 121
Height = 19 Height = 19
Top = 21 Top = 21
Width = 89 Width = 89
@ -533,7 +568,7 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = chkAutosize AnchorSideLeft.Control = chkAutosize
AnchorSideTop.Control = chkSupport AnchorSideTop.Control = chkSupport
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 128 Left = 121
Height = 19 Height = 19
Top = 40 Top = 40
Width = 90 Width = 90
@ -545,7 +580,7 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = chkAutosize AnchorSideLeft.Control = chkAutosize
AnchorSideTop.Control = chkLarge AnchorSideTop.Control = chkLarge
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 128 Left = 121
Height = 19 Height = 19
Top = 59 Top = 59
Width = 81 Width = 81
@ -555,11 +590,17 @@ object TimelineMainForm: TTimelineMainForm
end end
object btnAuto: TButton object btnAuto: TButton
AnchorSideLeft.Control = GroupBox2 AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = chkReset
AnchorSideBottom.Control = GroupBox2
AnchorSideBottom.Side = asrBottom
Left = 12 Left = 12
Height = 25 Height = 25
Top = 120 Top = 121
Width = 75 Width = 84
AutoSize = True
BorderSpacing.Left = 12 BorderSpacing.Left = 12
BorderSpacing.Top = 6
BorderSpacing.Bottom = 12
Caption = 'A&utoLevels' Caption = 'A&utoLevels'
OnClick = btnAutoClick OnClick = btnAutoClick
TabOrder = 10 TabOrder = 10
@ -567,11 +608,15 @@ object TimelineMainForm: TTimelineMainForm
object chkReset: TCheckBox object chkReset: TCheckBox
AnchorSideLeft.Control = btnAuto AnchorSideLeft.Control = btnAuto
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
Left = 103 AnchorSideTop.Control = chkFlat
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrCenter
Left = 112
Height = 19 Height = 19
Top = 112 Top = 115
Width = 103 Width = 103
BorderSpacing.Left = 16 BorderSpacing.Left = 16
BorderSpacing.Top = 18
Caption = 'Reset levels &first' Caption = 'Reset levels &first'
TabOrder = 11 TabOrder = 11
end end
@ -579,11 +624,13 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = chkReset AnchorSideLeft.Control = chkReset
AnchorSideTop.Control = chkReset AnchorSideTop.Control = chkReset
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 103 Left = 112
Height = 19 Height = 19
Top = 133 Top = 136
Width = 130 Width = 130
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 12
BorderSpacing.Bottom = 12
Caption = '&Complete evaluation' Caption = '&Complete evaluation'
TabOrder = 12 TabOrder = 12
end end
@ -591,7 +638,7 @@ object TimelineMainForm: TTimelineMainForm
AnchorSideLeft.Control = chkAutosize AnchorSideLeft.Control = chkAutosize
AnchorSideTop.Control = chkOwnerDraw AnchorSideTop.Control = chkOwnerDraw
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 128 Left = 121
Height = 19 Height = 19
Top = 78 Top = 78
Width = 39 Width = 39
@ -611,24 +658,23 @@ object TimelineMainForm: TTimelineMainForm
OnClick = chkHelpYearClick OnClick = chkHelpYearClick
TabOrder = 4 TabOrder = 4
end end
object Bevel2: TBevel
AnchorSideLeft.Control = GroupBox2
AnchorSideLeft.Side = asrCenter
Left = 124
Height = 50
Top = 64
Width = 4
Shape = bsSpacer
end
end end
object GroupBox3: TGroupBox object GroupBox3: TGroupBox
Left = 528 AnchorSideLeft.Control = GroupBox2
Height = 193 AnchorSideLeft.Side = asrBottom
Top = 16 AnchorSideTop.Control = Panel2
Width = 193 AnchorSideBottom.Side = asrBottom
Left = 530
Height = 198
Top = 8
Width = 187
AutoSize = True
BorderSpacing.Left = 24
BorderSpacing.Top = 8
BorderSpacing.Right = 12
Caption = ' Sizing: ' Caption = ' Sizing: '
ClientHeight = 173 ClientHeight = 178
ClientWidth = 189 ClientWidth = 183
TabOrder = 2 TabOrder = 2
object lblYrSize: TLabel object lblYrSize: TLabel
AnchorSideLeft.Control = GroupBox3 AnchorSideLeft.Control = GroupBox3
@ -644,8 +690,9 @@ object TimelineMainForm: TTimelineMainForm
ParentColor = False ParentColor = False
end end
object lblItemHeight: TLabel object lblItemHeight: TLabel
AnchorSideLeft.Control = edItemHeight
AnchorSideTop.Control = lblYrSize AnchorSideTop.Control = lblYrSize
Left = 111 Left = 101
Height = 15 Height = 15
Top = 2 Top = 2
Width = 61 Width = 61
@ -667,21 +714,34 @@ object TimelineMainForm: TTimelineMainForm
ParentColor = False ParentColor = False
end end
object btnYrFont: TButton object btnYrFont: TButton
Left = 97 AnchorSideLeft.Control = btnFont
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnFont
Left = 83
Height = 25 Height = 25
Top = 104 Top = 110
Width = 75 Width = 85
AutoSize = True
BorderSpacing.Left = 16
BorderSpacing.Bottom = 12
Caption = 'Yea&r Font...' Caption = 'Yea&r Font...'
OnClick = btnYrFontClick OnClick = btnYrFontClick
TabOrder = 6 TabOrder = 6
end end
object btnFont: TButton object btnFont: TButton
AnchorSideLeft.Control = GroupBox3 AnchorSideLeft.Control = GroupBox3
AnchorSideTop.Control = dtpFirstDate
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ColorBtn
AnchorSideRight.Side = asrBottom
Left = 8 Left = 8
Height = 25 Height = 25
Top = 104 Top = 110
Width = 75 Width = 59
AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 16
BorderSpacing.Bottom = 6
Caption = '&Font...' Caption = '&Font...'
OnClick = btnFontClick OnClick = btnFontClick
TabOrder = 4 TabOrder = 4
@ -699,6 +759,8 @@ object TimelineMainForm: TTimelineMainForm
Text = '600' Text = '600'
end end
object udYrSize: TUpDown object udYrSize: TUpDown
AnchorSideLeft.Control = edYrSize
AnchorSideLeft.Side = asrBottom
Left = 62 Left = 62
Height = 23 Height = 23
Top = 21 Top = 21
@ -710,20 +772,23 @@ object TimelineMainForm: TTimelineMainForm
OnClick = udYrSizeClick OnClick = udYrSizeClick
Position = 600 Position = 600
TabOrder = 1 TabOrder = 1
Wrap = False
end end
object edItemHeight: TEdit object edItemHeight: TEdit
AnchorSideLeft.Control = lblItemHeight AnchorSideLeft.Control = udYrSize
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edYrSize AnchorSideTop.Control = edYrSize
Left = 111 Left = 101
Height = 23 Height = 23
Top = 21 Top = 21
Width = 50 Width = 50
BorderSpacing.Left = 24
TabOrder = 2 TabOrder = 2
Text = '36' Text = '36'
end end
object udItemHeight: TUpDown object udItemHeight: TUpDown
Left = 161 AnchorSideLeft.Control = edItemHeight
AnchorSideLeft.Side = asrBottom
Left = 151
Height = 23 Height = 23
Top = 21 Top = 21
Width = 15 Width = 15
@ -732,7 +797,6 @@ object TimelineMainForm: TTimelineMainForm
OnClick = udItemHeightClick OnClick = udItemHeightClick
Position = 36 Position = 36
TabOrder = 3 TabOrder = 3
Wrap = False
end end
object dtpFirstDate: TDateTimePicker object dtpFirstDate: TDateTimePicker
AnchorSideLeft.Control = lblFirstVisibleDate AnchorSideLeft.Control = lblFirstVisibleDate
@ -763,19 +827,35 @@ object TimelineMainForm: TTimelineMainForm
end end
object ColorBtn: TButton object ColorBtn: TButton
AnchorSideLeft.Control = btnFont AnchorSideLeft.Control = btnFont
AnchorSideTop.Control = btnFont
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnFont
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 8 Left = 8
Height = 25 Height = 25
Top = 136 Top = 141
Width = 75 Width = 59
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Bottom = 12
Caption = 'Color...' Caption = 'Color...'
OnClick = ColorBtnClick OnClick = ColorBtnClick
TabOrder = 7 TabOrder = 7
end end
object cbDragging: TComboBox object cbDragging: TComboBox
Left = 97 AnchorSideLeft.Control = ColorBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ColorBtn
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = btnYrFont
AnchorSideRight.Side = asrBottom
Left = 83
Height = 23 Height = 23
Top = 136 Top = 142
Width = 76 Width = 85
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 16
ItemHeight = 15 ItemHeight = 15
Items.Strings = ( Items.Strings = (
'No dragging' 'No dragging'
@ -788,19 +868,32 @@ object TimelineMainForm: TTimelineMainForm
end end
end end
object btnSave: TButton object btnSave: TButton
Left = 536 AnchorSideTop.Control = GroupBox3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnLoad
Left = 585
Height = 25 Height = 25
Top = 254 Top = 216
Width = 75 Width = 59
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 10
BorderSpacing.Right = 12
Caption = 'Save...' Caption = 'Save...'
OnClick = btnSaveClick OnClick = btnSaveClick
TabOrder = 3 TabOrder = 3
end end
object btnLoad: TButton object btnLoad: TButton
Left = 624 AnchorSideTop.Control = btnSave
AnchorSideRight.Control = GroupBox3
AnchorSideRight.Side = asrBottom
Left = 656
Height = 25 Height = 25
Top = 254 Top = 216
Width = 75 Width = 61
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Bottom = 12
Caption = 'Load...' Caption = 'Load...'
OnClick = btnLoadClick OnClick = btnLoadClick
TabOrder = 4 TabOrder = 4

View File

@ -41,7 +41,6 @@ type
TTimelineMainForm = class(TForm) TTimelineMainForm = class(TForm)
Bevel1: TBevel; Bevel1: TBevel;
Bevel2: TBevel;
CbImgIndex: TComboBoxEx; CbImgIndex: TComboBoxEx;
ImageList1: TImageList; ImageList1: TImageList;
Splitter1: TSplitter; Splitter1: TSplitter;
@ -105,6 +104,7 @@ type
procedure chkMultiClick(Sender: TObject); procedure chkMultiClick(Sender: TObject);
procedure btnFontClick(Sender: TObject); procedure btnFontClick(Sender: TObject);
procedure btnYrFontClick(Sender: TObject); procedure btnYrFontClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TimeLine1Click(Sender: TObject); procedure TimeLine1Click(Sender: TObject);
procedure Changecaption1Click(Sender: TObject); procedure Changecaption1Click(Sender: TObject);
procedure remove1Click(Sender: TObject); procedure remove1Click(Sender: TObject);
@ -218,6 +218,18 @@ begin
end; end;
end; end;
procedure TTimelineMainForm.FormShow(Sender: TObject);
var
h: Integer;
begin
h := Height;
AutoSize := true;
AutoSize := false;
Constraints.MinWidth := Width;
Constraints.MinHeight := Height;
Height := h;
end;
procedure TTimelineMainForm.TimeLine1Click(Sender: TObject); procedure TTimelineMainForm.TimeLine1Click(Sender: TObject);
begin begin
if TimeLine1.Selected <> nil then if TimeLine1.Selected <> nil then
@ -279,8 +291,8 @@ begin
if chkNoImages.Checked then if chkNoImages.Checked then
begin begin
TimeLine1.Images := nil; TimeLine1.Images := nil;
TimeLine1.ItemHeight := 16; TimeLine1.ItemHeight := 17;
udItemHeight.Position := 16; udItemHeight.Position := 17;
end end
else else
chkLargeClick(nil); chkLargeClick(nil);
@ -312,14 +324,14 @@ begin
if chkLarge.Checked then if chkLarge.Checked then
begin begin
TimeLine1.Images := ImageList2; TimeLine1.Images := ImageList2;
TimeLine1.ItemHeight := 50; TimeLine1.ItemHeight := 60;
udItemHeight.Position := 50; udItemHeight.Position := 60;
end end
else else
begin begin
TimeLine1.Images := ImageList1; TimeLine1.Images := ImageList1;
TimeLine1.ItemHeight := 36; TimeLine1.ItemHeight := 40;
udItemHeight.Position := 36; udItemHeight.Position := 40;
end; end;
end; end;

View File

@ -420,8 +420,10 @@ type
published published
property Align; property Align;
property AutoSize; property AutoSize;
property BorderSpacing;
property BorderStyle; property BorderStyle;
property Color; property Color;
property Constraints;
property Cursor; property Cursor;
property DragCursor; property DragCursor;
property DragLine; property DragLine;
@ -493,6 +495,7 @@ implementation
{$R ..\..\resource\jvtimeline.res} {$R ..\..\resource\jvtimeline.res}
uses uses
InterfaceBase, LCLPlatformDef,
Math, Types, DateUtils, Themes, Math, Types, DateUtils, Themes,
JvJCLUtils, JvJVCLUtils; JvJCLUtils, JvJVCLUtils;
@ -831,13 +834,16 @@ const
var var
Button: TThemedScrollBar; Button: TThemedScrollBar;
Details: TThemedElementDetails; Details: TThemedElementDetails;
useThemedBtn: Boolean;
begin begin
if TimeLine = nil then if TimeLine = nil then
Exit; Exit;
if not Visible then if not Visible then
Exit; Exit;
if ThemeServices.ThemesEnabled then useThemedBtn := ThemeServices.ThemesEnabled and not (WidgetSet.LCLPlatform in [lpQT, lpGTK2]);
if useThemedBtn then
begin begin
if FPushed then if FPushed then
Button := tsArrowBtnLeftPressed Button := tsArrowBtnLeftPressed
@ -1155,7 +1161,8 @@ begin
else else
FArrows[I].UpdatePlacement; FArrows[I].UpdatePlacement;
end; end;
FItemHeight := Canvas.TextHeight('Tg') + ITEM_MARGIN; if FItemHeight = 0 then
FItemHeight := Canvas.TextHeight('Tg') + ITEM_MARGIN;
end; end;
procedure TJvCustomTimeLine.UpdateOffset; procedure TJvCustomTimeLine.UpdateOffset;
@ -2033,8 +2040,7 @@ begin
ACanvas.Pen.Color := Item.TextColor; ACanvas.Pen.Color := Item.TextColor;
if (Length(Item.Caption) > 0) then if (Length(Item.Caption) > 0) then
begin begin
R.Bottom := Min(R.Top + ACanvas.TextHeight(Item.Caption), R.Bottom); R.Bottom := R.Top + ACanvas.TextHeight(Item.Caption) + 2;
ACanvas.Rectangle(R); ACanvas.Rectangle(R);
R.Left := R.Left + 2; R.Left := R.Left + 2;
SetBkMode(ACanvas.Handle, TRANSPARENT); SetBkMode(ACanvas.Handle, TRANSPARENT);