jvcllaz: Add TJvNotebookPageList as workaround for issues with TJvPageList and its componenteditors.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6365 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-05-01 17:21:14 +00:00
parent dfea328594
commit 493e1b50b8
9 changed files with 122 additions and 946 deletions

View File

@ -18,7 +18,9 @@ uses
PropEdits, ComponentEditors, PropEdits, ComponentEditors,
JvDsgnConsts, JvDsgnConsts,
JvNavigationPane, JvNavPaneEditors, JvNavigationPane, JvNavPaneEditors,
JvPageList,JvPageListEditors, JvPageListTreeView; JvPageList, JvNotebookPageList,
JvPageListEditors,
JvPageListTreeView;
procedure Register; procedure Register;
const const
@ -43,12 +45,16 @@ begin
// JvPageList // JvPageList
RegisterComponents(RsPaletteJvcl, [ // was: RsPaletteListComboTree RegisterComponents(RsPaletteJvcl, [ // was: RsPaletteListComboTree
TJvPageList]); //TJvPageList,
TJvNotebookPageList]);
{
RegisterClasses([TJvPageList, TJvStandardPage]); RegisterClasses([TJvPageList, TJvStandardPage]);
RegisterComponentEditor(TJvCustomPageList, TJvCustomPageListEditor); // was: TJvCustomPageEditor RegisterComponentEditor(TJvCustomPageList, TJvCustomPageListEditor); // was: TJvCustomPageEditor
RegisterComponentEditor(TJvCustomPage, TJvCustomPageEditor); RegisterComponentEditor(TJvCustomPage, TJvCustomPageEditor);
RegisterPropertyEditor(TypeInfo(TJvShowDesignCaption), nil, '', RegisterPropertyEditor(TypeInfo(TJvShowDesignCaption), nil, '',
TJvShowDesignCaptionProperty); TJvShowDesignCaptionProperty);#
}
{ {
RegisterPropertyEditor(TypeInfo(TJvCustomPage), RegisterPropertyEditor(TypeInfo(TJvCustomPage),
TJvCustomPageList, cActivePage, TJvActivePageProperty); TJvCustomPageList, cActivePage, TJvActivePageProperty);

View File

@ -1,545 +0,0 @@
object frmPageListEditor: TfrmPageListEditor
Left = 446
Top = 114
ClientWidth = 150
ClientHeight = 247
Caption = 'PageList Editor'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 150
Height = 23
AutoSize = True
ButtonHeight = 23
Caption = 'ToolBar1'
EdgeInner = esNone
EdgeOuter = esNone
Flat = True
Images = ilButtons
ParentShowHint = False
ShowHint = True
TabOrder = 0
object btnAdd: TToolButton
Left = 0
Top = 0
Hint = 'Add page'
Action = acAdd
end
object btnDelete: TToolButton
Left = 23
Top = 0
Hint = 'Delete page'
Action = acDelete
end
object ToolButton1: TToolButton
Left = 46
Top = 0
Width = 8
Caption = 'ToolButton1'
ImageIndex = 3
Style = tbsSeparator
end
object tbMoveUp: TToolButton
Left = 54
Top = 0
Action = acMoveUp
end
object tbMoveDown: TToolButton
Left = 77
Top = 0
Action = acMoveDown
end
end
object lbPages: TListBox
Left = 0
Top = 23
Width = 150
Height = 207
Align = alClient
ItemHeight = 13
PopupMenu = popEditor
TabOrder = 1
OnClick = lbPagesClick
OnKeyPress = lbPagesKeyPress
end
object StatusBar1: TStatusBar
Left = 0
Top = 230
Width = 150
Height = 19
Panels = <>
end
object alEditor: TActionList
Images = ilButtons
OnUpdate = alEditorUpdate
Left = 86
Top = 34
object acAdd: TAction
Caption = 'Add'
Hint = 'Add Welcome page'
ImageIndex = 0
ShortCut = 45
OnExecute = acAddExecute
end
object acDelete: TAction
Caption = 'Delete'
Hint = 'Delete selected page(s)'
ImageIndex = 1
ShortCut = 46
OnExecute = acDeleteExecute
OnUpdate = acDeleteUpdate
end
object acMoveUp: TAction
Caption = 'Move Up'
Hint = 'Move Up'
ImageIndex = 2
ShortCut = 16422
OnExecute = acMoveUpExecute
end
object acMoveDown: TAction
Caption = 'Move Down'
Hint = 'Move Down'
ImageIndex = 3
ShortCut = 16424
OnExecute = acMoveDownExecute
end
end
object ilButtons: TImageList
Left = 20
Top = 30
Bitmap = {
494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000848484008484
8400848484008484840084848400848484008484840084848400848484008484
8400848484008484840084848400848484000000000000000000848484008484
8400848484008484840084848400848484008484840084848400848484008484
8400848484008484840084848400848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
0000FFFFFF0000FFFF0000000000848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6
C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6
C60000000000FFFFFF0000000000848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF
FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF
FF00C6C6C6000000000000000000848484000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000848400000000000000000000000000000000
000000000000000000000000000000000000000000000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000
000000000000000000000000000084848400000084000000840000FFFF00FFFF
FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000
0000000000000000000000000000848484000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484
840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF
FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000008484000084840000848400008484000084840000000000000000
0000000000000000000000000000000000008484840000FFFF0000FFFF008484
8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484
840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000848400008484000084840000848400008484000084840000848400000000
0000000000000000000000000000000000000000000084848400FFFFFF008484
840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000
84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000
0000848400008484000084840000848400008484000084840000848400000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
000000000000000000000000000000000000848484008484840084848400FFFF
FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000
840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000
0000000000008484000084840000848400008484000084840000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF
FF00FFFFFF008484840084848400848484008484840000000000000000000000
0000000000000000000000000000000000008484840000008400000084000000
8400000084008484840000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
000000000000000000000000000000000000000000008484840000FFFF008484
840000FFFF008484840000FFFF00000000000000000000000000000000000000
0000000000000000000000000000000000000000840000008400848484000000
0000000084000000840084848400000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000848400000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000084840000848400008484000000000000000000000000
0000000000000000000000000000000000008484840000FFFF00000000008484
8400FFFFFF00000000008484840000FFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000840000008400848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000FFFF0000000000000000008484
840000FFFF000000000000000000848484000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000008400000084008484840000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008484
8400FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000300000000100010000000000800100000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFFFFFFFFFFFFFFC000C000FFFFFFFF
80008000FFFFFFFF80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F
80000000F83FF83F00000000F83FF01F00008000C007E00F80008000E00FC007
00008000F01FF83F00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F
66FFFC7FFFFFFFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000
000000000000}
end
object popEditor: TPopupMenu
Images = ilButtons
Left = 54
Top = 120
object Add1: TMenuItem
Action = acAdd
end
object Delete1: TMenuItem
Action = acDelete
end
object N1: TMenuItem
Caption = '-'
end
object MoveUp1: TMenuItem
Action = acMoveUp
end
object MoveDown1: TMenuItem
Action = acMoveDown
end
end
end

View File

@ -1,334 +0,0 @@
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvPageListEditorForm.PAS, released on 2004-03-28.
The Initial Developer of the Original Code is Peter Thornqvist <peter3 at sourceforge dot net>
Portions created by Peter Thornqvist are Copyright (C) 2004 Peter Thornqvist.
All Rights Reserved.
Contributor(s):
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.delphi-jedi.org
Known Issues:
-----------------------------------------------------------------------------}
// $Id$
unit JvPageListEditorForm;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, ImgList, ComCtrls, StdCtrls, ToolWin, Menus,
JvPageList;
type
TfrmPageListEditor = class(TForm) //class(TDesignWindow)
ToolBar1: TToolBar;
btnAdd: TToolButton;
btnDelete: TToolButton;
ToolButton1: TToolButton;
tbMoveUp: TToolButton;
tbMoveDown: TToolButton;
lbPages: TListBox;
alEditor: TActionList;
acAdd: TAction;
acDelete: TAction;
acMoveUp: TAction;
acMoveDown: TAction;
ilButtons: TImageList;
StatusBar1: TStatusBar;
popEditor: TPopupMenu;
Add1: TMenuItem;
Delete1: TMenuItem;
N1: TMenuItem;
MoveUp1: TMenuItem;
MoveDown1: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure acAddExecute(Sender: TObject);
procedure acDeleteExecute(Sender: TObject);
procedure acMoveUpExecute(Sender: TObject);
procedure acMoveDownExecute(Sender: TObject);
procedure FormClose(Sender: TObject; var AAction: TCloseAction);
procedure acDeleteUpdate(Sender: TObject);
procedure lbPagesClick(Sender: TObject);
procedure alEditorUpdate(AAction: TBasicAction; var Handled: Boolean);
procedure lbPagesKeyPress(Sender: TObject; var Key: Char);
private
FPageList: TJvCustomPageList;
procedure SetPageList(const Value: TJvCustomPageList);
procedure UpdateList(ItemIndex: Integer);
procedure SelectPage(const Index: Integer);
procedure Add(Page: TJvCustomPage);
public
property PageList:TJvCustomPageList read FPageList write SetPageList;
(*
procedure Activated; override;
procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override;
procedure DesignerClosed(const Designer: IDesigner; AGoingDormant: Boolean); override;
procedure ItemsModified(const Designer: IDesigner); override;
function GetEditState: TEditState; override;
*)
end;
procedure ShowPageListEditor(Designer: IDesigner; APageList: TJvCustomPageList);
implementation
uses
JvDsgnConsts;
{$R *.lfm}
procedure ShowPageListEditor(Designer: IDesigner; APageList: TJvCustomPageList);
var
I: Integer;
APageListEditor: TfrmPageListEditor;
begin
APageListEditor := nil;
for I := 0 to Screen.FormCount - 1 do
if Screen.Forms[I] is TfrmPageListEditor then
if TfrmPageListEditor(Screen.Forms[I]).PageList = APageList then
begin
APageListEditor := TfrmPageListEditor(Screen.Forms[I]);
Break;
end;
// Show the editor
if Assigned(APageListEditor) then
begin
APageListEditor.Show;
if APageListEditor.WindowState = wsMinimized then
APageListEditor.WindowState := wsNormal;
end
else
begin
APageListEditor := TfrmPageListEditor.Create(Application);
try
APageListEditor.Designer := Designer;
APageListEditor.PageList := APageList;
APageListEditor.Show;
except
APageListEditor.Free;
raise;
end;
end;
if APageListEditor <> nil then
APageListEditor.Caption := Format(RsFmtCaption,[APageList.Name]);
end;
type
TJvCustomPageAccess = class(TJvCustomPage);
procedure TfrmPageListEditor.acAddExecute(Sender: TObject);
var
APage: TJvCustomPage;
begin
APage := PageList.GetPageClass.Create(Designer.GetRoot);
try
APage.Name := UniqueName(APage);
Add(APage);
except
APage.Free;
raise;
end;
end;
procedure TfrmPageListEditor.acDeleteExecute(Sender: TObject);
var
I: Integer;
begin
if Assigned(PageList.ActivePage) then
begin
I := lbPages.ItemIndex;
if lbPages.ItemIndex >= 0 then
lbPages.Items.Delete(TJvCustomPageAccess(PageList.ActivePage).PageIndex);
Designer.SelectComponent(PageList);
PageList.ActivePage.Free;
if I >= lbPages.Items.Count then
Dec(I);
if (I >= 0) and (I < lbPages.Items.Count) then
begin
lbPages.ItemIndex := I;
SelectPage(I);
end
else
Designer.Modified;
end;
end;
procedure TfrmPageListEditor.acMoveUpExecute(Sender: TObject);
var
I: Integer;
begin
I := lbPages.ItemIndex;
lbPages.Items.Move(I, I-1);
if Assigned(PageList) then
begin
TJvCustomPageAccess(PageList.Pages[I]).PageIndex := I - 1;
lbPages.ItemIndex := I - 1;
end;
end;
procedure TfrmPageListEditor.acMoveDownExecute(Sender: TObject);
var
I: Integer;
begin
I := lbPages.ItemIndex;
lbPages.Items.Move(I, I+1);
if Assigned(PageList) then
begin
TJvCustomPageAccess(PageList.Pages[I]).PageIndex := I + 1;
lbPages.ItemIndex := I + 1;
end;
end;
(*
procedure TfrmPageListEditor.Activated;
begin
if (lbPages.ItemIndex < 0) and (lbPages.Items.Count > 0) then
lbPages.ItemIndex := 0;
if Assigned(FPageList) and Assigned(FPageList.ActivePage) and
(TJvCustomPageAccess(FPageList.ActivePage).PageIndex <> lbPages.ItemIndex) then
lbPages.ItemIndex := TJvCustomPageAccess(FPageList.ActivePage).PageIndex;
SelectPage(lbPages.ItemIndex);
end;
procedure TfrmPageListEditor.DesignerClosed(const Designer: IDesigner;
AGoingDormant: Boolean);
begin
if Designer = Self.Designer then
Close;
end;
procedure TfrmPageListEditor.ItemDeleted(const ADesigner: IDesigner;
Item: TPersistent);
begin
if Item = FPageList then
begin
FPageList := nil;
Close;
end;
end;
procedure TfrmPageListEditor.ItemsModified(const Designer: IDesigner);
begin
if not (csDestroying in ComponentState) then
UpdateList(lbPages.ItemIndex);
end;
function TfrmPageListEditor.GetEditState: TEditState;
begin
Result := [];
end; *)
procedure TfrmPageListEditor.SetPageList(const Value: TJvCustomPageList);
begin
if FPageList <> Value then
begin
FPageList := Value;
UpdateList(0);
end;
end;
procedure TfrmPageListEditor.Add(Page: TJvCustomPage);
begin
Page.Parent := PageList;
Page.PageList := PageList;
PageList.ActivePage := Page;
Designer.SelectComponent(Page);
//Designer.Modified;
lbPages.ItemIndex := lbPages.Items.Add(Page.Name);
end;
procedure TfrmPageListEditor.SelectPage(const Index: Integer);
var
Page: TJvCustomPageAccess;
begin
if Assigned(FPageList) and Active then
begin
Page := nil;
if (Index >= 0) and (Index < FPageList.PageCount) then
Page := TJvCustomPageAccess(FPageList.Pages[Index]);
PageList.ActivePage := Page;
Designer.SelectComponent(Page);
Designer.Modified;
end;
end;
procedure TfrmPageListEditor.UpdateList(ItemIndex: Integer);
var
I: Integer;
begin
if Assigned(FPageList) then
begin
lbPages.Items.BeginUpdate;
try
lbPages.Items.Clear;
for I := 0 to FPageList.PageCount - 1 do
lbPages.Items.Add(TJvCustomPageAccess(FPageList.Pages[I]).Name);
if (ItemIndex >= 0) and (ItemIndex < lbPages.Items.Count) then
lbPages.ItemIndex := ItemIndex
else
lbPages.ItemIndex := -1;
finally
lbPages.Items.EndUpdate;
end;
end;
end;
procedure TfrmPageListEditor.FormClose(Sender: TObject;
var AAction: TCloseAction);
begin
AAction := caFree;
end;
procedure TfrmPageListEditor.acDeleteUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled :=
(lbPages.Items.Count > 0) and (lbPages.ItemIndex >= 0);
end;
procedure TfrmPageListEditor.lbPagesClick(Sender: TObject);
begin
SelectPage(lbPages.ItemIndex);
end;
procedure TfrmPageListEditor.alEditorUpdate(AAction: TBasicAction;
var Handled: Boolean);
begin
acMoveUp.Enabled := lbPages.ItemIndex > 0;
acMoveDown.Enabled :=
(lbPages.ItemIndex <> -1) and
(lbPages.ItemIndex < lbPages.Items.Count - 1);
end;
procedure TfrmPageListEditor.lbPagesKeyPress(Sender: TObject;
var Key: Char);
begin
if lbPages.ItemIndex <> -1 then
begin
SelectPage(lbPages.ItemIndex);
ActivateInspector(Key);
Key := #0;
end;
end;
procedure TfrmPageListEditor.FormCreate(Sender: TObject);
begin
{$IFDEF COMPILER9_UP}
FormStyle := fsStayOnTop;
{$ENDIF COMPILER9_UP}
end;
end.

View File

@ -43,12 +43,14 @@ type
procedure GetValues(Proc: TGetStrProc); override; procedure GetValues(Proc: TGetStrProc); override;
end; end;
*) *)
TJvShowDesignCaptionProperty = class(TEnumProperty) TJvShowDesignCaptionProperty = class(TEnumProperty)
function GetAttributes: TPropertyAttributes; override; function GetAttributes: TPropertyAttributes; override;
end; end;
{ a component editor for the TJvPageList } { a component editor for the TJvPageList }
(********************************** NOT WORKING ***************
// adapted from TUntabbedNotebookComponentEditor) // adapted from TUntabbedNotebookComponentEditor)
TJvCustomPageListEditor = class(TDefaultComponentEditor) TJvCustomPageListEditor = class(TDefaultComponentEditor)
protected protected
@ -71,7 +73,7 @@ type
function Page: TJvCustomPage; virtual; function Page: TJvCustomPage; virtual;
end; end;
(* {
TJvCustomPageEditor = class(TComponentEditor) TJvCustomPageEditor = class(TComponentEditor)
private private
procedure InsertPage; procedure InsertPage;
@ -84,7 +86,8 @@ type
function GetVerbCount: Integer; override; function GetVerbCount: Integer; override;
procedure ExecuteVerb(Index: Integer); override; procedure ExecuteVerb(Index: Integer); override;
procedure Edit; override; procedure Edit; override;
end; *) end; }
***********************************************)
TJvSettingsTreeImagesProperty = class(TImageIndexPropertyEditor) TJvSettingsTreeImagesProperty = class(TImageIndexPropertyEditor)
protected protected
@ -94,7 +97,6 @@ type
implementation implementation
uses uses
LazLogger,
TypInfo, TypInfo,
JvDsgnConsts, JvPageListTreeView; //, JvPageListEditorForm; JvDsgnConsts, JvPageListTreeView; //, JvPageListEditorForm;
@ -119,6 +121,7 @@ const
{ TJvCustomPageListEditor } { TJvCustomPageListEditor }
(****************************************** NOT WORKING
{ adapted from TUntabbedNotebookComponentEditor for LCL's Notebook { adapted from TUntabbedNotebookComponentEditor for LCL's Notebook
originally named "TJvCustomPageEditor" } originally named "TJvCustomPageEditor" }
@ -260,7 +263,7 @@ begin
end; end;
(* {
procedure TJvCustomPageEditor.Edit; procedure TJvCustomPageEditor.Edit;
begin begin
@ -359,7 +362,8 @@ begin
Designer.Modified; Designer.Modified;
end; end;
end; end;
*) }
*********************************************************)
//=== { TJvActivePageProperty } ============================================== //=== { TJvActivePageProperty } ==============================================
@ -384,6 +388,7 @@ begin
end; end;
*) *)
//=== { TJvSettingsTreeImagesProperty } ====================================== //=== { TJvSettingsTreeImagesProperty } ======================================
function TJvSettingsTreeImagesProperty.GetImageList: TCustomImageList; function TJvSettingsTreeImagesProperty.GetImageList: TCustomImageList;
@ -400,6 +405,7 @@ begin
Result := nil; Result := nil;
end; end;
//=== { TJvShowDesignCaptionProperty } ======================================= //=== { TJvShowDesignCaptionProperty } =======================================
function TJvShowDesignCaptionProperty.GetAttributes: TPropertyAttributes; function TJvShowDesignCaptionProperty.GetAttributes: TPropertyAttributes;

