IDE: Improve "Manage desktops" dialog. Issue #35786, patch from FTurtle.

git-svn-id: trunk@61528 -
This commit is contained in:
juha 2019-07-04 21:59:53 +00:00
parent 77eab57ea8
commit 12bd4546ad
3 changed files with 256 additions and 182 deletions

View File

@ -1,21 +1,28 @@
object DesktopForm: TDesktopForm object DesktopForm: TDesktopForm
Left = 334 Left = 334
Height = 292 Height = 310
Top = 319 Top = 319
Width = 377 Width = 450
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
Caption = 'DesktopForm' Caption = 'DesktopForm'
ClientHeight = 292 ClientHeight = 310
ClientWidth = 377 ClientWidth = 450
Constraints.MinHeight = 310
Constraints.MinWidth = 350
OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
OnShow = FormShow OnShow = FormShow
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.9.0.0' LCLVersion = '2.1.0.0'
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 34 Height = 34
Top = 252 Top = 270
Width = 365 Width = 438
BorderSpacing.Left = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
BorderSpacing.Around = 0
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.Caption = 'OK' OKButton.Caption = 'OK'
OKButton.DefaultCaption = False OKButton.DefaultCaption = False
@ -30,10 +37,10 @@ object DesktopForm: TDesktopForm
TabOrder = 4 TabOrder = 4
ShowButtons = [pbClose, pbHelp] ShowButtons = [pbClose, pbHelp]
object ExportBitBtn: TBitBtn object ExportBitBtn: TBitBtn
Left = 93 Left = 179
Height = 26 Height = 26
Top = 8 Top = 8
Width = 91 Width = 0
Align = alCustom Align = alCustom
AutoSize = True AutoSize = True
Caption = 'ExportBitBtn' Caption = 'ExportBitBtn'
@ -42,10 +49,10 @@ object DesktopForm: TDesktopForm
TabOrder = 4 TabOrder = 4
end end
object ImportBitBtn: TBitBtn object ImportBitBtn: TBitBtn
Left = 190 Left = 271
Height = 26 Height = 26
Top = 8 Top = 8
Width = 94 Width = 0
Align = alCustom Align = alCustom
AutoSize = True AutoSize = True
Caption = 'ImportBitBtn' Caption = 'ImportBitBtn'
@ -55,16 +62,19 @@ object DesktopForm: TDesktopForm
end end
end end
object DesktopListBox: TListBox object DesktopListBox: TListBox
AnchorSideLeft.Control = LblGrayedInfo AnchorSideLeft.Control = Owner
AnchorSideRight.Control = LblGrayedInfo AnchorSideTop.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Control = Panel1
AnchorSideBottom.Control = AssociatedDebugDesktopComboBox AnchorSideBottom.Control = AssociatedDebugDesktopLabel
Left = 11 Left = 6
Height = 163 Height = 178
Top = 8 Top = 6
Width = 320 Width = 290
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Bottom = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 4
ItemHeight = 18 ItemHeight = 18
OnDblClick = SetActiveDesktopActionClick OnDblClick = SetActiveDesktopActionClick
OnDrawItem = DesktopListBoxDrawItem OnDrawItem = DesktopListBoxDrawItem
@ -74,157 +84,186 @@ object DesktopForm: TDesktopForm
TabOrder = 0 TabOrder = 0
end end
object AutoSaveActiveDesktopCheckBox: TCheckBox object AutoSaveActiveDesktopCheckBox: TCheckBox
AnchorSideLeft.Control = LblGrayedInfo AnchorSideLeft.Control = DesktopListBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = LblGrayedInfo AnchorSideBottom.Control = LblGrayedInfo
Left = 11 Left = 6
Height = 19 Height = 17
Top = 204 Top = 230
Width = 151 Width = 140
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Top = 6
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
Caption = 'Auto save active desktop' Caption = 'Auto save active desktop'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 2 TabOrder = 2
end end
object ToolBar1: TToolBar
Left = 340
Height = 241
Top = 8
Width = 30
Align = alNone
Anchors = [akTop, akRight, akBottom]
Caption = 'ToolBar1'
EdgeBorders = []
TabOrder = 3
object SaveTB: TToolButton
Left = 1
Top = 0
Action = SaveAction
OnClick = SaveActionClick
ParentShowHint = False
ShowHint = True
end
object ToolButton1: TToolButton
Left = 1
Top = 22
Width = 23
Caption = 'ToolButton1'
Style = tbsDivider
end
object SetActiveDesktopTB: TToolButton
Left = 1
Top = 27
Action = SetActiveDesktopAction
OnClick = SetActiveDesktopActionClick
ParentShowHint = False
ShowHint = True
end
object SetDebugDesktopTB: TToolButton
Left = 1
Top = 54
Action = SetDebugDesktopAction
OnClick = SetDebugDesktopActionClick
ParentShowHint = False
ShowHint = True
end
object RenameTB: TToolButton
Left = 1
Top = 76
Action = RenameAction
OnClick = RenameActionClick
ParentShowHint = False
ShowHint = True
end
object DeleteTB: TToolButton
Left = 1
Top = 98
Action = DeleteAction
OnClick = DeleteActionClick
ParentShowHint = False
ShowHint = True
end
object MoveUpTB: TToolButton
Tag = -1
Left = 1
Top = 125
Action = MoveUpAction
OnClick = MoveUpDownActionClick
ParentShowHint = False
ShowHint = True
end
object MoveDownTB: TToolButton
Tag = 1
Left = 1
Top = 147
Action = MoveDownAction
OnClick = MoveUpDownActionClick
ParentShowHint = False
ShowHint = True
end
object ToolButton2: TToolButton
Left = 1
Top = 120
Width = 23
Caption = 'ToolButton2'
Style = tbsDivider
end
object ToolButton3: TToolButton
Left = 1
Top = 49
Width = 23
Caption = 'ToolButton3'
Style = tbsDivider
end
end
object LblGrayedInfo: TLabel object LblGrayedInfo: TLabel
AnchorSideLeft.Control = DesktopListBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 11 AnchorSideBottom.Control = ButtonPanel1
Height = 15 Left = 6
Top = 229 Height = 13
Width = 320 Top = 253
Width = 438
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Top = 3 BorderSpacing.Bottom = 4
Caption = 'Grayed desktops are for undocked environment.' Caption = 'Grayed desktops are for undocked environment.'
ParentColor = False ParentColor = False
WordWrap = True WordWrap = True
end end
object AssociatedDebugDesktopComboBox: TComboBox object AssociatedDebugDesktopComboBox: TComboBox
AnchorSideLeft.Control = AssociatedDebugDesktopLabel AnchorSideLeft.Control = DesktopListBox
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = DesktopListBox AnchorSideRight.Control = DesktopListBox
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = AutoSaveActiveDesktopCheckBox AnchorSideBottom.Control = AutoSaveActiveDesktopCheckBox
Left = 184 Left = 6
Height = 21 Height = 21
Top = 177 Top = 203
Width = 147 Width = 290
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 10 BorderSpacing.Bottom = 6
ItemHeight = 15 ItemHeight = 13
OnChange = AssociatedDebugDesktopComboBoxChange OnChange = AssociatedDebugDesktopComboBoxChange
Style = csDropDownList Style = csDropDownList
TabOrder = 1 TabOrder = 1
end end
object AssociatedDebugDesktopLabel: TLabel object AssociatedDebugDesktopLabel: TLabel
AnchorSideLeft.Control = AutoSaveActiveDesktopCheckBox AnchorSideLeft.Control = DesktopListBox
AnchorSideTop.Control = AssociatedDebugDesktopComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 11 AnchorSideRight.Control = DesktopListBox
Height = 15 AnchorSideRight.Side = asrBottom
Top = 180 AnchorSideBottom.Control = AssociatedDebugDesktopComboBox
Width = 163 Left = 6
Height = 13
Top = 188
Width = 290
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Bottom = 2
Caption = 'AssociatedDebugDesktopLabel' Caption = 'AssociatedDebugDesktopLabel'
ParentColor = False ParentColor = False
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
WordWrap = True
end
object Panel1: TPanel
AnchorSideTop.Control = DesktopListBox
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = LblGrayedInfo
Left = 302
Height = 247
Top = 6
Width = 142
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
BevelOuter = bvNone
ChildSizing.VerticalSpacing = 2
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 247
ClientWidth = 142
TabOrder = 3
object SaveAsButton: TBitBtn
Left = 0
Height = 24
Top = 0
Width = 142
Action = SaveAsAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object SetActiveDesktopButton: TBitBtn
Left = 0
Height = 24
Top = 26
Width = 142
Action = SetActiveDesktopAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object SetDebugDesktopButton: TBitBtn
Left = 0
Height = 24
Top = 52
Width = 142
Action = SetDebugDesktopAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 2
end
object RenameButton: TBitBtn
Left = 0
Height = 24
Top = 78
Width = 142
Action = RenameAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 3
end
object DeleteButton: TBitBtn
Left = 0
Height = 24
Top = 104
Width = 142
Action = DeleteAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
object MoveUpButton: TBitBtn
Tag = -1
Left = 0
Height = 24
Top = 130
Width = 142
Action = MoveUpAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
object MoveDownButton: TBitBtn
Tag = 1
Left = 0
Height = 24
Top = 156
Width = 142
Action = MoveDownAction
AutoSize = True
Constraints.MinHeight = 24
Constraints.MinWidth = 24
ParentShowHint = False
ShowHint = True
TabOrder = 6
end
end end
object ExportMenu: TPopupMenu object ExportMenu: TPopupMenu
Left = 48 left = 28
Top = 24 top = 24
object ExportItem: TMenuItem object ExportItem: TMenuItem
Action = ExportAction Action = ExportAction
OnClick = ExportActionClick OnClick = ExportActionClick
@ -235,11 +274,11 @@ object DesktopForm: TDesktopForm
end end
end end
object ActionList1: TActionList object ActionList1: TActionList
Left = 128 left = 89
Top = 32 top = 24
object SaveAction: TAction object SaveAsAction: TAction
Caption = 'SaveAction' Caption = 'SaveAsAction'
OnExecute = SaveActionClick OnExecute = SaveAsActionClick
ShortCut = 16467 ShortCut = 16467
end end
object SetActiveDesktopAction: TAction object SetActiveDesktopAction: TAction

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, Types, Classes, SysUtils, Types,
LCLIntf, LCLType, LCLProc, Forms, Controls, Graphics, Dialogs, StdCtrls, LCLIntf, LCLType, LCLProc, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, ButtonPanel, Menus, ComCtrls, ActnList, Buttons, ButtonPanel, Menus, ComCtrls, ActnList, ExtCtrls,
// LazUtils // LazUtils
Laz2_XMLCfg, Laz2_XMLCfg,
// IdeIntf // IdeIntf
@ -21,19 +21,25 @@ type
TDesktopForm = class(TForm) TDesktopForm = class(TForm)
AssociatedDebugDesktopComboBox: TComboBox; AssociatedDebugDesktopComboBox: TComboBox;
DeleteButton: TBitBtn;
ExportBitBtn: TBitBtn; ExportBitBtn: TBitBtn;
ImportBitBtn: TBitBtn; ImportBitBtn: TBitBtn;
ImportAction: TAction; ImportAction: TAction;
ExportAction: TAction; ExportAction: TAction;
ExportAllAction: TAction; ExportAllAction: TAction;
AssociatedDebugDesktopLabel: TLabel; AssociatedDebugDesktopLabel: TLabel;
MoveDownButton: TBitBtn;
MoveUpAction: TAction; MoveUpAction: TAction;
MoveDownAction: TAction; MoveDownAction: TAction;
DeleteAction: TAction; DeleteAction: TAction;
MoveUpButton: TBitBtn;
RenameAction: TAction; RenameAction: TAction;
RenameButton: TBitBtn;
SaveAsButton: TBitBtn;
SetActiveDesktopButton: TBitBtn;
SetDebugDesktopAction: TAction; SetDebugDesktopAction: TAction;
SetActiveDesktopAction: TAction; SetActiveDesktopAction: TAction;
SaveAction: TAction; SaveAsAction: TAction;
ActionList1: TActionList; ActionList1: TActionList;
AutoSaveActiveDesktopCheckBox: TCheckBox; AutoSaveActiveDesktopCheckBox: TCheckBox;
ButtonPanel1: TButtonPanel; ButtonPanel1: TButtonPanel;
@ -42,17 +48,8 @@ type
ExportItem: TMenuItem; ExportItem: TMenuItem;
ExportAllItem: TMenuItem; ExportAllItem: TMenuItem;
DesktopListBox: TListBox; DesktopListBox: TListBox;
ToolBar1: TToolBar; Panel1: TPanel;
SaveTB: TToolButton; SetDebugDesktopButton: TBitBtn;
ToolButton1: TToolButton;
SetActiveDesktopTB: TToolButton;
SetDebugDesktopTB: TToolButton;
RenameTB: TToolButton;
DeleteTB: TToolButton;
MoveUpTB: TToolButton;
MoveDownTB: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
procedure AssociatedDebugDesktopComboBoxChange(Sender: TObject); procedure AssociatedDebugDesktopComboBoxChange(Sender: TObject);
procedure DeleteActionClick(Sender: TObject); procedure DeleteActionClick(Sender: TObject);
procedure DesktopListBoxDrawItem(Control: TWinControl; Index: Integer; procedure DesktopListBoxDrawItem(Control: TWinControl; Index: Integer;
@ -62,13 +59,14 @@ type
procedure ExportAllActionClick(Sender: TObject); procedure ExportAllActionClick(Sender: TObject);
procedure ExportActionClick(Sender: TObject); procedure ExportActionClick(Sender: TObject);
procedure ExportBitBtnClick(Sender: TObject); procedure ExportBitBtnClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure HelpButtonClick(Sender: TObject); procedure HelpButtonClick(Sender: TObject);
procedure ImportActionClick(Sender: TObject); procedure ImportActionClick(Sender: TObject);
procedure MoveUpDownActionClick(Sender: TObject); procedure MoveUpDownActionClick(Sender: TObject);
procedure RenameActionClick(Sender: TObject); procedure RenameActionClick(Sender: TObject);
procedure SaveActionClick(Sender: TObject); procedure SaveAsActionClick(Sender: TObject);
procedure SetActiveDesktopActionClick(Sender: TObject); procedure SetActiveDesktopActionClick(Sender: TObject);
procedure SetDebugDesktopActionClick(Sender: TObject); procedure SetDebugDesktopActionClick(Sender: TObject);
private private
@ -286,7 +284,7 @@ begin
xMISaveAs.ImageIndex := IDEImages.LoadImage('menu_saveas'); xMISaveAs.ImageIndex := IDEImages.LoadImage('menu_saveas');
xMIToggleDebug := TMenuItem.Create(xPM); xMIToggleDebug := TMenuItem.Create(xPM);
xMIToggleDebug.Caption := dlgToggleDebugDesktop; xMIToggleDebug.Caption := dlgToggleDebugDesktopBtnCaption;
xMIToggleDebug.ImageIndex := IDEImages.LoadImage('debugger'); xMIToggleDebug.ImageIndex := IDEImages.LoadImage('debugger');
// Saved desktops // Saved desktops
@ -348,29 +346,48 @@ end;
procedure TDesktopForm.FormCreate(Sender: TObject); procedure TDesktopForm.FormCreate(Sender: TObject);
begin begin
IDEDialogLayoutList.ApplyLayout(Self, 470, 326);
// buttons captions & text // buttons captions & text
ToolBar1.Images := IDEImages.Images_16;
ActionList1.Images := IDEImages.Images_16; // for TDesktopForm.DesktopListBoxDrawItem only
Caption := dlgManageDesktops; Caption := dlgManageDesktops;
SaveAction.Hint := dlgSaveCurrentDesktopAs;
SaveAction.ImageIndex := IDEImages.LoadImage('laz_save'); SaveAsAction.Caption := dlgSaveCurrentDesktopAsBtnCaption;
DeleteAction.Hint := lisDelete; SaveAsAction.Hint := dlgSaveCurrentDesktopAsBtnHint;
DeleteAction.ImageIndex := IDEImages.LoadImage('laz_cancel'); IDEImages.AssignImage(SaveAsButton, 'menu_saveas');
RenameAction.Hint := lisRename;
RenameAction.ImageIndex := IDEImages.LoadImage('laz_edit'); DeleteAction.Caption := dlgDeleteSelectedDesktopBtnCaption;
MoveUpAction.Hint := lisMenuEditorMoveUp; DeleteAction.Hint := dlgDeleteSelectedDesktopBtnHint;
MoveUpAction.ImageIndex := IDEImages.LoadImage('arrow_up'); IDEImages.AssignImage(DeleteButton, 'laz_cancel');
MoveDownAction.Hint := lisMenuEditorMoveDown;
MoveDownAction.ImageIndex := IDEImages.LoadImage('arrow_down'); RenameAction.Caption := dlgRenameSelectedDesktopBtnCaption;
SetActiveDesktopAction.Hint := dlgSetActiveDesktop; RenameAction.Hint := dlgRenameSelectedDesktopBtnHint;
SetActiveDesktopAction.ImageIndex := IDEImages.LoadImage('laz_tick'); IDEImages.AssignImage(RenameButton, 'laz_edit');
SetDebugDesktopAction.Hint := dlgToggleDebugDesktop;
SetDebugDesktopAction.ImageIndex := IDEImages.LoadImage('debugger'); MoveUpAction.Caption := lisMoveUp;
MoveUpAction.Hint := lisMoveUp;
IDEImages.AssignImage(MoveUpButton, 'arrow_up');
MoveDownAction.Caption := lisMoveDown;
MoveDownAction.Hint := lisMoveDown;
IDEImages.AssignImage(MoveDownButton, 'arrow_down');
SetActiveDesktopAction.Caption := dlgSetActiveDesktopBtnCaption;
SetActiveDesktopAction.Hint := dlgSetActiveDesktopBtnHint;
IDEImages.AssignImage(SetActiveDesktopButton, 'laz_tick');
SetDebugDesktopAction.Caption := dlgToggleDebugDesktopBtnCaption;
SetDebugDesktopAction.Hint := dlgToggleDebugDesktopBtnHint;
IDEImages.AssignImage(SetDebugDesktopButton, 'debugger');
AutoSaveActiveDesktopCheckBox.Caption := dlgAutoSaveActiveDesktop; AutoSaveActiveDesktopCheckBox.Caption := dlgAutoSaveActiveDesktop;
AutoSaveActiveDesktopCheckBox.Hint := dlgAutoSaveActiveDesktopHint; AutoSaveActiveDesktopCheckBox.Hint := dlgAutoSaveActiveDesktopHint;
LblGrayedInfo.Caption := ''; LblGrayedInfo.Caption := '';
AssociatedDebugDesktopLabel.Caption := dlgAssociatedDebugDesktop; //AssociatedDebugDesktopLabel.Caption := dlgAssociatedDebugDesktop; // moved to TDesktopForm.DesktopListBoxSelectionChange
AssociatedDebugDesktopLabel.Hint := dlgAssociatedDebugDesktopHint; AssociatedDebugDesktopLabel.Hint := dlgAssociatedDebugDesktopHint;
LblGrayedInfo.Font.Color := clGrayText; LblGrayedInfo.Font.Color := clGrayText; // perhaps better clInactiveCaption
ExportAction.Hint := lisExport; ExportAction.Hint := lisExport;
ExportAction.Caption := lisExportSelected; ExportAction.Caption := lisExportSelected;
@ -546,6 +563,11 @@ begin
ExportMenu.PopUp(p.x,p.y); ExportMenu.PopUp(p.x,p.y);
end; end;
procedure TDesktopForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TDesktopForm.ExportDesktops( procedure TDesktopForm.ExportDesktops(
const aDesktops: array of TCustomDesktopOpt); const aDesktops: array of TCustomDesktopOpt);
var var
@ -785,7 +807,7 @@ begin
raise Exception.Create('Desktop manager internal error: the desktop list doesn''t match the listbox content.'); raise Exception.Create('Desktop manager internal error: the desktop list doesn''t match the listbox content.');
end; end;
xInfo := ''; xInfo := '';
xTextLeft := ARect.Left+ToolBar1.Images.Width + 4; xTextLeft := ARect.Left+ActionList1.Images.Width + 4;
xIconLeft := ARect.Left+2; xIconLeft := ARect.Left+2;
if (xDesktopName <> '') and (EnvironmentOptions.ActiveDesktopName = xDesktopName) then if (xDesktopName <> '') and (EnvironmentOptions.ActiveDesktopName = xDesktopName) then
begin begin
@ -793,7 +815,7 @@ begin
xInfo := xInfo + ', '; xInfo := xInfo + ', ';
xInfo := xInfo + dlgActiveDesktop; xInfo := xInfo + dlgActiveDesktop;
xLB.Canvas.Font.Style := xLB.Canvas.Font.Style + [fsBold]; xLB.Canvas.Font.Style := xLB.Canvas.Font.Style + [fsBold];
ToolBar1.Images.Draw(xLB.Canvas, xIconLeft, (ARect.Top+ARect.Bottom-ToolBar1.Images.Height) div 2, SetActiveDesktopTB.ImageIndex, xDesktop.Compatible);//I don't see a problem painting the tick over the "run" icon... ActionList1.Images.Draw(xLB.Canvas, xIconLeft, (ARect.Top+ARect.Bottom-ActionList1.Images.Height) div 2, SetActiveDesktopButton.ImageIndex, xDesktop.Compatible);//I don't see a problem painting the tick over the "run" icon...
end; end;
if (xDesktopName <> '') and (EnvironmentOptions.DebugDesktopName = xDesktopName) then if (xDesktopName <> '') and (EnvironmentOptions.DebugDesktopName = xDesktopName) then
begin begin
@ -802,10 +824,10 @@ begin
xInfo := xInfo + dlgDebugDesktop; xInfo := xInfo + dlgDebugDesktop;
if (EnvironmentOptions.ActiveDesktopName = xDesktopName) then if (EnvironmentOptions.ActiveDesktopName = xDesktopName) then
begin begin
xTextLeft := xTextLeft + ToolBar1.Images.Width; xTextLeft := xTextLeft + ActionList1.Images.Width;
xIconLeft := xIconLeft + ToolBar1.Images.Width; xIconLeft := xIconLeft + ActionList1.Images.Width;
end; end;
ToolBar1.Images.Draw(xLB.Canvas, xIconLeft, (ARect.Top+ARect.Bottom-ToolBar1.Images.Height) div 2, SetDebugDesktopTB.ImageIndex, xDesktop.Compatible); ActionList1.Images.Draw(xLB.Canvas, xIconLeft, (ARect.Top+ARect.Bottom-ActionList1.Images.Height) div 2, SetDebugDesktopButton.ImageIndex, xDesktop.Compatible);
end; end;
ARect.Left := xTextLeft; ARect.Left := xTextLeft;
xText := xDesktopName; xText := xDesktopName;
@ -864,6 +886,9 @@ begin
ExportAction.Enabled := HasSel; ExportAction.Enabled := HasSel;
ExportAllAction.Enabled := DesktopListBox.Items.Count>0; ExportAllAction.Enabled := DesktopListBox.Items.Count>0;
ExportBitBtn.Enabled := ExportItem.Enabled or ExportAllItem.Enabled; ExportBitBtn.Enabled := ExportItem.Enabled or ExportAllItem.Enabled;
if DesktopListBox.Items.Count>0 then
AssociatedDebugDesktopLabel.Caption:=Format(dlgAssociatedDebugDesktop,
[DesktopListBox.Items[DesktopListBox.ItemIndex]]);
end; end;
procedure TDesktopForm.ExportAllActionClick(Sender: TObject); procedure TDesktopForm.ExportAllActionClick(Sender: TObject);
@ -877,7 +902,7 @@ begin
ExportDesktops(xDesktops); ExportDesktops(xDesktops);
end; end;
procedure TDesktopForm.SaveActionClick(Sender: TObject); procedure TDesktopForm.SaveAsActionClick(Sender: TObject);
var var
xDesktopName, xOldDesktopName: string; xDesktopName, xOldDesktopName: string;
begin begin

View File

@ -149,6 +149,8 @@ resourcestring
lisMoveFiles = 'Move Files'; lisMoveFiles = 'Move Files';
lisMoveFiles2 = 'Move files?'; lisMoveFiles2 = 'Move files?';
lrsPLDDeleteSelected = 'Delete selected'; lrsPLDDeleteSelected = 'Delete selected';
lisMoveUp = 'Move Up';
lisMoveDown = 'Move Down';
dlgMultipleInstances = 'Multiple Lazarus instances'; dlgMultipleInstances = 'Multiple Lazarus instances';
dlgMultipleInstances_AlwaysStartNew = 'always start a new instance'; dlgMultipleInstances_AlwaysStartNew = 'always start a new instance';
@ -1380,12 +1382,20 @@ resourcestring
dlgManageDesktops = 'Manage desktops'; dlgManageDesktops = 'Manage desktops';
dlgSaveCurrentDesktop = 'Save current desktop'; dlgSaveCurrentDesktop = 'Save current desktop';
dlgSaveCurrentDesktopAs = 'Save current desktop as'; dlgSaveCurrentDesktopAs = 'Save current desktop as';
dlgSaveCurrentDesktopAsBtnCaption = 'Save active desktop as ...';
dlgSaveCurrentDesktopAsBtnHint = 'Save active desktop as';
dlgDeleteSelectedDesktopBtnCaption = 'Delete';
dlgDeleteSelectedDesktopBtnHint = 'Delete selected desktop';
dlgRenameSelectedDesktopBtnCaption = 'Rename';
dlgRenameSelectedDesktopBtnHint = 'Rename selected desktop';
dlgReallyDeleteDesktop = 'Really delete desktop "%s"?'; dlgReallyDeleteDesktop = 'Really delete desktop "%s"?';
dlgCannotUseDockedUndockedDesktop = 'You cannot use docked desktop in undocked environment and vice versa.'; dlgCannotUseDockedUndockedDesktop = 'You cannot use docked desktop in undocked environment and vice versa.';
dlgRenameDesktop = 'Rename desktop'; dlgRenameDesktop = 'Rename desktop';
dlgNewDesktop = 'New desktop ...'; dlgNewDesktop = 'New desktop ...';
dlgSetActiveDesktop = 'Set active'; dlgSetActiveDesktopBtnCaption = 'Set active';
dlgToggleDebugDesktop = 'Toggle as debug desktop'; dlgSetActiveDesktopBtnHint = 'Set active';
dlgToggleDebugDesktopBtnCaption = 'Toggle as debug desktop';
dlgToggleDebugDesktopBtnHint = 'Toggle as debug desktop';
dlgDesktopName = 'Desktop name'; dlgDesktopName = 'Desktop name';
dlgOverwriteDesktop = 'Desktop with the name "%s" was found.'+sLineBreak+'Should the old desktop be overwritten?'; dlgOverwriteDesktop = 'Desktop with the name "%s" was found.'+sLineBreak+'Should the old desktop be overwritten?';
dlgDebugDesktop = 'debug'; dlgDebugDesktop = 'debug';
@ -1399,7 +1409,7 @@ resourcestring
dlgGrayedDesktopsUndocked = 'Grayed desktops are for undocked environment.'; dlgGrayedDesktopsUndocked = 'Grayed desktops are for undocked environment.';
dlgAutoSaveActiveDesktop = 'Auto save active desktop'; dlgAutoSaveActiveDesktop = 'Auto save active desktop';
dlgAutoSaveActiveDesktopHint = 'Save active desktop on IDE close'+sLineBreak+'Save debug desktop on IDE close and debug end'; dlgAutoSaveActiveDesktopHint = 'Save active desktop on IDE close'+sLineBreak+'Save debug desktop on IDE close and debug end';
dlgAssociatedDebugDesktop = 'Associated debug desktop'; dlgAssociatedDebugDesktop = 'Associated debug desktop for "%s"';
dlgAssociatedDebugDesktopHint = 'If you select the desktop, the associated debug desktop will be selected as well.'; dlgAssociatedDebugDesktopHint = 'If you select the desktop, the associated debug desktop will be selected as well.';
// Window options // Window options