jvcllaz: In JvOutlookBar component editor, use IDE images, save/load layout, improve interaction with object inspector (inspired by fieldseditor.pas).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6357 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-04-26 10:09:15 +00:00
parent 6d6f3c6f62
commit fe7d894bc7
3 changed files with 617 additions and 193 deletions

View File

@ -2,14 +2,16 @@ object FrmOLBEditor: TFrmOLBEditor
Left = 311 Left = 311
Height = 462 Height = 462
Top = 151 Top = 151
Width = 226 Width = 258
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
Caption = 'OutlookBar Editor' Caption = 'OutlookBar Editor'
ClientHeight = 462 ClientHeight = 462
ClientWidth = 226 ClientWidth = 258
Constraints.MinHeight = 200 Constraints.MinHeight = 200
Constraints.MinWidth = 150 Constraints.MinWidth = 150
OnActivate = FormActivate OnActivate = FormActivate
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
PopupMenu = popForm PopupMenu = popForm
@ -17,15 +19,16 @@ object FrmOLBEditor: TFrmOLBEditor
LCLVersion = '1.9.0.0' LCLVersion = '1.9.0.0'
object TbTop: TToolBar object TbTop: TToolBar
Left = 0 Left = 0
Height = 26 Height = 36
Top = 0 Top = 0
Width = 226 Width = 258
AutoSize = True AutoSize = True
ButtonHeight = 34
ButtonWidth = 30
Caption = 'TbTop' Caption = 'TbTop'
EdgeBorders = [ebTop, ebBottom]
Images = ImgList16
ParentShowHint = False ParentShowHint = False
PopupMenu = popToolbar PopupMenu = popToolbar
ShowCaptions = True
TabOrder = 0 TabOrder = 0
object BtnNew: TToolButton object BtnNew: TToolButton
Left = 1 Left = 1
@ -35,33 +38,33 @@ object FrmOLBEditor: TFrmOLBEditor
Style = tbsDropDown Style = tbsDropDown
end end
object BtnDel: TToolButton object BtnDel: TToolButton
Left = 36 Left = 74
Top = 2 Top = 2
Action = AcDelete Action = AcDelete
end end
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 59 Left = 115
Height = 22 Height = 34
Top = 2 Top = 2
Caption = 'ToolButton1' Caption = 'ToolButton1'
Style = tbsDivider Style = tbsDivider
end end
object BtnUp: TToolButton object BtnUp: TToolButton
Left = 64 Left = 120
Top = 2 Top = 2
Action = AcMoveUp Action = AcMoveUp
end end
object BtnDown: TToolButton object BtnDown: TToolButton
Left = 87 Left = 150
Top = 2 Top = 2
Action = AcMoveDown Action = AcMoveDown
end end
end end
object TvItems: TTreeView object TvItems: TTreeView
Left = 0 Left = 0
Height = 413 Height = 403
Top = 26 Top = 36
Width = 226 Width = 258
Align = alClient Align = alClient
HideSelection = False HideSelection = False
RightClickSelect = True RightClickSelect = True
@ -77,150 +80,14 @@ object FrmOLBEditor: TFrmOLBEditor
Left = 0 Left = 0
Height = 23 Height = 23
Top = 439 Top = 439
Width = 226 Width = 258
Panels = < Panels = <
item item
Width = 50 Width = 50
end> end>
SimplePanel = False SimplePanel = False
end end
object ImgList16: TImageList
left = 64
top = 96
Bitmap = {
4C69040000001000000010000000000000000000000000000000848484FFFFFF
FFFF000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000FFFFFF0000000000000000848484FF00FF
FFFF0000000000000000848484FF000000000000000000000000000000000000
0000000000000000000000000000848484FF00FFFFFF00000000848484FFFFFF
FFFF00000000848484FF00FFFFFF000000000000000000000000000000000000
000000000000000000000000000000000000848484FF00FFFFFF848484FF00FF
FFFF848484FF00FFFFFF00000000000000000000000000000000000000000000
0000000000000000000000000000FFFFFFFF00FFFFFF848484FF00FFFFFFFFFF
FFFF848484FF848484FF848484FF848484FF000000FF000000FF000000FF0000
00FF000000FF000000FF00000000848484FF848484FF848484FFFFFFFFFF8484
84FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF000000FF848484FF00000000848484FFFFFFFFFF848484FF00FF
FFFF848484FF00FFFFFFFFFFFFFF00FFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFF000000FF848484FF848484FF00FFFFFF00FFFFFF848484FFFFFF
FFFF00FFFFFF848484FF00FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF000000FF848484FFFFFFFFFF000000FFFFFFFFFF848484FF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFF000000FF848484FF00000000000000FF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF000000FF0000
00FF000000FF000000FF848484FF00000000000000FFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF00FFFFFFC6C6
C6FF000000FF000000FF848484FF00000000000000FF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FFC6C6C6FF0000
00FFFFFFFFFF000000FF848484FF00000000000000FFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF000000FFFFFF
FFFF00FFFFFF000000FF848484FF00000000000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF848484FF0000000000000000848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000084FF000084FF848484FF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000084FF000084FF848484FF000000000000000000000000000000000000
0000000000000000000000000000000084FF000084FF848484FF000000000000
84FF000084FF848484FF00000000000000000000000000000000000000000000
0000000000000000000000000000848484FF000084FF000084FF000084FF0000
84FF848484FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF0000000000000000848484FF000084FF000084FF0000
84FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF000000FF848484FF00000000848484FF000084FF000084FF0000
84FF000084FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFF000000FF848484FF00000000000084FF000084FF848484FF00FF
FFFF000084FF000084FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF000000FF848484FF848484FF000084FF848484FF00FFFFFFFFFF
FFFF848484FF000084FF848484FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFF000000FF848484FF000084FF000084FF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF848484FF000084FF00FFFFFFFFFFFFFF000000FF000000FF0000
00FF000000FF000000FF848484FF000084FF000000FFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF00FFFFFFC6C6
C6FF000000FF000000FF848484FF848484FF000000FF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FFC6C6C6FF0000
00FFFFFFFFFF000000FF848484FF00000000000000FFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF000000FFFFFF
FFFF00FFFFFF000000FF848484FF00000000000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF848484FF0000000000000000848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000FF848400FF000000FF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00FF848400FF848400FF848400FF848400FF848400FF000000FF000000000000
0000000000000000000000000000000000000000000000000000000000FF8484
00FF848400FF848400FF848400FF848400FF848400FF848400FF000000FF0000
00000000000000000000000000000000000000000000000000FF000000FF0000
00FF000000FF848400FF848400FF848400FF000000FF000000FF000000FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF000000FF000000FF000000FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF000000FF000000FF000000FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
00000000000000000000000000000000000000000000000000FF000000FF0000
00FF000000FF848400FF848400FF848400FF000000FF000000FF000000FF0000
00FF000000000000000000000000000000000000000000000000000000FF8484
00FF848400FF848400FF848400FF848400FF848400FF848400FF000000FF0000
0000000000000000000000000000000000000000000000000000000000000000
00FF848400FF848400FF848400FF848400FF848400FF000000FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FF848400FF848400FF848400FF000000FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000FF848400FF000000FF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000
}
end
object AlActions: TActionList object AlActions: TActionList
Images = ImgList16
OnUpdate = AlActionsUpdate OnUpdate = AlActionsUpdate
left = 64 left = 64
top = 40 top = 40
@ -243,13 +110,13 @@ object FrmOLBEditor: TFrmOLBEditor
OnExecute = AcDeleteExecute OnExecute = AcDeleteExecute
end end
object AcMoveUp: TAction object AcMoveUp: TAction
Caption = 'Move up' Caption = 'Up'
Hint = 'Move item up' Hint = 'Move item up'
ImageIndex = 2 ImageIndex = 2
OnExecute = AcMoveUpExecute OnExecute = AcMoveUpExecute
end end
object AcMoveDown: TAction object AcMoveDown: TAction
Caption = 'Move down' Caption = 'Down'
Hint = 'Move item down' Hint = 'Move item down'
ImageIndex = 3 ImageIndex = 3
OnExecute = AcMoveDownExecute OnExecute = AcMoveDownExecute
@ -259,10 +126,11 @@ object FrmOLBEditor: TFrmOLBEditor
Hint = 'Update list' Hint = 'Update list'
OnExecute = AcUpdateExecute OnExecute = AcUpdateExecute
end end
object AcShowTextLabels: TAction object AcShowToolbarCaptions: TAction
Caption = 'Text labels' Caption = 'Toolbar captions'
Hint = 'Show text labels' Checked = True
OnExecute = AcShowTextLabelsExecute Hint = 'Show toolbar captions'
OnExecute = AcShowToolbarCaptionsExecute
end end
object AcToolbar: TAction object AcToolbar: TAction
Caption = 'Toolbar' Caption = 'Toolbar'
@ -271,45 +139,294 @@ object FrmOLBEditor: TFrmOLBEditor
end end
end end
object popNew: TPopupMenu object popNew: TPopupMenu
Images = ImgList16
left = 64 left = 64
top = 152 top = 152
object MnuNewPage: TMenuItem object MnuNewPage: TMenuItem
Action = AcNewPage Action = AcNewPage
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF000000000000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF000000FFFFFFFFFF00FFFFFF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FFC6C6C6FF000000FFFFFFFFFF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF00FFFFFFC6C6C6FF000000FF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FF000000FF000000FF000000FF000000FF848484FFFFFFFFFF0000
00FFFFFFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF00FF
FFFF00FFFFFF848484FFFFFFFFFF00FFFFFF848484FF00FFFFFFFFFFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF000000008484
84FFFFFFFFFF848484FF00FFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF8484
84FF848484FFFFFFFFFF848484FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FFFFFFFFFF00FF
FFFF848484FF00FFFFFFFFFFFFFF848484FF848484FF848484FF848484FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000000008484
84FF00FFFFFF848484FF00FFFFFF848484FF00FFFFFF00000000000000000000
0000000000000000000000000000000000000000000000000000848484FF00FF
FFFF00000000848484FFFFFFFFFF00000000848484FF00FFFFFF000000000000
000000000000000000000000000000000000000000000000000000FFFFFF0000
000000000000848484FF00FFFFFF0000000000000000848484FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000848484FFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MnuNewButton: TMenuItem object MnuNewButton: TMenuItem
Action = AcNewButton Action = AcNewButton
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF000000000000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF000000FFFFFFFFFF00FFFFFF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FFC6C6C6FF000000FFFFFFFFFF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF00FFFFFFC6C6C6FF000000FF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FF000000FF000000FF000000FF000000FF848484FFFFFFFFFF0000
00FFFFFFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF00FF
FFFF00FFFFFF848484FFFFFFFFFF00FFFFFF848484FF00FFFFFFFFFFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF000000008484
84FFFFFFFFFF848484FF00FFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF8484
84FF848484FFFFFFFFFF848484FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FFFFFFFFFF00FF
FFFF848484FF00FFFFFFFFFFFFFF848484FF848484FF848484FF848484FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000000008484
84FF00FFFFFF848484FF00FFFFFF848484FF00FFFFFF00000000000000000000
0000000000000000000000000000000000000000000000000000848484FF00FF
FFFF00000000848484FFFFFFFFFF00000000848484FF00FFFFFF000000000000
000000000000000000000000000000000000000000000000000000FFFFFF0000
000000000000848484FF00FFFFFF0000000000000000848484FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000848484FFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
end end
object popToolbar: TPopupMenu object popToolbar: TPopupMenu
Images = ImgList16
left = 64 left = 64
top = 208 top = 208
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
Action = AcShowTextLabels Action = AcShowToolbarCaptions
end end
end end
object popForm: TPopupMenu object popForm: TPopupMenu
Images = ImgList16
left = 64 left = 64
top = 264 top = 264
object MenuItem2: TMenuItem object MenuItem2: TMenuItem
Action = AcNewPage Action = AcNewPage
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF000000000000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF000000FFFFFFFFFF00FFFFFF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FFC6C6C6FF000000FFFFFFFFFF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF00FFFFFFC6C6C6FF000000FF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FF000000FF000000FF000000FF000000FF848484FFFFFFFFFF0000
00FFFFFFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF00FF
FFFF00FFFFFF848484FFFFFFFFFF00FFFFFF848484FF00FFFFFFFFFFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF000000008484
84FFFFFFFFFF848484FF00FFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF8484
84FF848484FFFFFFFFFF848484FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FFFFFFFFFF00FF
FFFF848484FF00FFFFFFFFFFFFFF848484FF848484FF848484FF848484FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000000008484
84FF00FFFFFF848484FF00FFFFFF848484FF00FFFFFF00000000000000000000
0000000000000000000000000000000000000000000000000000848484FF00FF
FFFF00000000848484FFFFFFFFFF00000000848484FF00FFFFFF000000000000
000000000000000000000000000000000000000000000000000000FFFFFF0000
000000000000848484FF00FFFFFF0000000000000000848484FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000848484FFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MenuItem3: TMenuItem object MenuItem3: TMenuItem
Action = AcNewButton Action = AcNewButton
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF000000000000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF000000FFFFFFFFFF00FFFFFF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FFC6C6C6FF000000FFFFFFFFFF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF00FFFFFFC6C6C6FF000000FF000000FF848484FF000000000000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FF000000FF000000FF000000FF000000FF848484FFFFFFFFFF0000
00FFFFFFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF00FF
FFFF00FFFFFF848484FFFFFFFFFF00FFFFFF848484FF00FFFFFFFFFFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF000000008484
84FFFFFFFFFF848484FF00FFFFFF848484FF00FFFFFFFFFFFFFF00FFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF848484FF8484
84FF848484FFFFFFFFFF848484FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FFFFFFFFFF00FF
FFFF848484FF00FFFFFFFFFFFFFF848484FF848484FF848484FF848484FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000000008484
84FF00FFFFFF848484FF00FFFFFF848484FF00FFFFFF00000000000000000000
0000000000000000000000000000000000000000000000000000848484FF00FF
FFFF00000000848484FFFFFFFFFF00000000848484FF00FFFFFF000000000000
000000000000000000000000000000000000000000000000000000FFFFFF0000
000000000000848484FF00FFFFFF0000000000000000848484FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000848484FFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MenuItem4: TMenuItem object MenuItem4: TMenuItem
Action = AcDelete Action = AcDelete
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848484FF848484FF848484FF848484FF848484FF848484FF848484FF8484
84FF848484FF848484FF848484FF848484FF848484FF848484FF000000000000
00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF848484FF000000000000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF000000FFFFFFFFFF00FFFFFF000000FF848484FF848484FF0000
00FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF000000FFC6C6C6FF000000FFFFFFFFFF000000FF848484FF000084FF0000
00FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFF000000FF00FFFFFFC6C6C6FF000000FF000000FF848484FF000084FF0000
84FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF848484FF000084FF00FFFFFFFFFF
FFFF000000FF000000FF000000FF000000FF000000FF848484FF848484FF0000
84FF848484FF00FFFFFFFFFFFFFF848484FF000084FF848484FFFFFFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF000000000000
84FF000084FF848484FF00FFFFFF000084FF000084FFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF000000008484
84FF000084FF000084FF000084FF000084FFFFFFFFFF00FFFFFFFFFFFFFF00FF
FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF848484FF000000008484
84FF000084FF000084FF000084FFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFF
FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF848484FF848484FF0000
84FF000084FF000084FF000084FF848484FF000000FF000000FF000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000084FF0000
84FF848484FF00000000000084FF000084FF848484FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000084FF000084FF848484FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000084FF000084FF848484FF0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MenuItem5: TMenuItem object MenuItem5: TMenuItem
Caption = '-' Caption = '-'
end end
object MenuItem6: TMenuItem object MenuItem6: TMenuItem
Action = AcMoveUp Action = AcMoveUp
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF000000FF000000FF000000FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000FF000000FF000000FF000000FF848400FF848400FF848400FF0000
00FF000000FF000000FF000000FF000000000000000000000000000000000000
000000000000000000FF848400FF848400FF848400FF848400FF848400FF8484
00FF848400FF000000FF00000000000000000000000000000000000000000000
00000000000000000000000000FF848400FF848400FF848400FF848400FF8484
00FF000000FF0000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000FF848400FF000000FF0000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MenuItem7: TMenuItem object MenuItem7: TMenuItem
Action = AcMoveDown Action = AcMoveDown
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000FF848400FF000000FF0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000FF848400FF848400FF848400FF848400FF8484
00FF000000FF0000000000000000000000000000000000000000000000000000
000000000000000000FF848400FF848400FF848400FF848400FF848400FF8484
00FF848400FF000000FF00000000000000000000000000000000000000000000
0000000000FF000000FF000000FF000000FF848400FF848400FF848400FF0000
00FF000000FF000000FF000000FF000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF848400FF848400FF848400FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FF000000FF000000FF000000FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
end end
object MenuItem8: TMenuItem object MenuItem8: TMenuItem
Caption = '-' Caption = '-'

