1
0
mirror of synced 2024-11-22 01:53:50 +00:00

Added: somewhat working support for moving menu items in the editor

Fixed: animation start time based on action start
Fixed: auto-collapse + auto-select
This commit is contained in:
Mark van Renswoude 2007-04-20 13:37:56 +00:00
parent eedd2e0696
commit e070e53c07
12 changed files with 830 additions and 302 deletions

View File

@ -38,7 +38,8 @@ contains
X2CLGraphics in '..\..\Source\X2CLGraphics.pas', X2CLGraphics in '..\..\Source\X2CLGraphics.pas',
X2CLMenuBarAnimators in '..\..\Source\X2CLMenuBarAnimators.pas', X2CLMenuBarAnimators in '..\..\Source\X2CLMenuBarAnimators.pas',
X2CLMenuBar in '..\..\Source\X2CLMenuBar.pas', X2CLMenuBar in '..\..\Source\X2CLMenuBar.pas',
X2CLmusikCubeMenuBarPainter in '..\..\Source\X2CLmusikCubeMenuBarPainter.pas'; X2CLmusikCubeMenuBarPainter in '..\..\Source\X2CLmusikCubeMenuBarPainter.pas',
X2CLMenuBarActions in '..\..\Source\X2CLMenuBarActions.pas';
end. end.

View File

@ -11,6 +11,7 @@ interface
uses uses
DesignEditors; DesignEditors;
type type
TX2MenuBarComponentEditor = class(TComponentEditor) TX2MenuBarComponentEditor = class(TComponentEditor)
public public
@ -20,12 +21,14 @@ type
function GetVerbCount(): Integer; override; function GetVerbCount(): Integer; override;
end; end;
implementation implementation
uses uses
X2CLMenuBar, X2CLMenuBar,
X2CLMenuBarEditor; X2CLMenuBarEditor;
{ TX2MenuBarComponentEditor } { TX2MenuBarComponentEditor }
procedure TX2MenuBarComponentEditor.Edit(); procedure TX2MenuBarComponentEditor.Edit();
begin begin
@ -33,16 +36,19 @@ begin
TfrmMenuBarEditor.Execute(TX2CustomMenuBar(Component), Designer); TfrmMenuBarEditor.Execute(TX2CustomMenuBar(Component), Designer);
end; end;
procedure TX2MenuBarComponentEditor.ExecuteVerb(Index: Integer); procedure TX2MenuBarComponentEditor.ExecuteVerb(Index: Integer);
begin begin
Edit(); Edit();
end; end;
function TX2MenuBarComponentEditor.GetVerb(Index: Integer): string; function TX2MenuBarComponentEditor.GetVerb(Index: Integer): string;
begin begin
Result := 'Edit...'; Result := 'Edit...';
end; end;
function TX2MenuBarComponentEditor.GetVerbCount(): Integer; function TX2MenuBarComponentEditor.GetVerbCount(): Integer;
begin begin
Result := 1; Result := 1;

View File

