IDE: Add option to show form's name in window menu. Issue #26420, patch from Tomasz Wieckowski.

git-svn-id: trunk@45725 -
This commit is contained in:
juha 2014-06-28 23:25:29 +00:00
parent cca4d2158e
commit 3926c42a5f
5 changed files with 121 additions and 78 deletions

View File

@ -283,6 +283,9 @@ type
FIDETitleIncludesBuildMode: boolean;
FIDEProjectDirectoryInIdeTitle: boolean;
// window menu
FIDENameForDesignedFormList: boolean;
// main buttons
FIDESpeedButtonsVisible: boolean;
FShowButtonGlyphs: TApplicationShowGlyphs;
@ -539,6 +542,10 @@ type
property CompletionWindowHeight: Integer read FCompletionWindowHeight
write FCompletionWindowHeight;
// window menu list
property IDENameForDesignedFormList: boolean read FIDENameForDesignedFormList
write FIDENameForDesignedFormList;
// component palette
property ComponentPaletteOptions: TCompPaletteOptions read FComponentPaletteOptions
write FComponentPaletteOptions;
@ -940,6 +947,9 @@ begin
FComponentPaletteVisible:=true;
FIDESpeedButtonsVisible:=true;
// window menu
FIDENameForDesignedFormList:=false;
// EnvironmentOptionsDialog editor
FShowGrid:=true;
FShowBorderSpacing:=false;
@ -1271,6 +1281,10 @@ begin
FCompletionWindowHeight:=XMLConfig.GetValue(
Path+'Desktop/CompletionWindowHeight/Value', 6);
// Window menu
FIDENameForDesignedFormList:=XMLConfig.GetValue(
Path+'Desktop/IDENameForDesignedFormList/Value',false);
// form editor
FShowGrid:=XMLConfig.GetValue(
Path+'FormEditor/ShowGrid',true);
@ -1657,6 +1671,9 @@ begin
XMLConfig.SetDeleteValue(Path+'Desktop/CompletionWindowHeight/Value',
FCompletionWindowHeight, 6);
// Window menu
XMLConfig.SetDeleteValue(Path+'Desktop/IDENameForDesignedFormList/Value',
FIDENameForDesignedFormList,false);
// form editor
XMLConfig.SetDeleteValue(Path+'FormEditor/ShowBorderSpacing',
FShowBorderSpacing,false);

View File

