From 493e1b50b874c9a7ce5d59994a070cdcd5a201fa Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 1 May 2018 17:21:14 +0000 Subject: [PATCH] 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 --- .../design/JvPageComps/JvPageCompsReg.pas | 18 +- .../JvPageComps/JvPageListEditorForm.lfm | 545 ------------------ .../JvPageComps/JvPageListEditorForm.pas | 334 ----------- .../design/JvPageComps/JvPageListEditors.pas | 16 +- .../design/JvPageComps/images/images.txt | 1 + .../images/tjvnotebookpagelist.png | Bin 0 -> 538 bytes components/jvcllaz/packages/JvPageCompsR.lpk | 6 +- .../jvcllaz/resource/jvpagecompsreg.res | Bin 13944 -> 14550 bytes .../jvcllaz/run/JvCustomControls/JvTabBar.pas | 148 +++-- 9 files changed, 122 insertions(+), 946 deletions(-) delete mode 100644 components/jvcllaz/design/JvPageComps/JvPageListEditorForm.lfm delete mode 100644 components/jvcllaz/design/JvPageComps/JvPageListEditorForm.pas create mode 100644 components/jvcllaz/design/JvPageComps/images/tjvnotebookpagelist.png diff --git a/components/jvcllaz/design/JvPageComps/JvPageCompsReg.pas b/components/jvcllaz/design/JvPageComps/JvPageCompsReg.pas index 7eb4a33de..0a5cf4044 100644 --- a/components/jvcllaz/design/JvPageComps/JvPageCompsReg.pas +++ b/components/jvcllaz/design/JvPageComps/JvPageCompsReg.pas @@ -18,7 +18,9 @@ uses PropEdits, ComponentEditors, JvDsgnConsts, JvNavigationPane, JvNavPaneEditors, - JvPageList,JvPageListEditors, JvPageListTreeView; + JvPageList, JvNotebookPageList, + JvPageListEditors, + JvPageListTreeView; procedure Register; const @@ -42,17 +44,21 @@ begin TJvNavIconButtonImageIndexProperty); // JvPageList - RegisterComponents(RsPaletteJvcl, [ // was: RsPaletteListComboTree - TJvPageList]); + RegisterComponents(RsPaletteJvcl, [ // was: RsPaletteListComboTree + //TJvPageList, + TJvNotebookPageList]); + { RegisterClasses([TJvPageList, TJvStandardPage]); RegisterComponentEditor(TJvCustomPageList, TJvCustomPageListEditor); // was: TJvCustomPageEditor RegisterComponentEditor(TJvCustomPage, TJvCustomPageEditor); RegisterPropertyEditor(TypeInfo(TJvShowDesignCaption), nil, '', - TJvShowDesignCaptionProperty); -{ + TJvShowDesignCaptionProperty);# + } + + { RegisterPropertyEditor(TypeInfo(TJvCustomPage), TJvCustomPageList, cActivePage, TJvActivePageProperty); -} + } // JvPageTree RegisterComponents(RsPaletteJvcl, [ // was: TsPaletteListComboTree diff --git a/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.lfm b/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.lfm deleted file mode 100644 index 33944ef4c..000000000 --- a/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.lfm +++ /dev/null @@ -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 diff --git a/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.pas b/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.pas deleted file mode 100644 index b0d712bb4..000000000 --- a/components/jvcllaz/design/JvPageComps/JvPageListEditorForm.pas +++ /dev/null @@ -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 -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. diff --git a/components/jvcllaz/design/JvPageComps/JvPageListEditors.pas b/components/jvcllaz/design/JvPageComps/JvPageListEditors.pas index 56c8c0f17..0706f00a8 100644 --- a/components/jvcllaz/design/JvPageComps/JvPageListEditors.pas +++ b/components/jvcllaz/design/JvPageComps/JvPageListEditors.pas @@ -43,12 +43,14 @@ type procedure GetValues(Proc: TGetStrProc); override; end; *) + TJvShowDesignCaptionProperty = class(TEnumProperty) function GetAttributes: TPropertyAttributes; override; end; { a component editor for the TJvPageList } + (********************************** NOT WORKING *************** // adapted from TUntabbedNotebookComponentEditor) TJvCustomPageListEditor = class(TDefaultComponentEditor) protected @@ -71,7 +73,7 @@ type function Page: TJvCustomPage; virtual; end; - (* + { TJvCustomPageEditor = class(TComponentEditor) private procedure InsertPage; @@ -84,7 +86,8 @@ type function GetVerbCount: Integer; override; procedure ExecuteVerb(Index: Integer); override; procedure Edit; override; - end; *) + end; } + ***********************************************) TJvSettingsTreeImagesProperty = class(TImageIndexPropertyEditor) protected @@ -94,7 +97,6 @@ type implementation uses - LazLogger, TypInfo, JvDsgnConsts, JvPageListTreeView; //, JvPageListEditorForm; @@ -119,6 +121,7 @@ const { TJvCustomPageListEditor } +(****************************************** NOT WORKING { adapted from TUntabbedNotebookComponentEditor for LCL's Notebook originally named "TJvCustomPageEditor" } @@ -260,7 +263,7 @@ begin end; -(* +{ procedure TJvCustomPageEditor.Edit; begin @@ -359,7 +362,8 @@ begin Designer.Modified; end; end; - *) + } +*********************************************************) //=== { TJvActivePageProperty } ============================================== @@ -384,6 +388,7 @@ begin end; *) + //=== { TJvSettingsTreeImagesProperty } ====================================== function TJvSettingsTreeImagesProperty.GetImageList: TCustomImageList; @@ -400,6 +405,7 @@ begin Result := nil; end; + //=== { TJvShowDesignCaptionProperty } ======================================= function TJvShowDesignCaptionProperty.GetAttributes: TPropertyAttributes; diff --git a/components/jvcllaz/design/JvPageComps/images/images.txt b/components/jvcllaz/design/JvPageComps/images/images.txt index 2f24fe287..fef80576d 100644 --- a/components/jvcllaz/design/JvPageComps/images/images.txt +++ b/components/jvcllaz/design/JvPageComps/images/images.txt @@ -6,3 +6,4 @@ tjvnavpanelheader.bmp tjvnavpanestylemanager.bmp tjvnavpanetoolpanel.bmp tjvoutlooksplitter.bmp +tjvnotebookpagelist.png diff --git a/components/jvcllaz/design/JvPageComps/images/tjvnotebookpagelist.png b/components/jvcllaz/design/JvPageComps/images/tjvnotebookpagelist.png new file mode 100644 index 0000000000000000000000000000000000000000..07e076a2ce4d94a85e750a7ded89fad2df98ff2d GIT binary patch literal 538 zcmV+#0_FXQP)xc(j^wJihxR3sVphZC# z3eh&&7e%XD6;Tw`)}4rC1(Em<1Tm{tfk9Ri={+q0y3s&Z0aEO&x6b}y4eUO|4qUH&pvF4mN{paP4 zklcF^IuM;*fZJu$HTX<`a{>_q5i|)RHKJH739t7V_qJOU&LvESyC6w+T?4(!zjxZ$ zjrW&M2Cw$ zNKRN1H%2tXFfrENvWv!K8T9( - + @@ -28,6 +28,10 @@ + + + + diff --git a/components/jvcllaz/resource/jvpagecompsreg.res b/components/jvcllaz/resource/jvpagecompsreg.res index 3ed5f7c9d95cf897640cf4e9917f09d9a2725b12..6ca8ddf50ff26a1a78e231360aa53e064d41576f 100644 GIT binary patch delta 604 zcmV-i0;B!-Y}RqGcs4N_0ssI+00030{|W$907?K>08Ri;08{`)073vy08ao*08juy z07n2t089W$08;=|lkpl8e~C~|M-2)Z3IG5A4M|8uQUCw|7ytkO7zhRc007{3J@^0s z010qNS#tmY3ljhU3ljkVnw%H_00GQNL_t(Y$F-HqO9D|8#=q-}(XI3%LkR-I7E$!l z7NWS1{(_)IK^O|rHrf|Ot6CLN6xG(9h-3wk_zwgzt5$(QRukzxe=SP6(>T-A*ntBV zX868ye)n;hoCl#E0kkA!VQu?QaR6|L;ciPzGe@tc@sZ<^Su)cPUX!OXEIOkm5f!qC#NaPN_VjoVIdf|34OX6gN z=%V04WTI1p=r`hqh&I-55Rac&64!JfB05g{Rfzr~Ziwh|#DVa52PDbjrW&M2Cw$NKRN1H%2tXFfrENvWv!K8T9(o(9qWLYFQg-P6K;Fc1-44HCvj+e}}yW High(Word) then - Result := High(Word); + Result := CurrentPainter.GetTabSize(Canvas, Tab).cy; end; function TJvCustomTabBar.GetTabWidth(Tab: TJvTabBarItem): Integer; begin - Result := Abs(CurrentPainter.GetTabSize(Canvas, Tab).cx); - if Result > High(Word) then - Result := High(Word); + Result := CurrentPainter.GetTabSize(Canvas, Tab).cx; end; function TJvCustomTabBar.TabAt(X, Y: Integer): TJvTabBarItem; @@ -1790,19 +1788,27 @@ begin case TabBar.Orientation of toBottom: - Result := Rect(FLeft, 0, - FLeft + TabBar.GetTabWidth(Self), 0 + TabBar.GetTabHeight(Self)); + Result := Rect( + FLeft, + 0, + FLeft + TabBar.GetTabWidth(Self), + 0 + TabBar.GetTabHeight(Self) + ); else // toTop - Result := Rect(FLeft, TabBar.ClientHeight - TabBar.GetTabHeight(Self), - FLeft + TabBar.GetTabWidth(Self), TabBar.ClientHeight); + Result := Rect( + FLeft, + TabBar.ClientHeight - TabBar.GetTabHeight(Self), + FLeft + TabBar.GetTabWidth(Self), + TabBar.ClientHeight + ); end; end; end; function TJvTabBarItem.GetHot: Boolean; begin - Result := TabBar.HotTab = Self; + Result := (TabBar.HotTab = Self); end; function TJvTabBarItem.GetImages: TCustomImageList; @@ -1829,7 +1835,8 @@ begin FCaption := Value; if TabBar.PageListTabLink and (TabBar.PageList <> nil) and not (csLoading in TabBar.ComponentState) and - Supports(TabBar.PageList, IPageList, PageListIntf) then + Supports(TabBar.PageList, IPageList, PageListIntf) + then PageListIntf.PageCaptionChanged(Index, FCaption); Changed; end; @@ -2232,6 +2239,7 @@ procedure TJvModernTabBarPainter.DrawTab(Canvas: TCanvas; Tab: TJvTabBarItem; var R, CloseR: TRect; ts: TTextStyle; + margin: Integer; begin R := ATabRect; @@ -2274,15 +2282,18 @@ begin LineTo(R.Right - 1 - 1, R.Top); end; + inc(R.Left, Scale96(LEFT_MARGIN)); + dec(R.Right, Scale96(RIGHT_MARGIN)); + if Tab.TabBar.CloseButton then begin + CloseR := GetCloseRect(Canvas, Tab, ATabRect); + // close button color if Tab.Selected then Brush.Color := CloseColorSelected else Brush.Color := CloseColor; - - CloseR := GetCloseRect(Canvas, Tab, ATabRect); Pen.Color := CloseRectColor; if not Tab.Enabled then Pen.Color := CloseRectColorDisabled; @@ -2303,39 +2314,27 @@ begin Pen.Color := CloseCrossColor else Pen.Color := CloseCrossColorDisabled; + Pen.Width := 2; // Draw close cross - MoveTo(CloseR.Left + 3, CloseR.Top + 3); - MoveTo(CloseR.Left + 3, CloseR.Top + 3); - LineTo(CloseR.Right - 3, CloseR.Bottom - 3); - 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); - + margin := Scale96(CROSS_MARGIN); + Line(CloseR.Left + margin, CloseR.Top + margin, CloseR.Right - margin - 1, CloseR.Bottom - margin - 1); + Line(CloseR.Left + margin, CloseR.Bottom - margin - 1, CloseR.Right - margin - 1, CloseR.Top + margin); + { // remove intersection if Tab.Modified then FillRect(Rect(CloseR.Left + 5, CloseR.Top + 4, CloseR.Right - 5, CloseR.Bottom - 4)); - - R.Right := CloseR.Left; - // R.Left := CloseR.Right; + } + R.Right := CloseR.Left - Scale96(TEXT_MARGIN_RIGHT); end; - InflateRect(R, -1, -1); - - // if not Tab.TabBar.CloseButton then - Dec(R.Right, 2); -// Inc(R.Left, 2); + { Draw image from image list } if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then begin - inc(R.Left, 2); Tab.GetImages.Draw(Canvas, R.Left, (R.Top + R.Bottom - Tab.GetImages.Height) div 2, Tab.ImageIndex, Tab.Enabled); - Inc(R.Left, Tab.GetImages.Width + 2); + Inc(R.Left, Tab.GetImages.Width + Scale96(TEXT_MARGIN_LEFT)); end; if Tab.Enabled then @@ -2352,20 +2351,21 @@ begin ts := TextStyle; ts.EndEllipsis := true; ts.Clipping := true; + TextRect(R, R.Left, (R.Top + R.Bottom - TextHeight('Tg')) div 2, Tab.Caption, ts); end; end; function TJvModernTabBarPainter.GetCloseRect(Canvas: TCanvas; Tab: TJvTabBarItem; ATabRect: TRect): TRect; -const - H = 12; - W = 12; +var + btnSize: TSize; begin - Result.Right := ATabRect.Right - 5; - Result.Left := Result.Right - W; - Result.Top := (ATabRect.Top + ATabRect.Bottom - H) div 2; - Result.Bottom := Result.Top + W; + btnSize := Size(Scale96(CLOSE_BUTTON_SIZE), Scale96(CLOSE_BUTTON_SIZE)); + Result.Right := ATabRect.Right - Scale96(RIGHT_MARGIN); + Result.Left := Result.Right - btnSize.CX; + Result.Top := (ATabRect.Top + ATabRect.Bottom - btnSize.CY) div 2; + Result.Bottom := Result.Top + btnSize.CY; end; function TJvModernTabBarPainter.GetDividerWidth(Canvas: TCanvas; LeftTab: TJvTabBarItem): Integer; @@ -2374,6 +2374,9 @@ begin end; function TJvModernTabBarPainter.GetTabSize(Canvas: TCanvas; Tab: TJvTabBarItem): TSize; +var + w: Integer; + h: Integer; begin if Tab.Enabled then begin @@ -2385,13 +2388,43 @@ begin else 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.cy := Canvas.TextHeight(Tab.Caption + 'Ag') + 7; if Tab.TabBar.CloseButton then Result.cx := Result.cx + 15; if (Tab.ImageIndex <> -1) and (Tab.GetImages <> nil) then Result.cx := Result.cx + Tab.GetImages.Width + 2; + *) + // Override width if TabWidth is fixed. if TabWidth > 0 then Result.cx := TabWidth; end; @@ -2406,6 +2439,11 @@ begin Changed; end; +function TJvModernTabBarPainter.Scale96(AValue: Integer): Integer; +begin + Result := MulDiv(AValue, Font.PixelsPerInch, 96); +end; + procedure TJvModernTabBarPainter.SetBorderColor(const Value: TColor); begin if Value <> FBorderColor then