You've already forked lazarus-ccr
tvplanit: Fix and activate component editor of TVpNavBar (still some issues!). Fix TvNavBar background painting issue (#33675).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6370 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,347 +1,380 @@
|
|||||||
object frmNavBarEd: TfrmNavBarEd
|
object frmNavBarEd: TfrmNavBarEd
|
||||||
Left = 374
|
Left = 374
|
||||||
Height = 344
|
Height = 364
|
||||||
Top = 236
|
Top = 236
|
||||||
Width = 426
|
Width = 543
|
||||||
HorzScrollBar.Page = 425
|
HorzScrollBar.Page = 425
|
||||||
VertScrollBar.Page = 322
|
VertScrollBar.Page = 322
|
||||||
Caption = 'Nav Bar Layout Tool'
|
Caption = 'Nav Bar Layout Tool'
|
||||||
ClientHeight = 344
|
ClientHeight = 364
|
||||||
ClientWidth = 426
|
ClientWidth = 543
|
||||||
FormStyle = fsStayOnTop
|
FormStyle = fsStayOnTop
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnResize = FormResize
|
OnShow = FormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.9.0.0'
|
||||||
object pnlItems: TPanel
|
|
||||||
Left = 217
|
|
||||||
Height = 226
|
|
||||||
Top = 0
|
|
||||||
Width = 209
|
|
||||||
Align = alClient
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 226
|
|
||||||
ClientWidth = 209
|
|
||||||
TabOrder = 1
|
|
||||||
object lbItems: TListBox
|
|
||||||
Left = 0
|
|
||||||
Height = 203
|
|
||||||
Top = 23
|
|
||||||
Width = 173
|
|
||||||
Align = alClient
|
|
||||||
ItemHeight = 13
|
|
||||||
OnClick = lbItemsClick
|
|
||||||
OnDrawItem = lbItemsDrawItem
|
|
||||||
Style = lbOwnerDrawVariable
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object Panel1: TPanel
|
|
||||||
Left = 173
|
|
||||||
Height = 203
|
|
||||||
Top = 23
|
|
||||||
Width = 32
|
|
||||||
Align = alRight
|
|
||||||
BorderSpacing.Right = 4
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 203
|
|
||||||
ClientWidth = 32
|
|
||||||
TabOrder = 2
|
|
||||||
object btnItemAdd: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Add Item'
|
|
||||||
Top = 7
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333300000333300033330AAA0333300033330AAA0333300030000AAA0000
|
|
||||||
300030AAAAAAAAA0300030AAAAAAAAA0300030AAAAAAAAA0300030000AAA0000
|
|
||||||
300033330AAA0333300033330AAA033330003333000003333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnItemAddClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnItemDelete: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Remove item'
|
|
||||||
Top = 39
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033333333333330003333333333333000300000000000
|
|
||||||
3000309999999990300030999999999030003099999999903000300000000000
|
|
||||||
3000333333333333300033333333333330003333333333333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnItemDeleteClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnItemUp: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Move item up'
|
|
||||||
Top = 72
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033330000033330003333066603333000333306660333
|
|
||||||
3000333306660333300030000666000030003306666666033000333066666033
|
|
||||||
3000333306660333300033333060333330003333330333333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnItemUpClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnItemDown: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Move item down'
|
|
||||||
Top = 104
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033333303333330003333306033333000333306660333
|
|
||||||
3000333066666033300033066666660330003000066600003000333306660333
|
|
||||||
3000333306660333300033330666033330003333000003333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnItemDownClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object Panel4: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 23
|
|
||||||
Top = 0
|
|
||||||
Width = 209
|
|
||||||
Align = alTop
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 23
|
|
||||||
ClientWidth = 209
|
|
||||||
TabOrder = 0
|
|
||||||
object Label2: TLabel
|
|
||||||
Left = 0
|
|
||||||
Height = 15
|
|
||||||
Top = 4
|
|
||||||
Width = 62
|
|
||||||
Caption = '&Items/Icons'
|
|
||||||
FocusControl = lbItems
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object pnlFolders: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 226
|
|
||||||
Top = 0
|
|
||||||
Width = 217
|
|
||||||
Align = alLeft
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 226
|
|
||||||
ClientWidth = 217
|
|
||||||
TabOrder = 0
|
|
||||||
object lbFolders: TListBox
|
|
||||||
Left = 4
|
|
||||||
Height = 203
|
|
||||||
Top = 23
|
|
||||||
Width = 181
|
|
||||||
Align = alClient
|
|
||||||
BorderSpacing.Left = 4
|
|
||||||
ItemHeight = 0
|
|
||||||
OnClick = lbFoldersClick
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object Panel6: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 23
|
|
||||||
Top = 0
|
|
||||||
Width = 217
|
|
||||||
Align = alTop
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 23
|
|
||||||
ClientWidth = 217
|
|
||||||
TabOrder = 0
|
|
||||||
object Label1: TLabel
|
|
||||||
Left = 4
|
|
||||||
Height = 15
|
|
||||||
Top = 4
|
|
||||||
Width = 38
|
|
||||||
Caption = '&Folders'
|
|
||||||
FocusControl = lbFolders
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object Panel5: TPanel
|
|
||||||
Left = 185
|
|
||||||
Height = 203
|
|
||||||
Top = 23
|
|
||||||
Width = 32
|
|
||||||
Align = alRight
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 203
|
|
||||||
ClientWidth = 32
|
|
||||||
TabOrder = 2
|
|
||||||
object btnFolderAdd: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Add Item'
|
|
||||||
Top = 7
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333300000333300033330AAA0333300033330AAA0333300030000AAA0000
|
|
||||||
300030AAAAAAAAA0300030AAAAAAAAA0300030AAAAAAAAA0300030000AAA0000
|
|
||||||
300033330AAA0333300033330AAA033330003333000003333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnFolderAddClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnFolderDelete: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Remove item'
|
|
||||||
Top = 39
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033333333333330003333333333333000300000000000
|
|
||||||
3000309999999990300030999999999030003099999999903000300000000000
|
|
||||||
3000333333333333300033333333333330003333333333333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnFolderDeleteClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnFolderUp: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Move item up'
|
|
||||||
Top = 72
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033330000033330003333066603333000333306660333
|
|
||||||
3000333306660333300030000666000030003306666666033000333066666033
|
|
||||||
3000333306660333300033333060333330003333330333333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnFolderUpClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
object btnFolderDown: TSpeedButton
|
|
||||||
Left = 4
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Move item down'
|
|
||||||
Top = 104
|
|
||||||
Width = 25
|
|
||||||
Glyph.Data = {
|
|
||||||
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
|
||||||
0400000000006800000000000000000000001000000010000000000000000000
|
|
||||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
|
||||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
|
||||||
3000333333333333300033333303333330003333306033333000333306660333
|
|
||||||
3000333066666033300033066666660330003000066600003000333306660333
|
|
||||||
3000333306660333300033330666033330003333000003333000333333333333
|
|
||||||
3000
|
|
||||||
}
|
|
||||||
Layout = blGlyphTop
|
|
||||||
Spacing = 1
|
|
||||||
OnClick = btnFolderDownClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object pnlImages: TPanel
|
object pnlImages: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 118
|
Height = 85
|
||||||
Top = 226
|
Top = 279
|
||||||
Width = 426
|
Width = 543
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
|
AutoSize = True
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 118
|
ClientHeight = 85
|
||||||
ClientWidth = 426
|
ClientWidth = 543
|
||||||
TabOrder = 2
|
TabOrder = 0
|
||||||
object Panel8: TPanel
|
object Panel8: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 27
|
Height = 27
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 426
|
Width = 543
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 27
|
ClientHeight = 27
|
||||||
ClientWidth = 426
|
ClientWidth = 543
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
|
AnchorSideLeft.Control = Panel8
|
||||||
|
AnchorSideTop.Control = Panel8
|
||||||
Left = 4
|
Left = 4
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 89
|
Width = 89
|
||||||
Caption = 'Available I&mages'
|
BorderSpacing.Left = 4
|
||||||
|
BorderSpacing.Top = 8
|
||||||
|
Caption = 'Available Images'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object lbImages: TListBox
|
object sbImages: TScrollBox
|
||||||
Left = 4
|
Left = 4
|
||||||
Height = 87
|
Height = 54
|
||||||
Top = 27
|
Top = 27
|
||||||
Width = 418
|
Width = 535
|
||||||
|
HorzScrollBar.Page = 56
|
||||||
|
HorzScrollBar.Tracking = True
|
||||||
|
VertScrollBar.Page = 50
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
AutoSize = True
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
BorderSpacing.Right = 4
|
BorderSpacing.Right = 4
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
Columns = 10
|
ClientHeight = 50
|
||||||
ItemHeight = 16
|
ClientWidth = 531
|
||||||
OnClick = lbImagesClick
|
Color = clWindow
|
||||||
OnDrawItem = lbImagesDrawItem
|
ParentColor = False
|
||||||
Style = lbOwnerDrawFixed
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
|
OnResize = sbImagesResize
|
||||||
|
object pnlImageView: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 50
|
||||||
|
Top = 0
|
||||||
|
Width = 56
|
||||||
|
Constraints.MinHeight = 40
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = pnlImageViewClick
|
||||||
|
OnPaint = pnlImageViewPaint
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object pnlFoldersAndItems: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 279
|
||||||
|
Top = 0
|
||||||
|
Width = 543
|
||||||
|
Align = alClient
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 2
|
||||||
|
ClientHeight = 279
|
||||||
|
ClientWidth = 543
|
||||||
|
TabOrder = 1
|
||||||
|
object pnlFolders: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 279
|
||||||
|
Top = 0
|
||||||
|
Width = 272
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 279
|
||||||
|
ClientWidth = 272
|
||||||
|
TabOrder = 0
|
||||||
|
object lbFolders: TListBox
|
||||||
|
Left = 4
|
||||||
|
Height = 256
|
||||||
|
Top = 23
|
||||||
|
Width = 236
|
||||||
|
Align = alClient
|
||||||
|
BorderSpacing.Left = 4
|
||||||
|
ItemHeight = 0
|
||||||
|
OnClick = lbFoldersClick
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object Panel6: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 23
|
||||||
|
Top = 0
|
||||||
|
Width = 272
|
||||||
|
Align = alTop
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 23
|
||||||
|
ClientWidth = 272
|
||||||
|
TabOrder = 0
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 4
|
||||||
|
Height = 15
|
||||||
|
Top = 4
|
||||||
|
Width = 38
|
||||||
|
Caption = '&Folders'
|
||||||
|
FocusControl = lbFolders
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel5: TPanel
|
||||||
|
Left = 240
|
||||||
|
Height = 256
|
||||||
|
Top = 23
|
||||||
|
Width = 32
|
||||||
|
Align = alRight
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 256
|
||||||
|
ClientWidth = 32
|
||||||
|
TabOrder = 2
|
||||||
|
object btnFolderAdd: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Add folder'
|
||||||
|
Top = 7
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333300000333300033330AAA0333300033330AAA0333300030000AAA0000
|
||||||
|
300030AAAAAAAAA0300030AAAAAAAAA0300030AAAAAAAAA0300030000AAA0000
|
||||||
|
300033330AAA0333300033330AAA033330003333000003333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnFolderAddClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnFolderDelete: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Remove folder'
|
||||||
|
Top = 40
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033333333333330003333333333333000300000000000
|
||||||
|
3000309999999990300030999999999030003099999999903000300000000000
|
||||||
|
3000333333333333300033333333333330003333333333333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnFolderDeleteClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnFolderUp: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Move folder up'
|
||||||
|
Top = 72
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033330000033330003333066603333000333306660333
|
||||||
|
3000333306660333300030000666000030003306666666033000333066666033
|
||||||
|
3000333306660333300033333060333330003333330333333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnFolderUpClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnFolderDown: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Move folder down'
|
||||||
|
Top = 104
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033333303333330003333306033333000333306660333
|
||||||
|
3000333066666033300033066666660330003000066600003000333306660333
|
||||||
|
3000333306660333300033330666033330003333000003333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnFolderDownClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object pnlItems: TPanel
|
||||||
|
Left = 272
|
||||||
|
Height = 279
|
||||||
|
Top = 0
|
||||||
|
Width = 271
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 279
|
||||||
|
ClientWidth = 271
|
||||||
|
TabOrder = 1
|
||||||
|
object lbItems: TListBox
|
||||||
|
Left = 0
|
||||||
|
Height = 256
|
||||||
|
Top = 23
|
||||||
|
Width = 235
|
||||||
|
Align = alClient
|
||||||
|
ItemHeight = 13
|
||||||
|
OnClick = lbItemsClick
|
||||||
|
OnDrawItem = lbItemsDrawItem
|
||||||
|
OnMeasureItem = lbItemsMeasureItem
|
||||||
|
Style = lbOwnerDrawVariable
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 235
|
||||||
|
Height = 256
|
||||||
|
Top = 23
|
||||||
|
Width = 32
|
||||||
|
Align = alRight
|
||||||
|
BorderSpacing.Right = 4
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 256
|
||||||
|
ClientWidth = 32
|
||||||
|
TabOrder = 2
|
||||||
|
object btnItemAdd: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Add Item'
|
||||||
|
Top = 7
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333300000333300033330AAA0333300033330AAA0333300030000AAA0000
|
||||||
|
300030AAAAAAAAA0300030AAAAAAAAA0300030AAAAAAAAA0300030000AAA0000
|
||||||
|
300033330AAA0333300033330AAA033330003333000003333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnItemAddClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnItemDelete: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Remove item'
|
||||||
|
Top = 39
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033333333333330003333333333333000300000000000
|
||||||
|
3000309999999990300030999999999030003099999999903000300000000000
|
||||||
|
3000333333333333300033333333333330003333333333333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnItemDeleteClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnItemUp: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Move item up'
|
||||||
|
Top = 72
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033330000033330003333066603333000333306660333
|
||||||
|
3000333306660333300030000666000030003306666666033000333066666033
|
||||||
|
3000333306660333300033333060333330003333330333333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnItemUpClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object btnItemDown: TSpeedButton
|
||||||
|
Left = 4
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Move item down'
|
||||||
|
Top = 104
|
||||||
|
Width = 25
|
||||||
|
Glyph.Data = {
|
||||||
|
DE000000424DDE0000000000000076000000280000000D0000000D0000000100
|
||||||
|
0400000000006800000000000000000000001000000010000000000000000000
|
||||||
|
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
|
||||||
|
3000333333333333300033333303333330003333306033333000333306660333
|
||||||
|
3000333066666033300033066666660330003000066600003000333306660333
|
||||||
|
3000333306660333300033330666033330003333000003333000333333333333
|
||||||
|
3000
|
||||||
|
}
|
||||||
|
Layout = blGlyphTop
|
||||||
|
Spacing = 1
|
||||||
|
OnClick = btnItemDownClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel4: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 23
|
||||||
|
Top = 0
|
||||||
|
Width = 271
|
||||||
|
Align = alTop
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 23
|
||||||
|
ClientWidth = 271
|
||||||
|
TabOrder = 0
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 0
|
||||||
|
Height = 15
|
||||||
|
Top = 4
|
||||||
|
Width = 62
|
||||||
|
Caption = '&Items/Icons'
|
||||||
|
FocusControl = lbItems
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -34,34 +34,29 @@ unit VpNabEd;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
LCLProc, LCLType, LCLIntf,
|
|
||||||
{$ELSE}
|
|
||||||
Windows, Messages,
|
|
||||||
{$ENDIF}
|
|
||||||
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
||||||
|
|
||||||
|
lazlogger,
|
||||||
|
|
||||||
|
LCLProc, LCLType, LCLIntf,
|
||||||
|
PropEdits, LazarusPackageIntf, FieldsEditor, ComponentEditors,
|
||||||
|
{$ELSE}
|
||||||
|
Windows, Messages,
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF VERSION6}
|
||||||
{$IFNDEF LCL}
|
|
||||||
DesignIntf, DesignEditors,
|
DesignIntf, DesignEditors,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
PropEdits,
|
|
||||||
LazarusPackageIntf,
|
|
||||||
FieldsEditor,
|
|
||||||
ComponentEditors,
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
|
||||||
DsgnIntf,
|
DsgnIntf,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
StdCtrls, ExtCtrls, Buttons,
|
StdCtrls, ExtCtrls, Buttons,
|
||||||
VpBase, VpNavBar;
|
VpBase, VpNavBar;
|
||||||
|
|
||||||
type
|
type
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF VERSION6}
|
||||||
TProtectedSelList = class(TDesignerSelections);
|
TProtectedSelList = class(TDesignerSelections);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
TVpNavBarEditor = class(TComponentEditor)
|
TVpNavBarEditor = class(TComponentEditor)
|
||||||
@@ -70,7 +65,11 @@ type
|
|||||||
function GetVerbCount : Integer; override;
|
function GetVerbCount : Integer; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TfrmNavBarEd }
|
||||||
|
|
||||||
TfrmNavBarEd = class(TForm)
|
TfrmNavBarEd = class(TForm)
|
||||||
|
pnlImageView: TPanel;
|
||||||
|
pnlFoldersAndItems: TPanel;
|
||||||
pnlItems: TPanel;
|
pnlItems: TPanel;
|
||||||
pnlFolders: TPanel;
|
pnlFolders: TPanel;
|
||||||
lbItems: TListBox;
|
lbItems: TListBox;
|
||||||
@@ -92,47 +91,66 @@ type
|
|||||||
pnlImages: TPanel;
|
pnlImages: TPanel;
|
||||||
Panel8: TPanel;
|
Panel8: TPanel;
|
||||||
Label3: TLabel;
|
Label3: TLabel;
|
||||||
lbImages: TListBox;
|
sbImages: TScrollBox;
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure FormResize(Sender: TObject);
|
|
||||||
procedure lbFoldersClick(Sender: TObject);
|
|
||||||
procedure lbItemsMeasureItem(Control: TWinControl; Index: Integer;
|
|
||||||
var Height: Integer);
|
|
||||||
procedure lbItemsDrawItem(Control: TWinControl; Index: Integer;
|
|
||||||
Rect: TRect; State: TOwnerDrawState);
|
|
||||||
procedure lbImagesDrawItem(Control: TWinControl; Index: Integer;
|
|
||||||
Rect: TRect; State: TOwnerDrawState);
|
|
||||||
procedure lbImagesClick(Sender: TObject);
|
|
||||||
procedure btnItemUpClick(Sender: TObject);
|
|
||||||
procedure btnItemDownClick(Sender: TObject);
|
|
||||||
procedure btnFolderUpClick(Sender: TObject);
|
|
||||||
procedure btnFolderDownClick(Sender: TObject);
|
|
||||||
procedure btnItemDeleteClick(Sender: TObject);
|
|
||||||
procedure btnFolderDeleteClick(Sender: TObject);
|
|
||||||
procedure btnFolderAddClick(Sender: TObject);
|
procedure btnFolderAddClick(Sender: TObject);
|
||||||
|
procedure btnFolderDeleteClick(Sender: TObject);
|
||||||
|
procedure btnFolderDownClick(Sender: TObject);
|
||||||
|
procedure btnFolderUpClick(Sender: TObject);
|
||||||
|
|
||||||
procedure btnItemAddClick(Sender: TObject);
|
procedure btnItemAddClick(Sender: TObject);
|
||||||
procedure lbItemsClick(Sender: TObject);
|
procedure btnItemDeleteClick(Sender: TObject);
|
||||||
|
procedure btnItemDownClick(Sender: TObject);
|
||||||
|
procedure btnItemUpClick(Sender: TObject);
|
||||||
|
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
// procedure FormResize(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
|
||||||
|
procedure lbFoldersClick(Sender: TObject);
|
||||||
|
procedure lbItemsMeasureItem(Control: TWinControl; Index: Integer; var Height: Integer);
|
||||||
|
procedure lbItemsClick(Sender: TObject);
|
||||||
|
procedure lbItemsDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
||||||
|
|
||||||
|
procedure pnlImageViewClick(Sender: TObject);
|
||||||
|
procedure pnlImageViewPaint(Sender: TObject);
|
||||||
|
|
||||||
|
procedure sbImagesResize(Sender: TObject);
|
||||||
|
|
||||||
private
|
private
|
||||||
|
FBar: TVpNavBar;
|
||||||
|
FDesigner: TIDesigner;
|
||||||
RefreshTimer: TTimer;
|
RefreshTimer: TTimer;
|
||||||
{$IFDEF VERSION5}
|
FSelImgIndex: Integer;
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF LCL}
|
||||||
{$IFNDEF LCL}
|
function FindBtnIndex(APersistent: TPersistent): Integer;
|
||||||
procedure SelectList(SelList : TDesignerSelections);
|
function FindFolderIndex(APersistent: TPersistent): Integer;
|
||||||
{$ENDIF}
|
procedure OnGetSelection(const ASelection: TPersistentSelectionList);
|
||||||
{$ELSE}
|
procedure OnPersistentAdded(APersistent: TPersistent; Select: boolean);
|
||||||
procedure SelectList(SelList : TDesignerSelectionList);
|
procedure OnPersistentDeleting(APersistent: TPersistent);
|
||||||
{$ENDIF}
|
procedure OnSetSelection(const ASelection: TPersistentSelectionList);
|
||||||
|
procedure SelectList(SelList: TPersistentSelectionList);
|
||||||
|
{$ELSE}
|
||||||
|
{$IFDEF VERSION5}
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
procedure SelectList(SelList: TDesignerSelections);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
procedure SelectList(SelList : TComponentList);
|
procedure SelectList(SelList: TDesignerSelectionList);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$ELSE}
|
||||||
|
procedure SelectList(SelList: TComponentList);
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
procedure OnTimer(Sender: TObject);
|
procedure OnTimer(Sender: TObject);
|
||||||
|
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
Bar : TVpNavBar;
|
|
||||||
Designer : TIDesigner;
|
|
||||||
procedure PopulateFolderList;
|
procedure PopulateFolderList;
|
||||||
procedure PopulateItemList;
|
procedure PopulateItemList;
|
||||||
|
procedure SetData(ADesigner: TIDesigner; ABar: TVpNavBar);
|
||||||
|
property Bar: TVpNavBar read FBar;
|
||||||
|
property Designer: TIDesigner read FDesigner;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@@ -147,25 +165,26 @@ implementation
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
PropEditUtils,
|
||||||
VpMisc;
|
VpMisc;
|
||||||
|
|
||||||
{$IFDEF VERSION6}
|
const
|
||||||
procedure EditNavBar(Designer : TIDesigner; Bar : TVpNavBar);
|
ITEMS_MARGIN = 2;
|
||||||
|
IMG_MARGIN = 4;
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure EditNavBar(Designer: TIDesigner; Bar: TVpNavBar);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
procedure EditNavBar(Designer : TIFormDesigner; Bar : TVpNavBar);
|
{$IFDEF VERSION6}
|
||||||
|
procedure EditNavBar(Designer: TIDesigner; Bar: TVpNavBar);
|
||||||
|
{$ELSE}
|
||||||
|
procedure EditNavBar(Designer: TIFormDesigner; Bar: TVpNavBar);
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
var
|
|
||||||
i : Integer;
|
|
||||||
begin
|
begin
|
||||||
frmNavEd := TfrmNavBarEd.Create(Application);
|
if frmNavEd = nil then
|
||||||
frmNavEd.Bar := Bar;
|
frmNavEd := TfrmNavBarEd.Create(Application);
|
||||||
frmNavEd.PopulateFolderList;
|
frmNavEd.SetData(Designer, Bar);
|
||||||
frmNavEd.Designer := Designer;
|
|
||||||
if Bar.Images <> nil then begin
|
|
||||||
frmNavEd.lbImages.ItemHeight := Bar.Images.Height + 4;
|
|
||||||
for i := 0 to pred(Bar.Images.Count) do
|
|
||||||
frmNavEd.lbImages.Items.Add(IntToStr(i));
|
|
||||||
end;
|
|
||||||
frmNavEd.Show;
|
frmNavEd.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -200,14 +219,17 @@ begin
|
|||||||
RefreshTimer.OnTimer := OnTimer;
|
RefreshTimer.OnTimer := OnTimer;
|
||||||
RefreshTimer.Enabled := true;
|
RefreshTimer.Enabled := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.FormClose(Sender: TObject;
|
procedure TfrmNavBarEd.FormClose(Sender: TObject;
|
||||||
var Action: TCloseAction);
|
var Action: TCloseAction);
|
||||||
begin
|
begin
|
||||||
|
(*
|
||||||
Unused(Action);
|
Unused(Action);
|
||||||
RefreshTimer.Free;
|
RefreshTimer.Free;
|
||||||
Release;
|
Release;
|
||||||
|
*)
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
@@ -236,20 +258,149 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
(*
|
||||||
procedure TfrmNavBarEd.FormResize(Sender: TObject);
|
procedure TfrmNavBarEd.FormResize(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
pnlFolders.Width := (pnlItems.Width + pnlFolders.Width) div 2;
|
pnlFolders.Width := (pnlItems.Width + pnlFolders.Width) div 2;
|
||||||
if Bar.Images <> nil then begin
|
if Bar.Images <> nil then begin
|
||||||
pnlImages.Height := 25 + (5 * (Bar.Images.Height div 3));
|
pnlImages.Height := 25 + (5 * (Bar.Images.Height div 3));
|
||||||
lbImages.Columns := lbImages.Width div Bar.Images.Width;
|
lbImages.Columns := lbImages.ClientWidth div Bar.Images.Width;
|
||||||
{Allow for scrollbar if excessive number of images}
|
{Allow for scrollbar if excessive number of images}
|
||||||
if (lbImages.Width >= Bar.Images.Width) then
|
if (lbImages.Width >= Bar.Images.Width) then
|
||||||
pnlImages.Height := pnlImages.Height + 20;
|
pnlImages.Height := pnlImages.Height + 20;
|
||||||
end;
|
end;
|
||||||
|
end; *)
|
||||||
|
|
||||||
|
procedure TfrmNavBarEd.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Bar.Images <> nil then begin
|
||||||
|
// sbImages.Constraints.MinHeight := Bar.Images.Height + GetScrollbarHeight + 2*IMG_MARGIN;
|
||||||
|
pnlImages.Height := Bar.Images.Height + GetScrollbarHeight + 2*IMG_MARGIN +
|
||||||
|
Panel8.Height + pnlImages.BorderSpacing.Top + pnlImages.BorderSpacing.Bottom;
|
||||||
|
//lbImages.Columns := lbImages.ClientWidth div Bar.Images.Width;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
function TfrmNavBarEd.FindFolderIndex(APersistent: TPersistent): Integer;
|
||||||
|
begin
|
||||||
|
for Result := 0 to lbFolders.Items.Count-1 do
|
||||||
|
if TPersistent(lbFolders.Items.Objects[Result]) = APersistent then
|
||||||
|
exit;
|
||||||
|
Result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmNavBarEd.FindBtnIndex(APersistent: TPersistent): Integer;
|
||||||
|
begin
|
||||||
|
for Result := 0 to lbItems.Items.Count-1 do
|
||||||
|
if TPersistent(lbItems.Items.Objects[Result]) = APersistent then
|
||||||
|
exit;
|
||||||
|
Result := -1;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure TfrmNavBarEd.OnGetSelection(const ASelection: TPersistentSelectionList);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
if not Assigned(ASelection) then
|
||||||
|
exit;
|
||||||
|
if ASelection.Count > 0 then
|
||||||
|
ASelection.Clear;
|
||||||
|
|
||||||
|
if lbFolders.Focused then begin
|
||||||
|
for i:=0 to lbFolders.Items.Count-1 do
|
||||||
|
if lbFolders.Selected[i] then
|
||||||
|
ASelection.Add(TPersistent(lbFolders.Items.Objects[i]));
|
||||||
|
end else
|
||||||
|
if lbItems.Focused then begin
|
||||||
|
for i:=0 to lbItems.Items.Count-1 do
|
||||||
|
if lbItems.Selected[i] then
|
||||||
|
ASelection.Add(TPersistent(lbItems.Items.Objects[i]));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure TfrmNavBarEd.OnPersistentAdded(APersistent: TPersistent; Select: boolean);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
if not Assigned(APersistent) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
if (APersistent is TVpNavFolder) then
|
||||||
|
begin
|
||||||
|
PopulateFolderList;
|
||||||
|
if Select then begin
|
||||||
|
i := FindFolderIndex(APersistent);
|
||||||
|
lbFolders.ItemIndex := i;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
if (APersistent is TVpNavBtnItem) then
|
||||||
|
begin
|
||||||
|
PopulateItemList;
|
||||||
|
if Select then begin
|
||||||
|
i := FindBtnIndex(APersistent);
|
||||||
|
lbItems.ItemIndex := i;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure TfrmNavBarEd.OnPersistentDeleting(APersistent: TPersistent);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
if APersistent is TVpNavFolder then
|
||||||
|
begin
|
||||||
|
i := FindFolderIndex(APersistent);
|
||||||
|
if i <> -1 then lbFolders.Items.Delete(i);
|
||||||
|
end else
|
||||||
|
if APersistent is TVpNavBtnItem then
|
||||||
|
begin
|
||||||
|
i := FindBtnIndex(APersistent);
|
||||||
|
if i <> -1 then lbItems.Items.Delete(i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure TfrmNavBarEd.OnSetSelection(const ASelection: TPersistentSelectionList);
|
||||||
|
var
|
||||||
|
i, j: Integer;
|
||||||
|
begin
|
||||||
|
if Assigned(ASelection) and (ASelection.Count > 0) then
|
||||||
|
begin
|
||||||
|
if TPersistent(ASelection[0]) is TVpNavFolder then begin
|
||||||
|
//Unselect all
|
||||||
|
for i := 0 to lbFolders.Items.Count-1 do
|
||||||
|
lbFolders.Selected[i] := false;
|
||||||
|
//select from list
|
||||||
|
for i := 0 to ASelection.Count - 1 do begin
|
||||||
|
j := FindFolderIndex(ASelection[i]);
|
||||||
|
if j <> -1 then lbFolders.Selected[j] := true;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
if TPersistent(ASelection[0]) is TVpNavBtnItem then
|
||||||
|
begin
|
||||||
|
// Unselect all
|
||||||
|
for i := 0 to lbItems.Items.Count - 1 do
|
||||||
|
lbItems.Selected[i] := false;
|
||||||
|
// Select from list
|
||||||
|
for i := 0 to ASelection.Count - 1 do begin
|
||||||
|
j := FindBtnIndex(ASelection[i]);
|
||||||
|
if j <> -1 then lbItems.Selected[j] := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.PopulateFolderList;
|
procedure TfrmNavBarEd.PopulateFolderList;
|
||||||
var
|
var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
@@ -282,22 +433,92 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
procedure TfrmNavBarEd.SetData(ADesigner: TIDesigner; ABar: TVpNavBar);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
w: Integer;
|
||||||
|
begin
|
||||||
|
if FBar <> nil then
|
||||||
|
FBar.RemoveFreeNotification(self);
|
||||||
|
|
||||||
|
FBar := ABar;
|
||||||
|
FDesigner := ADesigner;
|
||||||
|
|
||||||
|
if FBar <> nil then
|
||||||
|
FBar.FreeNotification(self);
|
||||||
|
|
||||||
|
PopulateFolderList;
|
||||||
|
|
||||||
|
if FBar.Images <> nil then begin
|
||||||
|
w := (Bar.Images.Width + 2*IMG_MARGIN) * Bar.Images.Count;
|
||||||
|
pnlImageView.ClientWidth := w;
|
||||||
|
pnlImageView.Constraints.MinHeight := Bar.Images.Height + 2 * IMG_MARGIN + GetScrollbarHeight;
|
||||||
|
if w > sbImages.ClientWidth then begin
|
||||||
|
sbImages.HorzScrollbar.Range := w - sbImages.ClientWidth;
|
||||||
|
sbImages.HorzScrollbar.Visible := true;
|
||||||
|
end else
|
||||||
|
sbImages.HorzScrollbar.Visible := false;
|
||||||
|
(*
|
||||||
|
lbImages.ItemHeight := Bar.Images.Height + 4;
|
||||||
|
for i := 0 to pred(FBar.Images.Count) do
|
||||||
|
lbImages.Items.Add(IntToStr(i));
|
||||||
|
*)
|
||||||
|
end;
|
||||||
|
FSelImgIndex := -1;
|
||||||
|
|
||||||
|
if GlobalDesignHook <> nil then
|
||||||
|
begin
|
||||||
|
GlobalDesignHook.RemoveAllHandlersForObject(Self);
|
||||||
|
if FBar <> nil then
|
||||||
|
begin
|
||||||
|
GlobalDesignHook.AddHandlerPersistentAdded(OnPersistentAdded);
|
||||||
|
GlobalDesignHook.AddHandlerPersistentDeleting(OnPersistentDeleting);
|
||||||
|
GlobalDesignHook.AddHandlerGetSelection(OnGetSelection);
|
||||||
|
GlobalDesignHook.AddHandlerSetSelection(OnSetSelection);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmNavBarEd.lbFoldersClick(Sender: TObject);
|
procedure TfrmNavBarEd.lbFoldersClick(Sender: TObject);
|
||||||
|
{$IFDEF LCL}
|
||||||
|
var
|
||||||
|
SelList: TPersistentSelectionList;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
PopulateItemList;
|
||||||
|
Bar.ActiveFolder := lbFolders.ItemIndex;
|
||||||
|
FSelImgIndex := -1;
|
||||||
|
pnlImageView.Invalidate;
|
||||||
|
|
||||||
|
SelList := TPersistentSelectionList.Create;
|
||||||
|
SelList.ForceUpdate := true;
|
||||||
|
for i := 0 to pred(lbFolders.Items.Count) do
|
||||||
|
if lbFolders.Selected[i] then begin
|
||||||
|
SelList.Add(TPersistent(lbFolders.Items.Objects[i]));
|
||||||
|
Bar.FolderCollection.DoOnItemSelected(i);
|
||||||
|
end;
|
||||||
|
if not Bar.FolderCollection.ReadOnly then
|
||||||
|
begin
|
||||||
|
btnFolderUp.Enabled := SelList.Count = 1;
|
||||||
|
btnFolderDown.Enabled := btnFolderUp.Enabled;
|
||||||
|
btnFolderDelete.Enabled := btnFolderUp.Enabled;
|
||||||
|
end;
|
||||||
|
if SelList.Count > 0 then
|
||||||
|
SelectList(SelList);
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
var
|
var
|
||||||
{$IFDEF VERSION5}
|
{$IFDEF VERSION5}
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF VERSION6}
|
||||||
{$IFNDEF LCL}
|
SelList : TDesignerSelections;
|
||||||
SelList : TDesignerSelections;
|
{$ELSE}
|
||||||
{$ENDIF}
|
SelList : TDesignerSelectionList;
|
||||||
{$ELSE}
|
{$ENDIF}
|
||||||
SelList : TDesignerSelectionList;
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
SelList : TComponentList;
|
SelList : TComponentList;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{%H-}i : Integer;
|
{%H-}i : Integer;
|
||||||
begin
|
begin
|
||||||
{$IFNDEF LCL}
|
|
||||||
PopulateItemList;
|
PopulateItemList;
|
||||||
Bar.ActiveFolder := lbFolders.ItemIndex;
|
Bar.ActiveFolder := lbFolders.ItemIndex;
|
||||||
|
|
||||||
@@ -335,8 +556,8 @@ begin
|
|||||||
if SelList.Count > 0 then
|
if SelList.Count > 0 then
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
SelectList(SelList);
|
SelectList(SelList);
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl;
|
procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl;
|
||||||
@@ -344,103 +565,141 @@ procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl;
|
|||||||
begin
|
begin
|
||||||
Unused(Control, Index);
|
Unused(Control, Index);
|
||||||
if (Bar.Images <> nil) then
|
if (Bar.Images <> nil) then
|
||||||
Height := Bar.Images.Height + 4;
|
Height := Bar.Images.Height + 2 * ITEMS_MARGIN;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.lbItemsDrawItem(Control: TWinControl;
|
procedure TfrmNavBarEd.lbItemsDrawItem(Control: TWinControl;
|
||||||
Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
||||||
|
var
|
||||||
|
btn: TVpNavBtnItem;
|
||||||
|
lb: TListbox;
|
||||||
|
ts: TTextStyle;
|
||||||
|
x, y: Integer;
|
||||||
|
delta: Integer;
|
||||||
begin
|
begin
|
||||||
Unused(State);
|
Unused(State);
|
||||||
with TListBox(Control).Canvas do
|
lb := TListBox(Control);
|
||||||
FillRect(Rect);
|
lb.Canvas.FillRect(Rect);
|
||||||
if (Bar.Images <> nil)
|
|
||||||
and (TVpNavBtnItem(lbItems.Items.Objects[Index]).IconIndex > -1)
|
|
||||||
and (TVpNavBtnItem(lbItems.Items.Objects[Index]).IconIndex <
|
|
||||||
Bar.Images.Count)
|
|
||||||
then begin
|
|
||||||
Bar.Images.Draw(TListBox(Control).Canvas, Rect.Right - Bar.Images.Width,
|
|
||||||
Rect.Top, TVpNavBtnItem(lbItems.Items.Objects[Index]).IconIndex);
|
|
||||||
with TListBox(Control).Canvas do
|
|
||||||
TextOut(Rect.Left + 2, Rect.Top + (Rect.Bottom - Rect.Top) div 3,
|
|
||||||
TListBox(Control).Items[Index]);
|
|
||||||
end else
|
|
||||||
with TListBox(Control).Canvas do
|
|
||||||
TextOut(Rect.Left + 2, Rect.Top, TListBox(Control).Items[Index]);
|
|
||||||
end;
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TfrmNavBarEd.lbImagesDrawItem(Control: TWinControl;
|
if Index = -1 then
|
||||||
Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
exit;
|
||||||
begin
|
|
||||||
Unused(State);
|
// Draw button image
|
||||||
with TListBox(Control).Canvas do
|
delta := ITEMS_MARGIN;
|
||||||
FillRect(Rect);
|
btn := TVpNavBtnItem(lbItems.Items.Objects[Index]);
|
||||||
if (Bar.Images <> nil) then
|
if (Bar.Images <> nil) and (btn <> nil) and
|
||||||
Bar.Images.Draw(TListBox(Control).Canvas, Rect.Left + 1, Rect.Top + 1,
|
(btn.IconIndex > -1) and (btn.IconIndex < Bar.Images.Count) then
|
||||||
Index);
|
begin
|
||||||
|
Bar.Images.Draw(
|
||||||
|
lb.Canvas,
|
||||||
|
Rect.Right - Bar.Images.Width - delta,
|
||||||
|
(Rect.Top + Rect.Bottom - Bar.Images.Height) div 2,
|
||||||
|
btn.IconIndex
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Draw text
|
||||||
|
ts := lb.Canvas.TextStyle;
|
||||||
|
ts.Alignment := taLeftJustify;
|
||||||
|
ts.Layout := tlCenter;
|
||||||
|
ts.EndEllipsis := true;
|
||||||
|
ts.Singleline := true;
|
||||||
|
ts.Wordbreak := false;
|
||||||
|
x := Rect.Left + 2;
|
||||||
|
y := (Rect.Top + Rect.Bottom - lb.Canvas.TextHeight('Tg')) div 2;
|
||||||
|
lb.Canvas.TextRect(Rect, x, y, lb.Items[Index]);
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.lbItemsClick(Sender: TObject);
|
procedure TfrmNavBarEd.lbItemsClick(Sender: TObject);
|
||||||
|
{$IFDEF LCL}
|
||||||
var
|
var
|
||||||
{$IFDEF VERSION5}
|
SelList: TPersistentSelectionList;
|
||||||
{$IFDEF VERSION6}
|
i: Integer;
|
||||||
{$IFNDEF LCL}
|
btn: TVpNavBtnItem;
|
||||||
SelList : TDesignerSelections;
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
|
||||||
SelList : TDesignerSelectionList;
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
|
||||||
SelList : TComponentList;
|
|
||||||
{$ENDIF}
|
|
||||||
{%H-}i : Integer;
|
|
||||||
begin
|
begin
|
||||||
{$IFNDEF LCL}
|
if (lbItems.ItemIndex <> -1) and (Bar.ActiveFolder <> 1) then
|
||||||
if (lbItems.ItemIndex <> -1) then begin
|
begin
|
||||||
lbImages.ItemIndex :=
|
btn := TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]);
|
||||||
TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]).IconIndex;
|
FSelImgIndex := btn.IconIndex;
|
||||||
|
pnlImageView.Invalidate;
|
||||||
{$IFDEF VERSION5}
|
SelList := TPersistentSelectionList.Create;
|
||||||
{$IFDEF VERSION6}
|
SelList.ForceUpdate := true;
|
||||||
SelList := TDesignerSelections.Create;
|
for i:=0 to lbItems.Items.Count-1 do
|
||||||
{$ELSE}
|
if lbItems.Selected[i] then
|
||||||
SelList := TDesignerSelectionList.Create;
|
begin
|
||||||
{$ENDIF}
|
SelList.Add(TPersistent(lbItems.Items.Objects[i]));
|
||||||
{$ELSE}
|
|
||||||
SelList := TComponentList.Create;
|
|
||||||
{$ENDIF}
|
|
||||||
for i := 0 to pred(lbItems.Items.Count) do
|
|
||||||
if lbItems.Selected[i] then begin
|
|
||||||
{$IFDEF VERSION6}
|
|
||||||
TProtectedSelList(SelList).Add(TComponent(lbItems.Items.Objects[i]));
|
|
||||||
{$ELSE}
|
|
||||||
SelList.Add(TComponent(lbItems.Items.Objects[i]));
|
|
||||||
{$ENDIF}
|
|
||||||
Bar.Folders[Bar.ActiveFolder].ItemCollection.DoOnItemSelected(I);
|
Bar.Folders[Bar.ActiveFolder].ItemCollection.DoOnItemSelected(I);
|
||||||
end;
|
end;
|
||||||
if not Bar.Folders[Bar.ActiveFolder].ItemCollection.ReadOnly
|
if not Bar.Folders[Bar.ActiveFolder].ItemCollection.ReadOnly
|
||||||
then begin
|
then begin
|
||||||
{$IFDEF VERSION6}
|
btnItemUp.Enabled := SelList.Count = 1;
|
||||||
btnItemUp.Enabled := TProtectedSelList(SelList).Count = 1;
|
|
||||||
{$ELSE}
|
|
||||||
btnItemUp.Enabled := SelList.Count = 1;
|
|
||||||
{$ENDIF}
|
|
||||||
btnItemDown.Enabled := btnItemUp.Enabled;
|
btnItemDown.Enabled := btnItemUp.Enabled;
|
||||||
btnItemDelete.Enabled := btnItemUp.Enabled;
|
btnItemDelete.Enabled := btnItemUp.Enabled;
|
||||||
end;
|
end;
|
||||||
{$IFDEF VERSION6}
|
|
||||||
if TProtectedSelList(SelList).Count > 0 then
|
|
||||||
{$ELSE}
|
|
||||||
if SelList.Count > 0 then
|
if SelList.Count > 0 then
|
||||||
{$ENDIF}
|
|
||||||
SelectList(SelList);
|
SelectList(SelList);
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
{=====}
|
{$ELSE}
|
||||||
|
var
|
||||||
|
{$IFDEF VERSION5}
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
SelList : TDesignerSelections;
|
||||||
|
{$ELSE}
|
||||||
|
SelList : TDesignerSelectionList;
|
||||||
|
{$ENDIF}
|
||||||
|
{$ELSE}
|
||||||
|
SelList : TComponentList;
|
||||||
|
{$ENDIF}
|
||||||
|
i : Integer;
|
||||||
|
begin
|
||||||
|
if (lbItems.ItemIndex <> -1) then begin
|
||||||
|
lbImages.ItemIndex :=
|
||||||
|
TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]).IconIndex;
|
||||||
|
|
||||||
|
{$IFDEF VERSION5}
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
SelList := TDesignerSelections.Create;
|
||||||
|
{$ELSE}
|
||||||
|
SelList := TDesignerSelectionList.Create;
|
||||||
|
{$ENDIF}
|
||||||
|
{$ELSE}
|
||||||
|
SelList := TComponentList.Create;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
for i := 0 to pred(lbItems.Items.Count) do
|
||||||
|
if lbItems.Selected[i] then begin
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
TProtectedSelList(SelList).Add(TComponent(lbItems.Items.Objects[i]));
|
||||||
|
{$ELSE}
|
||||||
|
SelList.Add(TComponent(lbItems.Items.Objects[i]));
|
||||||
|
{$ENDIF}
|
||||||
|
Bar.Folders[Bar.ActiveFolder].ItemCollection.DoOnItemSelected(I);
|
||||||
|
end;
|
||||||
|
if not Bar.Folders[Bar.ActiveFolder].ItemCollection.ReadOnly
|
||||||
|
then begin
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
btnItemUp.Enabled := TProtectedSelList(SelList).Count = 1;
|
||||||
|
{$ELSE}
|
||||||
|
btnItemUp.Enabled := SelList.Count = 1;
|
||||||
|
{$ENDIF}
|
||||||
|
btnItemDown.Enabled := btnItemUp.Enabled;
|
||||||
|
btnItemDelete.Enabled := btnItemUp.Enabled;
|
||||||
|
end;
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
if TProtectedSelList(SelList).Count > 0 then
|
||||||
|
SelectList(SelList);
|
||||||
|
{$ELSE}
|
||||||
|
if SelList.Count > 0 then
|
||||||
|
SelectList(SelList);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
{=====}
|
||||||
|
(*
|
||||||
procedure TfrmNavBarEd.lbImagesClick(Sender: TObject);
|
procedure TfrmNavBarEd.lbImagesClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if (lbImages.ItemIndex <> -1) and (lbItems.ItemIndex <> -1) then begin
|
if (lbImages.ItemIndex <> -1) and (lbItems.ItemIndex <> -1) then begin
|
||||||
@@ -450,7 +709,8 @@ begin
|
|||||||
if assigned(Designer) then
|
if assigned(Designer) then
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
end;
|
end;
|
||||||
end;
|
end; *)
|
||||||
|
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TfrmNavBarEd.btnItemUpClick(Sender: TObject);
|
procedure TfrmNavBarEd.btnItemUpClick(Sender: TObject);
|
||||||
@@ -461,12 +721,14 @@ begin
|
|||||||
if (lbItems.ItemIndex > 0) then begin
|
if (lbItems.ItemIndex > 0) then begin
|
||||||
SaveItemIndex := lbItems.ItemIndex;
|
SaveItemIndex := lbItems.ItemIndex;
|
||||||
Item := TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]);
|
Item := TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]);
|
||||||
|
|
||||||
if Item.Index > 0 then
|
if Item.Index > 0 then
|
||||||
Item.Index := Item.Index - 1;
|
Item.Index := Item.Index - 1;
|
||||||
|
|
||||||
if Assigned(Designer) then
|
if Assigned(Designer) then begin
|
||||||
|
GlobalDesignHook.SelectOnlyThis(nil);
|
||||||
|
GlobalDesignHook.SelectOnlyThis(Item);
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
|
end;
|
||||||
|
|
||||||
PopulateItemList;
|
PopulateItemList;
|
||||||
|
|
||||||
@@ -485,8 +747,11 @@ begin
|
|||||||
if Item.Index < Pred(lbItems.Items.Count) then
|
if Item.Index < Pred(lbItems.Items.Count) then
|
||||||
Item.Index := Item.Index + 1;
|
Item.Index := Item.Index + 1;
|
||||||
|
|
||||||
if Assigned(Designer) then
|
if Assigned(Designer) then begin
|
||||||
|
GlobalDesignHook.SelectOnlyThis(nil);
|
||||||
|
GlobalDesignHook.SelectOnlyThis(Item);
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
|
end;
|
||||||
|
|
||||||
PopulateItemList;
|
PopulateItemList;
|
||||||
|
|
||||||
@@ -507,8 +772,11 @@ begin
|
|||||||
if Folder.Index > 0 then
|
if Folder.Index > 0 then
|
||||||
Folder.Index := Folder.Index - 1;
|
Folder.Index := Folder.Index - 1;
|
||||||
|
|
||||||
if assigned(Designer) then
|
if Assigned(Designer) then begin
|
||||||
|
GlobalDesignHook.SelectOnlyThis(nil);
|
||||||
|
GlobalDesignHook.SelectOnlyThis(folder);
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
|
end;
|
||||||
|
|
||||||
PopulateFolderList;
|
PopulateFolderList;
|
||||||
|
|
||||||
@@ -527,8 +795,11 @@ begin
|
|||||||
if Folder.Index < pred(lbFolders.Items.Count) then
|
if Folder.Index < pred(lbFolders.Items.Count) then
|
||||||
Folder.Index := Folder.Index + 1;
|
Folder.Index := Folder.Index + 1;
|
||||||
|
|
||||||
if assigned(Designer) then
|
if Assigned(Designer) then begin
|
||||||
|
GlobalDesignHook.SelectOnlyThis(nil);
|
||||||
|
GlobalDesignHook.SelectOnlyThis(folder);
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
|
end;
|
||||||
|
|
||||||
PopulateFolderList;
|
PopulateFolderList;
|
||||||
|
|
||||||
@@ -542,6 +813,7 @@ begin
|
|||||||
if (lbItems.ItemIndex <> -1) then begin
|
if (lbItems.ItemIndex <> -1) then begin
|
||||||
TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]).Free;
|
TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]).Free;
|
||||||
lbItems.ItemIndex := -1;
|
lbItems.ItemIndex := -1;
|
||||||
|
FSelImgIndex := -1;
|
||||||
PopulateItemList;
|
PopulateItemList;
|
||||||
if assigned(Designer) then
|
if assigned(Designer) then
|
||||||
Designer.Modified;
|
Designer.Modified;
|
||||||
@@ -586,20 +858,98 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
procedure TfrmNavBarEd.pnlImageViewPaint(Sender: TObject);
|
||||||
|
var
|
||||||
|
R: TRect;
|
||||||
|
Rimg: TRect;
|
||||||
|
i: Integer;
|
||||||
|
x, y: Integer;
|
||||||
|
wimg, himg: Integer;
|
||||||
|
begin
|
||||||
|
R := Rect(0, 0, sbImages.Width, sbImages.Height);
|
||||||
|
pnlImageView.Canvas.Brush.Color := clWindow;
|
||||||
|
pnlImageView.Canvas.FillRect(R);
|
||||||
|
|
||||||
|
if (Bar.Images = nil) or (Bar.Images.Count = 0) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
wimg := Bar.Images.Width;
|
||||||
|
himg := Bar.Images.Height;
|
||||||
|
|
||||||
|
x := 0;
|
||||||
|
y := R.Top + IMG_MARGIN;
|
||||||
|
if pnlImageView.Width <= sbImages.Width then // no scrollbar
|
||||||
|
inc(y, GetScrollbarHeight div 2);
|
||||||
|
|
||||||
|
i := 0;
|
||||||
|
while i < Bar.Images.Count do begin
|
||||||
|
if i = FSelImgIndex then begin
|
||||||
|
R := Rect(x, R.Top, x+wimg+2*IMG_MARGIN, R.Bottom);
|
||||||
|
pnlImageView.Canvas.Brush.Color := clHighlight;
|
||||||
|
pnlImageView.Canvas.FillRect(R);
|
||||||
|
end;
|
||||||
|
Bar.Images.Draw(pnlImageView.Canvas, x + IMG_MARGIN, y, i, true);
|
||||||
|
inc(i);
|
||||||
|
inc(x, wimg + 2*IMG_MARGIN);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmNavBarEd.pnlImageViewClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
P: TPoint;
|
||||||
|
btn: TVpNavBtnItem;
|
||||||
|
res: Integer;
|
||||||
|
begin
|
||||||
|
if (Bar.Images = nil) or (Bar.Images.Count = 0) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
P := pnlImageView.ScreenToClient(Mouse.CursorPos);
|
||||||
|
FSelImgIndex := P.X div (Bar.Images.Width + 2*IMG_MARGIN);
|
||||||
|
if FSelImgIndex >= Bar.Images.Count then FSelImgIndex := Bar.Images.Count - 1;
|
||||||
|
pnlImageView.Invalidate;
|
||||||
|
|
||||||
|
if (FSelImgIndex <> -1) and (lbItems.ItemIndex <> -1) then begin
|
||||||
|
btn := TVpNavBtnItem(lbItems.Items.Objects[lbItems.ItemIndex]);
|
||||||
|
if btn.IconIndex <> -1 then begin
|
||||||
|
res := MessageDlg('Do you want to replace the button icon by this one?',
|
||||||
|
mtConfirmation, [mbYes, mbNo, mbCancel], 0);
|
||||||
|
if res <> mrYes then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
btn.IconIndex := FSelImgIndex;
|
||||||
|
lbItems.Invalidate;
|
||||||
|
if Assigned(Designer) then
|
||||||
|
Designer.Modified;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmNavBarEd.sbImagesResize(Sender: TObject);
|
||||||
|
begin
|
||||||
|
sbImages.HorzScrollbar.Visible := sbImages.ClientWidth < pnlImageView.ClientWidth;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$IFDEF LCL}
|
||||||
|
procedure TfrmNavBarEd.Selectlist(SelList: TPersistentSelectionList);
|
||||||
|
begin
|
||||||
|
if GlobalDesignHook <> nil then
|
||||||
|
begin
|
||||||
|
GlobalDesignHook.SetSelection(SelList);
|
||||||
|
GlobalDesignHook.LookupRoot := GetLookupRootForComponent(Bar);
|
||||||
|
end;
|
||||||
|
SelList.Free;
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
{$IFDEF VERSION5}
|
{$IFDEF VERSION5}
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF VERSION6}
|
||||||
{$IFNDEF LCL}
|
procedure TfrmNavBarEd.SelectList(SelList : TDesignerSelections);
|
||||||
procedure TfrmNavBarEd.SelectList(SelList : TDesignerSelections);
|
{$ELSE}
|
||||||
{$ENDIF}
|
procedure TfrmNavBarEd.SelectList(SelList : TDesignerSelectionList);
|
||||||
{$ELSE}
|
{$ENDIF}
|
||||||
procedure TfrmNavBarEd.SelectList(SelList : TDesignerSelectionList);
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
procedure TfrmNavBarEd.SelectList(SelList : TComponentList);
|
procedure TfrmNavBarEd.SelectList(SelList : TComponentList);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF Ver80}
|
||||||
{$IFNDEF Ver80}
|
|
||||||
{$IFDEF VERSION4}
|
{$IFDEF VERSION4}
|
||||||
if Designer <> nil then
|
if Designer <> nil then
|
||||||
{$IFDEF VERSION6}
|
{$IFDEF VERSION6}
|
||||||
@@ -612,9 +962,9 @@ begin
|
|||||||
(Designer as TFormDesigner).SetSelections(SelList);
|
(Designer as TFormDesigner).SetSelections(SelList);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
SelList.Free;
|
SelList.Free;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
CompLib.SetSelection(Designer, Designer.Form, SelList);
|
CompLib.SetSelection(Designer, Designer.Form, SelList);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{=====}
|
{=====}
|
||||||
|
@@ -36,21 +36,17 @@ unit VpReg;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
LCLProc, LCLType, LCLIntf, LazFileUtils,
|
LCLProc, LCLType, LCLIntf, LazFileUtils,
|
||||||
{$ELSE}
|
|
||||||
Windows,
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
{$IFDEF VERSION6}
|
|
||||||
{$IFNDEF LCL}
|
|
||||||
DesignIntf, DesignEditors, VCLEditors,
|
|
||||||
{$ELSE}
|
|
||||||
PropEdits, LazarusPackageIntf, FieldsEditor, ComponentEditors,
|
PropEdits, LazarusPackageIntf, FieldsEditor, ComponentEditors,
|
||||||
{$ENDIF}
|
{$ELSE}
|
||||||
|
Windows,
|
||||||
|
{$IFDEF VERSION6}
|
||||||
|
DesignIntf, DesignEditors, VCLEditors,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
DsgnIntf,
|
DsgnIntf,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
Dialogs, Classes, Controls, TypInfo, Forms, SysUtils,
|
Dialogs, Classes, Controls, TypInfo, Forms, SysUtils,
|
||||||
VpDatePropEdit;
|
VpDatePropEdit;
|
||||||
|
|
||||||
@@ -202,9 +198,7 @@ uses
|
|||||||
VpContactButtons, { - New contact grid button bar component }
|
VpContactButtons, { - New contact grid button bar component }
|
||||||
{ Designtime Interfaces (Property and Component Editors) }
|
{ Designtime Interfaces (Property and Component Editors) }
|
||||||
VpAbout, { About form for the About property editor }
|
VpAbout, { About form for the About property editor }
|
||||||
{$IFDEF DELPHI}
|
VpNabEd, { component editor for the VpNavBar }
|
||||||
VpNabEd, { component editor for the VpNavBar } // crashes in Lazarus
|
|
||||||
{$ENDIF}
|
|
||||||
VpFlxDSEd1; { Field mapper component editor for the FlexDS }
|
VpFlxDSEd1; { Field mapper component editor for the FlexDS }
|
||||||
|
|
||||||
|
|
||||||
@@ -557,9 +551,7 @@ begin
|
|||||||
{----------------------------------------------------------------------------}
|
{----------------------------------------------------------------------------}
|
||||||
{ register component editors }
|
{ register component editors }
|
||||||
{----------------------------------------------------------------------------}
|
{----------------------------------------------------------------------------}
|
||||||
{$IFDEF DELPHI}
|
|
||||||
RegisterComponentEditor(TVpNavBar, TVpNavBarEditor);
|
RegisterComponentEditor(TVpNavBar, TVpNavBarEditor);
|
||||||
{$ENDIF}
|
|
||||||
RegisterComponentEditor(TVpControlLink, TVpPrtFmtPropertyEditor);
|
RegisterComponentEditor(TVpControlLink, TVpPrtFmtPropertyEditor);
|
||||||
RegisterComponentEditor(TVpFlexDataStore, TVpFlexDSEditor);
|
RegisterComponentEditor(TVpFlexDataStore, TVpFlexDSEditor);
|
||||||
|
|
||||||
|
@@ -182,6 +182,9 @@ procedure LoadGlyphFromRCDATA(AGlyph: TBitmap; ABaseResName: String;
|
|||||||
procedure LoadImageFromRCDATA(AImage: TImage; ABaseResName: String;
|
procedure LoadImageFromRCDATA(AImage: TImage; ABaseResName: String;
|
||||||
ALowRes, AMedRes, AHighRes: Integer; AdjustSize: Boolean = true);
|
ALowRes, AMedRes, AHighRes: Integer; AdjustSize: Boolean = true);
|
||||||
|
|
||||||
|
function GetScrollbarHeight: Integer;
|
||||||
|
function GetScrollbarWidth: Integer;
|
||||||
|
|
||||||
procedure Unused(const A1); overload;
|
procedure Unused(const A1); overload;
|
||||||
procedure Unused(const A1, A2); overload;
|
procedure Unused(const A1, A2); overload;
|
||||||
procedure Unused(const A1, A2, A3); overload;
|
procedure Unused(const A1, A2, A3); overload;
|
||||||
@@ -1023,6 +1026,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetScrollbarHeight: Integer;
|
||||||
|
begin
|
||||||
|
Result := GetSystemMetrics(SM_CYHSCROLL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetScrollbarWidth: Integer;
|
||||||
|
begin
|
||||||
|
Result := GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$PUSH}{$HINTS OFF}
|
{$PUSH}{$HINTS OFF}
|
||||||
procedure Unused(const A1);
|
procedure Unused(const A1);
|
||||||
begin
|
begin
|
||||||
|
@@ -328,7 +328,7 @@ type
|
|||||||
property ActiveFolder: Integer read FActiveFolder write SetActiveFolder;
|
property ActiveFolder: Integer read FActiveFolder write SetActiveFolder;
|
||||||
property AllowInplaceEdit: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default false;
|
property AllowInplaceEdit: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default false;
|
||||||
property AllowRearrange: Boolean read FAllowRearrange write FAllowRearrange;
|
property AllowRearrange: Boolean read FAllowRearrange write FAllowRearrange;
|
||||||
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor;
|
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clWindow;
|
||||||
property BackgroundImage: TBitmap read FBackgroundImage write SetBackgroundImage;
|
property BackgroundImage: TBitmap read FBackgroundImage write SetBackgroundImage;
|
||||||
property BackgroundMethod: TVpBackgroundMethod read FBackgroundMethod write SetBackgroundMethod;
|
property BackgroundMethod: TVpBackgroundMethod read FBackgroundMethod write SetBackgroundMethod;
|
||||||
property ButtonHeight: Integer read FButtonHeight write SetButtonHeight;
|
property ButtonHeight: Integer read FButtonHeight write SetButtonHeight;
|
||||||
@@ -1005,7 +1005,7 @@ begin
|
|||||||
FItemFont := TFont.Create;
|
FItemFont := TFont.Create;
|
||||||
FItemFont.Name := Font.Name;
|
FItemFont.Name := Font.Name;
|
||||||
FItemFont.OnChange := nabFontChanged;
|
FItemFont.OnChange := nabFontChanged;
|
||||||
FItemFont.Color := clWhite;
|
FItemFont.Color := clWindowText;
|
||||||
FItemSpacing := abs(FItemFont.Height) + 3;
|
FItemSpacing := abs(FItemFont.Height) + 3;
|
||||||
|
|
||||||
FSelectedItemFont := TFont.Create;
|
FSelectedItemFont := TFont.Create;
|
||||||
@@ -1061,7 +1061,7 @@ begin
|
|||||||
ParentColor := False;
|
ParentColor := False;
|
||||||
|
|
||||||
FAllowRearrange := True;
|
FAllowRearrange := True;
|
||||||
FBackgroundColor := clInactiveCaption;
|
FBackgroundColor := clWindow;
|
||||||
FBackgroundImage := TBitmap.Create;
|
FBackgroundImage := TBitmap.Create;
|
||||||
FBackgroundMethod := bmNormal;
|
FBackgroundMethod := bmNormal;
|
||||||
// FBorderStyle := bsSingle;
|
// FBorderStyle := bsSingle;
|
||||||
|
@@ -214,7 +214,7 @@ var
|
|||||||
rowStart: Integer;
|
rowStart: Integer;
|
||||||
lLeft, lHeight, lWidth: Integer;
|
lLeft, lHeight, lWidth: Integer;
|
||||||
begin
|
begin
|
||||||
if FBackgroundImage.Empty or (FBackgroundMethod = bmNone) then
|
if FBackgroundImage.Empty or (FBackgroundMethod = bmNone) or (FNavBar.FolderCount = 0) then
|
||||||
begin
|
begin
|
||||||
Canvas.Brush.Color := FBackgroundColor;
|
Canvas.Brush.Color := FBackgroundColor;
|
||||||
Canvas.FillRect(R.Left, R.Top, R.Right, R.Bottom);
|
Canvas.FillRect(R.Left, R.Top, R.Right, R.Bottom);
|
||||||
@@ -861,6 +861,7 @@ begin
|
|||||||
try
|
try
|
||||||
DrawBmp.Width := FClientWidth;
|
DrawBmp.Width := FClientWidth;
|
||||||
DrawBmp.Height := FClientHeight;
|
DrawBmp.Height := FClientHeight;
|
||||||
|
DrawBmp.Transparent := false;
|
||||||
|
|
||||||
DrawBmp.Canvas.Font := FNavBar.Font;
|
DrawBmp.Canvas.Font := FNavBar.Font;
|
||||||
DrawBmp.Canvas.Pen.Color := FBackgroundColor;
|
DrawBmp.Canvas.Pen.Color := FBackgroundColor;
|
||||||
@@ -878,6 +879,8 @@ begin
|
|||||||
if FNavBar.FolderCount = 0 then begin
|
if FNavBar.FolderCount = 0 then begin
|
||||||
nabScrollUpBtn.Visible := False;
|
nabScrollUpBtn.Visible := False;
|
||||||
nabScrollDownBtn.Visible := False;
|
nabScrollDownBtn.Visible := False;
|
||||||
|
FNavBar.Canvas.CopyMode := cmSrcCopy;
|
||||||
|
FNavBar.Canvas.CopyRect(MyRect, DrawBmp.Canvas, Rect(0, 0, DrawBmp.Width,DrawBmp.Height));
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user