@ -1,10 +1,10 @@
object frmMenuBarEditor: TfrmMenuBarEditor object frmMenuBarEditor: TfrmMenuBarEditor
Left = 0 Left = 271
Top = 0 Top = 101
Width = 394
Height = 469
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
Caption = 'Editing' Caption = 'Editing'
ClientHeight = 376
ClientWidth = 276
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -22,20 +22,21 @@ object frmMenuBarEditor: TfrmMenuBarEditor
TextHeight = 13 TextHeight = 13
object tvMenu: TTreeView object tvMenu: TTreeView
Left = 0 Left = 0
Top = 26 Top = 28
Width = 276 Width = 386
Height = 331 Height = 395
Align = alClient Align = alClient
HideSelection = False HideSelection = False
Indent = 19 Indent = 19
ReadOnly = True ReadOnly = True
TabOrder = 0 TabOrder = 0
OnChange = tvMenuChange OnChange = tvMenuChange
OnKeyPress = tvMenuKeyPress
end end
object sbStatus: TStatusBar object sbStatus: TStatusBar
Left = 0 Left = 0
Top = 357 Top = 423
Width = 276 Width = 386
Height = 19 Height = 19
Panels = < Panels = <
item item
@ -45,40 +46,307 @@ object frmMenuBarEditor: TfrmMenuBarEditor
object tbMenu: TToolBar object tbMenu: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
Width = 276 Width = 386
Height = 26 Height = 28
AutoSize = True AutoSize = True
ButtonWidth = 84
EdgeBorders = [ebTop, ebBottom] EdgeBorders = [ebTop, ebBottom]
Images = ilsActions Images = ilsActions
List = True
ShowCaptions = True
TabOrder = 2 TabOrder = 2
object tbAddGroup: TToolButton object tbAddGroup: TToolButton
Left = 0 Left = 0
Top = 0 Top = 2
Action = actAddGroup Action = actAddGroup
AutoSize = True
end end
object tbAddItem: TToolButton object tbAddItem: TToolButton
Left = 81 Left = 23
Top = 0 Top = 2
Action = actAddItem Action = actAddItem
AutoSize = True
end end
object tbDelete: TToolButton object tbDelete: TToolButton
Left = 154 Left = 46
Top = 0 Top = 2
Action = actDelete Action = actDelete
AutoSize = True end
object tbSep1: TToolButton
Left = 69
Top = 2
Width = 8
ImageIndex = 3
Style = tbsSeparator
end
object tbMoveUp: TToolButton
Left = 77
Top = 2
Action = actMoveUp
end
object tbMoveDown: TToolButton
Left = 100
Top = 2
Action = actMoveDown
end end
end end
object ilsActions: TImageList object ilsActions: TImageList
Left = 8 Left = 24
Top = 32 Top = 44
Bitmap = { Bitmap = {
494C010103000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 494C010105000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010 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
000000000000000000000000000069AC69005EAB5E0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000022AD350028B13E0071AF7100000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000020B7300069FFA30056D588001AA22700000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000001EAC240067FFA2005BF6900057F48D004CCB7E00169C1F000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00001DA1210063FF9C005AF5900055EF890052ED860051EC860045C576001795
1C00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000028A0
2B0068FFA20079FFA9006AF39A0051EB850050EA83004CE781004EEA860043C4
7500219426000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000228D23001093
1A001C97260049CA63008BF8B1004BE87F004DE7800049DD7D0028A946000D87
18000B8714001C831D0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000199B270086F8B00047E57C0049E47D004ADF7F00128A1F000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000001A9B290083F6AE0044E2790046E17A0047DE7C00138A21000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000001A9929007FF3A90041DF760043DD770044DC7B00138921000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000001996260076F0A3003CDC71003FDA730041D97600118720000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000001997280097FCC2006BEC9B005BE98F004BE28400128923000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000077B0B0010881D000D8318001081180014851F0009750D000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -102,7 +370,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
770000750000BDA99D000000000000000000000000004E4EAB001844F600194D 770000750000BDA99D000000000000000000000000004E4EAB001844F600194D
F8001031D2002427AE000000000000000000000000004E4EAB000928D700092E F8001031D2002427AE000000000000000000000000004E4EAB000928D700092E
D7000313B3004E4EAB0000000000000000000000000000000000000000000000 D7000313B3004E4EAB0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000A7B0E00128A1E000F8018000E791600117919000E7510000000
0000000000000000000000000000000000000000000000000000689BAF001989 0000000000000000000000000000000000000000000000000000689BAF001989
B700007EB10090EFFF0030E0FF007AEEFF0000860000008600000086000048E1 B700007EB10090EFFF0030E0FF007AEEFF0000860000008600000086000048E1
7B00007500000075000000750000000000000000000000000000A27F6F00FFFF 7B00007500000075000000750000000000000000000000000000A27F6F00FFFF
@ -110,7 +378,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
7B0000750000007500000075000000000000000000002022B1002451F9001F51 7B0000750000007500000075000000000000000000002022B1002451F9001F51
FF00194DF8001744E8001017AF00000000004545AD00092ED7001142F9000D3D FF00194DF8001744E8001017AF00000000004545AD00092ED7001142F9000D3D
F5000D3DF500041ABC006F6FAA00000000000000000000000000000000000000 F5000D3DF500041ABC006F6FAA00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000025A93C0069F59E0044E47E0045E57F0045E17F00189230000000
00000000000000000000000000000000000000000000000000003B92B4003B9F 00000000000000000000000000000000000000000000000000003B92B4003B9F
C600007EB1009FF1FF0046E2FF0090EFFF00008D00005EF791005AF38D0053EC C600007EB1009FF1FF0046E2FF0090EFFF00008D00005EF791005AF38D0053EC
860048E17B0045DE780000750000000000000000000000000000A3807000FFFF 860048E17B0045DE780000750000000000000000000000000000A3807000FFFF
@ -118,7 +386,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
860048E17B0045DE7800007500000000000000000000000000001832DB00285A 860048E17B0045DE7800007500000000000000000000000000001832DB00285A
FF002451F9002451F9001A4AF100060EAF000F30DD00164AFE001142F9001041 FF002451F9002451F9001A4AF100060EAF000F30DD00164AFE001142F9001041
F6000D3DF5000D3DF5002C2CA200000000000000000000000000000000000000 F6000D3DF5000D3DF5002C2CA200000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000022A7370077EFA40040DC750041DB740042DB7900188D2B000000
0000000000000000000000000000000000000000000074A0B1000E84B700B6F5 0000000000000000000000000000000000000000000074A0B1000E84B700B6F5
FB000081B400B6F5FB005EECFF00A3F3FF0000910000008D0000008D00005AF3 FB000081B400B6F5FB005EECFF00A3F3FF0000910000008D0000008D00005AF3
8D0000860000007D0000007D0000000000000000000000000000A9877800FFFF 8D0000860000007D0000007D0000000000000000000000000000A9877800FFFF
@ -126,7 +394,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
8D0000860000007D0000007D000000000000000000007777B3001832DB004170 8D0000860000007D0000007D000000000000000000007777B3001832DB004170
FF002D5DFF00285AFF00285AFF001F51FF00194DF800194DF8001142F9001142 FF002D5DFF00285AFF00285AFF001F51FF00194DF800194DF8001142F9001142
F9000F3DF200161CAC0000000000000000000000000000000000000000000000 F9000F3DF200161CAC0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000025AC3A007DF3A90042DF770043DE770045DE7C0018902B000000
000000000000000000000000000000000000000000004596B40044A5C900DDFF 000000000000000000000000000000000000000000004596B40044A5C900DDFF
FF000084B700C0FBFF0077F4FF00B6F5FB00ADF6FF00ADF6FF00008D00005EF7 FF000084B700C0FBFF0077F4FF00B6F5FB00ADF6FF00ADF6FF00008D00005EF7
910000860000C3F1F80061A8C700000000000000000000000000AB897A00FFFF 910000860000C3F1F80061A8C700000000000000000000000000AB897A00FFFF
@ -134,7 +402,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
910000860000C8B7AE00000000000000000000000000000000006969B8001A25 910000860000C8B7AE00000000000000000000000000000000006969B8001A25
C5003A6DFF003668FF00285AFF00285AFF002451F900194DF8001F51FF00123D C5003A6DFF003668FF00285AFF00285AFF002451F900194DF8001F51FF00123D
ED002427AE000000000000000000000000000000000000000000000000000000 ED002427AE000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000026AF3C0085F6AE0044E2790046E0790048E17E001B942E000000
000000000000000000000000000000000000000000002790B800ABDCEA00E6FE 000000000000000000000000000000000000000000002790B800ABDCEA00E6FE
FE000084B700D2FFFF008EFDFF0089FAFF0082F6FF00B0F7FF00009100000091 FE000084B700D2FFFF008EFDFF0089FAFF0082F6FF00B0F7FF00009100000091
0000008D0000C1FDFF000072A500000000000000000000000000AB897A00FFFF 0000008D0000C1FDFF000072A500000000000000000000000000AB897A00FFFF
@ -142,39 +410,39 @@ object frmMenuBarEditor: TfrmMenuBarEditor
0000008D0000BFABA10000000000000000000000000000000000000000000000 0000008D0000BFABA10000000000000000000000000000000000000000000000
00002F2FB3002E4EE7003668FF00285AFF00285AFF002451F900123DED002C2C 00002F2FB3002E4EE7003668FF00285AFF00285AFF002451F900123DED002C2C
A200000000000000000000000000000000000000000000000000000000000000 A200000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000028B03A008CF8B50048E57C0049E37D004AE2810019932B000000
000000000000000000000000000000000000000000000A8CBC00C9F6FA00F1FF 000000000000000000000000000000000000000000000A8CBC00C9F6FA00F1FF
FF000088BB00DDFFFF00A1FFFF00A1FFFF0094F8FF00C0FBFF00C0FBFF00B0F7 FF000088BB00DDFFFF00A1FFFF00A1FFFF0094F8FF00C0FBFF00C0FBFF00B0F7
FF00C3EDF500DDFFFF000072A500000000000000000000000000B1908000FFFF FF00C3EDF500DDFFFF000072A500000000000000000000000000B1908000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FCF8F100FFFFFF00FCF8F100FFFFFF00FCF8 FF00FFFFFF00FFFFFF00FFFFFF00FCF8F100FFFFFF00FCF8F100FFFFFF00FCF8
F100FCF6ED009B7C6B0000000000000000000000000000000000000000000000 F100FCF6ED009B7C6B0000000000000000000000000000000000000000000000
000000000000253FDF003A6DFF003668FF002D5DFF00285AFF001B46EA002427 000000000000253FDF003A6DFF003668FF002D5DFF00285AFF001B46EA002427
AE00000000000000000000000000000000000000000000000000000000000000 AE000000000000000000000000000000000000000000000000003397330015A7
0000000000000000000000000000000000000000000000000000000000000000 23001BB02E0035C9550063F3960050EA83004DE780004BE27F00249A3D001293
00000000000000000000000000000000000000000000018DC0000F92C1007EC4 210011981E002B8C2B00000000000000000000000000018DC0000F92C1007EC4
DD000088BB00C3EDF5007ADBEA0085E3EF0092F0F800A1FFFF0094F8FF0065D2 DD000088BB00C3EDF5007ADBEA0085E3EF0092F0F800A1FFFF0094F8FF0065D2
E700ADF6FF00DDFFFF000079AC00000000000000000000000000AF8F8000FFFF E700ADF6FF00DDFFFF000079AC00000000000000000000000000AF8F8000FFFF
FF00DFCDCB00DFCDCB00DBC6C200DECAC600DDC1B400DDC1B400DEBEAD00DEBE FF00DFCDCB00DFCDCB00DBC6C200DECAC600DDC1B400DDC1B400DEBEAD00DEBE
AD00FCF6ED009B7C6B0000000000000000000000000000000000000000000000 AD00FCF6ED009B7C6B0000000000000000000000000000000000000000000000
00002B2CC0004B7CFF004170FF003A6DFF003A6DFF00285AFF00285AFF001031 00002B2CC0004B7CFF004170FF003A6DFF003A6DFF00285AFF00285AFF001031
D2004A4AB2000000000000000000000000000000000000000000000000000000 D2004A4AB200000000000000000000000000000000000000000000000000279E
0000000000000000000000000000000000000000000000000000000000000000 2A009EFFC7007DFFAD0053F1890052EB850050E983004CE580004DE583004FEC
0000000000000000000000000000000000000000000000000000000000000000 8A00229628000000000000000000000000000000000000000000000000000000
0000018DC000F1FFFF00C3F1F800ABE7F10081D4E60065C6DF0065C6DF005FC2 0000018DC000F1FFFF00C3F1F800ABE7F10081D4E60065C6DF0065C6DF005FC2
DB00D2FFFF00E6FEFE000079AC00000000000000000000000000B1908000FFFF DB00D2FFFF00E6FEFE000079AC00000000000000000000000000B1908000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCF8F100FCF8F100F9F4 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCF8F100FCF8F100F9F4
EE00F0E8E0009C7D6D0000000000000000000000000000000000000000000000 EE00F0E8E0009C7D6D0000000000000000000000000000000000000000000000
0000253FDF00527CFA004170FF003668FF000C13C1003A6DFF00285AFF002451 0000253FDF00527CFA004170FF003668FF000C13C1003A6DFF00285AFF002451
F9000B1DC2000000000000000000000000000000000000000000000000000000 F9000B1DC2000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00001AA11F00A0FFC50062F7960053EF880051EB840050EA860051ED8A001A99
0000000000000000000000000000000000000000000000000000000000000000 2000000000000000000000000000000000000000000000000000000000000000
00001A96C50031A5CD004AB0D30083CDE200D0EFF600E6FEFE00F1FFFF00E6FE 00001A96C50031A5CD004AB0D30083CDE200D0EFF600E6FEFE00F1FFFF00E6FE
FE00DDFFFF00F1FFFF000079AC00000000000000000000000000B1908000FFFF FE00DDFFFF00F1FFFF000079AC00000000000000000000000000B1908000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A3807000A782 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A3807000A782
7000A7827000A380700000000000000000000000000000000000000000004F4F 7000A7827000A380700000000000000000000000000000000000000000004F4F
BD00527CFA005080FF004B7CFF00181FC500000000001B22C4003A6DFF00285A BD00527CFA005080FF004B7CFF00181FC500000000001B22C4003A6DFF00285A
FF001A4AF1001419B10000000000000000000000000000000000000000000000 FF001A4AF1001419B10000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000001AA82200A4FFC9005CF3900053EF890059F5930019A624000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000589FBA003298BE002390BC00158FBF00FFFF 0000000000000000000000000000589FBA003298BE002390BC00158FBF00FFFF
FF00FFFFFF00FFFFFF00007EB100000000000000000000000000B8988800FFFF FF00FFFFFF00FFFFFF00007EB100000000000000000000000000B8988800FFFF
@ -182,7 +450,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
D900B1908000AB9E98000000000000000000000000000000000000000000252D D900B1908000AB9E98000000000000000000000000000000000000000000252D
D6006A9CFF005788FF002E4EE7007070B90000000000000000001621C7002D5D D6006A9CFF005788FF002E4EE7007070B90000000000000000001621C7002D5D
FF002451F9001439DD004545AD00000000000000000000000000000000000000 FF002451F9001439DD004545AD00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000021B42D00A4FFCC0072FEA9001DB32C00000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000088BB00EDF6 00000000000000000000000000000000000000000000000000000088BB00EDF6
FA00FFFFFF00FFFFFF00007EB100000000000000000000000000B8988800FFFF FA00FFFFFF00FFFFFF00007EB100000000000000000000000000B8988800FFFF
@ -190,7 +458,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
7D00AB9E98000000000000000000000000000000000000000000000000004B4B 7D00AB9E98000000000000000000000000000000000000000000000000004B4B
C8003951E2005080FF002929C600000000000000000000000000000000001628 C8003951E2005080FF002929C600000000000000000000000000000000001628
D300285AFF000F2EE3002123B500000000000000000000000000000000000000 D300285AFF000F2EE3002123B500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000035C84A0037CD500074AC7400000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000002F99C3000084 00000000000000000000000000000000000000000000000000002F99C3000084
B7000084B7000081B4004388A900000000000000000000000000B8988800B898 B7000084B7000081B4004388A900000000000000000000000000B8988800B898
@ -198,7 +466,7 @@ object frmMenuBarEditor: TfrmMenuBarEditor
9800000000000000000000000000000000000000000000000000000000000000 9800000000000000000000000000000000000000000000000000000000000000
0000000000003E3EB90000000000000000000000000000000000000000006B6B 0000000000003E3EB90000000000000000000000000000000000000000006B6B
B6002E2EB5000000000000000000000000000000000000000000000000000000 B6002E2EB5000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000006EAC6E0063AB630000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -208,18 +476,26 @@ object frmMenuBarEditor: TfrmMenuBarEditor
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000 000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000100000000100010000000000800000000000000000000000 2800000040000000300000000100010000000000800100000000000000000000
000000000000000000000000FFFFFF00FFFFFFFFFFFF0000E1C7C003C7CF0000 000000000000000000000000FFFFFF0000000000000000000000000000000000
E007C00383830000C001C00181010000C001C001C00100008001C00180030000 0000000000000000000000000000000000000000000000000000000000000000
8001C003C00700008001C003F00F00008001C003F80F00008001C003F0070000 0000000000000000000000000000000000000000000000000000000000000000
F001C003F0070000F001C003E0830000FE01C003E0C10000FFC1C007E1E10000 0000000000000000000000000000000000000000000000000000000000000000
FFC1C00FFBE70000FFFFFFFFFFFF000000000000000000000000000000000000 00000000000000000000000000000000FFFF000000000000FE7F000000000000
FE3F000000000000FC3F000000000000F81F000000000000F00F000000000000
E007000000000000C003000000000000F81F000000000000F81F000000000000
F81F000000000000F81F000000000000F81F000000000000F81F000000000000
FFFF000000000000FFFF000000000000FFFFFFFFFFFFFFFFE1C7C003C7CFFFFF
E007C0038383F81FC001C0018101F81FC001C001C001F81F8001C0018003F81F
8001C003C007F81F8001C003F00FF81F8001C003F80FC0038001C003F007E007
F001C003F007F00FF001C003E083F81FFE01C003E0C1FC3FFFC1C007E1E1FE3F
FFC1C00FFBE7FE7FFFFFFFFFFFFFFFFF00000000000000000000000000000000
000000000000} 000000000000}
end end
object alMenu: TActionList object alMenu: TActionList
Images = ilsActions Images = ilsActions
Left = 36 Left = 80
Top = 32 Top = 44
object actAddGroup: TAction object actAddGroup: TAction
Caption = '&Add group' Caption = '&Add group'
ImageIndex = 0 ImageIndex = 0
@ -244,5 +520,17 @@ object frmMenuBarEditor: TfrmMenuBarEditor
'Ctrl+Del') 'Ctrl+Del')
OnExecute = actDeleteExecute OnExecute = actDeleteExecute
end end
object actMoveUp: TAction
Caption = 'Move &Up'
ImageIndex = 3
ShortCut = 16422
OnExecute = actMoveUpExecute
end
object actMoveDown: TAction
Caption = 'Move &Down'
ImageIndex = 4
ShortCut = 16424
OnExecute = actMoveDownExecute
end
end end
end end