View File

@ -21,9 +21,8 @@ type
AcMoveDown: TAction; AcMoveDown: TAction;
AcToolbar: TAction; AcToolbar: TAction;
AcUpdate: TAction; AcUpdate: TAction;
AcShowTextLabels: TAction; AcShowToolbarCaptions: TAction;
AlActions: TActionList; AlActions: TActionList;
ImgList16: TImageList;
MenuItem1: TMenuItem; MenuItem1: TMenuItem;
MenuItem2: TMenuItem; MenuItem2: TMenuItem;
MenuItem3: TMenuItem; MenuItem3: TMenuItem;
@ -51,11 +50,13 @@ type
procedure AcMoveUpExecute(Sender: TObject); procedure AcMoveUpExecute(Sender: TObject);
procedure AcNewButtonExecute(Sender: TObject); procedure AcNewButtonExecute(Sender: TObject);
procedure AcNewPageExecute(Sender: TObject); procedure AcNewPageExecute(Sender: TObject);
procedure AcShowTextLabelsExecute(Sender: TObject); procedure AcShowToolbarCaptionsExecute(Sender: TObject);
procedure AcToolbarExecute(Sender: TObject); procedure AcToolbarExecute(Sender: TObject);
procedure AcUpdateExecute(Sender: TObject); procedure AcUpdateExecute(Sender: TObject);
procedure AlActionsUpdate(AAction: TBasicAction; var Handled: Boolean); procedure AlActionsUpdate(AAction: TBasicAction; var Handled: Boolean);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure TvItemsChange(Sender: TObject; Node: TTreeNode); procedure TvItemsChange(Sender: TObject; Node: TTreeNode);
@ -64,11 +65,21 @@ type
procedure TvItemsEdited(Sender: TObject; Node: TTreeNode; var S: string); procedure TvItemsEdited(Sender: TObject; Node: TTreeNode; var S: string);
procedure TvItemsKeyPress(Sender: TObject; var Key: char); procedure TvItemsKeyPress(Sender: TObject; var Key: char);
private private
FUpdateSelectionCount: Integer;
FLargeToolBtnSize: Integer;
FSmallToolBtnSize: Integer;
procedure BeginUpdateSelection;
procedure EndUpdateSelection;
procedure BuildTreeData; procedure BuildTreeData;
procedure DeleteItem(Item: TPersistent); procedure DeleteItem(Item: TPersistent);
procedure ExchangeItems(Node1, Node2: TTreeNode); procedure ExchangeItems(Node1, Node2: TTreeNode);
class function GetButtonName(OLBar: TJvCustomOutlookBar): string; // class function GetButtonName(OLBar: TJvCustomOutlookBar): string;
class function GetPageName(OLBar: TJvCustomOutlookBar): string; // class function GetPageName(OLBar: TJvCustomOutlookBar): string;
// procedure OnComponentRenamed(AComponent: TComponent);
procedure OnGetSelection(const ASelection: TPersistentSelectionList);
procedure OnPersistentAdded(APersistent: TPersistent; Select: boolean);
procedure OnPersistentDeleting(APersistent: TPersistent);
procedure OnSetSelection(const ASelection: TPersistentSelectionList);
procedure SelectButtonInObjectInspector(AButton: TJvOutlookBarButton; ForceUpdate: Boolean); procedure SelectButtonInObjectInspector(AButton: TJvOutlookBarButton; ForceUpdate: Boolean);
procedure SelectPageInObjectInspector(APage: TJvOutlookBarPage; ForceUpdate: Boolean); procedure SelectPageInObjectInspector(APage: TJvOutlookBarPage; ForceUpdate: Boolean);
function ValidateTreeData: boolean; function ValidateTreeData: boolean;
@ -78,9 +89,12 @@ type
FDesigner: TComponentEditorDesigner; FDesigner: TComponentEditorDesigner;
function CheckValidButtonNode(Node: TTreeNode): boolean; function CheckValidButtonNode(Node: TTreeNode): boolean;
function CheckValidPageNode(Node: TTreeNode): boolean; function CheckValidPageNode(Node: TTreeNode): boolean;
function FindNode(ACandidate: TPersistent; out ANode: TTreeNode): Boolean;
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SelectionChanged(AOrderChanged: Boolean = false);
public public
constructor Create(AOwner: TComponent); override;
procedure RefreshNames; procedure RefreshNames;
procedure SetData(AOutlookBar: TJvCustomOutlookBar; ADesigner: TComponentEditorDesigner); procedure SetData(AOutlookBar: TJvCustomOutlookBar; ADesigner: TComponentEditorDesigner);
property Outlookbar: TJvCustomOutlookBar read FOutlookBar; property Outlookbar: TJvCustomOutlookBar read FOutlookBar;
@ -95,7 +109,7 @@ implementation
{$R *.lfm} {$R *.lfm}
uses uses
PropEditUtils, PropEditUtils, IDEWindowIntf, IDEImagesIntf,
JvConsts; JvConsts;
type type
@ -107,6 +121,36 @@ const
{ TFrmOLBEditor } { TFrmOLBEditor }
constructor TFrmOLBEditor.Create(AOwner: TComponent);
begin
inherited;
FLargeToolBtnSize := 34;
FSmallToolBtnSize := 22;
TbTop.ButtonHeight := FLargeToolBtnSize;
TbTop.ButtonWidth := TbTop.ButtonHeight;
AlActions.Images := IDEImages.Images_16;
AcNewPage.ImageIndex := IDEImages.LoadImage('laz_add');
AcNewButton.ImageIndex := IDEImages.LoadImage('laz_add');
AcDelete.ImageIndex := IDEImages.LoadImage('laz_delete');
AcMoveDown.ImageIndex := IDEImages.LoadImage('arrow_down');
AcMoveUp.ImageIndex := IDEImages.LoadImage('arrow_up');
TbTop.Images := AlActions.Images;
popNew.Images := AlActions.Images;
popForm.Images := AlActions.Images;
popToolbar.Images := AlActions.Images;
if Assigned(GlobalDesignHook) then
begin
// GlobalDesignHook.AddHandlerComponentRenamed(@OnComponentRenamed);
GlobalDesignHook.AddHandlerPersistentDeleting(@OnPersistentDeleting);
GlobalDesignHook.AddHandlerGetSelection(@OnGetSelection);
GlobalDesignHook.AddHandlerSetSelection(@OnSetSelection);
GlobalDesignHook.AddHandlerPersistentAdded(@OnPersistentAdded);
end;
end;
procedure TFrmOLBEditor.AcDeleteExecute(Sender: TObject); procedure TFrmOLBEditor.AcDeleteExecute(Sender: TObject);
var var
P: TPersistent; P: TPersistent;
@ -116,6 +160,16 @@ begin
if (FOutlookBar = nil) or (FDesigner = nil) or (TvItems.Selected = nil) then if (FOutlookBar = nil) or (FDesigner = nil) or (TvItems.Selected = nil) then
exit; exit;
BeginUpdateSelection;
FDesigner.DeleteSelection;
EndUpdateSelection;
exit;
TvItems.Items.BeginUpdate; TvItems.Items.BeginUpdate;
try try
node := TvItems.Selected; node := TvItems.Selected;
@ -177,17 +231,18 @@ begin
N := N.Parent; N := N.Parent;
page := TJvOutlookBarPage(N.Data); page := TJvOutlookBarPage(N.Data);
btn := page.Buttons.Add; btn := page.Buttons.Add;
// btn.Caption := FDesigner.CreateUniqueComponentName(btn.ClassName);
btn.Caption := GetButtonName(OutlookBar);
TvItems.Selected := TvItems.Items.AddChildObject(N, btn.Caption, btn);
FDesigner.PropertyEditorHook.PersistentAdded(btn, True); FDesigner.PropertyEditorHook.PersistentAdded(btn, True);
FDesigner.Modified; FDesigner.Modified;
if FindNode(btn, N) then TvItems.Selected := N;
//TvItems.Selected := TvItems.Items.AddChildObject(N, btn.Caption, btn);
//SelectionChanged;
end; end;
procedure TFrmOLBEditor.AcNewPageExecute(Sender: TObject); procedure TFrmOLBEditor.AcNewPageExecute(Sender: TObject);
var var
page: TJvOutlookBarPage; page: TJvOutlookBarPage;
node: TTreeNode;
begin begin
if (FOutlookBar = nil) or (FDesigner = nil) then if (FOutlookBar = nil) or (FDesigner = nil) then
exit; exit;
@ -195,25 +250,24 @@ begin
exit; exit;
page := THackOutlookBar(FOutlookBar).Pages.Add; page := THackOutlookBar(FOutlookBar).Pages.Add;
// page.Caption := FDesigner.CreateUniqueComponentName(page.ClassName);
page.Caption := GetPageName(FOutlookBar);
TvItems.Selected := TvItems.Items.AddObject(nil, page.Caption, page);
FDesigner.PropertyEditorHook.PersistentAdded(page,True); FDesigner.PropertyEditorHook.PersistentAdded(page,True);
FDesigner.Modified; FDesigner.Modified;
if FindNode(page, node) then TvItems.Selected := node;
//TvItems.Selected := TvItems.Items.AddObject(nil, page.Caption, page);
//SelectionChanged;
end; end;
procedure TFrmOLBEditor.AcShowTextLabelsExecute(Sender: TObject); procedure TFrmOLBEditor.AcShowToolbarCaptionsExecute(Sender: TObject);
begin begin
AcShowTextLabels.Checked := not AcShowTextLabels.Checked; AcShowToolbarCaptions.Checked := not AcShowToolbarCaptions.Checked;
tbTop.ShowCaptions := AcShowTextLabels.Checked; tbTop.ShowCaptions := AcShowToolbarCaptions.Checked;
if AcShowTextLabels.Checked then begin if AcShowToolbarCaptions.Checked then begin
tbTop.ButtonHeight := 32; TbTop.ButtonHeight := FLargeToolBtnSize;
tbTop.ButtonWidth := 32; TbTop.ButtonWidth := FLargeToolBtnSize;
end else end else
begin begin
tbTop.ButtonHeight := 22; TbTop.ButtonHeight := FSmallToolBtnSize;
tbTop.ButtonWidth := 22; TbTop.ButtonWidth := FSmallToolBtnSize;
end; end;
end; end;
@ -240,6 +294,11 @@ begin
AcUpdate.Enabled := Screen.ActiveForm = Self; AcUpdate.Enabled := Screen.ActiveForm = Self;
end; end;
procedure TFrmOLBEditor.BeginUpdateSelection;
begin
Inc(FUpdateSelectionCount);
end;
procedure TFrmOLBEditor.BuildTreeData; procedure TFrmOLBEditor.BuildTreeData;
var var
i, j: Integer; i, j: Integer;
@ -339,6 +398,13 @@ begin
end; end;
end; end;
procedure TFrmOLBEditor.EndUpdateSelection;
begin
dec(FUpdateSelectionCount);
if FUpdateSelectionCount=0 then
SelectionChanged;
end;
procedure TFrmOLBEditor.ExchangeItems(Node1, Node2: TTreeNode); procedure TFrmOLBEditor.ExchangeItems(Node1, Node2: TTreeNode);
var var
I: Integer; I: Integer;
@ -348,6 +414,7 @@ begin
I := TJvOutlookBarButton(Node1.Data).Index; I := TJvOutlookBarButton(Node1.Data).Index;
TJvOutlookBarButton(Node1.Data).Index := TJvOutlookBarButton(Node2.Data).Index; TJvOutlookBarButton(Node1.Data).Index := TJvOutlookBarButton(Node2.Data).Index;
TJvOutlookBarButton(Node2.Data).Index := I; TJvOutlookBarButton(Node2.Data).Index := I;
FDesigner.PropertyEditorHook.PersistentAdded(TJvOutlookBarButton(Node1.Data), True);
end end
else else
if TObject(Node1.Data) is TJvOutlookBarPage then if TObject(Node1.Data) is TJvOutlookBarPage then
@ -355,7 +422,39 @@ begin
I := TJvOutlookBarPage(Node1.Data).Index; I := TJvOutlookBarPage(Node1.Data).Index;
TJvOutlookBarPage(Node1.Data).Index := TJvOutlookBarPage(Node2.Data).Index; TJvOutlookBarPage(Node1.Data).Index := TJvOutlookBarPage(Node2.Data).Index;
TJvOutlookBarPage(Node2.Data).Index := I; TJvOutlookBarPage(Node2.Data).Index := I;
FDesigner.PropertyEditorHook.PersistentAdded(TJvOutlookBarPage(Node1.Data), True);
end; end;
FDesigner.Modified;
end;
function TFrmOLBEditor.FindNode(ACandidate: TPersistent;
out ANode: TTreeNode): Boolean;
var
pageNode, btnNode: TTreeNode;
begin
pageNode := TvItems.Items.GetFirstNode;
while pageNode <> nil do begin
if (ACandidate is TJvOutlookBarPage) then begin
if TJvOutlookBarPage(pageNode.Data) = ACandidate then begin
ANode := pageNode;
Result := true;
exit;
end;
end else
if (ACandidate is TJvOutlookBarButton) then begin
btnNode := pageNode.GetFirstChild;
while btnnode <> nil do begin
if TJvOutlookBarButton(btnNode.Data) = ACandidate then begin
ANode := btnNode;
Result := true;
exit;
end;
btnNode := btnNode.GetNextSibling;
end;
end;
pageNode := pageNode.GetNextSibling;
end;
Result := false;
end; end;
procedure TFrmOLBEditor.FormActivate(Sender: TObject); procedure TFrmOLBEditor.FormActivate(Sender: TObject);
@ -366,10 +465,31 @@ begin
BuildTreeData; BuildTreeData;
end; end;
procedure TFrmOLBEditor.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TFrmOLBEditor.FormCreate(Sender: TObject);
begin
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TFrmOLBEditor.FormDestroy(Sender: TObject); procedure TFrmOLBEditor.FormDestroy(Sender: TObject);
begin begin
if FOutlookBar <> nil then if FOutlookBar <> nil then
FOutlookBar.RemoveFreeNotification(self); FOutlookBar.RemoveFreeNotification(self);
if GlobalDesignHook = Nil then
Exit;
(*
if Assigned(FComponentEditor) and Assigned(LinkDataset)
and not (csDestroying in LinkDataset.ComponentState)
and (FieldsListBox.SelCount > 0) then
GlobalDesignHook.SelectOnlyThis(LinkDataset);
*)
GlobalDesignHook.RemoveAllHandlersForObject(Self);
end; end;
procedure TFrmOLBEditor.FormShow(Sender: TObject); procedure TFrmOLBEditor.FormShow(Sender: TObject);
@ -378,7 +498,7 @@ begin
exit; exit;
BuildTreeData; BuildTreeData;
end; end;
(*
class function TFrmOLBEditor.GetButtonName(OLBar: TJvCustomOutlookBar): string; class function TFrmOLBEditor.GetButtonName(OLBar: TJvCustomOutlookBar): string;
const const
cPrefix = 'JvOutlookBarButton'; cPrefix = 'JvOutlookBarButton';
@ -445,7 +565,7 @@ begin
end; end;
end; end;
end; end;
*)
procedure TFrmOLBEditor.Notification(AComponent: TComponent; procedure TFrmOLBEditor.Notification(AComponent: TComponent;
Operation: TOperation); Operation: TOperation);
begin begin
@ -458,6 +578,102 @@ begin
SetData(nil, nil); SetData(nil, nil);
end; end;
end; end;
(*
procedure TFrmOLBEditor.OnComponentRenamed(AComponent: TComponent);
var
page: TJvOutlookBarPage;
button: TJvOutlookBarButton;
i: integer;
begin
if AComponent is TJvOutlookBarPage then begin
page := TJvOutlookBarPage(AComponent);
if AComponent is TField then begin
Field := TField(AComponent);
if not Assigned( Field ) then Exit;
i := FieldsListBox.Items.IndexOfObject(Field);
if i >= 0 then
FieldsListBox.Items[i] := Field.FieldName;
end else
if AComponent is TDataset And (AComponent = LinkDataset) then
Caption := fesFeTitle + ' - ' + LinkDataset.Name;
end; *)
procedure TFrmOLBEditor.OnGetSelection(
const ASelection: TPersistentSelectionList);
var
pagenode, btnnode: TTreeNode;
begin
if not Assigned(ASelection) then
exit;
if ASelection.Count > 0 then
ASelection.Clear;
pageNode := TvItems.Items.GetFirstNode;
while pageNode <> nil do begin
if pageNode.Selected then
ASelection.Add(TPersistent(pageNode.Data));
btnNode := pageNode.GetFirstChild;
while btnNode <> nil do begin
if btnNode.selected then
ASelection.Add(TPersistent(btnNode.Data));
btnNode := btnNode.GetNextSibling;
end;
pageNode := pageNode.GetNextSibling;
end;
end;
procedure TFrmOLBEditor.OnPersistentAdded(APersistent: TPersistent; Select: boolean);
var
olb: TJvCustomOutlookBar;
page: TJvOutlookBarPage;
button: TJvOutlookBarButton;
node: TTreeNode;
begin
if not Assigned(APersistent) then exit;
if (APersistent is TJvOutlookBarPage) then begin
page := TJvOutlookBarPage(APersistent);
olb := THackOutlookbar((page.Collection).Owner);
if (olb = FOutlookBar) then begin
if not FindNode(page, node) then
node := TvItems.Items.AddObject(nil, page.Caption, page);
TvItems.Selected := node;
end;
end else
if (APersistent is TJvOutlookBarButton) then begin
button := TJvOutlookBarButton(APersistent);
page := TJvOutlookBarPage(button.Collection.Owner);
olb := THackOutlookBar(page.Collection.Owner);
if (olb = FOutlookBar) and FindNode(page, node) then begin
if not FindNode(button, node) then
node := TvItems.Items.AddChildObject(node, button.Caption, button);
TvItems.Selected := node;
end;
end;
end;
procedure TFrmOLBEditor.OnPersistentDeleting(APersistent: TPersistent);
var
node: TTreeNode;
begin
if FindNode(APersistent, node) then
TvItems.Items.Delete(node);
end;
procedure TFrmOLBEditor.OnSetSelection(
const ASelection: TPersistentSelectionList);
var
i: Integer;
node: TTreeNode;
begin
if Assigned(ASelection) then begin
//Unselect all
for i := 0 to TvItems.SelectionCount-1 do
TvItems.Items.GetSelections(I).Selected := false;
//select from list
for i := 0 to ASelection.Count - 1 do
if FindNode(ASelection.Items[i], node) then
node.Selected := true;
end;
end;
procedure TFrmOLBEditor.RefreshNames; procedure TFrmOLBEditor.RefreshNames;
var var
@ -486,6 +702,29 @@ begin
end; end;
end; end;
procedure TFrmOLBEditor.SelectionChanged(AOrderChanged: Boolean = false);
var
SelList: TPersistentSelectionList;
begin
if (FUpdateSelectionCount>0) or (GlobalDesignHook=nil) then
exit;
GlobalDesignHook.RemoveHandlerSetSelection(@OnSetSelection);
try
SelList := TPersistentSelectionList.Create;
SelList.ForceUpdate := AOrderChanged;
try
OnGetSelection(SelList);
FDesigner.PropertyEditorHook.SetSelection(SelList) ;
finally
SelList.Free;
end;
finally
GlobalDesignHook.AddHandlerSetSelection(@OnSetSelection);
end;
AlActions.UpdateAction(nil);
end;
procedure TFrmOLBEditor.SelectPageInObjectInspector(APage: TJvOutlookbarPage; procedure TFrmOLBEditor.SelectPageInObjectInspector(APage: TJvOutlookbarPage;
ForceUpdate: Boolean); ForceUpdate: Boolean);
var var
@ -566,8 +805,6 @@ begin
raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure); raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure);
page := TJvOutlookBarPage(Obj); page := TJvOutlookBarPage(Obj);
SelectPageInObjectInspector(page, true); SelectPageInObjectInspector(page, true);
(****************** FIX ME
FDesigner.SelectOnlyThisComponent(page); *)
index := olb.Pages.IndexOf(page); index := olb.Pages.IndexOf(page);
if index = -1 then if index = -1 then
raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure); raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure);
@ -577,9 +814,6 @@ begin
begin begin
btn := TJvOutlookBarButton(Obj); btn := TJvOutlookBarButton(Obj);
SelectButtonInObjectInspector(btn, true); SelectButtonInObjectInspector(btn, true);
(******************* FIX ME
FDesigner.SelectOnlyThisComponent(btn);
**********)
if not(CheckValidButtonNode(Node)) then if not(CheckValidButtonNode(Node)) then
raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure); raise Exception.Create('TFrmOLBEditor.TvItemsChange: ' + SDamagedTreeStructure);
page := TJvOutlookBarPage(Node.Parent.Data); page := TJvOutlookBarPage(Node.Parent.Data);
@ -591,6 +825,7 @@ begin
end else end else
FDesigner.SelectOnlyThisComponent(FOutlookBar); FDesigner.SelectOnlyThisComponent(FOutlookBar);
FDesigner.Modified;
// CheckActionsAvailability; // CheckActionsAvailability;
end; end;