View File

@ -6,3 +6,4 @@ tjvnavpanelheader.bmp
tjvnavpanestylemanager.bmp tjvnavpanestylemanager.bmp
tjvnavpanetoolpanel.bmp tjvnavpanetoolpanel.bmp
tjvoutlooksplitter.bmp tjvoutlooksplitter.bmp
tjvnotebookpagelist.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

View File

@ -15,7 +15,7 @@
<Description Value="Page style components of the JVCL library (https://sourceforge.net/projects/jvcl/) (runtime code)"/> <Description Value="Page style components of the JVCL library (https://sourceforge.net/projects/jvcl/) (runtime code)"/>
<License Value="The JVCL is released in accordance with the MPL 1.1 license. To get your own copy or read it, go to http://www.mozilla.org/MPL/MPL-1.1.html. "/> <License Value="The JVCL is released in accordance with the MPL 1.1 license. To get your own copy or read it, go to http://www.mozilla.org/MPL/MPL-1.1.html. "/>
<Version Major="1" Release="4"/> <Version Major="1" Release="4"/>
<Files Count="3"> <Files Count="4">
<Item1> <Item1>
<Filename Value="..\run\JvPageComps\JvNavigationPane.pas"/> <Filename Value="..\run\JvPageComps\JvNavigationPane.pas"/>
<UnitName Value="JvNavigationPane"/> <UnitName Value="JvNavigationPane"/>
@ -28,6 +28,10 @@
<Filename Value="..\run\JvPageComps\JvPageListTreeView.pas"/> <Filename Value="..\run\JvPageComps\JvPageListTreeView.pas"/>
<UnitName Value="JvPageListTreeView"/> <UnitName Value="JvPageListTreeView"/>
</Item3> </Item3>
<Item4>
<Filename Value="..\run\JvPageComps\jvnotebookpagelist.pas"/>
<UnitName Value="jvnotebookpagelist"/>
</Item4>
</Files> </Files>
<RequiredPkgs Count="3"> <RequiredPkgs Count="3">
<Item1> <Item1>