@ -7,16 +7,16 @@ object WindowOptionsFrame: TWindowOptionsFrame
ClientWidth = 566
TabOrder = 0
Visible = False
DesignLeft = 319
DesignTop = 171
DesignLeft = 415
DesignTop = 367
object SingleTaskBarButtonCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 24
Height = 17
Top = 0
Width = 194
Width = 181
Caption = 'SingleTaskBarButtonCheckBox'
Enabled = False
TabOrder = 0
@ -27,28 +27,28 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 0
Height = 24
Top = 24
Width = 162
Height = 17
Top = 17
Width = 151
Caption = 'HideIDEOnRunCheckBox'
TabOrder = 1
end
object WindowPositionsGroupBox: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = TitleIncludesBuildMode
AnchorSideTop.Control = NameForDesignedFormList
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 359
Top = 123
Height = 377
Top = 105
Width = 566
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 3
Caption = 'WindowPositionsGroupBox'
ClientHeight = 342
ClientHeight = 359
ClientWidth = 562
TabOrder = 2
object Bevel1: TBevel
@ -68,10 +68,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = WindowPositionsGroupBox
AnchorSideRight.Side = asrBottom
Left = 179
Left = 177
Height = 3
Top = 132
Width = 377
Width = 379
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
@ -83,7 +83,7 @@ object WindowOptionsFrame: TWindowOptionsFrame
Left = 70
Height = 15
Top = 126
Width = 103
Width = 101
BorderSpacing.Left = 70
BorderSpacing.Top = 6
Caption = 'lblWindowCaption'
@ -95,10 +95,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = LeftEdit
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = LeftEdit
Left = 291
Left = 295
Height = 15
Top = 231
Width = 52
Top = 230
Width = 48
Anchors = [akTop, akRight]
BorderSpacing.Right = 3
Caption = 'LeftLabel'
@ -110,7 +110,7 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Control = TopEdit
Left = 294
Height = 15
Top = 262
Top = 259
Width = 49
Anchors = [akTop, akRight]
BorderSpacing.Right = 3
@ -121,10 +121,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = WidthEdit
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = WidthEdit
Left = 416
Left = 418
Height = 15
Top = 231
Width = 62
Top = 230
Width = 60
Anchors = [akTop, akRight]
BorderSpacing.Right = 3
Caption = 'WidthLabel'
@ -134,10 +134,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = HeightEdit
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = HeightEdit
Left = 412
Left = 414
Height = 15
Top = 262
Width = 66
Top = 259
Width = 64
Anchors = [akTop, akRight]
BorderSpacing.Right = 3
Caption = 'HeightLabel'
@ -161,16 +161,15 @@ object WindowOptionsFrame: TWindowOptionsFrame
ScrollWidth = 548
ShowHint = True
TabOrder = 0
TopIndex = -1
end
object LetWindowManagerDecideRadioButton: TRadioButton
AnchorSideLeft.Control = WindowPositionsGroupBox
AnchorSideTop.Control = RestoreWindowGeometryRadioButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 253
Width = 245
Height = 17
Top = 246
Width = 229
BorderSpacing.Left = 6
BorderSpacing.Top = 3
Caption = 'LetWindowManagerDecideRadioButton'
@ -184,9 +183,9 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = LetWindowManagerDecideRadioButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 280
Width = 167
Height = 17
Top = 266
Width = 151
BorderSpacing.Left = 6
BorderSpacing.Top = 3
Caption = 'FixedDefaultRadioButton'
@ -200,9 +199,9 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = SplitterPanel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Height = 17
Top = 226
Width = 239
Width = 221
BorderSpacing.Left = 6
BorderSpacing.Top = 4
Caption = 'RestoreWindowGeometryRadioButton'
@ -218,9 +217,9 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = FixedDefaultRadioButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 307
Width = 192
Height = 17
Top = 286
Width = 180
BorderSpacing.Left = 6
BorderSpacing.Top = 3
Caption = 'CustomGeometryRadioButton'
@ -233,7 +232,7 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = RestoreWindowGeometryRadioButton
AnchorSideRight.Control = WidthEdit
Left = 346
Height = 25
Height = 23
Top = 226
Width = 75
Anchors = [akTop, akRight]
@ -249,8 +248,8 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = HeightEdit
Left = 346
Height = 25
Top = 257
Height = 23
Top = 255
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
@ -266,7 +265,7 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Control = WindowPositionsGroupBox
AnchorSideRight.Side = asrBottom
Left = 481
Height = 25
Height = 23
Top = 226
Width = 75
Anchors = [akTop, akRight]
@ -282,8 +281,8 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Control = WindowPositionsGroupBox
AnchorSideRight.Side = asrBottom
Left = 481
Height = 25
Top = 257
Height = 23
Top = 255
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
@ -296,10 +295,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
object GetWindowPositionButton: TButton
AnchorSideTop.Control = ApplyButton
AnchorSideRight.Control = ApplyButton
Left = 309
Height = 27
Top = 294
Width = 159
Left = 290
Height = 25
Top = 290
Width = 167
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Right = 6
@ -313,10 +312,10 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = WindowPositionsGroupBox
AnchorSideRight.Side = asrBottom
Left = 474
Height = 27
Top = 294
Width = 82
Left = 463
Height = 25
Top = 290
Width = 93
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 12
@ -345,8 +344,8 @@ object WindowOptionsFrame: TWindowOptionsFrame
BorderWidth = 1
BorderStyle = bsSingle
Caption = ' '
ClientHeight = 76
ClientWidth = 556
ClientHeight = 74
ClientWidth = 554
TabOrder = 11
Visible = False
object SplitterList: TListBox
@ -355,7 +354,7 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideBottom.Control = SplitterPanel
AnchorSideBottom.Side = asrBottom
Left = 1
Height = 74
Height = 72
Top = 1
Width = 275
Anchors = [akTop, akLeft, akBottom]
@ -365,7 +364,6 @@ object WindowOptionsFrame: TWindowOptionsFrame
ScrollWidth = 273
ShowHint = True
TabOrder = 0
TopIndex = -1
end
object SplitLabel: TLabel
AnchorSideTop.Control = SplitEdit
@ -373,8 +371,8 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Control = SplitEdit
Left = 424
Height = 15
Top = 46
Width = 53
Top = 45
Width = 51
Anchors = [akTop, akRight]
BorderSpacing.Right = 3
Caption = 'SplitLabel'
@ -385,8 +383,8 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = SplitterPanel
AnchorSideBottom.Side = asrBottom
Left = 480
Height = 25
Left = 478
Height = 23
Top = 41
Width = 75
Anchors = [akRight, akBottom]
@ -403,12 +401,12 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideRight.Control = SplitterPanel
AnchorSideRight.Side = asrBottom
Left = 282
Height = 29
Height = 23
Top = 1
Width = 273
Width = 271
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
ItemHeight = 0
ItemHeight = 15
ParentShowHint = False
ShowHint = True
Style = csDropDownList
@ -421,9 +419,9 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = HideIDEOnRunCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 24
Top = 48
Width = 203
Height = 17
Top = 34
Width = 186
Caption = 'TitleStartsWithProjectCheckBox'
ParentShowHint = False
ShowHint = True
@ -434,9 +432,9 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = TitleStartsWithProjectCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 24
Top = 72
Width = 189
Height = 17
Top = 51
Width = 173
Caption = 'ProjectDirInIdeTitleCheckBox'
ParentShowHint = False
ShowHint = True
@ -447,12 +445,25 @@ object WindowOptionsFrame: TWindowOptionsFrame
AnchorSideTop.Control = ProjectDirInIdeTitleCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 24
Top = 96
Width = 155
Height = 17
Top = 68
Width = 145
Caption = 'TitleIncludesBuildMode'
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
object NameForDesignedFormList: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = TitleIncludesBuildMode
AnchorSideTop.Side = asrBottom
Left = 0
Height = 17
Top = 85
Width = 164
Caption = 'NameForDesignedFormList'
ParentShowHint = False
ShowHint = True
TabOrder = 6
end
end