View File

@ -95,7 +95,6 @@ type
procedure Change; procedure Change;
procedure SetEnabled(const Value: Boolean); procedure SetEnabled(const Value: Boolean);
procedure SetAction(Value: TBasicAction); procedure SetAction(Value: TBasicAction);
function GetOutlookBar: TJvCustomOutlookBar;
protected protected
function GetDisplayName: string; override; function GetDisplayName: string; override;
function GetActionLinkClass: TJvOutlookBarButtonActionLinkClass; dynamic; function GetActionLinkClass: TJvOutlookBarButtonActionLinkClass; dynamic;
@ -108,6 +107,7 @@ type
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
procedure Click; dynamic; procedure Click; dynamic;
procedure EditCaption; procedure EditCaption;
function GetOutlookBar: TJvCustomOutlookBar;
// A property for user's usage, allowing to link an object to the button // A property for user's usage, allowing to link an object to the button
property LinkedObject: TObject read FLinkedObject write FLinkedObject; property LinkedObject: TObject read FLinkedObject write FLinkedObject;
@ -177,15 +177,14 @@ type
protected protected
procedure DoPictureChange(Sender: TObject); procedure DoPictureChange(Sender: TObject);
function GetDisplayName: string; override; function GetDisplayName: string; override;
function GetOutlookBar: TJvCustomOutlookBar;
public public
constructor Create(ACollection: Classes.TCollection); override; constructor Create(ACollection: Classes.TCollection); override;
destructor Destroy; override; destructor Destroy; override;
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
procedure EditCaption; procedure EditCaption;
function GetOutlookBar: TJvCustomOutlookBar;
property DownButton: TJvOutlookBarButton read GetDownButton write SetDownButton; property DownButton: TJvOutlookBarButton read GetDownButton write SetDownButton;
property DownIndex: Integer read GetDownIndex write SetDownIndex; property DownIndex: Integer read GetDownIndex write SetDownIndex;
// A property for user's usage, allowing to link an objet to the page. // A property for user's usage, allowing to link an objet to the page.
property LinkedObject: TObject read FLinkedObject write FLinkedObject; property LinkedObject: TObject read FLinkedObject write FLinkedObject;
published published
@ -510,6 +509,9 @@ uses
{$R ..\..\resource\JvOutlookBar.res} {$R ..\..\resource\JvOutlookBar.res}
type
THackOutlookBar = class(TJvCustomOutlookBar);
const const
cTextMargins = 3; cTextMargins = 3;
cMinTextWidth = 32; cMinTextWidth = 32;
@ -542,6 +544,74 @@ begin
Result := (Method1.Code = Method2.Code) and (Method1.Data = Method2.Data); Result := (Method1.Code = Method2.Code) and (Method1.Data = Method2.Data);
end; end;
function GetUniquePageName(OLBar: TJvCustomOutlookBar): string;
const
cPrefix = 'JvOutlookBarPage';
cTemplate = cPrefix + '%d';
var
K: Integer;
Tmp: string;
function IsUnique(const S: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 0 to THackOutlookBar(OLBar).Pages.Count - 1 do
if AnsiSameText(THackOutlookBar(OLBar).Pages[I].Caption, S) then
Exit;
Result := True;
end;
begin
Result := cPrefix;
if OLBar <> nil then
for K := 1 to MaxInt - 1 do
begin
Tmp := Format(cTemplate, [K]);
if IsUnique(Tmp) then
begin
Result := Tmp;
Exit;
end;
end;
end;
function GetUniqueButtonName(OLBar: TJvCustomOutlookBar): string;
const
cPrefix = 'JvOutlookBarButton';
cTemplate = cPrefix + '%d';
var
K: Integer;
Tmp: string;
function IsUnique(const S: string): Boolean;
var
I, J: Integer;
begin
Result := False;
for I := 0 to THackOutlookBar(OLBar).Pages.Count - 1 do
for J := 0 to THackOutlookBar(OLBar).Pages[I].Buttons.Count - 1 do
if AnsiSameText(THackOutlookBar(OLBar).Pages[I].Buttons[J].Caption, S) then
Exit;
Result := True;
end;
begin
Result := cPrefix;
if OLBar <> nil then
for K := 1 to MaxInt - 1 do
begin
Tmp := Format(cTemplate, [K]);
if IsUnique(Tmp) then
begin
Result := Tmp;
Exit;
end;
end;
end;
//=== { TJvOutlookBarEdit } ================================================== //=== { TJvOutlookBarEdit } ==================================================
type type
@ -1030,6 +1100,7 @@ end;
function TJvOutlookBarButtons.Add: TJvOutlookBarButton; function TJvOutlookBarButtons.Add: TJvOutlookBarButton;
begin begin
Result := TJvOutlookBarButton(inherited Add); Result := TJvOutlookBarButton(inherited Add);
Result.Caption := GetUniqueButtonName(Result.GetOutlookBar);
end; end;
procedure TJvOutlookBarButtons.Assign(Source: TPersistent); procedure TJvOutlookBarButtons.Assign(Source: TPersistent);
@ -1347,6 +1418,7 @@ end;
function TJvOutlookBarPages.Add: TJvOutlookBarPage; function TJvOutlookBarPages.Add: TJvOutlookBarPage;
begin begin
Result := TJvOutlookBarPage(inherited Add); Result := TJvOutlookBarPage(inherited Add);
Result.Caption := GetUniquePageName(Result.GetOutlookBar);
end; end;
procedure TJvOutlookBarPages.Assign(Source: TPersistent); procedure TJvOutlookBarPages.Assign(Source: TPersistent);