mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 05:58:06 +02:00
IDE: Improve ChgEncodingDialog layout. Issue #29219, patch from Alexey Torgashin.
git-svn-id: trunk@51042 -
This commit is contained in:
parent
35b30db335
commit
b6a09af5dc
@ -1,7 +1,7 @@
|
||||
object ChgEncodingDialog: TChgEncodingDialog
|
||||
Left = 290
|
||||
Height = 560
|
||||
Top = 191
|
||||
Top = 163
|
||||
Width = 683
|
||||
ActiveControl = OwnerComboBox
|
||||
BorderIcons = [biSystemMenu, biMaximize]
|
||||
@ -11,17 +11,17 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.5'
|
||||
LCLVersion = '1.7'
|
||||
object FilesGroupBox: TGroupBox
|
||||
Left = 6
|
||||
Height = 151
|
||||
Top = 67
|
||||
Height = 173
|
||||
Top = 74
|
||||
Width = 671
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'FilesGroupBox'
|
||||
ClientHeight = 131
|
||||
ClientHeight = 154
|
||||
ClientWidth = 667
|
||||
TabOrder = 1
|
||||
object FileFilterLabel: TLabel
|
||||
@ -29,9 +29,9 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideTop.Control = NonUTF8FilesCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 56
|
||||
Width = 72
|
||||
Height = 17
|
||||
Top = 66
|
||||
Width = 97
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'FileFilterLabel'
|
||||
ParentColor = False
|
||||
@ -40,9 +40,9 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideLeft.Control = FilesGroupBox
|
||||
AnchorSideTop.Control = FilesGroupBox
|
||||
Left = 6
|
||||
Height = 19
|
||||
Height = 24
|
||||
Top = 6
|
||||
Width = 122
|
||||
Width = 157
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'UTF8FilesCheckBox'
|
||||
Checked = True
|
||||
@ -55,9 +55,9 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideTop.Control = UTF8FilesCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 31
|
||||
Width = 145
|
||||
Height = 24
|
||||
Top = 36
|
||||
Width = 185
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'NonUTF8FilesCheckBox'
|
||||
Checked = True
|
||||
@ -70,9 +70,9 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideTop.Control = FileFilterCombobox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 106
|
||||
Width = 114
|
||||
Height = 24
|
||||
Top = 124
|
||||
Width = 148
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'RegExprCheckBox'
|
||||
OnChange = PreviewClick
|
||||
@ -85,12 +85,12 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideRight.Control = FilesGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 77
|
||||
Height = 29
|
||||
Top = 89
|
||||
Width = 655
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
OnChange = PreviewClick
|
||||
TabOrder = 2
|
||||
Text = 'FileFilterCombobox'
|
||||
@ -100,10 +100,10 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = RegExprCheckBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 126
|
||||
Height = 15
|
||||
Top = 108
|
||||
Width = 95
|
||||
Left = 160
|
||||
Height = 17
|
||||
Top = 128
|
||||
Width = 128
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'RegExprErrorLabel'
|
||||
Font.Color = clFuchsia
|
||||
@ -113,20 +113,20 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
end
|
||||
object BtnPanel: TPanel
|
||||
Left = 0
|
||||
Height = 38
|
||||
Top = 522
|
||||
Height = 41
|
||||
Top = 519
|
||||
Width = 683
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 38
|
||||
ClientHeight = 41
|
||||
ClientWidth = 683
|
||||
TabOrder = 3
|
||||
object CloseButton: TBitBtn
|
||||
Left = 586
|
||||
Height = 26
|
||||
Left = 582
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 91
|
||||
Width = 95
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -136,10 +136,10 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
TabOrder = 2
|
||||
end
|
||||
object ApplyButton: TBitBtn
|
||||
Left = 487
|
||||
Height = 26
|
||||
Left = 479
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 93
|
||||
Width = 97
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -150,9 +150,9 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
end
|
||||
object HelpButton: TBitBtn
|
||||
Left = 6
|
||||
Height = 26
|
||||
Height = 29
|
||||
Top = 6
|
||||
Width = 71
|
||||
Width = 63
|
||||
Align = alLeft
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -164,14 +164,14 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
end
|
||||
object ScopeGroupBox: TGroupBox
|
||||
Left = 6
|
||||
Height = 55
|
||||
Height = 62
|
||||
Top = 6
|
||||
Width = 671
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'ScopeGroupBox'
|
||||
ClientHeight = 35
|
||||
ClientHeight = 43
|
||||
ClientWidth = 667
|
||||
TabOrder = 0
|
||||
object NewEncodingLabel: TLabel
|
||||
@ -179,10 +179,10 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideTop.Control = NewEncodingComboBox
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = NewEncodingComboBox
|
||||
Left = 426
|
||||
Height = 15
|
||||
Top = 10
|
||||
Width = 102
|
||||
Left = 400
|
||||
Height = 17
|
||||
Top = 13
|
||||
Width = 128
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'NewEncodingLabel'
|
||||
@ -193,12 +193,12 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideTop.Control = ScopeGroupBox
|
||||
AnchorSideRight.Control = NewEncodingLabel
|
||||
Left = 6
|
||||
Height = 23
|
||||
Height = 31
|
||||
Top = 6
|
||||
Width = 414
|
||||
Width = 388
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
OnChange = PreviewClick
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
@ -208,12 +208,12 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
AnchorSideRight.Control = ScopeGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 534
|
||||
Height = 23
|
||||
Height = 31
|
||||
Top = 6
|
||||
Width = 127
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
OnChange = PreviewClick
|
||||
Style = csDropDownList
|
||||
TabOrder = 1
|
||||
@ -221,18 +221,18 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
end
|
||||
object PreviewGroupBox: TGroupBox
|
||||
Left = 6
|
||||
Height = 292
|
||||
Top = 224
|
||||
Height = 209
|
||||
Top = 304
|
||||
Width = 671
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'PreviewGroupBox'
|
||||
ClientHeight = 272
|
||||
ClientHeight = 190
|
||||
ClientWidth = 667
|
||||
TabOrder = 2
|
||||
object PreviewListView: TListView
|
||||
Left = 5
|
||||
Height = 262
|
||||
Height = 180
|
||||
Top = 5
|
||||
Width = 657
|
||||
Align = alClient
|
||||
@ -241,16 +241,27 @@ object ChgEncodingDialog: TChgEncodingDialog
|
||||
item
|
||||
AutoSize = True
|
||||
Caption = 'Files'
|
||||
Width = 659
|
||||
Width = 41
|
||||
end
|
||||
item
|
||||
AutoSize = True
|
||||
Caption = 'Encoding'
|
||||
Width = 62
|
||||
Width = 598
|
||||
end>
|
||||
SortColumn = 1
|
||||
SortType = stText
|
||||
TabOrder = 0
|
||||
ViewStyle = vsReport
|
||||
end
|
||||
end
|
||||
object LabelNoPreview: TLabel
|
||||
Left = 20
|
||||
Height = 17
|
||||
Top = 267
|
||||
Width = 643
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 20
|
||||
Caption = 'LabelNoPreview'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
|
@ -53,6 +53,7 @@ type
|
||||
HelpButton: TBitBtn;
|
||||
BtnPanel: TPanel;
|
||||
CloseButton: TBitBtn;
|
||||
LabelNoPreview: TLabel;
|
||||
RegExprErrorLabel: TLabel;
|
||||
NewEncodingComboBox: TComboBox;
|
||||
FileFilterCombobox: TComboBox;
|
||||
@ -351,17 +352,20 @@ var
|
||||
Encoding: String;
|
||||
li: TListItem;
|
||||
HasFiles: Boolean;
|
||||
IsDone: Boolean;
|
||||
begin
|
||||
Screen.Cursor:=crHourGlass;
|
||||
try
|
||||
HasFiles:=GetFiles;
|
||||
PreviewListView.Items.Clear;
|
||||
if HasFiles and (FFiles.Tree.Count=0) then begin
|
||||
li:=PreviewListView.Items.Add;
|
||||
li.Caption:=lisFilesHaveRightEncoding;
|
||||
ApplyButton.Enabled:=False;
|
||||
exit;
|
||||
end;
|
||||
|
||||
IsDone:=HasFiles and (FFiles.Tree.Count=0);
|
||||
PreviewGroupBox.Visible:=not IsDone;
|
||||
LabelNoPreview.Visible:=IsDone;
|
||||
LabelNoPreview.Caption:=lisFilesHaveRightEncoding;
|
||||
ApplyButton.Enabled:=not IsDone;
|
||||
if IsDone then exit;
|
||||
|
||||
PreviewListView.BeginUpdate;
|
||||
Node:=FFiles.Tree.FindLowest;
|
||||
while Node<>nil do begin
|
||||
|
Loading…
Reference in New Issue
Block a user