JCF2: improved 'Clarify/Spaces' page layout

git-svn-id: trunk@24887 -
This commit is contained in:
maxim 2010-04-24 17:32:26 +00:00
parent 1c2ac82980
commit c100f0d607
2 changed files with 301 additions and 89 deletions

View File

@ -1,263 +1,428 @@
inherited fClarifySpaces: TfClarifySpaces
Height = 463
Width = 472
Width = 457
ClientHeight = 463
ClientWidth = 472
ClientWidth = 457
OnResize = FrameResize
TabOrder = 0
DesignLeft = 479
DesignTop = 188
object cbFixSpacing: TCheckBox[0]
Left = 8
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 17
Top = 6
Width = 71
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Fix &spacing'
TabOrder = 0
end
object cbSpaceClassHeritage: TCheckBox[1]
Left = 8
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbFixSpacing
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 29
Width = 151
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Space before class &heritage'
TabOrder = 1
end
object gbColon: TGroupBox[2]
Left = 8
Height = 292
Top = 50
Width = 246
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbSpaceClassHeritage
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = gbTabs
Left = 6
Height = 294
Top = 52
Width = 218
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Spaces &before colon in'
ClientHeight = 274
ClientWidth = 242
ClientHeight = 276
ClientWidth = 214
TabOrder = 2
object lblSpaceBeforeColonVar: TLabel
Left = 8
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpaceBeforeColonVar
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 3
Top = 9
Width = 78
BorderSpacing.Left = 6
Caption = '&Var declarations'
FocusControl = eSpaceBeforeColonVar
ParentColor = False
end
object lblSpacesBeforeColonClassVar: TLabel
Left = 8
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpacesBeforeColonClassVar
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 123
Top = 117
Width = 72
BorderSpacing.Left = 6
Caption = '&Class variables'
FocusControl = eSpacesBeforeColonClassVar
ParentColor = False
end
object lblSpaceBeforeColonFn: TLabel
Left = 8
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpaceBeforeColonFn
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 93
Top = 90
Width = 105
BorderSpacing.Left = 6
Caption = '&Function return types'
FocusControl = eSpaceBeforeColonFn
ParentColor = False
end
object lblSpaceBeforeColonParam: TLabel
Left = 8
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpaceBeforeColonParam
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 63
Width = 108
BorderSpacing.Left = 6
Caption = '&Procedure parameters'
FocusControl = eSpaceBeforeColonParam
ParentColor = False
end
object lblSpacesBeforeCaseLabel: TLabel
Left = 5
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpacesBeforeCaseLabel
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 183
Top = 171
Width = 50
BorderSpacing.Left = 6
Caption = 'Case l&abel'
FocusControl = eSpacesBeforeCaseLabel
ParentColor = False
end
object lbSpacesBeforeLabel: TLabel
Left = 5
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpacesBeforeLabel
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 213
Top = 198
Width = 26
BorderSpacing.Left = 6
Caption = '&Label'
FocusControl = eSpacesBeforeLabel
ParentColor = False
end
object lblSpacesBeforeColonGeneric: TLabel
Left = 5
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpacesBeforeColonGeneric
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 243
Top = 225
Width = 49
BorderSpacing.Left = 6
Caption = 'In &generic'
FocusControl = eSpacesBeforeColonGeneric
ParentColor = False
end
object lblSpaceBeforeColonConst: TLabel
Left = 7
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpaceBeforeColonConst
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 33
Top = 36
Width = 90
BorderSpacing.Left = 6
Caption = 'C&onst declarations'
FocusControl = eSpaceBeforeColonConst
ParentColor = False
end
object lblSpacesBeforeColonRecordField: TLabel
Left = 8
AnchorSideLeft.Control = gbColon
AnchorSideTop.Control = eSpacesBeforeColonRecordField
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 153
Top = 144
Width = 63
BorderSpacing.Left = 6
Caption = '&Record fields'
FocusControl = eSpacesBeforeColonRecordField
ParentColor = False
end
object eSpaceBeforeColonVar: TSpinEdit
Left = 180
AnchorSideTop.Control = gbColon
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 1
Top = 6
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 0
end
object eSpaceBeforeColonParam: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpaceBeforeColonConst
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 61
Top = 60
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 1
end
object eSpaceBeforeColonFn: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpaceBeforeColonParam
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 91
Top = 87
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 2
end
object eSpacesBeforeColonClassVar: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpaceBeforeColonFn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 121
Top = 114
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 3
end
object eSpacesBeforeCaseLabel: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpacesBeforeColonRecordField
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 181
Top = 168
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 4
end
object eSpacesBeforeLabel: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpacesBeforeCaseLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 211
Top = 195
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 5
end
object eSpacesBeforeColonGeneric: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpacesBeforeLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 241
Top = 222
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 6
end
object eSpaceBeforeColonConst: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpaceBeforeColonVar
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 31
Top = 33
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 7
end
object eSpacesBeforeColonRecordField: TSpinEdit
Left = 180
AnchorSideTop.Control = eSpacesBeforeColonClassVar
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbColon
AnchorSideRight.Side = asrBottom
Left = 158
Height = 21
Top = 151
Top = 141
Width = 50
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
TabOrder = 8
end
end
object gbTabs: TGroupBox[3]
Left = 8
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = edtMaxSpacesInCode
Left = 6
Height = 78
Top = 344
Width = 457
Top = 352
Width = 445
Anchors = [akLeft, akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = '&Tab characters'
ClientHeight = 60
ClientWidth = 453
ClientWidth = 441
TabOrder = 3
object Label1: TLabel
Left = 240
AnchorSideTop.Control = edtSpacesPerTab
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtSpacesPerTab
Left = 307
Height = 14
Top = 7
Top = 9
Width = 73
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
Caption = 'Spaces per tab'
ParentColor = False
end
object Label3: TLabel
Left = 240
AnchorSideTop.Control = edtSpacesForTab
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtSpacesForTab
Left = 309
Height = 14
Top = 29
Top = 36
Width = 71
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
Caption = 'Spaces for tab'
ParentColor = False
end
object cbTabsToSpaces: TCheckBox
AnchorSideLeft.Control = gbTabs
AnchorSideTop.Control = edtSpacesPerTab
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 9
Top = 8
Width = 113
BorderSpacing.Left = 6
Caption = 'Turn tabs to spaces'
OnClick = cbTabsToSpacesClick
TabOrder = 0
end
object cbSpacesToTabs: TCheckBox
AnchorSideLeft.Control = gbTabs
AnchorSideTop.Control = edtSpacesForTab
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 31
Top = 35
Width = 113
BorderSpacing.Left = 6
Caption = 'Turn spaces to tabs'
OnClick = cbSpacesToTabsClick
TabOrder = 2
end
object edtSpacesPerTab: TSpinEdit
Left = 356
AnchorSideTop.Control = gbTabs
AnchorSideRight.Control = gbTabs
AnchorSideRight.Side = asrBottom
Left = 386
Height = 21
Top = 5
Top = 6
Width = 49
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
MaxValue = 12
TabOrder = 1
end
object edtSpacesForTab: TSpinEdit
Left = 356
AnchorSideTop.Control = edtSpacesPerTab
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbTabs
AnchorSideRight.Side = asrBottom
Left = 386
Height = 21
Top = 29
Top = 33
Width = 49
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
MaxValue = 12
TabOrder = 3
end
end
object cbMaxSpaces: TCheckBox[4]
Left = 8
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = edtMaxSpacesInCode
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 426
Top = 438
Width = 111
BorderSpacing.Left = 6
Caption = '&Max spaces in code'
OnClick = cbMaxSpacesClick
TabOrder = 4
end
object edtMaxSpacesInCode: TSpinEdit[5]
Left = 193
AnchorSideLeft.Control = cbMaxSpaces
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = gbTabs
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 123
Height = 21
Top = 424
Top = 436
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
MaxValue = 99
TabOrder = 5
end
object rgOperators: TRadioGroup[6]
Left = 260
Height = 92
AnchorSideLeft.Control = gbColon
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 230
Height = 81
Top = 6
Width = 202
Width = 221
Anchors = [akTop, akLeft, akRight]
AutoFill = True
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Spaces around &operators'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -267,8 +432,8 @@ inherited fClarifySpaces: TfClarifySpaces
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 74
ClientWidth = 198
ClientHeight = 63
ClientWidth = 217
Items.Strings = (
'Always'
'Leave as is'
@ -277,70 +442,111 @@ inherited fClarifySpaces: TfClarifySpaces
TabOrder = 6
end
object GroupBoxInsertSpaceBeforeBracket: TGroupBox[7]
Left = 260
Height = 95
Top = 98
Width = 202
AnchorSideLeft.Control = gbColon
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = rgOperators
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 230
Height = 93
Top = 93
Width = 221
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Around = 6
Caption = '&Insert space before bracket'
ClientHeight = 77
ClientWidth = 198
ClientHeight = 75
ClientWidth = 217
TabOrder = 7
object cbInsertSpaceBeforeBracketinFunctionDeclaration: TCheckBox
Left = 8
AnchorSideLeft.Control = GroupBoxInsertSpaceBeforeBracket
AnchorSideTop.Control = GroupBoxInsertSpaceBeforeBracket
Left = 6
Height = 17
Top = 10
Top = 6
Width = 126
BorderSpacing.Around = 6
Caption = 'In function &declaration'
TabOrder = 0
end
object cbInsertSpaceBeforeBracketinFunctionCall: TCheckBox
Left = 8
AnchorSideLeft.Control = GroupBoxInsertSpaceBeforeBracket
AnchorSideTop.Control = cbInsertSpaceBeforeBracketinFunctionDeclaration
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 32
Top = 29
Width = 88
BorderSpacing.Around = 6
Caption = 'In function &call'
TabOrder = 1
end
object cbBeforeOpenSquareBracketInExpression: TCheckBox
Left = 8
AnchorSideLeft.Control = GroupBoxInsertSpaceBeforeBracket
AnchorSideTop.Control = cbInsertSpaceBeforeBracketinFunctionCall
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 52
Width = 123
BorderSpacing.Around = 6
Caption = 'Before [ in expression'
TabOrder = 2
end
end
object GroupBoxSpacesInsideBrackets: TGroupBox[8]
Left = 260
AnchorSideLeft.Control = gbColon
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBoxInsertSpaceBeforeBracket
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 230
Height = 70
Top = 194
Width = 202
Top = 192
Width = 221
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Insert space inside brackets'
ClientHeight = 52
ClientWidth = 198
ClientWidth = 217
TabOrder = 8
object CheckBoxInsertSpaceBeforeEnd: TCheckBox
Left = 8
AnchorSideLeft.Control = GroupBoxSpacesInsideBrackets
AnchorSideTop.Control = cbInsertSpaceAfterOpen
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 27
Top = 29
Width = 71
BorderSpacing.Around = 6
Caption = 'Before end'
TabOrder = 0
end
object cbInsertSpaceAfterOpen: TCheckBox
Left = 8
AnchorSideLeft.Control = GroupBoxSpacesInsideBrackets
AnchorSideTop.Control = GroupBoxSpacesInsideBrackets
Left = 6
Height = 17
Top = 4
Top = 6
Width = 70
BorderSpacing.Around = 6
Caption = 'After open'
TabOrder = 1
end
end
object cbMoveSpacesToBeforeColon: TCheckBox[9]
Left = 260
AnchorSideLeft.Control = gbColon
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBoxSpacesInsideBrackets
AnchorSideTop.Side = asrBottom
Left = 230
Height = 17
Top = 270
Top = 268
Width = 156
BorderSpacing.Around = 6
Caption = 'Move spaces to before colon'
TabOrder = 9
end

View File

@ -82,6 +82,7 @@ type
procedure cbTabsToSpacesClick(Sender: TObject);
procedure cbSpacesToTabsClick(Sender: TObject);
procedure cbMaxSpacesClick(Sender: TObject);
procedure FrameResize(Sender:TObject);
public
constructor Create(AOwner: TComponent); override;
@ -265,6 +266,11 @@ begin
edtMaxSpacesInCode.Enabled := cbMaxSpaces.Checked;
end;
procedure TfClarifySpaces.FrameResize(Sender:TObject);
begin
gbColon.Width:=trunc(Width*0.5);
end;
initialization
RegisterIDEOptionsEditor(JCFOptionsGroup, TfClarifySpaces, JCFOptionSpaces, JCFOptionClarify);
end.