View File

@ -7,17 +7,21 @@ uses
ComCtrls, ComCtrls,
Controls, Controls,
DesignIntf, DesignIntf,
DesignWindows,
Forms, Forms,
ImgList, ImgList,
ToolWin, ToolWin,
X2CLMenuBar; X2CLMenuBar;
type type
TfrmMenuBarEditor = class(TForm, IX2MenuBarDesigner) TfrmMenuBarEditor = class(TDesignWindow, IX2MenuBarDesigner)
actAddGroup: TAction; actAddGroup: TAction;
actAddItem: TAction; actAddItem: TAction;
actDelete: TAction; actDelete: TAction;
actMoveDown: TAction;
actMoveUp: TAction;
alMenu: TActionList; alMenu: TActionList;
ilsActions: TImageList; ilsActions: TImageList;
sbStatus: TStatusBar; sbStatus: TStatusBar;
@ -25,6 +29,9 @@ type
tbAddItem: TToolButton; tbAddItem: TToolButton;
tbDelete: TToolButton; tbDelete: TToolButton;
tbMenu: TToolBar; tbMenu: TToolBar;
tbMoveDown: TToolButton;
tbMoveUp: TToolButton;
tbSep1: TToolButton;
tvMenu: TTreeView; tvMenu: TTreeView;
procedure actDeleteExecute(Sender: TObject); procedure actDeleteExecute(Sender: TObject);
@ -36,8 +43,10 @@ type
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure tvMenuChange(Sender: TObject; Node: TTreeNode); procedure tvMenuChange(Sender: TObject; Node: TTreeNode);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure actMoveUpExecute(Sender: TObject);
procedure actMoveDownExecute(Sender: TObject);
procedure tvMenuKeyPress(Sender: TObject; var Key: Char);
private private
FDesigner: IDesigner;
FMenuBar: TX2CustomMenuBar; FMenuBar: TX2CustomMenuBar;
FDesignerAttached: Boolean; FDesignerAttached: Boolean;
@ -48,6 +57,7 @@ type
function GetSelectedItem(): TX2CustomMenuBarItem; function GetSelectedItem(): TX2CustomMenuBarItem;
function GetItemNode(AItem: TX2CustomMenuBarItem): TTreeNode; function GetItemNode(AItem: TX2CustomMenuBarItem): TTreeNode;
procedure MoveSelectedItem(ADown: Boolean);
protected protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure ItemAdded(AItem: TX2CustomMenuBarItem); procedure ItemAdded(AItem: TX2CustomMenuBarItem);
@ -62,26 +72,29 @@ type
procedure UpdateUI(); procedure UpdateUI();
procedure Modified(); procedure Modified();
property Designer: IDesigner read FDesigner write FDesigner;
property MenuBar: TX2CustomMenuBar read FMenuBar write SetMenuBar; property MenuBar: TX2CustomMenuBar read FMenuBar write SetMenuBar;
public public
class procedure Execute(AMenuBar: TX2CustomMenuBar; ADesigner: IDesigner); class procedure Execute(AMenuBar: TX2CustomMenuBar; ADesigner: IDesigner);
end; end;
implementation implementation
uses uses
Contnrs, Contnrs,
SysUtils; SysUtils;
var var
GEditors: TObjectBucketList; GEditors: TObjectBucketList;
type type
TProtectedX2CustomMenuBar = class(TX2CustomMenuBar); TProtectedX2CustomMenuBar = class(TX2CustomMenuBar);
{$R *.dfm} {$R *.dfm}
{ TfrmMenuBarEditor } { TfrmMenuBarEditor }
class procedure TfrmMenuBarEditor.Execute(AMenuBar: TX2CustomMenuBar; ADesigner: IDesigner); class procedure TfrmMenuBarEditor.Execute(AMenuBar: TX2CustomMenuBar; ADesigner: IDesigner);
var var
@ -106,6 +119,7 @@ begin
editorForm.Show(); editorForm.Show();
end; end;
procedure TfrmMenuBarEditor.FormCreate(Sender: TObject); procedure TfrmMenuBarEditor.FormCreate(Sender: TObject);
begin begin
{$IFDEF VER180} {$IFDEF VER180}
@ -117,6 +131,7 @@ begin
{$ENDIF} {$ENDIF}
end; end;
procedure TfrmMenuBarEditor.FormActivate(Sender: TObject); procedure TfrmMenuBarEditor.FormActivate(Sender: TObject);
var var
item: TX2CustomMenuBarItem; item: TX2CustomMenuBarItem;
@ -133,6 +148,7 @@ begin
UpdateUI(); UpdateUI();
end; end;
procedure TfrmMenuBarEditor.FormClose(Sender: TObject; var Action: TCloseAction); procedure TfrmMenuBarEditor.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
if Assigned(Designer) and Assigned(MenuBar) then if Assigned(Designer) and Assigned(MenuBar) then
@ -141,6 +157,7 @@ begin
Action := caFree; Action := caFree;
end; end;
procedure TfrmMenuBarEditor.FormDestroy(Sender: TObject); procedure TfrmMenuBarEditor.FormDestroy(Sender: TObject);
begin begin
if Assigned(MenuBar) then if Assigned(MenuBar) then
@ -170,6 +187,12 @@ begin
end; end;
procedure TfrmMenuBarEditor.tvMenuKeyPress(Sender: TObject; var Key: Char);
begin
ActivateInspector(Key);
end;
procedure TfrmMenuBarEditor.RefreshMenu(); procedure TfrmMenuBarEditor.RefreshMenu();
var var
groupIndex: Integer; groupIndex: Integer;
@ -195,6 +218,7 @@ begin
Modified(); Modified();
end; end;
procedure TfrmMenuBarEditor.actAddItemExecute(Sender: TObject); procedure TfrmMenuBarEditor.actAddItemExecute(Sender: TObject);
var var
menuItem: TX2CustomMenuBarItem; menuItem: TX2CustomMenuBarItem;
@ -222,6 +246,7 @@ begin
end; end;
end; end;
procedure TfrmMenuBarEditor.actDeleteExecute(Sender: TObject); procedure TfrmMenuBarEditor.actDeleteExecute(Sender: TObject);
var var
menuItem: TX2CustomMenuBarItem; menuItem: TX2CustomMenuBarItem;
@ -236,6 +261,18 @@ begin
end; end;
procedure TfrmMenuBarEditor.actMoveUpExecute(Sender: TObject);
begin
MoveSelectedItem(False);
end;
procedure TfrmMenuBarEditor.actMoveDownExecute(Sender: TObject);
begin
MoveSelectedItem(True);
end;
function TfrmMenuBarEditor.AddGroup(AGroup: TX2MenuBarGroup): TTreeNode; function TfrmMenuBarEditor.AddGroup(AGroup: TX2MenuBarGroup): TTreeNode;
var var
itemIndex: Integer; itemIndex: Integer;
@ -286,6 +323,7 @@ begin
end; end;
end; end;
function TfrmMenuBarEditor.AddItem(ANode: TTreeNode; AItem: TX2MenuBarItem): TTreeNode; function TfrmMenuBarEditor.AddItem(ANode: TTreeNode; AItem: TX2MenuBarItem): TTreeNode;
var var
siblingItem: TX2MenuBarItem; siblingItem: TX2MenuBarItem;
@ -328,6 +366,7 @@ begin
end; end;
end; end;
procedure TfrmMenuBarEditor.UpdateNode(ANode: TTreeNode); procedure TfrmMenuBarEditor.UpdateNode(ANode: TTreeNode);
var var
menuItem: TX2CustomMenuBarItem; menuItem: TX2CustomMenuBarItem;
@ -339,16 +378,50 @@ begin
ANode.SelectedIndex := ANode.ImageIndex; ANode.SelectedIndex := ANode.ImageIndex;
end; end;
procedure TfrmMenuBarEditor.UpdateUI(); procedure TfrmMenuBarEditor.UpdateUI();
var var
canMoveDown: Boolean;
canMoveUp: Boolean;
itemSelected: Boolean; itemSelected: Boolean;
menuItem: TX2CustomMenuBarItem;
group: TX2MenuBarGroup;
begin begin
itemSelected := Assigned(tvMenu.Selected); itemSelected := Assigned(tvMenu.Selected);
actAddGroup.Enabled := Assigned(MenuBar); actAddGroup.Enabled := Assigned(MenuBar);
actAddItem.Enabled := itemSelected; actAddItem.Enabled := itemSelected;
actDelete.Enabled := itemSelected; actDelete.Enabled := itemSelected;
canMoveUp := False;
canMoveDown := False;
if itemSelected then
begin
menuItem := GetSelectedItem();
if Assigned(menuItem.Collection) then
begin
canMoveUp := (menuItem.Index > 0);
canMoveDown := (menuItem.Index < Pred(menuItem.Collection.Count));
if menuItem is TX2MenuBarItem then
begin
group := TX2MenuBarItem(menuItem).Group;
if Assigned(group) then
begin
canMoveUp := canMoveUp or (group.Index > 0);
canMoveDown := canMoveDown or (group.Index < Pred(MenuBar.Groups.Count));
end; end;
end;
end;
end;
actMoveUp.Enabled := canMoveUp;
actMoveDown.Enabled := canMoveDown;
end;
procedure TfrmMenuBarEditor.Modified(); procedure TfrmMenuBarEditor.Modified();
begin begin
@ -370,6 +443,7 @@ begin
inherited; inherited;
end; end;
procedure TfrmMenuBarEditor.ItemAdded(AItem: TX2CustomMenuBarItem); procedure TfrmMenuBarEditor.ItemAdded(AItem: TX2CustomMenuBarItem);
var var
group: TX2MenuBarGroup; group: TX2MenuBarGroup;
@ -397,6 +471,7 @@ begin
tvMenu.Selected := treeNode; tvMenu.Selected := treeNode;
end; end;
procedure TfrmMenuBarEditor.ItemModified(AItem: TX2CustomMenuBarItem); procedure TfrmMenuBarEditor.ItemModified(AItem: TX2CustomMenuBarItem);
var var
treeNode: TTreeNode; treeNode: TTreeNode;
@ -415,6 +490,7 @@ begin
end; end;
end; end;
procedure TfrmMenuBarEditor.ItemDeleting(AItem: TX2CustomMenuBarItem); procedure TfrmMenuBarEditor.ItemDeleting(AItem: TX2CustomMenuBarItem);
var var
treeNode: TTreeNode; treeNode: TTreeNode;
@ -435,6 +511,7 @@ begin
FDesignerAttached := True; FDesignerAttached := True;
end; end;
procedure TfrmMenuBarEditor.DetachDesigner(); procedure TfrmMenuBarEditor.DetachDesigner();
begin begin
if not FDesignerAttached then if not FDesignerAttached then
@ -446,6 +523,67 @@ begin
end; end;
procedure TfrmMenuBarEditor.MoveSelectedItem(ADown: Boolean);
var
selectedItem: TX2CustomMenuBarItem;
group: TX2MenuBarGroup;
refresh: Boolean;
begin
if not Assigned(MenuBar) then
Exit;
selectedItem := GetSelectedItem();
if not Assigned(selectedItem) then
Exit;
refresh := False;
group := nil;
if selectedItem is TX2MenuBarItem then
group := TX2MenuBarItem(selectedItem).Group;
if ADown then
begin
if selectedItem.Index < Pred(selectedItem.Collection.Count) then
begin
selectedItem.Index := Succ(selectedItem.Index);
refresh := True;
end else if Assigned(group) then
begin
{ Move down to another group }
if group.Index < Pred(MenuBar.Groups.Count) then
begin
selectedItem.Collection := MenuBar.Groups[Succ(group.Index)].Items;
refresh := True;
end;
end;
end else
begin
if selectedItem.Index > 0 then
begin
selectedItem.Index := Pred(selectedItem.Index);
refresh := True;
end else if Assigned(group) then
begin
{ Move up to another group }
if group.Index > 0 then
begin
selectedItem.Collection := MenuBar.Groups[Pred(group.Index)].Items;
refresh := True;
end;
end;
end;
if refresh then
begin
ItemDeleting(selectedItem);
ItemAdded(selectedItem);
end;
end;
function TfrmMenuBarEditor.GetSelectedItem(): TX2CustomMenuBarItem; function TfrmMenuBarEditor.GetSelectedItem(): TX2CustomMenuBarItem;
begin begin
Result := nil; Result := nil;
@ -453,6 +591,7 @@ begin
Result := TX2CustomMenuBarItem(tvMenu.Selected.Data); Result := TX2CustomMenuBarItem(tvMenu.Selected.Data);
end; end;
function TfrmMenuBarEditor.GetItemNode(AItem: TX2CustomMenuBarItem): TTreeNode; function TfrmMenuBarEditor.GetItemNode(AItem: TX2CustomMenuBarItem): TTreeNode;
var var
treeNode: TTreeNode; treeNode: TTreeNode;
@ -512,6 +651,7 @@ begin
end; end;
end; end;
initialization initialization
finalization finalization
if Assigned(GEditors) then if Assigned(GEditors) then

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -123,6 +123,8 @@ type
constructor Create(AItemsBuffer: Graphics.TBitmap); virtual; constructor Create(AItemsBuffer: Graphics.TBitmap); virtual;
destructor Destroy(); override; destructor Destroy(); override;
procedure ResetStartTime();
procedure Update(); virtual; procedure Update(); virtual;
procedure Draw(ACanvas: TCanvas; const ABounds: TRect); virtual; abstract; procedure Draw(ACanvas: TCanvas; const ABounds: TRect); virtual; abstract;
@ -184,6 +186,7 @@ type
TX2CustomMenuBarAction = class(TObject) TX2CustomMenuBarAction = class(TObject)
private private
FMenuBar: TX2CustomMenuBar; FMenuBar: TX2CustomMenuBar;
FStarted: Boolean;
FTerminated: Boolean; FTerminated: Boolean;
protected protected
function GetTerminated(): Boolean; virtual; function GetTerminated(): Boolean; virtual;
@ -193,6 +196,9 @@ type
public public
constructor Create(AMenuBar: TX2CustomMenuBar); constructor Create(AMenuBar: TX2CustomMenuBar);
function AllowUpdateScrollbar(): Boolean; virtual;
function AllowInteraction(): Boolean; virtual;
procedure Start(); virtual; procedure Start(); virtual;
procedure Stop(); virtual; procedure Stop(); virtual;
@ -204,6 +210,7 @@ type
var AHandled: Boolean); virtual; var AHandled: Boolean); virtual;
procedure AfterPaint(); virtual; procedure AfterPaint(); virtual;
property Started: Boolean read FStarted;
property Terminated: Boolean read GetTerminated; property Terminated: Boolean read GetTerminated;
end; end;
@ -507,6 +514,9 @@ type
property OnSelectedChanged: TX2MenuBarSelectedChangedEvent read FOnSelectedChanged write FOnSelectedChanged; property OnSelectedChanged: TX2MenuBarSelectedChangedEvent read FOnSelectedChanged write FOnSelectedChanged;
property OnSelectedChanging: TX2MenuBarSelectedChangingEvent read FOnSelectedChanging write FOnSelectedChanging; property OnSelectedChanging: TX2MenuBarSelectedChangingEvent read FOnSelectedChanging write FOnSelectedChanging;
protected protected
procedure InternalSetExpanded(AGroup: TX2MenuBarGroup; AExpanded: Boolean); virtual;
procedure InternalSetSelected(AItem: TX2CustomMenuBarItem); virtual;
function DoAutoCollapse(AGroup: TX2MenuBarGroup): Boolean; virtual; function DoAutoCollapse(AGroup: TX2MenuBarGroup): Boolean; virtual;
function DoAutoSelectItem(AGroup: TX2MenuBarGroup): Boolean; virtual; function DoAutoSelectItem(AGroup: TX2MenuBarGroup): Boolean; virtual;
function DoExpand(AGroup: TX2MenuBarGroup; AExpanding: Boolean): Boolean; virtual; function DoExpand(AGroup: TX2MenuBarGroup; AExpanding: Boolean): Boolean; virtual;
@ -643,6 +653,7 @@ begin
FMenuBar := TX2CustomMenuBar(AOwner); FMenuBar := TX2CustomMenuBar(AOwner);
end; end;
destructor TX2CustomMenuBarPainter.Destroy(); destructor TX2CustomMenuBarPainter.Destroy();
begin begin
FreeAndNil(FObservers); FreeAndNil(FObservers);
@ -672,12 +683,14 @@ begin
FMenuBar := AMenuBar; FMenuBar := AMenuBar;
end; end;
procedure TX2CustomMenuBarPainter.EndPaint(); procedure TX2CustomMenuBarPainter.EndPaint();
begin begin
Assert(Assigned(FMenuBar), 'EndPaint without BeginPaint'); Assert(Assigned(FMenuBar), 'EndPaint without BeginPaint');
FMenuBar := nil; FMenuBar := nil;
end; end;
procedure TX2CustomMenuBarPainter.NotifyObservers(); procedure TX2CustomMenuBarPainter.NotifyObservers();
var var
observerIndex: Integer; observerIndex: Integer;
@ -694,6 +707,7 @@ begin
Result := ABounds; Result := ABounds;
end; end;
function TX2CustomMenuBarPainter.GetGroupHeight(AGroup: TX2MenuBarGroup): Integer; function TX2CustomMenuBarPainter.GetGroupHeight(AGroup: TX2MenuBarGroup): Integer;
var var
itemIndex: Integer; itemIndex: Integer;
@ -719,6 +733,7 @@ begin
Abort := PtInRect(ItemBounds, hitPoint^); Abort := PtInRect(ItemBounds, hitPoint^);
end; end;
function TX2CustomMenuBarPainter.HitTest(const APoint: TPoint): TX2MenuBarHitTest; function TX2CustomMenuBarPainter.HitTest(const APoint: TPoint): TX2MenuBarHitTest;
var var
hitPoint: TPoint; hitPoint: TPoint;
@ -735,6 +750,7 @@ begin
Result.HitTestCode := htItem; Result.HitTestCode := htItem;
end; end;
function TX2CustomMenuBarPainter.HitTest(AX, AY: Integer): TX2MenuBarHitTest; function TX2CustomMenuBarPainter.HitTest(AX, AY: Integer): TX2MenuBarHitTest;
begin begin
Result := HitTest(Point(AX, AY)); Result := HitTest(Point(AX, AY));
@ -747,6 +763,7 @@ begin
Result := FMenuBar; Result := FMenuBar;
end; end;
function TX2CustomMenuBarPainter.GetSpacing(AElement: TX2MenuBarSpacingElement): Integer; function TX2CustomMenuBarPainter.GetSpacing(AElement: TX2MenuBarSpacingElement): Integer;
begin begin
Result := 0; Result := 0;
@ -758,7 +775,7 @@ constructor TX2CustomMenuBarAnimator.Create(AItemsBuffer: Graphics.TBitmap);
begin begin
inherited Create(); inherited Create();
FStartTime := GetTickCount(); ResetStartTime();
FItemsBuffer := Graphics.TBitmap.Create(); FItemsBuffer := Graphics.TBitmap.Create();
FItemsBuffer.Assign(AItemsBuffer); FItemsBuffer.Assign(AItemsBuffer);
end; end;
@ -771,11 +788,18 @@ begin
end; end;
procedure TX2CustomMenuBarAnimator.ResetStartTime();
begin
FStartTime := GetTickCount();
end;
function TX2CustomMenuBarAnimator.GetHeight(): Integer; function TX2CustomMenuBarAnimator.GetHeight(): Integer;
begin begin
Result := ItemsBuffer.Height; Result := ItemsBuffer.Height;
end; end;
function TX2CustomMenuBarAnimator.GetTimeElapsed(): Cardinal; function TX2CustomMenuBarAnimator.GetTimeElapsed(): Cardinal;
var var
currentTime: Cardinal; currentTime: Cardinal;
@ -788,6 +812,7 @@ begin
Inc(Result, High(Cardinal)); Inc(Result, High(Cardinal));
end; end;
procedure TX2CustomMenuBarAnimator.SetExpanding(const Value: Boolean); procedure TX2CustomMenuBarAnimator.SetExpanding(const Value: Boolean);
begin begin
FExpanding := Value; FExpanding := Value;
@ -821,13 +846,27 @@ begin
end; end;
function TX2CustomMenuBarAction.AllowInteraction(): Boolean;
begin
Result := False;
end;
function TX2CustomMenuBarAction.AllowUpdateScrollbar(): Boolean;
begin
Result := False;
end;
procedure TX2CustomMenuBarAction.Start(); procedure TX2CustomMenuBarAction.Start();
begin begin
FStarted := True;
end; end;
procedure TX2CustomMenuBarAction.Stop(); procedure TX2CustomMenuBarAction.Stop();
begin begin
FStarted := False;
end; end;
@ -866,48 +905,56 @@ begin
FClient := (AClient as TX2CustomMenuBarItem); FClient := (AClient as TX2CustomMenuBarItem);
end; end;
function TX2MenuBarActionLink.IsCaptionLinked(): Boolean; function TX2MenuBarActionLink.IsCaptionLinked(): Boolean;
begin begin
Result := inherited IsCaptionLinked() and Result := inherited IsCaptionLinked() and
(Client.Caption = (Action as TCustomAction).Caption); (Client.Caption = (Action as TCustomAction).Caption);
end; end;
function TX2MenuBarActionLink.IsEnabledLinked(): Boolean; function TX2MenuBarActionLink.IsEnabledLinked(): Boolean;
begin begin
Result := inherited IsCaptionLinked() and Result := inherited IsCaptionLinked() and
(Client.Enabled = (Action as TCustomAction).Enabled); (Client.Enabled = (Action as TCustomAction).Enabled);
end; end;
function TX2MenuBarActionLink.IsImageIndexLinked(): Boolean; function TX2MenuBarActionLink.IsImageIndexLinked(): Boolean;
begin begin
Result := inherited IsCaptionLinked() and Result := inherited IsCaptionLinked() and
(Client.ImageIndex = (Action as TCustomAction).ImageIndex); (Client.ImageIndex = (Action as TCustomAction).ImageIndex);
end; end;
function TX2MenuBarActionLink.IsVisibleLinked(): Boolean; function TX2MenuBarActionLink.IsVisibleLinked(): Boolean;
begin begin
Result := inherited IsCaptionLinked() and Result := inherited IsCaptionLinked() and
(Client.Visible = (Action as TCustomAction).Visible); (Client.Visible = (Action as TCustomAction).Visible);
end; end;
procedure TX2MenuBarActionLink.SetCaption(const Value: string); procedure TX2MenuBarActionLink.SetCaption(const Value: string);
begin begin
if IsCaptionLinked() then if IsCaptionLinked() then
Client.Caption := Value; Client.Caption := Value;
end; end;
procedure TX2MenuBarActionLink.SetEnabled(Value: Boolean); procedure TX2MenuBarActionLink.SetEnabled(Value: Boolean);
begin begin
if IsEnabledLinked() then if IsEnabledLinked() then
Client.Enabled := Value; Client.Enabled := Value;
end; end;
procedure TX2MenuBarActionLink.SetImageIndex(Value: Integer); procedure TX2MenuBarActionLink.SetImageIndex(Value: Integer);
begin begin
if IsImageIndexLinked() then if IsImageIndexLinked() then
Client.ImageIndex := Value; Client.ImageIndex := Value;
end; end;
procedure TX2MenuBarActionLink.SetVisible(Value: Boolean); procedure TX2MenuBarActionLink.SetVisible(Value: Boolean);
begin begin
if IsVisibleLinked() then if IsVisibleLinked() then
@ -967,6 +1014,7 @@ begin
ActionChange(Sender, False); ActionChange(Sender, False);
end; end;
procedure TX2CustomMenuBarItem.ActionChange(Sender: TObject; procedure TX2CustomMenuBarItem.ActionChange(Sender: TObject;
CheckDefaults: Boolean); CheckDefaults: Boolean);
begin begin
@ -993,6 +1041,7 @@ begin
Result := (Length(Caption) > 0); Result := (Length(Caption) > 0);
end; end;
function TX2CustomMenuBarItem.GetMenuBar(): TX2CustomMenuBar; function TX2CustomMenuBarItem.GetMenuBar(): TX2CustomMenuBar;
var var
parentCollection: TCollection; parentCollection: TCollection;
@ -1020,6 +1069,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetAction(const Value: TBasicAction); procedure TX2CustomMenuBarItem.SetAction(const Value: TBasicAction);
begin begin
if Value <> FAction then if Value <> FAction then
@ -1052,6 +1102,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetCaption(const Value: String); procedure TX2CustomMenuBarItem.SetCaption(const Value: String);
begin begin
if Value <> FCaption then if Value <> FCaption then
@ -1061,6 +1112,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetData(const Value: TObject); procedure TX2CustomMenuBarItem.SetData(const Value: TObject);
begin begin
if Value <> FData then if Value <> FData then
@ -1072,6 +1124,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetEnabled(const Value: Boolean); procedure TX2CustomMenuBarItem.SetEnabled(const Value: Boolean);
begin begin
if Value <> FEnabled then if Value <> FEnabled then
@ -1081,6 +1134,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetImageIndex(const Value: TImageIndex); procedure TX2CustomMenuBarItem.SetImageIndex(const Value: TImageIndex);
begin begin
if Value <> FImageIndex then if Value <> FImageIndex then
@ -1090,6 +1144,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBarItem.SetVisible(const Value: Boolean); procedure TX2CustomMenuBarItem.SetVisible(const Value: Boolean);
begin begin
if Value <> FVisible then if Value <> FVisible then
@ -1109,6 +1164,7 @@ begin
inherited; inherited;
end; end;
procedure TX2CustomMenuBarItems.Update(Item: TCollectionItem); procedure TX2CustomMenuBarItems.Update(Item: TCollectionItem);
begin begin
inherited; inherited;
@ -1164,6 +1220,7 @@ begin
Result := TX2MenuBarItem(inherited GetItem(Index)); Result := TX2MenuBarItem(inherited GetItem(Index));
end; end;
procedure TX2MenuBarItems.SetItem(Index: Integer; const Value: TX2MenuBarItem); procedure TX2MenuBarItems.SetItem(Index: Integer; const Value: TX2MenuBarItem);
begin begin
inherited SetItem(Index, Value); inherited SetItem(Index, Value);
@ -1183,6 +1240,7 @@ begin
inherited; inherited;
end; end;
destructor TX2MenuBarGroup.Destroy(); destructor TX2MenuBarGroup.Destroy();
begin begin
FreeAndNil(FItems); FreeAndNil(FItems);
@ -1217,21 +1275,16 @@ begin
end; end;
end; end;
procedure TX2MenuBarGroup.InternalSetExpanded(const Value: Boolean);
var
menu: TX2CustomMenuBar;
procedure TX2MenuBarGroup.InternalSetExpanded(const Value: Boolean);
begin begin
if Value <> FExpanded then if Value <> FExpanded then
begin begin
FExpanded := Value; FExpanded := Value;
Changed(False); Changed(False);
end;
end;
menu := MenuBar;
if Assigned(menu) then
menu.DoExpandedChanged(Self);
end;
end;
procedure TX2MenuBarGroup.ItemsNotify(Sender: TObject; Item: TCollectionItem; Action: TCollectionNotification); procedure TX2MenuBarGroup.ItemsNotify(Sender: TObject; Item: TCollectionItem; Action: TCollectionNotification);
begin begin
@ -1239,6 +1292,7 @@ begin
TProtectedCollection(Self.Collection).Notify(Item, Action); TProtectedCollection(Self.Collection).Notify(Item, Action);
end; end;
procedure TX2MenuBarGroup.ItemsUpdate(Sender: TObject; Item: TCollectionItem); procedure TX2MenuBarGroup.ItemsUpdate(Sender: TObject; Item: TCollectionItem);
var var
groupCollection: TProtectedCollection; groupCollection: TProtectedCollection;
@ -1250,11 +1304,13 @@ begin
groupCollection.Update(Item); groupCollection.Update(Item);
end; end;
function TX2MenuBarGroup.IsCaptionStored(): Boolean; function TX2MenuBarGroup.IsCaptionStored(): Boolean;
begin begin
Result := (Caption <> SDefaultGroupCaption); Result := (Caption <> SDefaultGroupCaption);
end; end;
procedure TX2MenuBarGroup.SetEnabled(const Value: Boolean); procedure TX2MenuBarGroup.SetEnabled(const Value: Boolean);
begin begin
inherited; inherited;
@ -1263,6 +1319,7 @@ begin
Expanded := False; Expanded := False;
end; end;
procedure TX2MenuBarGroup.SetExpanded(const Value: Boolean); procedure TX2MenuBarGroup.SetExpanded(const Value: Boolean);
var var
menu: TX2CustomMenuBar; menu: TX2CustomMenuBar;
@ -1279,6 +1336,7 @@ begin
end; end;
end; end;
procedure TX2MenuBarGroup.SetItems(const Value: TX2MenuBarItems); procedure TX2MenuBarGroup.SetItems(const Value: TX2MenuBarItems);
begin begin
if Value <> FItems then if Value <> FItems then
@ -1310,6 +1368,7 @@ begin
Result := TX2MenuBarGroup(inherited GetItem(Index)); Result := TX2MenuBarGroup(inherited GetItem(Index));
end; end;
procedure TX2MenuBarGroups.SetItem(Index: Integer; const Value: TX2MenuBarGroup); procedure TX2MenuBarGroups.SetItem(Index: Integer; const Value: TX2MenuBarGroup);
begin begin
inherited SetItem(Index, Value); inherited SetItem(Index, Value);
@ -1377,6 +1436,7 @@ begin
inherited; inherited;
end; end;
procedure TX2CustomMenuBar.WMEraseBkgnd(var Msg: TWMEraseBkgnd); procedure TX2CustomMenuBar.WMEraseBkgnd(var Msg: TWMEraseBkgnd);
begin begin
Msg.Result := 0; Msg.Result := 0;
@ -1411,7 +1471,12 @@ begin
{ Update action } { Update action }
currentAction := GetCurrentAction(); currentAction := GetCurrentAction();
if Assigned(currentAction) then if Assigned(currentAction) then
begin
if not currentAction.Started then
currentAction.Start();
currentAction.BeforePaint(); currentAction.BeforePaint();
end;
UpdateScrollbar(); UpdateScrollbar();
@ -1432,21 +1497,15 @@ begin
{ Action queue } { Action queue }
if Assigned(currentAction) then if Assigned(currentAction) then
begin begin
{ Make sure Paint is called again while there's an action queue }
Invalidate();
currentAction.AfterPaint(); currentAction.AfterPaint();
if currentAction.Terminated then if currentAction.Terminated then
begin begin
currentAction.Stop(); currentAction.Stop();
PopCurrentAction(); PopCurrentAction();
currentAction := GetCurrentAction();
if Assigned(currentAction) then
begin
currentAction.Start();
{ Make sure Paint is called again while there's an action queue }
Invalidate();
end;
end; end;
end; end;
end end
@ -1479,6 +1538,7 @@ begin
Include(Result, mdsGroupSelected); Include(Result, mdsGroupSelected);
end; end;
procedure TX2CustomMenuBar.DrawMenuItem(Sender: TObject; procedure TX2CustomMenuBar.DrawMenuItem(Sender: TObject;
Item: TX2CustomMenuBarItem; Item: TX2CustomMenuBarItem;
const MenuBounds, ItemBounds: TRect; const MenuBounds, ItemBounds: TRect;
@ -1514,6 +1574,7 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBar.DrawMenuItems(ACanvas: TCanvas; AGroup: TX2MenuBarGroup; const ABounds: TRect); procedure TX2CustomMenuBar.DrawMenuItems(ACanvas: TCanvas; AGroup: TX2MenuBarGroup; const ABounds: TRect);
var var
itemBounds: TRect; itemBounds: TRect;
@ -1542,11 +1603,13 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBar.DrawMenu(ACanvas: TCanvas); procedure TX2CustomMenuBar.DrawMenu(ACanvas: TCanvas);
begin begin
IterateItemBounds(DrawMenuItem, Pointer(ACanvas)); IterateItemBounds(DrawMenuItem, Pointer(ACanvas));
end; end;
procedure TX2CustomMenuBar.DrawNoPainter(ACanvas: TCanvas; const ABounds: TRect); procedure TX2CustomMenuBar.DrawNoPainter(ACanvas: TCanvas; const ABounds: TRect);
const const
XorColor = $00FFD8CE; // RGB(206, 216, 255) XorColor = $00FFD8CE; // RGB(206, 216, 255)
@ -1759,6 +1822,7 @@ begin
{ Pretend to auto select item - required for proper functioning of { Pretend to auto select item - required for proper functioning of
the OnSelectedChanging event } the OnSelectedChanging event }
// #ToDo1 (MvR) 20-4-2007: check OnSelectedChanging behaviour
// if AutoSelectItem then // if AutoSelectItem then
// if not DoAutoSelectItem(AGroup, saBefore) then // if not DoAutoSelectItem(AGroup, saBefore) then
// exit; // exit;
@ -1793,14 +1857,11 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBar.DoExpandedChanged(AGroup: TX2MenuBarGroup); procedure TX2CustomMenuBar.DoExpandedChanged(AGroup: TX2MenuBarGroup);
begin begin
if AGroup.Expanded then if AGroup.Expanded then
begin begin
{ Auto select item }
// if AutoSelectItem then
// DoAutoSelectItem(AGroup, saAfter);
if Assigned(FOnExpanded) then if Assigned(FOnExpanded) then
FOnExpanded(Self, AGroup); FOnExpanded(Self, AGroup);
end else end else
@ -1808,6 +1869,7 @@ begin
FOnCollapsed(Self, AGroup); FOnCollapsed(Self, AGroup);
end; end;
procedure TX2CustomMenuBar.DoSelectedChanging(ANewItem: TX2CustomMenuBarItem; procedure TX2CustomMenuBar.DoSelectedChanging(ANewItem: TX2CustomMenuBarItem;
var AAllowed: Boolean); var AAllowed: Boolean);
begin begin
@ -1815,6 +1877,7 @@ begin
FOnSelectedChanging(Self, SelectedItem, ANewItem, AAllowed); FOnSelectedChanging(Self, SelectedItem, ANewItem, AAllowed);
end; end;
procedure TX2CustomMenuBar.DoSelectedChanged(); procedure TX2CustomMenuBar.DoSelectedChanged();
begin begin
if Assigned(FOnSelectedChanged) then if Assigned(FOnSelectedChanged) then
@ -1852,15 +1915,24 @@ end;
function TX2CustomMenuBar.AllowInteraction(): Boolean; function TX2CustomMenuBar.AllowInteraction(): Boolean;
var
currentAction: TX2CustomMenuBarAction;
begin begin
Result := (ActionQueue.Count = 0); Result := True;
currentAction := GetCurrentAction();
if Assigned(currentAction) then
Result := currentAction.AllowInteraction();
end; end;
function TX2CustomMenuBar.ItemEnabled(AItem: TX2CustomMenuBarItem): Boolean; function TX2CustomMenuBar.ItemEnabled(AItem: TX2CustomMenuBarItem): Boolean;
begin begin
Result := AItem.Enabled and AItem.Visible; Result := AItem.Enabled and AItem.Visible;
end; end;
function TX2CustomMenuBar.ItemVisible(AItem: TX2CustomMenuBarItem): Boolean; function TX2CustomMenuBar.ItemVisible(AItem: TX2CustomMenuBarItem): Boolean;
begin begin
Result := AItem.Visible or (csDesigning in ComponentState); Result := AItem.Visible or (csDesigning in ComponentState);
@ -1890,6 +1962,24 @@ begin
end; end;
procedure TX2CustomMenuBar.InternalSetExpanded(AGroup: TX2MenuBarGroup;
AExpanded: Boolean);
begin
AGroup.InternalSetExpanded(AExpanded);
DoExpandedChanged(AGroup);
end;
procedure TX2CustomMenuBar.InternalSetSelected(AItem: TX2CustomMenuBarItem);
begin
FSelectedItem := AItem;
DoSelectedChanged();
if Assigned(SelectedItem) and Assigned(SelectedItem.Action) then
SelectedItem.ActionLink.Execute(Self);
end;
function TX2CustomMenuBar.DoAutoCollapse(AGroup: TX2MenuBarGroup): Boolean; function TX2CustomMenuBar.DoAutoCollapse(AGroup: TX2MenuBarGroup): Boolean;
var var
possibleGroup: TX2MenuBarGroup; possibleGroup: TX2MenuBarGroup;
@ -2011,6 +2101,7 @@ var
itemIndex: Integer; itemIndex: Integer;
begin begin
Result := True;
group := AGroup; group := AGroup;
if not Assigned(group) then if not Assigned(group) then
@ -2047,14 +2138,8 @@ begin
end; end;
end; end;
// if Assigned(newItem) and (newItem <> SelectedItem) then if Assigned(newItem) and (newItem <> SelectedItem) then
// begin PerformSelectItem(newItem);
// if AAction in [saBefore, saBoth] then
// DoSelectedChanging(newItem, Result);
//
// if Result and (AAction in [saAfter, saBoth]) then
// SelectedItem := newItem;
// end;
end; end;
end; end;
@ -2076,14 +2161,19 @@ begin
if not allowed then if not allowed then
Exit; Exit;
if not AExpanding then if AExpanding then
begin if not PerformAutoCollapse(AGroup) then
// #ToDo1 (MvR) 22-3-2007: Exit;
end else
begin // if not AExpanding then
PerformAutoCollapse(AGroup); // begin
PerformAutoSelectItem(AGroup); // // #ToDo1 (MvR) 22-3-2007: ? anything ?
end; // end else
// begin
// if not (PerformAutoCollapse(AGroup) and
// PerformAutoSelectItem(AGroup)) then
// Result := False;
// end;
Result := True; Result := True;
expandAction := TX2MenuBarAnimateAction(GetAnimateAction(AGroup, AExpanding)); expandAction := TX2MenuBarAnimateAction(GetAnimateAction(AGroup, AExpanding));
@ -2096,11 +2186,8 @@ end;
function TX2CustomMenuBar.DoSelectItem(AItem: TX2CustomMenuBarItem): Boolean; function TX2CustomMenuBar.DoSelectItem(AItem: TX2CustomMenuBarItem): Boolean;
begin begin
PushAction(TX2MenuBarSelectAction.Create(Self, AItem));
Result := True; Result := True;
DoSelectedChanging(AItem, Result);
if Result then
PushAction(
end; end;
@ -2168,6 +2255,7 @@ begin
end; end;
end; end;
function TX2CustomMenuBar.HitTest(AX, AY: Integer): TX2MenuBarHitTest; function TX2CustomMenuBar.HitTest(AX, AY: Integer): TX2MenuBarHitTest;
begin begin
Result := HitTest(Point(AX, AY)); Result := HitTest(Point(AX, AY));
@ -2278,6 +2366,7 @@ begin
end; end;
end; end;
function TX2CustomMenuBar.SelectLast(): TX2CustomMenuBarItem; function TX2CustomMenuBar.SelectLast(): TX2CustomMenuBarItem;
begin begin
Result := nil; Result := nil;
@ -2290,25 +2379,27 @@ begin
end; end;
end; end;
function TX2CustomMenuBar.SelectNext(): TX2CustomMenuBarItem; function TX2CustomMenuBar.SelectNext(): TX2CustomMenuBarItem;
begin begin
Result := nil; Result := nil;
if AllowInteraction then if AllowInteraction then
begin begin
Result := Iterate(FindEnabledItem, mbdDown, nil, FSelectedItem); Result := Iterate(FindEnabledItem, mbdDown, nil, SelectedItem);
if Assigned(Result) then if Assigned(Result) then
SelectedItem := Result; SelectedItem := Result;
end; end;
end; end;
function TX2CustomMenuBar.SelectPrior(): TX2CustomMenuBarItem; function TX2CustomMenuBar.SelectPrior(): TX2CustomMenuBarItem;
begin begin
Result := nil; Result := nil;
if AllowInteraction then if AllowInteraction then
begin begin
Result := Iterate(FindEnabledItem, mbdUp, nil, FSelectedItem); Result := Iterate(FindEnabledItem, mbdUp, nil, SelectedItem);
if Assigned(Result) then if Assigned(Result) then
SelectedItem := Result; SelectedItem := Result;
end; end;
@ -2329,6 +2420,7 @@ begin
end; end;
end; end;
function TX2CustomMenuBar.SelectItem(AIndex: Integer; function TX2CustomMenuBar.SelectItem(AIndex: Integer;
AGroup: TX2MenuBarGroup): TX2CustomMenuBarItem; AGroup: TX2MenuBarGroup): TX2CustomMenuBarItem;
var var
@ -2366,6 +2458,7 @@ begin
end; end;
end; end;
function TX2CustomMenuBar.SelectItem(AIndex, AGroup: Integer): TX2CustomMenuBarItem; function TX2CustomMenuBar.SelectItem(AIndex, AGroup: Integer): TX2CustomMenuBarItem;
var var
group: TX2MenuBarGroup; group: TX2MenuBarGroup;
@ -2401,11 +2494,13 @@ begin
inherited; inherited;
end; end;
procedure TX2CustomMenuBar.PainterUpdate(Sender: TX2CustomMenuBarPainter); procedure TX2CustomMenuBar.PainterUpdate(Sender: TX2CustomMenuBarPainter);
begin begin
Invalidate(); Invalidate();
end; end;
procedure TX2CustomMenuBar.GroupsNotify(Sender: TObject; Item: TCollectionItem; Action: TCollectionNotification); procedure TX2CustomMenuBar.GroupsNotify(Sender: TObject; Item: TCollectionItem; Action: TCollectionNotification);
begin begin
if Action = cnDeleting then if Action = cnDeleting then
@ -2424,6 +2519,7 @@ begin
Invalidate(); Invalidate();
end; end;
procedure TX2CustomMenuBar.GroupsUpdate(Sender: TObject; Item: TCollectionItem); procedure TX2CustomMenuBar.GroupsUpdate(Sender: TObject; Item: TCollectionItem);
begin begin
if Assigned(SelectedItem) and (not ItemEnabled(SelectedItem)) then if Assigned(SelectedItem) and (not ItemEnabled(SelectedItem)) then
@ -2482,6 +2578,7 @@ begin
inherited; inherited;
end; end;
procedure TX2CustomMenuBar.CMMouseLeave(var Msg: TMessage); procedure TX2CustomMenuBar.CMMouseLeave(var Msg: TMessage);
begin begin
FLastMousePos := Point(-1, -1); FLastMousePos := Point(-1, -1);
@ -2640,18 +2737,18 @@ begin
end; end;
end; end;
procedure TX2CustomMenuBar.UpdateScrollbar(); procedure TX2CustomMenuBar.UpdateScrollbar();
var var
currentAction: TX2CustomMenuBarAction;
scrollInfo: TScrollInfo; scrollInfo: TScrollInfo;
begin begin
{ Don't update the scrollbar while animating, prevents issues with the { Don't update the scrollbar while animating, prevents issues with the
items buffer width if the scrollbar happens to show/hide during animation. } items buffer width if the scrollbar happens to show/hide during animation. }
// #ToDo1 (MvR) 13-3-2007: actionqueue currentAction := GetCurrentAction();
(* if Assigned(currentAction) and (not currentAction.AllowUpdateScrollbar()) then
if Assigned(Animator) then
exit; exit;
*)
FillChar(scrollInfo, SizeOf(TScrollInfo), #0); FillChar(scrollInfo, SizeOf(TScrollInfo), #0);
scrollInfo.cbSize := SizeOf(TScrollInfo); scrollInfo.cbSize := SizeOf(TScrollInfo);
@ -2712,8 +2809,8 @@ begin
begin begin
FAutoSelectItem := Value; FAutoSelectItem := Value;
// if Value and (not Assigned(SelectedItem)) then if Value and (not Assigned(SelectedItem)) then
// DoAutoSelectItem(nil, saBoth); DoAutoSelectItem(nil);
end; end;
end; end;
@ -2824,51 +2921,17 @@ begin
end else end else
begin begin
if group.Items.Count > 0 then if group.Items.Count > 0 then
PerformExpand(group, True) begin
else PerformExpand(group, True);
PerformAutoSelectItem(group);
end else
begin
if PerformAutoCollapse(group) then
PerformSelectItem(group); PerformSelectItem(group);
end; end;
end;
end else end else
PerformSelectItem(selectItem); PerformSelectItem(selectItem);
// #ToDo1 (MvR) 13-3-2007: check
// if Assigned(Value) then
// begin
// if Value is TX2MenuBarGroup then
// begin
// group := TX2MenuBarGroup(Value);
//
// if group.Items.Count > 0 then
// begin
// // Item is a group, expand it (triggers autoselect too if appropriate)
// group.Expanded := True;
// Exit;
// end else
// DoAutoCollapse(group);
// end;
//
// FSelectedItem := Value;
//
// if Value is TX2MenuBarItem then
// begin
// group := TX2MenuBarItem(Value).Group;
// if Assigned(group) then
// begin
// group.SelectedItem := Value.Index;
//
// if not group.Expanded then
// group.Expanded := True;
// end;
// end;
//
// if Assigned(FSelectedItem) and Assigned(FSelectedItem.Action) then
// FSelectedItem.ActionLink.Execute(Self);
// end;
// end;
//
// DoSelectedChanged();
// Invalidate();
end; end;
end; end;
end; end;

View File

@ -26,6 +26,8 @@ type
constructor Create(AMenuBar: TX2CustomMenuBar; AGroup: TX2MenuBarGroup; constructor Create(AMenuBar: TX2CustomMenuBar; AGroup: TX2MenuBarGroup;
AAnimator: TX2CustomMenuBarAnimator); AAnimator: TX2CustomMenuBarAnimator);
procedure Start(); override;
procedure BeforePaint(); override; procedure BeforePaint(); override;
procedure GetItemHeight(AItem: TX2CustomMenuBarItem; var AHeight: Integer; procedure GetItemHeight(AItem: TX2CustomMenuBarItem; var AHeight: Integer;
var AHandled: Boolean); override; var AHandled: Boolean); override;
@ -99,8 +101,7 @@ type
private private
FItem: TX2CustomMenuBarItem; FItem: TX2CustomMenuBarItem;
public public
constructor Create(AMenuBar: TX2CustomMenuBar; AGroup: TX2MenuBarGroup; constructor Create(AMenuBar: TX2CustomMenuBar; AItem: TX2CustomMenuBarItem);
AExpanding: Boolean);
procedure Start(); override; procedure Start(); override;
end; end;
@ -129,6 +130,14 @@ begin
end; end;
procedure TX2MenuBarAnimateAction.Start();
begin
inherited;
Animator.ResetStartTime();
end;
procedure TX2MenuBarAnimateAction.BeforePaint(); procedure TX2MenuBarAnimateAction.BeforePaint();
begin begin
inherited; inherited;
@ -330,11 +339,29 @@ procedure TX2MenuBarExpandAction.Start();
begin begin
inherited; inherited;
// #ToDo1 (MvR) 22-3-2007: via MenuBar t.b.v. OnExpandedChanged TProtectedX2CustomMenuBar(MenuBar).InternalSetExpanded(FGroup, FExpanding);
TProtectedX2MenuBarGroup(FGroup).InternalSetExpanded(FExpanding);
MenuBar.Invalidate(); MenuBar.Invalidate();
Terminate(); Terminate();
end; end;
{ TX2MenuBarSelectAction }
constructor TX2MenuBarSelectAction.Create(AMenuBar: TX2CustomMenuBar;
AItem: TX2CustomMenuBarItem);
begin
inherited Create(AMenuBar);
FItem := AItem;
end;
procedure TX2MenuBarSelectAction.Start();
begin
inherited;
TProtectedX2CustomMenuBar(MenuBar).InternalSetSelected(FItem);
Terminate();
end;
end. end.

View File

@ -1,9 +1,9 @@
object frmMain: TfrmMain object frmMain: TfrmMain
Left = 300 Left = 300
Top = 219 Top = 219
Width = 613
Height = 406
Caption = 'X2MenuBar Test' Caption = 'X2MenuBar Test'
ClientHeight = 379
ClientWidth = 589
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -22,8 +22,6 @@ object frmMain: TfrmMain
Height = 379 Height = 379
Align = alLeft Align = alLeft
Shape = bsLeftLine Shape = bsLeftLine
ExplicitLeft = 148
ExplicitTop = -4
end end
object lblAnimationTime: TLabel object lblAnimationTime: TLabel
Left = 424 Left = 424
@ -32,24 +30,13 @@ object frmMain: TfrmMain
Height = 13 Height = 13
Caption = 'Animation time (ms):' Caption = 'Animation time (ms):'
end end
object seAnimationTime: TJvSpinEdit
Left = 424
Top = 36
Width = 81
Height = 21
CheckMinValue = True
ButtonKind = bkStandard
Value = 250.000000000000000000
TabOrder = 0
OnChange = seAnimationTimeChange
end
object Panel1: TPanel object Panel1: TPanel
Left = 280 Left = 280
Top = 68 Top = 68
Width = 133 Width = 133
Height = 77 Height = 77
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 1 TabOrder = 0
object rbmusikCube: TRadioButton object rbmusikCube: TRadioButton
Left = 0 Left = 0
Top = 0 Top = 0
@ -86,7 +73,7 @@ object frmMain: TfrmMain
Width = 153 Width = 153
Height = 101 Height = 101
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 2 TabOrder = 1
object rbSliding: TRadioButton object rbSliding: TRadioButton
Left = 0 Left = 0
Top = 20 Top = 20
@ -141,7 +128,7 @@ object frmMain: TfrmMain
Width = 89 Width = 89
Height = 17 Height = 17
Caption = 'Auto collapse' Caption = 'Auto collapse'
TabOrder = 3 TabOrder = 2
OnClick = chkAutoCollapseClick OnClick = chkAutoCollapseClick
end end
object chkAllowCollapseAll: TCheckBox object chkAllowCollapseAll: TCheckBox
@ -150,7 +137,7 @@ object frmMain: TfrmMain
Width = 101 Width = 101
Height = 17 Height = 17
Caption = 'Allow collapse all' Caption = 'Allow collapse all'
TabOrder = 5 TabOrder = 4
OnClick = chkAllowCollapseAllClick OnClick = chkAllowCollapseAllClick
end end
object chkAutoSelectItem: TCheckBox object chkAutoSelectItem: TCheckBox
@ -159,7 +146,7 @@ object frmMain: TfrmMain
Width = 101 Width = 101
Height = 17 Height = 17
Caption = 'Auto select item' Caption = 'Auto select item'
TabOrder = 4 TabOrder = 3
OnClick = chkAutoSelectItemClick OnClick = chkAutoSelectItemClick
end end
object chkScrollbar: TCheckBox object chkScrollbar: TCheckBox
@ -170,7 +157,7 @@ object frmMain: TfrmMain
Caption = 'Scrollbar' Caption = 'Scrollbar'
Checked = True Checked = True
State = cbChecked State = cbChecked
TabOrder = 6 TabOrder = 5
OnClick = chkScrollbarClick OnClick = chkScrollbarClick
end end
object chkHideScrollbar: TCheckBox object chkHideScrollbar: TCheckBox
@ -181,7 +168,7 @@ object frmMain: TfrmMain
Caption = 'Hide Scrollbar' Caption = 'Hide Scrollbar'
Checked = True Checked = True
State = cbChecked State = cbChecked
TabOrder = 7 TabOrder = 6
OnClick = chkHideScrollbarClick OnClick = chkHideScrollbarClick
end end
object lbEvents: TListBox object lbEvents: TListBox
@ -190,7 +177,7 @@ object frmMain: TfrmMain
Width = 421 Width = 421
Height = 93 Height = 93
ItemHeight = 13 ItemHeight = 13
TabOrder = 8 TabOrder = 7
end end
object Button1: TButton object Button1: TButton
Left = 152 Left = 152
@ -199,7 +186,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectFirst' Caption = 'SelectFirst'
Enabled = False Enabled = False
TabOrder = 9 TabOrder = 8
end end
object Button2: TButton object Button2: TButton
Left = 152 Left = 152
@ -208,7 +195,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectPrior' Caption = 'SelectPrior'
Enabled = False Enabled = False
TabOrder = 10 TabOrder = 9
end end
object Button3: TButton object Button3: TButton
Left = 152 Left = 152
@ -217,7 +204,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectNext' Caption = 'SelectNext'
Enabled = False Enabled = False
TabOrder = 11 TabOrder = 10
end end
object Button4: TButton object Button4: TButton
Left = 152 Left = 152
@ -226,7 +213,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectLast' Caption = 'SelectLast'
Enabled = False Enabled = False
TabOrder = 12 TabOrder = 11
end end
object Button5: TButton object Button5: TButton
Left = 152 Left = 152
@ -235,7 +222,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectGroupByIndex' Caption = 'SelectGroupByIndex'
Enabled = False Enabled = False
TabOrder = 13 TabOrder = 12
end end
object Button6: TButton object Button6: TButton
Left = 152 Left = 152
@ -244,7 +231,7 @@ object frmMain: TfrmMain
Height = 25 Height = 25
Caption = 'SelectItemByIndex' Caption = 'SelectItemByIndex'
Enabled = False Enabled = False
TabOrder = 14 TabOrder = 13
end end
object chkHotHand: TCheckBox object chkHotHand: TCheckBox
Left = 424 Left = 424
@ -304,8 +291,9 @@ object frmMain: TfrmMain
end> end>
end end
item item
Action = actTest2
Caption = 'Group without items' Caption = 'Group without items'
ImageIndex = 2 ImageIndex = 3
Expanded = False Expanded = False
Items = <> Items = <>
end end
@ -376,12 +364,11 @@ object frmMain: TfrmMain
OnSelectedChanged = mbTestSelectedChanged OnSelectedChanged = mbTestSelectedChanged
OnSelectedChanging = mbTestSelectedChanging OnSelectedChanging = mbTestSelectedChanging
Painter = mcPainter Painter = mcPainter
ExplicitLeft = -6
end end
object gcMenu: TX2GraphicContainer object gcMenu: TX2GraphicContainer
Graphics = < Left = 180
item Top = 8
Name = 'ShareFile' object gcMenuShareFile: TX2GraphicContainerItem
Picture.Data = { Picture.Data = {
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000
00001008060000001FF3FF61000001844944415478DAA5D2CD4B02411400F0B7 00001008060000001FF3FF61000001844944415478DAA5D2CD4B02411400F0B7
@ -398,9 +385,9 @@ object frmMain: TfrmMain
24A302A9621B5BB524BC8F9CA951AA80F72FF07D76DA8516C9AAC0EE411B755D 24A302A9621B5BB524BC8F9CA951AA80F72FF07D76DA8516C9AAC0EE411B755D
0790339045841719DC8BA86241D37F4FE1AFEB07F8392D2050E7313500000000 0790339045841719DC8BA86241D37F4FE1AFEB07F8392D2050E7313500000000
49454E44AE426082} 49454E44AE426082}
PictureName = 'ShareFile'
end end
item object gcMenuShareFolder: TX2GraphicContainerItem
Name = 'ShareFolder'
Picture.Data = { Picture.Data = {
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000
00001008060000001FF3FF610000025B4944415478DAAD936D48535118C7FF77 00001008060000001FF3FF610000025B4944415478DAAD936D48535118C7FF77
@ -423,9 +410,9 @@ object frmMain: TfrmMain
98188F89D15032405E72F8781B0E2E5A0BCEAE7C8E99784F97551FC627B70BDF 98188F89D15032405E72F8781B0E2E5A0BCEAE7C8E99784F97551FC627B70BDF
BEFCE2E3117E4AE031625809CB9EEBF8F0D7627A77BFE0D4D8D88855A9440022 BEFCE2E3117E4AE031625809CB9EEBF8F0D7627A77BFE0D4D8D88855A9440022
1C27DB71FABF55E352ED373075032024CD24170000000049454E44AE426082} 1C27DB71FABF55E352ED373075032024CD24170000000049454E44AE426082}
PictureName = 'ShareFolder'
end end
item object gcMenuShareWebcam: TX2GraphicContainerItem
Name = 'ShareWebcam'
Picture.Data = { Picture.Data = {
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000
00001008060000001FF3FF61000002C14944415478DABD935D48935118C7FF9B 00001008060000001FF3FF61000002C14944415478DABD935D48935118C7FF9B
@ -452,9 +439,9 @@ object frmMain: TfrmMain
D60BE5E5B72EAAD5A7079392E41AB2AE9BCC6275B91CCB3E5FE08B40C0CE1F1D D60BE5E5B72EAAD5A7079392E41AB2AE9BCC6275B91CCB3E5FE08B40C0CE1F1D
F917A6A767427FD24C429A47FFAD1B7F00ED1B51200D4AE2740000000049454E F917A6A767427FD24C429A47FFAD1B7F00ED1B51200D4AE2740000000049454E
44AE426082} 44AE426082}
PictureName = 'ShareWebcam'
end end
item object gcMenuShareWebcamVideo: TX2GraphicContainerItem
Name = 'ShareWebcamVideo'
Picture.Data = { Picture.Data = {
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001000
00001008060000001FF3FF61000002EA4944415478DAA5935D48935118C7FFF3 00001008060000001FF3FF61000002EA4944415478DAA5935D48935118C7FFF3
@ -482,9 +469,8 @@ object frmMain: TfrmMain
64110A8582F8C2EBBFF7E2E27B9FD1B8F6322040D8A4D1DC1BFBA39988418288 64110A8582F8C2EBBFF7E2E27B9FD1B8F6322040D8A4D1DC1BFBA39988418288
894A481515B1B1B185168BE51531D8DD969696D1BF72E3BFB6EF2C065120000A 894A481515B1B1B185168BE51531D8DD969696D1BF72E3BFB6EF2C065120000A
A5C30000000049454E44AE426082} A5C30000000049454E44AE426082}
end> PictureName = 'ShareWebcamVideo'
Left = 180 end
Top = 8
end end
object glMenu: TX2GraphicList object glMenu: TX2GraphicList
Container = gcMenu Container = gcMenu
@ -509,5 +495,10 @@ object frmMain: TfrmMain
ImageIndex = 1 ImageIndex = 1
OnExecute = actTestExecute OnExecute = actTestExecute
end end
object actTest2: TAction
Caption = 'Group without items'
ImageIndex = 3
OnExecute = actTest2Execute
end
end end
end end

View File

@ -11,8 +11,8 @@ uses
StdCtrls, StdCtrls,
XPMan, XPMan,
JvExMask, // JvExMask,
JvSpin, // JvSpin,
PNGImage, PNGImage,
X2CLGraphicList, X2CLGraphicList,
X2CLMenuBar, X2CLMenuBar,
@ -28,7 +28,6 @@ type
rbmusikCube: TRadioButton; rbmusikCube: TRadioButton;
rbSliding: TRadioButton; rbSliding: TRadioButton;
lblAnimationTime: TLabel; lblAnimationTime: TLabel;
seAnimationTime: TJvSpinEdit;
Panel1: TPanel; Panel1: TPanel;
Panel2: TPanel; Panel2: TPanel;
rbNoAnimation: TRadioButton; rbNoAnimation: TRadioButton;
@ -53,6 +52,7 @@ type
mbTest: TX2MenuBar; mbTest: TX2MenuBar;
alMenu: TActionList; alMenu: TActionList;
actTest: TAction; actTest: TAction;
actTest2: TAction;
procedure mbTestSelectedChanging(Sender: TObject; Item, procedure mbTestSelectedChanging(Sender: TObject; Item,
NewItem: TX2CustomMenuBarItem; var Allowed: Boolean); NewItem: TX2CustomMenuBarItem; var Allowed: Boolean);
procedure mbTestSelectedChanged(Sender: TObject; procedure mbTestSelectedChanged(Sender: TObject;
@ -73,6 +73,7 @@ type
procedure AnimationClick(Sender: TObject); procedure AnimationClick(Sender: TObject);
procedure seAnimationTimeChange(Sender: TObject); procedure seAnimationTimeChange(Sender: TObject);
procedure actTestExecute(Sender: TObject); procedure actTestExecute(Sender: TObject);
procedure actTest2Execute(Sender: TObject);
private private
procedure Event(const AMsg: String); procedure Event(const AMsg: String);
end; end;
@ -81,7 +82,7 @@ implementation
uses uses
Dialogs, Dialogs,
X2UtHandCursor; Windows;
{$R *.dfm} {$R *.dfm}
@ -164,6 +165,8 @@ begin
chkAllowCollapseAll.Checked := mbTest.AllowCollapseAll; chkAllowCollapseAll.Checked := mbTest.AllowCollapseAll;
chkScrollbar.Checked := mbTest.Scrollbar; chkScrollbar.Checked := mbTest.Scrollbar;
chkHideScrollbar.Checked := mbTest.HideScrollbar; chkHideScrollbar.Checked := mbTest.HideScrollbar;
rbUnameIT.Checked := True;
end; end;
procedure TfrmMain.mbTestCollapsed(Sender: TObject; Group: TX2MenuBarGroup); procedure TfrmMain.mbTestCollapsed(Sender: TObject; Group: TX2MenuBarGroup);
@ -228,7 +231,12 @@ end;
procedure TfrmMain.seAnimationTimeChange(Sender: TObject); procedure TfrmMain.seAnimationTimeChange(Sender: TObject);
begin begin
mbTest.AnimationTime := seAnimationTime.AsInteger; // mbTest.AnimationTime := seAnimationTime.AsInteger;
end;
procedure TfrmMain.actTest2Execute(Sender: TObject);
begin
Sleep(200);
end; end;
end. end.

View File

@ -31,12 +31,12 @@
-M -M
-$M16384,1048576 -$M16384,1048576
-K$00400000 -K$00400000
-LE"C:\Documents and Settings\PsychoMark\My Documents\Borland Studio Projects\Bpl" -LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"C:\Documents and Settings\PsychoMark\My Documents\Borland Studio Projects\Bpl" -LN"c:\program files\borland\delphi7\Projects\Bpl"
-U"..\..\Source" -U"P:\Algemeen\Indy10;P:\Algemeen\Indy10\Core;P:\Algemeen\Indy10\Protocols;P:\Algemeen\Indy10\SuperCore;P:\Algemeen\Indy10\System"
-O"..\..\Source" -O"P:\Algemeen\Indy10;P:\Algemeen\Indy10\Core;P:\Algemeen\Indy10\Protocols;P:\Algemeen\Indy10\SuperCore;P:\Algemeen\Indy10\System"
-I"..\..\Source" -I"P:\Algemeen\Indy10;P:\Algemeen\Indy10\Core;P:\Algemeen\Indy10\Protocols;P:\Algemeen\Indy10\SuperCore;P:\Algemeen\Indy10\System"
-R"..\..\Source" -R"P:\Algemeen\Indy10;P:\Algemeen\Indy10\Core;P:\Algemeen\Indy10\Protocols;P:\Algemeen\Indy10\SuperCore;P:\Algemeen\Indy10\System"
-w-UNSAFE_TYPE -w-UNSAFE_TYPE
-w-UNSAFE_CODE -w-UNSAFE_CODE
-w-UNSAFE_CAST -w-UNSAFE_CAST

View File

@ -4,7 +4,11 @@ uses
Forms, Forms,
MainForm in 'MainForm.pas' {frmMain}, MainForm in 'MainForm.pas' {frmMain},
X2CLMenuBarAnimators in '..\..\Source\X2CLMenuBarAnimators.pas', X2CLMenuBarAnimators in '..\..\Source\X2CLMenuBarAnimators.pas',
X2CLGraphics in '..\..\Source\X2CLGraphics.pas'; X2CLGraphics in '..\..\Source\X2CLGraphics.pas',
X2CLunaMenuBarPainter in '..\..\Source\X2CLunaMenuBarPainter.pas',
X2CLMenuBar in '..\..\Source\X2CLMenuBar.pas',
X2CLmusikCubeMenuBarPainter in '..\..\Source\X2CLmusikCubeMenuBarPainter.pas',
X2CLMenuBarActions in '..\..\Source\X2CLMenuBarActions.pas';
{$R *.res} {$R *.res}