mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
IdeIntf: Use Toolbar instead of SpeedButton in ActionEditor. Issue #28110, patch from Alexey Torgashin.
git-svn-id: trunk@49074 -
This commit is contained in:
parent
929870eadc
commit
569d975af1
@ -1,142 +1,62 @@
|
||||
object ActionListEditor: TActionListEditor
|
||||
Left = 290
|
||||
Height = 300
|
||||
Top = 159
|
||||
Width = 400
|
||||
Left = 497
|
||||
Height = 315
|
||||
Top = 189
|
||||
Width = 404
|
||||
HorzScrollBar.Page = 399
|
||||
VertScrollBar.Page = 299
|
||||
Caption = 'ActionListEditor'
|
||||
ClientHeight = 300
|
||||
ClientWidth = 400
|
||||
ClientHeight = 315
|
||||
ClientWidth = 404
|
||||
KeyPreview = True
|
||||
OnClose = ActionListEditorClose
|
||||
OnCreate = FormCreate
|
||||
OnKeyDown = ActionListEditorKeyDown
|
||||
OnKeyPress = ActionListEditorKeyPress
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.29'
|
||||
LCLVersion = '1.5'
|
||||
object PanelDescr: TPanel
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 26
|
||||
Width = 400
|
||||
Top = 28
|
||||
Width = 404
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 26
|
||||
ClientWidth = 400
|
||||
ClientWidth = 404
|
||||
FullRepaint = False
|
||||
PopupMenu = PopMenuActions
|
||||
TabOrder = 1
|
||||
TabOrder = 0
|
||||
object lblCategory: TLabel
|
||||
Left = 6
|
||||
Height = 18
|
||||
Height = 15
|
||||
Top = 6
|
||||
Width = 79
|
||||
Width = 67
|
||||
Caption = 'Categories:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblName: TLabel
|
||||
Left = 162
|
||||
Height = 18
|
||||
Height = 15
|
||||
Top = 6
|
||||
Width = 56
|
||||
Width = 48
|
||||
Caption = 'Actions:'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
object Splitter: TSplitter
|
||||
Left = 152
|
||||
Height = 248
|
||||
Top = 52
|
||||
Height = 261
|
||||
Top = 54
|
||||
Width = 5
|
||||
AutoSnap = False
|
||||
OnCanResize = SplitterCanResize
|
||||
end
|
||||
object PanelToolbar: TPanel
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 400
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 26
|
||||
ClientWidth = 400
|
||||
FullRepaint = False
|
||||
TabOrder = 0
|
||||
object btnAdd: TSpeedButton
|
||||
Left = 1
|
||||
Height = 22
|
||||
Top = 2
|
||||
Width = 24
|
||||
Action = ActNew
|
||||
Flat = True
|
||||
NumGlyphs = 0
|
||||
Spacing = 0
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
object btnDelete: TSpeedButton
|
||||
Left = 35
|
||||
Height = 22
|
||||
Top = 2
|
||||
Width = 24
|
||||
Action = ActDelete
|
||||
Flat = True
|
||||
NumGlyphs = 0
|
||||
Spacing = 0
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
object btnUp: TSpeedButton
|
||||
Left = 64
|
||||
Height = 22
|
||||
Top = 2
|
||||
Width = 24
|
||||
Action = ActMoveUp
|
||||
Flat = True
|
||||
NumGlyphs = 0
|
||||
Spacing = 0
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
object btnDown: TSpeedButton
|
||||
Left = 89
|
||||
Height = 22
|
||||
Top = 2
|
||||
Width = 24
|
||||
Action = ActMoveDown
|
||||
Flat = True
|
||||
NumGlyphs = 0
|
||||
Spacing = 0
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
object SBShowMenuNewActions: TSpeedButton
|
||||
Left = 25
|
||||
Height = 22
|
||||
Top = 2
|
||||
Width = 10
|
||||
AllowAllUp = True
|
||||
Flat = True
|
||||
Glyph.Data = {
|
||||
72000000424D7200000000000000360000002800000005000000030000000100
|
||||
2000000000003C00000064000000640000000000000000000000000000000000
|
||||
0000000000FF000000000000000000000000000000FF000000FF000000FF0000
|
||||
0000000000FF000000FF000000FF000000FF000000FF
|
||||
}
|
||||
GroupIndex = 1
|
||||
NumGlyphs = 0
|
||||
Spacing = 0
|
||||
OnClick = SBShowMenuNewActionsClick
|
||||
ShowHint = True
|
||||
ParentShowHint = False
|
||||
end
|
||||
end
|
||||
object lstActionName: TListBox
|
||||
Left = 157
|
||||
Height = 248
|
||||
Top = 52
|
||||
Width = 243
|
||||
Height = 261
|
||||
Top = 54
|
||||
Width = 247
|
||||
Align = alClient
|
||||
ItemHeight = 0
|
||||
OnClick = lstActionNameClick
|
||||
@ -145,23 +65,79 @@ object ActionListEditor: TActionListEditor
|
||||
OnKeyDown = lstActionNameKeyDown
|
||||
OnMouseDown = lstActionNameMouseDown
|
||||
PopupMenu = PopMenuActions
|
||||
ScrollWidth = 245
|
||||
Style = lbOwnerDrawFixed
|
||||
TabOrder = 2
|
||||
TabOrder = 1
|
||||
TopIndex = -1
|
||||
end
|
||||
object lstCategory: TListBox
|
||||
Left = 0
|
||||
Height = 248
|
||||
Top = 52
|
||||
Height = 261
|
||||
Top = 54
|
||||
Width = 152
|
||||
Align = alLeft
|
||||
ItemHeight = 0
|
||||
OnClick = lstCategoryClick
|
||||
OnMouseDown = lstActionNameMouseDown
|
||||
PopupMenu = PopMenuActions
|
||||
TabOrder = 3
|
||||
ScrollWidth = 150
|
||||
TabOrder = 2
|
||||
TopIndex = -1
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Height = 28
|
||||
Top = 0
|
||||
Width = 404
|
||||
ButtonHeight = 26
|
||||
ButtonWidth = 26
|
||||
Caption = 'ToolBar1'
|
||||
EdgeBorders = []
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Images = ImageList1
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 4
|
||||
object btnAdd: TToolButton
|
||||
Left = 1
|
||||
Top = 0
|
||||
Action = ActNew
|
||||
end
|
||||
object btnAddMore: TToolButton
|
||||
Left = 27
|
||||
Top = 0
|
||||
Caption = 'btnAddMore'
|
||||
DropdownMenu = PopMenuToolBarActions
|
||||
ImageIndex = 0
|
||||
end
|
||||
object btnDelete: TToolButton
|
||||
Left = 53
|
||||
Top = 0
|
||||
Action = ActDelete
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 79
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 5
|
||||
Caption = 'ToolButton4'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object btnUp: TToolButton
|
||||
Left = 84
|
||||
Top = 0
|
||||
Action = ActMoveUp
|
||||
end
|
||||
object btnDown: TToolButton
|
||||
Left = 110
|
||||
Top = 0
|
||||
Action = ActMoveDown
|
||||
end
|
||||
end
|
||||
object ActionListSelf: TActionList
|
||||
top = 240
|
||||
left = 56
|
||||
top = 260
|
||||
object ActDelete: TAction
|
||||
Category = 'AddDelete'
|
||||
OnExecute = ActDeleteExecute
|
||||
@ -206,8 +182,8 @@ object ActionListEditor: TActionListEditor
|
||||
end
|
||||
end
|
||||
object PopMenuActions: TPopupMenu
|
||||
left = 160
|
||||
top = 261
|
||||
left = 56
|
||||
top = 216
|
||||
object mItemActListNewAction: TMenuItem
|
||||
Action = ActNew
|
||||
Caption = 'New Action'
|
||||
@ -253,7 +229,8 @@ object ActionListEditor: TActionListEditor
|
||||
end
|
||||
end
|
||||
object PopMenuToolBarActions: TPopupMenu
|
||||
top = 200
|
||||
left = 56
|
||||
top = 164
|
||||
object mItemToolBarNewAction: TMenuItem
|
||||
Action = ActNew
|
||||
Default = True
|
||||
@ -264,4 +241,44 @@ object ActionListEditor: TActionListEditor
|
||||
OnClick = ActNewStdExecute
|
||||
end
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
AllocBy = 8
|
||||
left = 56
|
||||
top = 116
|
||||
Bitmap = {
|
||||
4C69010000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007F7F7FFF7F7F
|
||||
7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F
|
||||
7FFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007F7F
|
||||
7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFFFFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF007F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFFFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF007F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFFFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF007F7F7FFF7F7F7FFFFFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ uses
|
||||
Classes, SysUtils, LCLProc, Forms, Controls, Dialogs,
|
||||
ActnList, ExtCtrls, Buttons, StdCtrls, ObjInspStrConsts,
|
||||
ComponentEditors, PropEdits, PropEditUtils, DBActns, StdActns, LCLIntf,
|
||||
LCLType, Graphics, Menus, contnrs;
|
||||
LCLType, Graphics, Menus, ComCtrls, contnrs;
|
||||
|
||||
type
|
||||
TActStdPropItem = class;
|
||||
@ -80,6 +80,7 @@ type
|
||||
ActNewStd: TAction;
|
||||
ActionListSelf: TActionList;
|
||||
ActNew: TAction;
|
||||
ImageList1: TImageList;
|
||||
lblCategory: TLabel;
|
||||
lblName: TLabel;
|
||||
lstCategory: TListBox;
|
||||
@ -96,16 +97,17 @@ type
|
||||
MenuItem6: TMenuItem;
|
||||
mItemActListDelAction: TMenuItem;
|
||||
MenuItem8: TMenuItem;
|
||||
PanelToolbar: TPanel;
|
||||
PanelDescr: TPanel;
|
||||
btnAdd: TSpeedButton;
|
||||
btnDelete: TSpeedButton;
|
||||
btnUp: TSpeedButton;
|
||||
btnDown: TSpeedButton;
|
||||
PopMenuActions: TPopupMenu;
|
||||
PopMenuToolBarActions: TPopupMenu;
|
||||
SBShowMenuNewActions: TSpeedButton;
|
||||
Splitter: TSplitter;
|
||||
ToolBar1: TToolBar;
|
||||
btnAdd: TToolButton;
|
||||
btnAddMore: TToolButton;
|
||||
btnDelete: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
btnUp: TToolButton;
|
||||
btnDown: TToolButton;
|
||||
procedure ActDeleteExecute(Sender: TObject);
|
||||
procedure ActDeleteUpdate(Sender: TObject);
|
||||
procedure ActMoveDownExecute(Sender: TObject);
|
||||
@ -120,9 +122,9 @@ type
|
||||
procedure ActionListEditorKeyDown(Sender: TObject; var Key: Word;
|
||||
{%H-}Shift: TShiftState);
|
||||
procedure ActionListEditorKeyPress(Sender: TObject; var Key: char);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure lstActionNameDrawItem(Control: TWinControl; Index: Integer;
|
||||
ARect: TRect; State: TOwnerDrawState);
|
||||
procedure SBShowMenuNewActionsClick(Sender: TObject);
|
||||
procedure SplitterCanResize(Sender: TObject; var {%H-}NewSize: Integer;
|
||||
var {%H-}Accept: Boolean);
|
||||
procedure lstActionNameKeyDown(Sender: TObject; var Key: Word;
|
||||
@ -688,7 +690,7 @@ end;
|
||||
|
||||
procedure TActionListEditor.ActPanelToolBarExecute(Sender: TObject);
|
||||
begin
|
||||
PanelToolBar.Visible := TAction(Sender).Checked;
|
||||
ToolBar1.Visible := TAction(Sender).Checked;
|
||||
end;
|
||||
|
||||
procedure TActionListEditor.ActionListEditorClose(Sender: TObject;
|
||||
@ -713,6 +715,21 @@ begin
|
||||
if Ord(Key) = VK_ESCAPE then Self.Close;
|
||||
end;
|
||||
|
||||
procedure TActionListEditor.FormCreate(Sender: TObject);
|
||||
begin
|
||||
//imageindex 0 exists
|
||||
ImageList1.AddResourceName(HInstance, 'laz_add'); //imageindex 1
|
||||
ImageList1.AddResourceName(HInstance, 'laz_delete'); //imageindex 2
|
||||
ImageList1.AddResourceName(HInstance, 'arrow_up'); //imadeindex 3
|
||||
ImageList1.AddResourceName(HInstance, 'arrow_down'); //imageindex 4
|
||||
btnAddMore.ImageIndex := 0;
|
||||
// These must be set in code because OI does not work with non-existent values.
|
||||
btnAdd.ImageIndex := 1;
|
||||
btnDelete.ImageIndex := 2;
|
||||
btnUp.ImageIndex := 3;
|
||||
btnDown.ImageIndex := 4;
|
||||
end;
|
||||
|
||||
procedure TActionListEditor.lstActionNameDrawItem(Control: TWinControl;
|
||||
Index: Integer; ARect: TRect; State: TOwnerDrawState);
|
||||
var
|
||||
@ -768,15 +785,6 @@ begin
|
||||
lstActionName.Items.Delete(i);
|
||||
end;
|
||||
|
||||
procedure TActionListEditor.SBShowMenuNewActionsClick(Sender: TObject);
|
||||
var
|
||||
MousePoint: TPoint;
|
||||
begin
|
||||
MousePoint := SBShowMenuNewActions.ClientToScreen(Point(0, btnAdd.Height-1));
|
||||
PopMenuToolBarActions.PopUp(MousePoint.X-btnAdd.Width, MousePoint.Y);
|
||||
SBShowMenuNewActions.Down := False;
|
||||
end;
|
||||
|
||||
procedure TActionListEditor.ActDeleteExecute(Sender: TObject);
|
||||
function IsCategory(Category: String): Boolean;
|
||||
var
|
||||
@ -885,7 +893,7 @@ begin
|
||||
ActMoveDown.Hint := cActionListEditorMoveDownAction;
|
||||
ActPanelDescr.Caption := cActionListEditorPanelDescrriptions;
|
||||
ActPanelToolBar.Caption := cActionListEditorPanelToolBar;
|
||||
SBShowMenuNewActions.Hint := cActionListEditorNewAction;
|
||||
btnAddMore.Hint := cActionListEditorNewAction;
|
||||
mItemToolBarNewAction.Caption := cActionListEditorNewAction;
|
||||
mItemToolBarNewStdAction.Caption := cActionListEditorNewStdAction;
|
||||
mItemActListNewAction.Caption := cActionListEditorNewAction;
|
||||
@ -894,11 +902,6 @@ begin
|
||||
mItemActListMoveUpAction.Caption := cActionListEditorMoveUpAction;
|
||||
mItemActListDelAction.Caption := cActionListEditorDeleteAction;
|
||||
|
||||
btnAdd.LoadGlyphFromResourceName(HInstance, 'laz_add');
|
||||
btnDelete.LoadGlyphFromResourceName(HInstance, 'laz_delete');
|
||||
btnUp.LoadGlyphFromResourceName(HInstance, 'arrow_up');
|
||||
btnDown.LoadGlyphFromResourceName(HInstance, 'arrow_down');
|
||||
|
||||
GlobalDesignHook.AddHandlerComponentRenamed(@OnComponentRenamed);
|
||||
GlobalDesignHook.AddHandlerSetSelection(@OnComponentSelection);
|
||||
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnRefreshPropertyValues);
|
||||
|
Loading…
Reference in New Issue
Block a user