View File

@ -38,6 +38,7 @@ type
ApplyButton: TButton;
Bevel1: TBevel;
Bevel2: TBevel;
NameForDesignedFormList: TCheckBox;
TitleIncludesBuildMode: TCheckBox;
dropSplitterPlacement: TComboBox;
CustomGeometryRadioButton: TRadioButton;
@ -120,6 +121,8 @@ begin
TitleStartsWithProjectCheckBox.Hint:=lisTitleInTaskbarShowsForExampleProject1LpiLazarus;
TitleIncludesBuildMode.Caption:=lisIDETitleShowsBuildMode;
TitleIncludesBuildMode.Hint:=lisBuildModeInTitleInExample;
NameForDesignedFormList.Caption:=lisWindowMenuWithNameForDesignedForm;
NameForDesignedFormList.Hint:=lisWindowMenuWithNameForDesignedFormHint;
ProjectDirInIdeTitleCheckBox.Caption:=lisIDETitleShowsProjectDir;
ProjectDirInIdeTitleCheckBox.Hint:=lisProjectDirectoryIsShowedInIdeTitleBar;
end;
@ -136,6 +139,7 @@ begin
HideIDEOnRunCheckBox.Checked := HideIDEOnRun;
TitleStartsWithProjectCheckBox.Checked:=IDETitleStartsWithProject;
TitleIncludesBuildMode.Checked:=IDETitleIncludesBuildMode;
NameForDesignedFormList.Checked:=IDENameForDesignedFormList;
ProjectDirInIdeTitleCheckBox.Checked:=IDEProjectDirectoryInIdeTitle;
end;
@ -212,6 +216,7 @@ begin
HideIDEOnRun:=HideIDEOnRunCheckBox.Checked;
IDETitleStartsWithProject:=TitleStartsWithProjectCheckBox.Checked;
IDETitleIncludesBuildMode := TitleIncludesBuildMode.Checked;
IDENameForDesignedFormList := NameForDesignedFormList.Checked;
IDEProjectDirectoryInIdeTitle:=ProjectDirInIdeTitleCheckBox.Checked;
end;
end;

View File

@ -1238,6 +1238,8 @@ resourcestring
lisIDETitleStartsWithProjectName = 'IDE title starts with project name';
lisIDETitleShowsProjectDir = 'IDE title shows project directory';
lisIDETitleShowsBuildMode = 'IDE title shows selected build mode';
lisWindowMenuWithNameForDesignedForm = 'Window menu shows designed form''s name instead of caption';
lisWindowMenuWithNameForDesignedFormHint = 'Useful especially if the caption is left empty.';
dlgDesktopHints = 'Hints';
dlgPalHints = 'Hints for component palette';
dlgSpBHints = 'Hints for main speed buttons (open, save, ...)';

View File

@ -239,11 +239,12 @@ begin
i:=Screen.CustomFormCount-1;
while (i>=0) do begin
Form:=Screen.CustomForms[i];
if Form.Caption=(Sender as TIDEMenuCommand).Caption then
begin
IDEWindowCreators.ShowForm(Form,true);
break;
end;
if (EnvironmentOptions.IDENameForDesignedFormList and (Form.Name=(Sender as TIDEMenuCommand).Caption)) or
((not EnvironmentOptions.IDENameForDesignedFormList) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
begin
IDEWindowCreators.ShowForm(Form,true);
break;
end;
dec(i);
end;
end;
@ -257,7 +258,8 @@ begin
i:=Screen.CustomFormCount-1;
while (i>=0) do begin
Form:=Screen.CustomForms[i];
if Form.Caption=(Sender as TIDEMenuCommand).Caption then
if (EnvironmentOptions.IDENameForDesignedFormList and (Form.Name=(Sender as TIDEMenuCommand).Caption)) or
((not EnvironmentOptions.IDENameForDesignedFormList) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
begin
// show
if not Form.IsVisible then
@ -1388,12 +1390,18 @@ begin
begin
// in the 'bring to front' list
CurMenuItem := GetMenuItem(i, itmWindowLists);
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
if EnvironmentOptions.IDENameForDesignedFormList and (TCustomForm(WindowsList[i]).Designer<>nil) then
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
else
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
CurMenuItem.MenuItem.Checked := WindowMenuActiveForm = TCustomForm(WindowsList[i]);
CurMenuItem.OnClick:=@mnuWindowItemClick;
// in the 'center' list
CurMenuItem := GetMenuItem(i, itmCenterWindowLists);
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
if EnvironmentOptions.IDENameForDesignedFormList and (TCustomForm(WindowsList[i]).Designer<>nil) then
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
else
CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Caption;
CurMenuItem.OnClick:=@mnuCenterWindowItemClick;
end;
//create source page menuitems