View File

@ -31,7 +31,7 @@ unit JvTabBar;
interface interface
uses uses
LCLIntf, LCLType, LMessages, Types, LCLIntf, LCLType, LMessages, LCLVersion, Types,
Graphics, Controls, Forms, ImgList, Menus, Buttons, Graphics, Controls, Forms, ImgList, Menus, Buttons,
ExtCtrls, SysUtils, Classes, Contnrs, Themes; ExtCtrls, SysUtils, Classes, Contnrs, Themes;
@ -79,7 +79,6 @@ type
FAutoDeleteDatas: TObjectList; FAutoDeleteDatas: TObjectList;
function GetEnabled: Boolean; function GetEnabled: Boolean;
function GetModified: Boolean; function GetModified: Boolean;
procedure SetPopupMenu(const Value: TPopupMenu); procedure SetPopupMenu(const Value: TPopupMenu);
function GetClosing: Boolean; function GetClosing: Boolean;
procedure SetModified(const Value: Boolean); procedure SetModified(const Value: Boolean);
@ -95,7 +94,6 @@ type
function GetHot: Boolean; function GetHot: Boolean;
protected protected
procedure Changed; virtual; procedure Changed; virtual;
procedure SetIndex(Value: Integer); override; procedure SetIndex(Value: Integer); override;
procedure Notification(Component: TComponent; Operation: TOperation); virtual; procedure Notification(Component: TComponent; Operation: TOperation); virtual;
property Name: string read FName write SetName; property Name: string read FName write SetName;
@ -109,7 +107,6 @@ type
function GetPreviousVisible: TJvTabBarItem; function GetPreviousVisible: TJvTabBarItem;
procedure MakeVisible; procedure MakeVisible;
function AutoDeleteData: TObjectList; function AutoDeleteData: TObjectList;
property Data: TObject read FData write FData; property Data: TObject read FData write FData;
property TabBar: TJvCustomTabBar read GetTabBar; property TabBar: TJvCustomTabBar read GetTabBar;
property DisplayRect: TRect read GetDisplayRect; property DisplayRect: TRect read GetDisplayRect;
@ -126,7 +123,6 @@ type
property Visible: Boolean read FVisible write SetVisible default True; property Visible: Boolean read FVisible write SetVisible default True;
property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu; property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu;
property ShowHint: Boolean read FShowHint write FShowHint default True; property ShowHint: Boolean read FShowHint write FShowHint default True;
property OnGetModified: TJvGetModifiedEvent read FOnGetModified write FOnGetModified; property OnGetModified: TJvGetModifiedEvent read FOnGetModified write FOnGetModified;
property OnGetEnabled: TJvGetEnabledEvent read FOnGetEnabled write FOnGetEnabled; property OnGetEnabled: TJvGetEnabledEvent read FOnGetEnabled write FOnGetEnabled;
end; end;
@ -143,7 +139,6 @@ type
function IndexOf(Item: TJvTabBarItem): Integer; function IndexOf(Item: TJvTabBarItem): Integer;
procedure EndUpdate; override; procedure EndUpdate; override;
property Items[Index: Integer]: TJvTabBarItem read GetItem write SetItem; default; property Items[Index: Integer]: TJvTabBarItem read GetItem write SetItem; default;
property TabBar: TJvCustomTabBar read GetTabBar; property TabBar: TJvCustomTabBar read GetTabBar;
end; end;
@ -155,7 +150,6 @@ type
FOnChangeList: TList; FOnChangeList: TList;
protected protected
procedure Changed; virtual; procedure Changed; virtual;
procedure DrawBackground(Canvas: TCanvas; TabBar: TJvCustomTabBar; R: TRect); virtual; abstract; procedure DrawBackground(Canvas: TCanvas; TabBar: TJvCustomTabBar; R: TRect); virtual; abstract;
procedure DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem; R: TRect); virtual; abstract; procedure DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem; R: TRect); virtual; abstract;
procedure DrawDivider(Canvas: TCanvas; LeftTab: TJvTabBarItem; R: TRect); virtual; abstract; procedure DrawDivider(Canvas: TCanvas; LeftTab: TJvTabBarItem; R: TRect); virtual; abstract;
@ -164,7 +158,6 @@ type
function GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; virtual; abstract; function GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; virtual; abstract;
function GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; R: TRect): TRect; virtual; abstract; function GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; R: TRect): TRect; virtual; abstract;
function Options: TJvTabBarPainterOptions; virtual; abstract; function Options: TJvTabBarPainterOptions; virtual; abstract;
procedure DrawScrollButton(Canvas: TCanvas; TabBar: TJvCustomTabBar; Button: TJvTabBarScrollButtonKind; procedure DrawScrollButton(Canvas: TCanvas; TabBar: TJvCustomTabBar; Button: TJvTabBarScrollButtonKind;
State: TJvTabBarScrollButtonState; R: TRect); virtual; State: TJvTabBarScrollButtonState; R: TRect); virtual;
procedure GetScrollButtons(TabBar: TJvCustomTabBar; var LeftButton, RightButton: TRect); {virtual; reserved for future use } procedure GetScrollButtons(TabBar: TJvCustomTabBar; var LeftButton, RightButton: TRect); {virtual; reserved for future use }
@ -193,7 +186,6 @@ type
FDividerColor: TColor; FDividerColor: TColor;
FMoveDividerColor: TColor; FMoveDividerColor: TColor;
FTabWidth: Integer; FTabWidth: Integer;
procedure SetCloseRectColorDisabled(const Value: TColor); procedure SetCloseRectColorDisabled(const Value: TColor);
procedure SetCloseColor(const Value: TColor); procedure SetCloseColor(const Value: TColor);
procedure SetCloseColorSelected(const Value: TColor); procedure SetCloseColorSelected(const Value: TColor);
@ -203,11 +195,9 @@ type
procedure SetFont(const Value: TFont); procedure SetFont(const Value: TFont);
procedure SetDisabledFont(const Value: TFont); procedure SetDisabledFont(const Value: TFont);
procedure SetSelectedFont(const Value: TFont); procedure SetSelectedFont(const Value: TFont);
procedure SetModifiedCrossColor(const Value: TColor); procedure SetModifiedCrossColor(const Value: TColor);
procedure SetBorderColor(const Value: TColor); procedure SetBorderColor(const Value: TColor);
procedure SetControlDivideColor(const Value: TColor); procedure SetControlDivideColor(const Value: TColor);
procedure SetTabColor(const Value: TColor); procedure SetTabColor(const Value: TColor);
procedure SetColor(const Value: TColor); procedure SetColor(const Value: TColor);
procedure FontChanged(Sender: TObject); procedure FontChanged(Sender: TObject);
@ -216,13 +206,14 @@ type
procedure SetTabWidth(Value: Integer); procedure SetTabWidth(Value: Integer);
protected protected
procedure DrawBackground(Canvas: TCanvas; TabBar: TJvCustomTabBar; R: TRect); override; procedure DrawBackground(Canvas: TCanvas; TabBar: TJvCustomTabBar; R: TRect); override;
procedure DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem; ATabRect: TRect); override;
procedure DrawDivider(Canvas: TCanvas; LeftTab: TJvTabBarItem; R: TRect); override; procedure DrawDivider(Canvas: TCanvas; LeftTab: TJvTabBarItem; R: TRect); override;
procedure DrawMoveDivider(Canvas: TCanvas; Tab: TJvTabBarItem; MoveLeft: Boolean); override; procedure DrawMoveDivider(Canvas: TCanvas; Tab: TJvTabBarItem; MoveLeft: Boolean); override;
procedure DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem; ATabRect: TRect); override;
function GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; ATabRect: TRect): TRect; override;
function GetDividerWidth(Canvas: TCanvas; LeftTab: TJvTabBarItem): Integer; override; function GetDividerWidth(Canvas: TCanvas; LeftTab: TJvTabBarItem): Integer; override;
function GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; override; function GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; override;
function GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; ATabRect: TRect): TRect; override;
function Options: TJvTabBarPainterOptions; override; function Options: TJvTabBarPainterOptions; override;
function Scale96(AValue: Integer): Integer;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -483,6 +474,17 @@ uses
const const
WHEEL_DELTA = 120; WHEEL_DELTA = 120;
// Pixels at 96 ppi:
LEFT_MARGIN = 4;
RIGHT_MARGIN = 6;
TEXT_MARGIN_LEft = 2;
TEXT_MARGIN_RIGHT = 4;
TOP_MARGIN = 2;
BOTTOM_MARGIN = 2;
CLOSE_BUTTON_SIZE = 12;
CROSS_MARGIN = 3;
function DrawButtonFace(ACanvas: TCanvas; const ARect: TRect; AFlat: Boolean; function DrawButtonFace(ACanvas: TCanvas; const ARect: TRect; AFlat: Boolean;
// BevelWidth: Integer; Style: TButtonStyle; IsRounded, // BevelWidth: Integer; Style: TButtonStyle; IsRounded,
IsDown, IsFocused: Boolean): TRect; IsDown, IsFocused: Boolean): TRect;
@ -1453,16 +1455,12 @@ end;
function TJvCustomTabBar.GetTabHeight(Tab: TJvTabBarItem): Integer; function TJvCustomTabBar.GetTabHeight(Tab: TJvTabBarItem): Integer;
begin begin
Result := Abs(CurrentPainter.GetTabSize(Canvas, Tab).cy); Result := CurrentPainter.GetTabSize(Canvas, Tab).cy;
if Result > High(Word) then
Result := High(Word);
end; end;
function TJvCustomTabBar.GetTabWidth(Tab: TJvTabBarItem): Integer; function TJvCustomTabBar.GetTabWidth(Tab: TJvTabBarItem): Integer;
begin begin
Result := Abs(CurrentPainter.GetTabSize(Canvas, Tab).cx); Result := CurrentPainter.GetTabSize(Canvas, Tab).cx;
if Result > High(Word) then
Result := High(Word);
end; end;
function TJvCustomTabBar.TabAt(X, Y: Integer): TJvTabBarItem; function TJvCustomTabBar.TabAt(X, Y: Integer): TJvTabBarItem;
@ -1790,19 +1788,27 @@ begin
case TabBar.Orientation of case TabBar.Orientation of
toBottom: toBottom:
Result := Rect(FLeft, 0, Result := Rect(
FLeft + TabBar.GetTabWidth(Self), 0 + TabBar.GetTabHeight(Self)); FLeft,
0,
FLeft + TabBar.GetTabWidth(Self),
0 + TabBar.GetTabHeight(Self)
);
else else
// toTop // toTop
Result := Rect(FLeft, TabBar.ClientHeight - TabBar.GetTabHeight(Self), Result := Rect(
FLeft + TabBar.GetTabWidth(Self), TabBar.ClientHeight); FLeft,
TabBar.ClientHeight - TabBar.GetTabHeight(Self),
FLeft + TabBar.GetTabWidth(Self),
TabBar.ClientHeight
);
end; end;
end; end;
end; end;
function TJvTabBarItem.GetHot: Boolean; function TJvTabBarItem.GetHot: Boolean;
begin begin
Result := TabBar.HotTab = Self; Result := (TabBar.HotTab = Self);
end; end;
function TJvTabBarItem.GetImages: TCustomImageList; function TJvTabBarItem.GetImages: TCustomImageList;
@ -1829,7 +1835,8 @@ begin
FCaption := Value; FCaption := Value;
if TabBar.PageListTabLink and (TabBar.PageList <> nil) and if TabBar.PageListTabLink and (TabBar.PageList <> nil) and
not (csLoading in TabBar.ComponentState) and not (csLoading in TabBar.ComponentState) and
Supports(TabBar.PageList, IPageList, PageListIntf) then Supports(TabBar.PageList, IPageList, PageListIntf)
then
PageListIntf.PageCaptionChanged(Index, FCaption); PageListIntf.PageCaptionChanged(Index, FCaption);
Changed; Changed;
end; end;
@ -2232,6 +2239,7 @@ procedure TJvModernTabBarPainter.DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem;
var var
R, CloseR: TRect; R, CloseR: TRect;
ts: TTextStyle; ts: TTextStyle;
margin: Integer;
begin begin
R := ATabRect; R := ATabRect;
@ -2274,15 +2282,18 @@ begin
LineTo(R.Right - 1 - 1, R.Top); LineTo(R.Right - 1 - 1, R.Top);
end; end;
inc(R.Left, Scale96(LEFT_MARGIN));
dec(R.Right, Scale96(RIGHT_MARGIN));
if Tab.TabBar.CloseButton then if Tab.TabBar.CloseButton then
begin begin
CloseR := GetCloseRect(Canvas, Tab, ATabRect);
// close button color // close button color
if Tab.Selected then if Tab.Selected then
Brush.Color := CloseColorSelected Brush.Color := CloseColorSelected
else else
Brush.Color := CloseColor; Brush.Color := CloseColor;
CloseR := GetCloseRect(Canvas, Tab, ATabRect);
Pen.Color := CloseRectColor; Pen.Color := CloseRectColor;
if not Tab.Enabled then if not Tab.Enabled then
Pen.Color := CloseRectColorDisabled; Pen.Color := CloseRectColorDisabled;
@ -2303,39 +2314,27 @@ begin
Pen.Color := CloseCrossColor Pen.Color := CloseCrossColor
else else
Pen.Color := CloseCrossColorDisabled; Pen.Color := CloseCrossColorDisabled;
Pen.Width := 2;
// Draw close cross // Draw close cross
MoveTo(CloseR.Left + 3, CloseR.Top + 3); margin := Scale96(CROSS_MARGIN);
MoveTo(CloseR.Left + 3, CloseR.Top + 3); Line(CloseR.Left + margin, CloseR.Top + margin, CloseR.Right - margin - 1, CloseR.Bottom - margin - 1);
LineTo(CloseR.Right - 3, CloseR.Bottom - 3); Line(CloseR.Left + margin, CloseR.Bottom - margin - 1, CloseR.Right - margin - 1, CloseR.Top + margin);
MoveTo(CloseR.Left + 4, CloseR.Top + 3); {
LineTo(CloseR.Right - 4, CloseR.Bottom - 3);
MoveTo(CloseR.Right - 4, CloseR.Top + 3);
LineTo(CloseR.Left + 2, CloseR.Bottom - 3);
MoveTo(CloseR.Right - 5, CloseR.Top + 3);
LineTo(CloseR.Left + 3, CloseR.Bottom - 3);
// remove intersection // remove intersection
if Tab.Modified then if Tab.Modified then
FillRect(Rect(CloseR.Left + 5, CloseR.Top + 4, CloseR.Right - 5, CloseR.Bottom - 4)); FillRect(Rect(CloseR.Left + 5, CloseR.Top + 4, CloseR.Right - 5, CloseR.Bottom - 4));
}
R.Right := CloseR.Left; R.Right := CloseR.Left - Scale96(TEXT_MARGIN_RIGHT);
// R.Left := CloseR.Right;
end; end;
InflateRect(R, -1, -1); { Draw image from image list }
// if not Tab.TabBar.CloseButton then
Dec(R.Right, 2);
// Inc(R.Left, 2);
if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then
begin begin
inc(R.Left, 2);
Tab.GetImages.Draw(Canvas, R.Left, (R.Top + R.Bottom - Tab.GetImages.Height) div 2, Tab.GetImages.Draw(Canvas, R.Left, (R.Top + R.Bottom - Tab.GetImages.Height) div 2,
Tab.ImageIndex, Tab.Enabled); Tab.ImageIndex, Tab.Enabled);
Inc(R.Left, Tab.GetImages.Width + 2); Inc(R.Left, Tab.GetImages.Width + Scale96(TEXT_MARGIN_LEFT));
end; end;
if Tab.Enabled then if Tab.Enabled then
@ -2352,20 +2351,21 @@ begin
ts := TextStyle; ts := TextStyle;
ts.EndEllipsis := true; ts.EndEllipsis := true;
ts.Clipping := true; ts.Clipping := true;
TextRect(R, R.Left, (R.Top + R.Bottom - TextHeight('Tg')) div 2, Tab.Caption, ts); TextRect(R, R.Left, (R.Top + R.Bottom - TextHeight('Tg')) div 2, Tab.Caption, ts);
end; end;
end; end;
function TJvModernTabBarPainter.GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; function TJvModernTabBarPainter.GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem;
ATabRect: TRect): TRect; ATabRect: TRect): TRect;
const var
H = 12; btnSize: TSize;
W = 12;
begin begin
Result.Right := ATabRect.Right - 5; btnSize := Size(Scale96(CLOSE_BUTTON_SIZE), Scale96(CLOSE_BUTTON_SIZE));
Result.Left := Result.Right - W; Result.Right := ATabRect.Right - Scale96(RIGHT_MARGIN);
Result.Top := (ATabRect.Top + ATabRect.Bottom - H) div 2; Result.Left := Result.Right - btnSize.CX;
Result.Bottom := Result.Top + W; Result.Top := (ATabRect.Top + ATabRect.Bottom - btnSize.CY) div 2;
Result.Bottom := Result.Top + btnSize.CY;
end; end;
function TJvModernTabBarPainter.GetDividerWidth(Canvas: TCanvas; LeftTab: TJvTabBarItem): Integer; function TJvModernTabBarPainter.GetDividerWidth(Canvas: TCanvas; LeftTab: TJvTabBarItem): Integer;
@ -2374,6 +2374,9 @@ begin
end; end;
function TJvModernTabBarPainter.GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; function TJvModernTabBarPainter.GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize;
var
w: Integer;
h: Integer;
begin begin
if Tab.Enabled then if Tab.Enabled then
begin begin
@ -2385,13 +2388,43 @@ begin
else else
Canvas.Font.Assign(DisabledFont); Canvas.Font.Assign(DisabledFont);
// Measure text
if Tab.Caption = '' then
Result := Size(0, Canvas.TextHeight('Tg'))
else
Result := Canvas.TextExtent(Tab.Caption);
inc(Result.CX, Scale96(LEFT_MARGIN) + Scale96(RIGHT_MARGIN));
// Extend width by close button
if Tab.TabBar.CloseButton then begin
w := Scale96(CLOSE_BUTTON_SIZE);
inc(Result.CX, w + Scale96(TEXT_MARGIN_RIGHT));
h := w;
if Result.CY < h then
Result.CY := h;
end;
// Extend width and height by image
if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then begin
w := Tab.GetImages.Width;
h := Tab.GetImages.Height;
inc(Result.CX, w + Scale96(TEXT_MARGIN_LEFT));
if Result.CY < h then
Result.CY := h;
end;
inc(Result.CY, Scale96(TOP_MARGIN) + Scale96(BOTTOM_MARGIN));
(*
Result.cx := Canvas.TextWidth(Tab.Caption) + 11; Result.cx := Canvas.TextWidth(Tab.Caption) + 11;
Result.cy := Canvas.TextHeight(Tab.Caption + 'Ag') + 7; Result.cy := Canvas.TextHeight(Tab.Caption + 'Ag') + 7;
if Tab.TabBar.CloseButton then if Tab.TabBar.CloseButton then
Result.cx := Result.cx + 15; Result.cx := Result.cx + 15;
if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then
Result.cx := Result.cx + Tab.GetImages.Width + 2; Result.cx := Result.cx + Tab.GetImages.Width + 2;
*)
// Override width if TabWidth is fixed.
if TabWidth > 0 then if TabWidth > 0 then
Result.cx := TabWidth; Result.cx := TabWidth;
end; end;
@ -2406,6 +2439,11 @@ begin
Changed; Changed;
end; end;
function TJvModernTabBarPainter.Scale96(AValue: Integer): Integer;
begin
Result := MulDiv(AValue, Font.PixelsPerInch, 96);
end;
procedure TJvModernTabBarPainter.SetBorderColor(const Value: TColor); procedure TJvModernTabBarPainter.SetBorderColor(const Value: TColor);
begin begin
if Value <> FBorderColor then if Value <> FBorderColor then