mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 03:18:55 +02:00
IDE: fixed auto code templates to not always add the typed character, IDE: fixed resetting IDE ToolStatus, fixing crash when double clicking on install package button, IDEIntf: added property OpenEditorsOnCodeToolChange to allow tools to cleanly change sources (this fixes the bug of quickfix items not working with temporary files)
git-svn-id: trunk@12613 -
This commit is contained in:
parent
d42e679dbb
commit
1d517decaf
@ -177,15 +177,15 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
||||
TabOrder = 2
|
||||
end
|
||||
object TemplateSynEdit: TSynEdit
|
||||
AnchorSideTop.Control = AutoOnLineBreakCheckBox
|
||||
AnchorSideTop.Control = AutoOnCheckGroup
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = EditTemplateGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = EditTemplateGroupBox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 158
|
||||
Top = 67
|
||||
Height = 150
|
||||
Top = 75
|
||||
Width = 469
|
||||
BorderSpacing.Around = 6
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
@ -520,30 +520,33 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
||||
)
|
||||
SelectedColor.OnChange = nil
|
||||
end
|
||||
object AutoOnLineBreakCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = UseMacrosCheckBox
|
||||
object AutoOnCheckGroup: TCheckGroup
|
||||
AnchorSideLeft.Control = EditTemplateGroupBox
|
||||
AnchorSideTop.Control = InsertMacroButton
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = EditTemplateGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 22
|
||||
Height = 30
|
||||
Top = 39
|
||||
Width = 197
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'AutoOnLineBreakCheckBox'
|
||||
Width = 469
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoFill = True
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'AutoOnCheckGroup'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
Columns = 2
|
||||
Constraints.MinHeight = 30
|
||||
TabOrder = 3
|
||||
end
|
||||
object AutoOnSpaceCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = AutoOnLineBreakCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = AutoOnLineBreakCheckBox
|
||||
Left = 215
|
||||
Height = 22
|
||||
Top = 39
|
||||
Width = 175
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'AutoOnSpaceCheckBox'
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
||||
object BtnPanel: TPanel
|
||||
Height = 50
|
||||
@ -595,7 +598,7 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
||||
object ASynPasSyn: TSynFreePascalSyn
|
||||
Enabled = False
|
||||
NestedComments = True
|
||||
left = 272
|
||||
top = 24
|
||||
left = 304
|
||||
top = 344
|
||||
end
|
||||
end
|
||||
|
@ -65,77 +65,81 @@ LazarusResources.Add('TCodeTemplateDialog','FORMDATA',[
|
||||
+#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#25'BorderSpacing.Inne'
|
||||
+'rBorder'#2#4#7'Caption'#6#17'InsertMacroButton'#7'OnClick'#7#22'InsertMacro'
|
||||
+'ButtonClick'#8'TabOrder'#2#2#0#0#8'TSynEdit'#15'TemplateSynEdit'#21'AnchorS'
|
||||
,'ideTop.Control'#7#23'AutoOnLineBreakCheckBox'#18'AnchorSideTop.Side'#7#9'as'
|
||||
+'rBottom'#23'AnchorSideRight.Control'#7#20'EditTemplateGroupBox'#20'AnchorSi'
|
||||
+'deRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#20'EditTemplate'
|
||||
+'GroupBox'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#3
|
||||
+#158#0#3'Top'#2'C'#5'Width'#3#213#1#20'BorderSpacing.Around'#2#6#7'Anchors'
|
||||
+#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#242#9'Font'
|
||||
+'.Name'#6#7'courier'#11'ParentColor'#8#8'TabOrder'#2#1#23'Gutter.CodeFolding'
|
||||
+'Width'#2#14#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Comma'
|
||||
+'nd'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'C'
|
||||
+'ommand'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Co'
|
||||
+'mmand'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7
|
||||
+'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7
|
||||
+'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7
|
||||
+'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7
|
||||
+'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7
|
||||
+'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7
|
||||
+'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'C'
|
||||
+'ommand'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7
|
||||
+'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'C'
|
||||
+'ommand'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7
|
||||
+'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'C'
|
||||
+'ommand'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7
|
||||
+'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1
|
||||
+#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- '
|
||||
+#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3
|
||||
+'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCu'
|
||||
+'t'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8
|
||||
+'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'C'
|
||||
+'ommand'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0
|
||||
+#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3
|
||||
+'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'Short'
|
||||
+'Cut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8
|
||||
+'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'['
|
||||
+#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command'
|
||||
+#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Com'
|
||||
+'mand'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7
|
||||
+'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0
|
||||
+#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4'
|
||||
+'@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut'
|
||||
+#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'Short'
|
||||
+'Cut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8
|
||||
+'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a'
|
||||
+#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3
|
||||
+'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Comman'
|
||||
+'d'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'C'
|
||||
+'ommand'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1
|
||||
+#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C'
|
||||
+'`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCu'
|
||||
+'t'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'Sh'
|
||||
+'ortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#15'TemplateSynEdit'#0#22'SelectedCo'
|
||||
+'lor.OnChange'#13#0#0#9'TCheckBox'#23'AutoOnLineBreakCheckBox'#22'AnchorSide'
|
||||
+'Left.Control'#7#17'UseMacrosCheckBox'#21'AnchorSideTop.Control'#7#17'Insert'
|
||||
+'MacroButton'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2
|
||||
+#22#3'Top'#2''''#5'Width'#3#197#0#17'BorderSpacing.Top'#2#6#7'Caption'#6#23
|
||||
+'AutoOnLineBreakCheckBox'#8'TabOrder'#2#3#0#0#9'TCheckBox'#19'AutoOnSpaceChe'
|
||||
+'ckBox'#22'AnchorSideLeft.Control'#7#23'AutoOnLineBreakCheckBox'#19'AnchorSi'
|
||||
+'deLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#23'AutoOnLineBreakC'
|
||||
+'heckBox'#4'Left'#3#215#0#6'Height'#2#22#3'Top'#2''''#5'Width'#3#175#0#18'Bo'
|
||||
+'rderSpacing.Left'#2#12#7'Caption'#6#19'AutoOnSpaceCheckBox'#8'TabOrder'#2#4
|
||||
+#0#0#0#6'TPanel'#8'BtnPanel'#6'Height'#2'2'#3'Top'#3#236#1#5'Width'#3#241#1#5
|
||||
+'Align'#7#8'alBottom'#8'AutoSize'#9#10'BevelOuter'#7#6'bvNone'#12'ClientHeig'
|
||||
+'ht'#2'2'#11'ClientWidth'#3#241#1#8'TabOrder'#2#3#0#7'TBitBtn'#8'OkButton'#21
|
||||
+'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'D'#1#6'Height'#2'&'#3'Top'#2
|
||||
+#6#5'Width'#2'K'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'
|
||||
,#2#6#7'Caption'#6#3'&OK'#20'Constraints.MinWidth'#2'K'#7'Default'#9#4'Kind'#7
|
||||
+#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'#7#13'OkButtonClick'
|
||||
+#8'TabOrder'#2#0#0#0#7'TBitBtn'#12'CancelButton'#20'AnchorSideRight.Side'#7#9
|
||||
+'asrBottom'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#149#1#6'Heigh'
|
||||
+'t'#2'&'#3'Top'#2#6#5'Width'#2'V'#5'Align'#7#7'alRight'#8'AutoSize'#9#20'Bor'
|
||||
+'derSpacing.Around'#2#6#6'Cancel'#9#7'Caption'#6#6'Cancel'#20'Constraints.Mi'
|
||||
+'nWidth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'T'
|
||||
+'abOrder'#2#1#0#0#0#17'TSynFreePascalSyn'#10'ASynPasSyn'#7'Enabled'#8#14'Nes'
|
||||
+'tedComments'#9#4'left'#3#16#1#3'top'#2#24#0#0#0
|
||||
,'ideTop.Control'#7#16'AutoOnCheckGroup'#18'AnchorSideTop.Side'#7#9'asrBottom'
|
||||
+#23'AnchorSideRight.Control'#7#20'EditTemplateGroupBox'#20'AnchorSideRight.S'
|
||||
+'ide'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#20'EditTemplateGroupBox'
|
||||
+#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#3#150#0#3'To'
|
||||
+'p'#2'K'#5'Width'#3#213#1#20'BorderSpacing.Around'#2#6#7'Anchors'#11#5'akTop'
|
||||
+#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#242#9'Font.Name'#6#7'c'
|
||||
+'ourier'#11'ParentColor'#8#8'TabOrder'#2#1#23'Gutter.CodeFoldingWidth'#2#14
|
||||
+#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'S'
|
||||
+'hortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8
|
||||
+'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0
|
||||
+#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8
|
||||
+'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8
|
||||
+'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8
|
||||
+'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8
|
||||
+'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8
|
||||
+'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8
|
||||
+'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'S'
|
||||
+'hortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8
|
||||
+'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'S'
|
||||
+'hortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8
|
||||
+'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'S'
|
||||
+'hortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8
|
||||
+'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201
|
||||
+#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3
|
||||
+#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Comman'
|
||||
+'d'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7
|
||||
+'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8
|
||||
+#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1
|
||||
+#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3
|
||||
+#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Comma'
|
||||
+'nd'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7
|
||||
+'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0
|
||||
+#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X'
|
||||
+'@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortC'
|
||||
+'ut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'S'
|
||||
+'hortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1
|
||||
+#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3
|
||||
+'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Comman'
|
||||
+'d'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'C'
|
||||
+'ommand'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1
|
||||
+#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'
|
||||
+#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3
|
||||
+'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCu'
|
||||
+'t'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'Sh'
|
||||
+'ortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1
|
||||
+#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3
|
||||
+#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Comm'
|
||||
+'and'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7
|
||||
+'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'
|
||||
+#0#0#13'Lines.Strings'#1#6#15'TemplateSynEdit'#0#22'SelectedColor.OnChange'
|
||||
+#13#0#0#11'TCheckGroup'#16'AutoOnCheckGroup'#22'AnchorSideLeft.Control'#7#20
|
||||
+'EditTemplateGroupBox'#21'AnchorSideTop.Control'#7#17'InsertMacroButton'#18
|
||||
+'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#20'EditTem'
|
||||
+'plateGroupBox'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'
|
||||
+#2#30#3'Top'#2''''#5'Width'#3#213#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
|
||||
+'ht'#0#8'AutoFill'#9#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6
|
||||
+#16'AutoOnCheckGroup'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.To'
|
||||
+'pBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChi'
|
||||
+'ldResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28
|
||||
+'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVer'
|
||||
+'tical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenT'
|
||||
+'opToBottom'#27'ChildSizing.ControlsPerLine'#2#2#7'Columns'#2#2#21'Constrain'
|
||||
+'ts.MinHeight'#2#30#8'TabOrder'#2#3#0#0#0#6'TPanel'#8'BtnPanel'#6'Height'#2
|
||||
+'2'#3'Top'#3#236#1#5'Width'#3#241#1#5'Align'#7#8'alBottom'#8'AutoSize'#9#10
|
||||
,'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'2'#11'ClientWidth'#3#241#1#8'Tab'
|
||||
+'Order'#2#3#0#7'TBitBtn'#8'OkButton'#21'AnchorSideBottom.Side'#7#9'asrBottom'
|
||||
+#4'Left'#3'D'#1#6'Height'#2'&'#3'Top'#2#6#5'Width'#2'K'#5'Align'#7#7'alRight'
|
||||
+#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#3'&OK'#20'Constrain'
|
||||
+'ts.MinWidth'#2'K'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumG'
|
||||
+'lyphs'#2#0#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#0#0#0#7'TBitBtn'#12
|
||||
+'CancelButton'#20'AnchorSideRight.Side'#7#9'asrBottom'#21'AnchorSideBottom.S'
|
||||
+'ide'#7#9'asrBottom'#4'Left'#3#149#1#6'Height'#2'&'#3'Top'#2#6#5'Width'#2'V'
|
||||
+#5'Align'#7#7'alRight'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6'Cancel'#9
|
||||
+#7'Caption'#6#6'Cancel'#20'Constraints.MinWidth'#2'K'#4'Kind'#7#8'bkCancel'
|
||||
+#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#0#17'TSynFreePasca'
|
||||
+'lSyn'#10'ASynPasSyn'#7'Enabled'#8#14'NestedComments'#9#4'left'#3'0'#1#3'top'
|
||||
+#3'X'#1#0#0#0
|
||||
]);
|
||||
|
@ -38,9 +38,21 @@ uses
|
||||
IDECommands, TextTools, SrcEditorIntf, MenuIntf, IDEWindowIntf, LazIDEIntf,
|
||||
IDEProcs, InputHistory, LazarusIDEStrConsts, EditorOptions, CodeMacroSelect;
|
||||
|
||||
type
|
||||
TAutoCompleteOption = (
|
||||
acoLineBreak,
|
||||
acoSpace,
|
||||
acoWordEnd,
|
||||
acoAddChar
|
||||
);
|
||||
|
||||
const
|
||||
CodeTemplateAutoOnLineBreak = 'AutoOnLineBreak';
|
||||
CodeTemplateAutoOnSpace = 'AutoOnSpace';
|
||||
AutoCompleteOptionNames: array[TAutoCompleteOption] of shortstring = (
|
||||
'AutoOnLineBreak',
|
||||
'AutoOnSpace',
|
||||
'AutoOnWordEnd',
|
||||
'AddChar'
|
||||
);
|
||||
|
||||
type
|
||||
|
||||
@ -49,8 +61,7 @@ type
|
||||
TCodeTemplateDialog = class(TForm)
|
||||
AddButton: TButton;
|
||||
ASynPasSyn: TSynFreePascalSyn;
|
||||
AutoOnLineBreakCheckBox: TCheckBox;
|
||||
AutoOnSpaceCheckBox: TCheckBox;
|
||||
AutoOnCheckGroup: TCheckGroup;
|
||||
EditTemplateGroupBox: TGroupBox;
|
||||
OkButton: TBitBtn;
|
||||
CancelButton: TBitBtn;
|
||||
@ -654,8 +665,11 @@ begin
|
||||
FilenameGroupBox.Caption:=lisToDoLFile;
|
||||
UseMacrosCheckBox.Caption:=lisEnableMacros;
|
||||
InsertMacroButton.Caption:=lisCTInsertMacro;
|
||||
AutoOnLineBreakCheckBox.Caption:=lisAutomaticallyOnLineBreak;
|
||||
AutoOnSpaceCheckBox.Caption:=lisAutomaticallyOnSpace;
|
||||
AutoOnCheckGroup.Caption:='Auto complete on ...';
|
||||
AutoOnCheckGroup.Items.Add(lisAutomaticallyOnLineBreak);
|
||||
AutoOnCheckGroup.Items.Add(lisAutomaticallyOnSpace);
|
||||
AutoOnCheckGroup.Items.Add(lisAutomaticallyOnWordEnd);
|
||||
AutoOnCheckGroup.Items.Add(lisAutomaticallyOnWordEnd);
|
||||
|
||||
FilenameEdit.Text:=EditorOpts.CodeTemplateFileName;
|
||||
|
||||
@ -904,13 +918,13 @@ var
|
||||
var
|
||||
idx, a, sp, ep: integer;
|
||||
s: string;
|
||||
AutoOnLineBreak: Boolean;
|
||||
AutoOnSpace: Boolean;
|
||||
AutoOnCat: array[TAutoCompleteOption] of Boolean;
|
||||
Attributes: TStrings;
|
||||
c: TAutoCompleteOption;
|
||||
begin
|
||||
EnableMacros:=false;
|
||||
AutoOnLineBreak:=false;
|
||||
AutoOnSpace:=false;
|
||||
for c:=Low(TAutoCompleteOption) to High(TAutoCompleteOption) do
|
||||
AutoOnCat[c]:=false;
|
||||
|
||||
LineCount := 0;
|
||||
idx := TemplateListBox.ItemIndex;
|
||||
@ -929,8 +943,8 @@ begin
|
||||
+' - '+dbgstr(SynAutoComplete.CompletionComments[a]);
|
||||
Attributes:=SynAutoComplete.CompletionAttributes[a];
|
||||
EnableMacros:=Attributes.IndexOfName(CodeTemplateEnableMacros)>=0;
|
||||
AutoOnLineBreak:=Attributes.IndexOfName(CodeTemplateAutoOnLineBreak)>=0;
|
||||
AutoOnSpace:=Attributes.IndexOfName(CodeTemplateAutoOnSpace)>=0;
|
||||
for c:=Low(TAutoCompleteOption) to High(TAutoCompleteOption) do
|
||||
AutoOnCat[c]:=Attributes.IndexOfName(AutoCompleteOptionNames[c])>=0;
|
||||
LastTemplate := -1;
|
||||
s:=SynAutoComplete.CompletionValues[a];
|
||||
//debugln('TCodeTemplateDialog.ShowCurCodeTemplate s="',s,'"');
|
||||
@ -954,8 +968,8 @@ begin
|
||||
TemplateSynEdit.Lines.EndUpdate;
|
||||
TemplateSynEdit.Invalidate;
|
||||
UseMacrosCheckBox.Checked:=EnableMacros;
|
||||
AutoOnLineBreakCheckBox.Checked:=AutoOnLineBreak;
|
||||
AutoOnSpaceCheckBox.Checked:=AutoOnSpace;
|
||||
for c:=Low(TAutoCompleteOption) to High(TAutoCompleteOption) do
|
||||
AutoOnCheckGroup.Checked[ord(c)]:=AutoOnCat[c];
|
||||
end;
|
||||
|
||||
procedure TCodeTemplateDialog.SaveCurCodeTemplate;
|
||||
@ -980,6 +994,7 @@ var
|
||||
var
|
||||
NewValue: string;
|
||||
l: integer;
|
||||
c: TAutoCompleteOption;
|
||||
begin
|
||||
if LastTemplate<0 then exit;
|
||||
a := LastTemplate;
|
||||
@ -999,8 +1014,8 @@ begin
|
||||
SynAutoComplete.CompletionValues[a]:=NewValue;
|
||||
|
||||
SetBooleanAttribute(CodeTemplateEnableMacros,UseMacrosCheckBox.Checked);
|
||||
SetBooleanAttribute(CodeTemplateAutoOnLineBreak,AutoOnLineBreakCheckBox.Checked);
|
||||
SetBooleanAttribute(CodeTemplateAutoOnSpace,AutoOnSpaceCheckBox.Checked);
|
||||
for c:=low(TAutoCompleteOption) to High(TAutoCompleteOption) do
|
||||
SetBooleanAttribute(AutoCompleteOptionNames[c],AutoOnCheckGroup.Checked[ord(c)]);
|
||||
|
||||
//DebugLn('TCodeTemplateDialog.SaveCurCodeTemplate NewValue="',NewValue,'" SynAutoComplete.CompletionValues[a]="',SynAutoComplete.CompletionValues[a],'"');
|
||||
end;
|
||||
|
@ -3431,8 +3431,9 @@ resourcestring
|
||||
rsConditionalDefines = 'Conditional defines';
|
||||
rsAddInverse = 'Add Inverse';
|
||||
rsRemove = '&Remove';
|
||||
lisAutomaticallyOnLineBreak = 'automatically on line break';
|
||||
lisAutomaticallyOnSpace = 'automatically on space';
|
||||
lisAutomaticallyOnLineBreak = 'line break';
|
||||
lisAutomaticallyOnSpace = 'space';
|
||||
lisAutomaticallyOnWordEnd = 'word end';
|
||||
lisPckOptsThisPackageProvidesTheSameAsTheFollowingPackages = 'This package '
|
||||
+'provides the same as the following packages:';
|
||||
|
||||
|
77
ide/main.pp
77
ide/main.pp
@ -491,7 +491,6 @@ type
|
||||
// display the correct tab
|
||||
FCheckingFilesOnDisk: boolean;
|
||||
FCheckFilesOnDiskNeeded: boolean;
|
||||
FOpenEditorsOnCodeToolChange: boolean;
|
||||
FRemoteControlTimer: TTimer;
|
||||
FRemoteControlFileValid: boolean;
|
||||
|
||||
@ -501,7 +500,7 @@ type
|
||||
procedure RenameInheritedMethods(AnUnitInfo: TUnitInfo; List: TStrings);
|
||||
protected
|
||||
procedure SetToolStatus(const AValue: TIDEToolStatus); override;
|
||||
function DoResetToolStatus(Interactive: boolean): boolean;
|
||||
function DoResetToolStatus(Interactive: boolean): boolean; override;
|
||||
procedure Notification(AComponent: TComponent;
|
||||
Operation: TOperation); override;
|
||||
|
||||
@ -1350,7 +1349,7 @@ begin
|
||||
FCheckingFilesOnDisk:=true;
|
||||
try
|
||||
// stop debugging/compiling/...
|
||||
if not DoResetToolStatus(true) then exit;
|
||||
if (ToolStatus=itExiting) and (not DoResetToolStatus(true)) then exit;
|
||||
|
||||
// check foreign windows
|
||||
if not CloseQueryIDEWindows then exit;
|
||||
@ -2938,7 +2937,7 @@ begin
|
||||
end;
|
||||
|
||||
end;
|
||||
Result:=true;
|
||||
Result:=ToolStatus=itNone;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.Notification(AComponent: TComponent; Operation: TOperation);
|
||||
@ -9037,12 +9036,12 @@ var
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
InputHistories.LastConvertDelphiUnit:=DelphiFilename;
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
Result:=DelphiProject2Laz.ConvertDelphiToLazarusUnit(DelphiFilename,[]);
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -9052,12 +9051,12 @@ var
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
InputHistories.LastConvertDelphiProject:=DelphiFilename;
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
Result:=DelphiProject2Laz.ConvertDelphiToLazarusProject(DelphiFilename);
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -9067,12 +9066,12 @@ var
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
InputHistories.LastConvertDelphiPackage:=DelphiFilename;
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
Result:=DelphiProject2Laz.ConvertDelphiToLazarusPackage(DelphiFilename);
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -10564,7 +10563,7 @@ var CompilerUnitSearchPath, CompilerUnitLinks: string;
|
||||
UnitLinksChanged: boolean;
|
||||
TargetOS, TargetProcessor: string;
|
||||
begin
|
||||
FOpenEditorsOnCodeToolChange:=false;
|
||||
OpenEditorsOnCodeToolChange:=false;
|
||||
|
||||
CodeToolBoss.SourceCache.ExpirationTimeInDays:=365;
|
||||
CodeToolBoss.DefineTree.OnGetVirtualDirectoryAlias:=
|
||||
@ -10719,13 +10718,21 @@ procedure TMainIDE.OnBeforeCodeToolBossApplyChanges(Manager: TCodeToolManager;
|
||||
// the CodeToolBoss built a list of Sources that will be modified
|
||||
// 1. open all of them in the source notebook
|
||||
// 2. lock the editors to reduce repaints and undo steps
|
||||
var i: integer;
|
||||
var
|
||||
i: integer;
|
||||
Flags: TOpenFlags;
|
||||
CodeBuf: TCodeBuffer;
|
||||
begin
|
||||
if FOpenEditorsOnCodeToolChange then begin
|
||||
if OpenEditorsOnCodeToolChange then begin
|
||||
// open all sources in editor
|
||||
for i:=0 to Manager.SourceChangeCache.BuffersToModifyCount-1 do begin
|
||||
CodeBuf:=Manager.SourceChangeCache.BuffersToModify[i];
|
||||
//DebugLn(['TMainIDE.OnBeforeCodeToolBossApplyChanges i=',i,' ',CodeBUf.Filename]);
|
||||
Flags:=[ofOnlyIfExists,ofDoNotLoadResource];
|
||||
if CodeBuf.IsVirtual then
|
||||
Include(Flags,ofVirtualFile);
|
||||
if DoOpenEditorFile(Manager.SourceChangeCache.BuffersToModify[i].Filename,
|
||||
-1,[ofOnlyIfExists,ofDoNotLoadResource])<>mrOk then
|
||||
-1,Flags)<>mrOk then
|
||||
begin
|
||||
Abort:=true;
|
||||
exit;
|
||||
@ -11498,8 +11505,8 @@ var
|
||||
CursorXY: TPoint;
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
Result:=mrCancel;
|
||||
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit;
|
||||
@ -11612,7 +11619,7 @@ begin
|
||||
|
||||
Result:=mrOk;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -11658,8 +11665,8 @@ var
|
||||
NewX, NewY, NewTopLine: integer;
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit;
|
||||
{$IFDEF IDE_DEBUG}
|
||||
@ -11683,7 +11690,7 @@ begin
|
||||
DoJumpToCodeToolBossError;
|
||||
end;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -11706,8 +11713,8 @@ begin
|
||||
BlockBegin:=ActiveSrcEdit.EditorComponent.BlockBegin;
|
||||
BlockEnd:=ActiveSrcEdit.EditorComponent.BlockEnd;
|
||||
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
CTResult:=ShowExtractProcDialog(ActiveUnitInfo.Source,BlockBegin,BlockEnd,
|
||||
NewSource,NewX,NewY,NewTopLine)=mrOk;
|
||||
@ -11719,7 +11726,7 @@ begin
|
||||
NewSource,NewX,NewY,NewTopLine,true);
|
||||
end;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -12070,8 +12077,8 @@ begin
|
||||
raise Exception.Create(Format(lisComponentNameIsKeyword, ['"', Newname, '"']
|
||||
));
|
||||
|
||||
OldOpenEditorsOnCodeToolChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldOpenEditorsOnCodeToolChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
|
||||
// check ancestor component
|
||||
@ -12134,7 +12141,7 @@ begin
|
||||
// rename methods
|
||||
RenameMethods;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldOpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=OldOpenEditorsOnCodeToolChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -12750,8 +12757,8 @@ begin
|
||||
writeln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName);
|
||||
DebugLn(['[TMainIDE.OnPropHookCreateMethod] Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]);
|
||||
{$ENDIF}
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
// create published method
|
||||
r:=CodeToolBoss.CreatePublishedMethod(ActiveUnitInfo.Source,
|
||||
@ -12771,7 +12778,7 @@ begin
|
||||
raise Exception.Create(lisUnableToCreateNewMethodPlzFixTheErrorShownIn);
|
||||
end;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -12817,8 +12824,8 @@ begin
|
||||
writeln('');
|
||||
writeln('[TMainIDE.OnPropHookRenameMethod] ************');
|
||||
{$ENDIF}
|
||||
OldChange:=FOpenEditorsOnCodeToolChange;
|
||||
FOpenEditorsOnCodeToolChange:=true;
|
||||
OldChange:=OpenEditorsOnCodeToolChange;
|
||||
OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
// rename/create published method
|
||||
BossResult:=CodeToolBoss.RenamePublishedMethod(ActiveUnitInfo.Source,
|
||||
@ -12846,7 +12853,7 @@ begin
|
||||
+#13#13+lisError+ErrorMsg);
|
||||
end;
|
||||
finally
|
||||
FOpenEditorsOnCodeToolChange:=OldChange;
|
||||
OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -112,13 +112,14 @@ type
|
||||
procedure LoadMenuShortCuts; virtual;
|
||||
function GetToolStatus: TIDEToolStatus; override;
|
||||
procedure SetToolStatus(const AValue: TIDEToolStatus); virtual;
|
||||
|
||||
|
||||
procedure mnuWindowsItemClick(Sender: TObject); virtual;
|
||||
procedure OnMainBarDestroy(Sender: TObject); virtual;
|
||||
|
||||
procedure ConnectOutputFilter;
|
||||
public
|
||||
property ToolStatus: TIDEToolStatus read FToolStatus write SetToolStatus;
|
||||
function DoResetToolStatus(Interactive: boolean): boolean; virtual; abstract;
|
||||
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure StartIDE; virtual; abstract;
|
||||
|
@ -76,6 +76,7 @@ procedure QuickFixUnitNotUsed(Sender: TObject; Step: TIMQuickFixStep;
|
||||
var
|
||||
CodeBuf: TCodeBuffer;
|
||||
UnneededUnitname: String;
|
||||
OldChange: Boolean;
|
||||
begin
|
||||
if Step<>imqfoMenuItem then exit;
|
||||
if not GetMsgLineFilename(Msg,CodeBuf) then exit;
|
||||
@ -87,10 +88,18 @@ begin
|
||||
UnneededUnitname:=REVar(1);
|
||||
|
||||
// remove unit
|
||||
LazarusIDE.SaveSourceEditorChangesToCodeCache(-1);
|
||||
if not CodeToolBoss.RemoveUnitFromAllUsesSections(CodeBuf,UnneededUnitname)
|
||||
then begin
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
if not LazarusIDE.BeginCodeTools then exit;
|
||||
OldChange:=LazarusIDE.OpenEditorsOnCodeToolChange;
|
||||
LazarusIDE.OpenEditorsOnCodeToolChange:=true;
|
||||
try
|
||||
LazarusIDE.SaveSourceEditorChangesToCodeCache(-1);
|
||||
if not CodeToolBoss.RemoveUnitFromAllUsesSections(CodeBuf,UnneededUnitname)
|
||||
then begin
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
exit;
|
||||
end;
|
||||
finally
|
||||
LazarusIDE.OpenEditorsOnCodeToolChange:=OldChange;
|
||||
end;
|
||||
|
||||
// message fixed
|
||||
@ -101,6 +110,7 @@ function GetMsgLineFilename(Msg: TIDEMessageLine; out CodeBuf: TCodeBuffer
|
||||
): boolean;
|
||||
var
|
||||
Filename: String;
|
||||
TestDir: String;
|
||||
begin
|
||||
Result:=false;
|
||||
CodeBuf:=nil;
|
||||
@ -110,6 +120,9 @@ begin
|
||||
end;
|
||||
|
||||
Filename:=Msg.Parts.Values['Filename'];
|
||||
TestDir:=LazarusIDE.GetTestBuildDirectory;
|
||||
if (TestDir<>'') or (FileIsInDirectory(Filename,TestDir)) then
|
||||
Filename:=ExtractFileName(Filename);
|
||||
//DebugLn('GetMsgLineFilename Filename=',Filename,' ',Msg.Parts.Text);
|
||||
CodeBuf:=CodeToolBoss.LoadFile(Filename,false,false);
|
||||
if CodeBuf=nil then begin
|
||||
|
@ -77,7 +77,7 @@ type
|
||||
// Forms
|
||||
FormsAutoCreatedLabel: TLabel;
|
||||
FormsAutoCreatedListBox: TListBox;
|
||||
FormsAvailFormsLabel: TLabel;
|
||||
FormsAvailFormsLabel: TLabel;
|
||||
FormsAvailFormsListBox: TListBox;
|
||||
FormsAddToAutoCreatedFormsBtn: TArrow;
|
||||
FormsRemoveFromAutoCreatedFormsBtn: TArrow;
|
||||
@ -233,6 +233,7 @@ begin
|
||||
Caption := dlgProjectOptions;
|
||||
OKButton.Caption:=lisOkBtn;
|
||||
CancelButton.Caption:=dlgCancel;
|
||||
HelpButton.Caption:=lisMenuHelp;
|
||||
|
||||
NoteBook.PageIndex := 0;
|
||||
|
||||
|
@ -179,8 +179,8 @@ type
|
||||
procedure UserCommandProcessed(Sender: TObject;
|
||||
var Command: TSynEditorCommand; var AChar: TUTF8Char; Data: pointer);
|
||||
procedure ccAddMessage(Texts: String);
|
||||
function AutoCompleteLineBreak: boolean;
|
||||
function AutoCompleteSpace: boolean;
|
||||
function AutoCompleteChar(Char: TUTF8Char; var AddChar: boolean;
|
||||
Category: TAutoCompleteOption): boolean;
|
||||
|
||||
procedure FocusEditor;// called by TSourceNotebook when the Notebook page
|
||||
// changes so the editor is focused
|
||||
@ -1335,6 +1335,8 @@ Procedure TSourceEditor.ProcessCommand(Sender: TObject;
|
||||
// these are normal commands for synedit (lower than ecUserFirst),
|
||||
// define extra actions here
|
||||
// for non synedit keys (bigger than ecUserFirst) use ProcessUserCommand
|
||||
var
|
||||
AddChar: Boolean;
|
||||
begin
|
||||
//DebugLn('TSourceEditor.ProcessCommand Command=',dbgs(Command));
|
||||
|
||||
@ -1401,25 +1403,30 @@ begin
|
||||
|
||||
ecChar:
|
||||
begin
|
||||
if aChar=' ' then begin
|
||||
if AutoCompleteSpace then begin
|
||||
// do not set Command to ecNone, because the space should be inserted
|
||||
end;
|
||||
end;
|
||||
//debugln('TSourceEditor.ProcessCommand AChar="',AChar,'" AutoIdentifierCompletion=',dbgs(EditorOpts.AutoIdentifierCompletion),' Interval=',dbgs(SourceCompletionTimer.Interval), Dbgs(FEditor.CaretXY));
|
||||
if (Command=ecChar) and EditorOpts.AutoIdentifierCompletion then begin
|
||||
AddChar:=true;
|
||||
//debugln(['TSourceEditor.ProcessCommand AChar="',AChar,'" AutoIdentifierCompletion=',dbgs(EditorOpts.AutoIdentifierCompletion),' Interval=',SourceCompletionTimer.Interval,' ',Dbgs(FEditor.CaretXY),' ',FEditor.IsIdentChar(aChar)]);
|
||||
if (aChar=' ') and AutoCompleteChar(aChar,AddChar,acoSpace) then begin
|
||||
// completed
|
||||
end else if (not FEditor.IsIdentChar(aChar))
|
||||
and AutoCompleteChar(aChar,AddChar,acoWordEnd) then begin
|
||||
// completed
|
||||
end else if EditorOpts.AutoIdentifierCompletion then begin
|
||||
// store caret position to detect caret changes
|
||||
SourceCompletionCaretXY:=FEditor.CaretXY;
|
||||
// add the char
|
||||
inc(SourceCompletionCaretXY.x,length(AChar));
|
||||
SourceCompletionTimer.AutoEnabled:=true;
|
||||
end;
|
||||
//DebugLn(['TSourceEditor.ProcessCommand AddCHar=',AddCHar]);
|
||||
if not AddChar then Command:=ecNone;
|
||||
end;
|
||||
|
||||
ecLineBreak:
|
||||
if AutoCompleteLineBreak then
|
||||
Command:=ecNone;
|
||||
|
||||
begin
|
||||
AddChar:=true;
|
||||
if AutoCompleteChar(aChar,AddChar,acoLineBreak) then ;
|
||||
if not AddChar then Command:=ecNone;
|
||||
end;
|
||||
end;
|
||||
//debugln('TSourceEditor.ProcessCommand B IdentCompletionTimer.AutoEnabled=',dbgs(SourceCompletionTimer.AutoEnabled));
|
||||
end;
|
||||
@ -2096,47 +2103,32 @@ Begin
|
||||
ErrorMsgs.Add(Texts);
|
||||
End;
|
||||
|
||||
function TSourceEditor.AutoCompleteLineBreak: boolean;
|
||||
function TSourceEditor.AutoCompleteChar(Char: TUTF8Char; var AddChar: boolean;
|
||||
Category: TAutoCompleteOption): boolean;
|
||||
var
|
||||
AToken: String;
|
||||
i: Integer;
|
||||
p: TPoint;
|
||||
Line: String;
|
||||
CatName: String;
|
||||
SrcToken: String;
|
||||
begin
|
||||
Result:=false;
|
||||
Line:=GetLineText;
|
||||
p:=GetCursorTextXY;
|
||||
if (p.x>length(Line)+1) or (Line='') then exit;
|
||||
CatName:=AutoCompleteOptionNames[Category];
|
||||
for i:=0 to FCodeTemplates.Completions.Count-1 do begin
|
||||
AToken:=FCodeTemplates.Completions[i];
|
||||
if (AnsiCompareText(AToken,copy(Line,length(Line)-length(AToken)+1,length(AToken)))=0)
|
||||
and (FCodeTemplates.CompletionAttributes[i].IndexOfName(CodeTemplateAutoOnLineBreak)>=0)
|
||||
then begin
|
||||
Result:=true;
|
||||
FCodeTemplates.ExecuteCompletion(AToken,FEditor);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSourceEditor.AutoCompleteSpace: boolean;
|
||||
var
|
||||
AToken: String;
|
||||
i: Integer;
|
||||
p: TPoint;
|
||||
Line: String;
|
||||
begin
|
||||
Result:=false;
|
||||
Line:=GetLineText;
|
||||
p:=GetCursorTextXY;
|
||||
if (p.x>length(Line)+1) or (Line='') then exit;
|
||||
for i:=0 to FCodeTemplates.Completions.Count-1 do begin
|
||||
AToken:=FCodeTemplates.Completions[i];
|
||||
if (AnsiCompareText(AToken,copy(Line,length(Line)-length(AToken)+1,length(AToken)))=0)
|
||||
and (FCodeTemplates.CompletionAttributes[i].IndexOfName(CodeTemplateAutoOnSpace)>=0)
|
||||
SrcToken:=copy(Line,length(Line)-length(AToken)+1,length(AToken));
|
||||
//DebugLn(['TSourceEditor.AutoCompleteChar ',AToken,' SrcToken=',SrcToken,' CatName=',CatName,' Index=',FCodeTemplates.CompletionAttributes[i].IndexOfName(CatName)]);
|
||||
if (AnsiCompareText(AToken,SrcToken)=0)
|
||||
and (FCodeTemplates.CompletionAttributes[i].IndexOfName(CatName)>=0)
|
||||
then begin
|
||||
Result:=true;
|
||||
FCodeTemplates.ExecuteCompletion(AToken,FEditor);
|
||||
AddChar:=FCodeTemplates.CompletionAttributes[i].IndexOfName(
|
||||
AutoCompleteOptionNames[acoAddChar])>=0;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
@ -127,6 +127,7 @@ type
|
||||
private
|
||||
FLazarusIDEHandlers: array[TLazarusIDEHandlerType] of TMethodList;
|
||||
FMainBarSubTitle: string;
|
||||
FOpenEditorsOnCodeToolChange: boolean;
|
||||
procedure AddHandler(HandlerType: TLazarusIDEHandlerType;
|
||||
const AMethod: TMethod; AsLast: boolean = false);
|
||||
procedure RemoveHandler(HandlerType: TLazarusIDEHandlerType;
|
||||
@ -197,6 +198,9 @@ type
|
||||
function BeginCodeTools: boolean; virtual; abstract;
|
||||
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
||||
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract;
|
||||
property OpenEditorsOnCodeToolChange: boolean
|
||||
read FOpenEditorsOnCodeToolChange
|
||||
write FOpenEditorsOnCodeToolChange;
|
||||
|
||||
// progress and error messages
|
||||
function ShowProgress(const SomeText: string;
|
||||
|
@ -2020,7 +2020,7 @@ end;
|
||||
|
||||
function TOICustomPropertyGrid.TopMax:integer;
|
||||
begin
|
||||
Result:=GridHeight-ClientHeight+2*BorderWidth;
|
||||
Result:=GridHeight-ClientHeight+2*integer(BorderWidth);
|
||||
if Result<0 then Result:=0;
|
||||
end;
|
||||
|
||||
|
@ -17,7 +17,7 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
published
|
||||
property Caption;
|
||||
property Caption stored true;// the translation of the IDE at designtime is used default item
|
||||
property Enabled;
|
||||
property Font;
|
||||
property Glyph;
|
||||
|
@ -831,6 +831,7 @@ type
|
||||
property Align;
|
||||
property Anchors;
|
||||
property AutoFill;
|
||||
property AutoSize;
|
||||
property BorderSpacing;
|
||||
property Caption;
|
||||
property ChildSizing;
|
||||
|
@ -348,6 +348,7 @@ var
|
||||
CurFilename: String;
|
||||
FileIsValid: boolean;
|
||||
begin
|
||||
//DebugLn(['TOpenPictureDialog.UpdatePreview ']);
|
||||
CurFilename := FileName;
|
||||
if CurFilename = FPreviewFilename then exit;
|
||||
|
||||
|
@ -303,7 +303,7 @@ type
|
||||
procedure ChangeDependency(Dependency, NewDependency: TPkgDependency);
|
||||
function OpenDependency(Dependency: TPkgDependency): TLoadPackageResult;
|
||||
procedure OpenInstalledDependency(Dependency: TPkgDependency;
|
||||
InstallType: TPackageInstallType);
|
||||
InstallType: TPackageInstallType; var Quiet: boolean);
|
||||
procedure OpenRequiredDependencyList(FirstDependency: TPkgDependency);
|
||||
procedure MoveRequiredDependencyUp(ADependency: TPkgDependency);
|
||||
procedure MoveRequiredDependencyDown(ADependency: TPkgDependency);
|
||||
@ -3395,9 +3395,10 @@ begin
|
||||
end;
|
||||
|
||||
procedure TLazPackageGraph.OpenInstalledDependency(Dependency: TPkgDependency;
|
||||
InstallType: TPackageInstallType);
|
||||
InstallType: TPackageInstallType; var Quiet: boolean);
|
||||
var
|
||||
BrokenPackage: TLazPackage;
|
||||
CurResult: TModalResult;
|
||||
begin
|
||||
OpenDependency(Dependency);
|
||||
if Dependency.LoadPackageResult<>lprSuccess then begin
|
||||
@ -3429,11 +3430,15 @@ begin
|
||||
AddPackage(BrokenPackage);
|
||||
DebugLn('TLazPackageGraph.OpenInstalledDependency ',BrokenPackage.IDAsString,' ',dbgs(ord(BrokenPackage.AutoInstall)));
|
||||
|
||||
// tell the user
|
||||
MessageDlg(lisPkgSysPackageFileNotFound,
|
||||
Format(lisPkgSysThePackageIsInstalledButNoValidPackageFileWasFound, ['"',
|
||||
BrokenPackage.Name, '"', #13]),
|
||||
mtError,[mbOk],0);
|
||||
if not Quiet then begin
|
||||
// tell the user
|
||||
CurResult:=QuestionDlg(lisPkgSysPackageFileNotFound,
|
||||
Format(lisPkgSysThePackageIsInstalledButNoValidPackageFileWasFound, ['"',
|
||||
BrokenPackage.Name, '"', #13]),
|
||||
mtError,[mrOk,mrYesToAll,'Skip these warnings'],0);
|
||||
if CurResult=mrYesToAll then
|
||||
Quiet:=true;
|
||||
end;
|
||||
|
||||
// open it
|
||||
if OpenDependency(Dependency)<>lprSuccess then
|
||||
|
@ -169,7 +169,7 @@ type
|
||||
procedure LoadStaticBasePackages;
|
||||
procedure LoadStaticCustomPackages;
|
||||
function LoadInstalledPackage(const PackageName: string;
|
||||
AddToAutoInstall: boolean): TLazPackage;
|
||||
AddToAutoInstall: boolean; var Quiet: boolean): TLazPackage;
|
||||
procedure LoadAutoInstallPackages;
|
||||
procedure SortAutoInstallDependencies;
|
||||
procedure AddUnitToProjectMainUsesSection(AProject: TProject;
|
||||
@ -586,6 +586,7 @@ var
|
||||
PkgList: TFPList;
|
||||
i: Integer;
|
||||
APackage: TLazPackage;
|
||||
CurResult: TModalResult;
|
||||
begin
|
||||
Ok:=false;
|
||||
PkgList:=nil;
|
||||
@ -604,12 +605,15 @@ begin
|
||||
if (APackage.PackageType=lptRunTime)
|
||||
and (APackage.FirstUsedByDependency=nil) then begin
|
||||
// this is a runtime only package, not needed by any other package
|
||||
if IDEMessageDialog(lisPkgMangPackageIsNoDesigntimePackage,
|
||||
CurResult:=IDEQuestionDialog(lisPkgMangPackageIsNoDesigntimePackage,
|
||||
Format(lisPkgMangThePackageIsARuntimeOnlyPackageRuntimeOnlyPackages, [
|
||||
APackage.IDAsString, #13]),
|
||||
mtWarning,[mbIgnore,mbCancel])<>mrIgnore
|
||||
then
|
||||
exit;
|
||||
mtWarning,[mrIgnore,mrYesToAll,'Ignore all',mrCancel]);
|
||||
case CurResult of
|
||||
mrIgnore: ;
|
||||
mrYesToAll: break;
|
||||
else exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1572,9 +1576,11 @@ var
|
||||
StaticPackage: PRegisteredPackage;
|
||||
i: Integer;
|
||||
APackage: TLazPackage;
|
||||
Quiet: Boolean;
|
||||
begin
|
||||
StaticPackages:=LazarusPackageIntf.RegisteredPackages;
|
||||
if StaticPackages=nil then exit;
|
||||
Quiet:=false;
|
||||
for i:=0 to StaticPackages.Count-1 do begin
|
||||
StaticPackage:=PRegisteredPackage(StaticPackages[i]);
|
||||
|
||||
@ -1595,7 +1601,8 @@ begin
|
||||
|
||||
// load package
|
||||
APackage:=LoadInstalledPackage(StaticPackage^.Name,
|
||||
{$IFDEF BigIDE}True{$ELSE}False{$ENDIF});
|
||||
{$IFDEF BigIDE}True{$ELSE}False{$ENDIF},
|
||||
Quiet);
|
||||
|
||||
// register
|
||||
PackageGraph.RegisterStaticPackage(APackage,StaticPackage^.RegisterProc);
|
||||
@ -1605,16 +1612,16 @@ begin
|
||||
end;
|
||||
|
||||
function TPkgManager.LoadInstalledPackage(const PackageName: string;
|
||||
AddToAutoInstall: boolean): TLazPackage;
|
||||
AddToAutoInstall: boolean; var Quiet: boolean): TLazPackage;
|
||||
var
|
||||
NewDependency: TPkgDependency;
|
||||
PackageList: TStringList;
|
||||
begin
|
||||
//DebugLn('TPkgManager.LoadInstalledPackage PackageName="',PackageName,'"');
|
||||
//DebugLn('TPkgManager.LoadInstalledPackage PackageName="',PackageName,'" Quiet=',Quiet);
|
||||
NewDependency:=TPkgDependency.Create;
|
||||
NewDependency.Owner:=Self;
|
||||
NewDependency.PackageName:=PackageName;
|
||||
PackageGraph.OpenInstalledDependency(NewDependency,pitStatic);
|
||||
PackageGraph.OpenInstalledDependency(NewDependency,pitStatic,Quiet);
|
||||
Result:=NewDependency.RequiredPackage;
|
||||
if AddToAutoInstall and (Result<>nil) then begin
|
||||
NewDependency.AddToList(FirstAutoInstallDependency,pdlRequires);
|
||||
@ -3323,6 +3330,8 @@ var
|
||||
BuildIDEFlags: TBuildLazarusFlags;
|
||||
Msg: string;
|
||||
begin
|
||||
if not MainIDE.DoResetToolStatus(true) then exit(mrCancel);
|
||||
|
||||
PackageGraph.BeginUpdate(true);
|
||||
PkgList:=nil;
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user