diff --git a/.gitattributes b/.gitattributes index b26ee55f3a..2d7c40e9b3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -917,6 +917,8 @@ ide/diffdialog.lfm svneol=native#text/plain ide/diffdialog.lrs svneol=native#text/plain ide/diffdialog.pas svneol=native#text/pascal ide/diffpatch.pas svneol=native#text/pascal +ide/diskdiffsdialog.lfm svneol=native#text/plain +ide/diskdiffsdialog.lrs svneol=native#text/pascal ide/diskdiffsdialog.pas svneol=native#text/pascal ide/editdefinetree.pas svneol=native#text/pascal ide/editoroptions.lfm svneol=native#text/plain diff --git a/ide/diskdiffsdialog.lfm b/ide/diskdiffsdialog.lfm new file mode 100644 index 0000000000..9a32c60f66 --- /dev/null +++ b/ide/diskdiffsdialog.lfm @@ -0,0 +1,413 @@ +object DiskDiffsDlg: TDiskDiffsDlg + ActiveControl = IgnoreDiskChangesButton + Caption = 'DiskDiffsDlg' + ClientHeight = 300 + ClientWidth = 600 + OnKeyDown = DiskDiffsDlgKeyDown + PixelsPerInch = 96 + Position = poScreenCenter + HorzScrollBar.Page = 599 + VertScrollBar.Page = 299 + Left = 340 + Height = 300 + Top = 635 + Width = 600 + object IgnoreDiskChangesButton: TButton + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Right = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'IgnoreDiskChangesButton' + ModalResult = 5 + TabOrder = 0 + AnchorSideRight.Control = RevertAllButton + Left = 342 + Height = 29 + Top = 264 + Width = 148 + end + object RevertAllButton: TButton + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.InnerBorder = 2 + Caption = 'RevertAllButton' + Default = True + ModalResult = 10 + TabOrder = 1 + Left = 496 + Height = 29 + Top = 264 + Width = 98 + end + object FilesListBox: TListBox + Align = alTop + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + OnMouseUp = FilesListBoxMouseUp + TabOrder = 2 + Left = 6 + Height = 86 + Top = 6 + Width = 594 + end + object DiffSynEdit: TSynEdit + Align = alTop + BorderSpacing.Left = 6 + BorderSpacing.Right = 6 + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -12 + Font.Name = 'courier' + Height = 159 + Name = 'DiffSynEdit' + ParentColor = False + TabOrder = 3 + Width = 588 + BookMarkOptions.Xoffset = -18 + BookMarkOptions.OnChange = nil + Gutter.Visible = False + Gutter.OnChange = nil + Gutter.CodeFoldingWidth = 14 + Keystrokes = < + item + Command = 3 + ShortCut = 38 + end + item + Command = 103 + ShortCut = 8230 + end + item + Command = 211 + ShortCut = 16422 + end + item + Command = 4 + ShortCut = 40 + end + item + Command = 104 + ShortCut = 8232 + end + item + Command = 212 + ShortCut = 16424 + end + item + Command = 1 + ShortCut = 37 + end + item + Command = 101 + ShortCut = 8229 + end + item + Command = 5 + ShortCut = 16421 + end + item + Command = 105 + ShortCut = 24613 + end + item + Command = 2 + ShortCut = 39 + end + item + Command = 102 + ShortCut = 8231 + end + item + Command = 6 + ShortCut = 16423 + end + item + Command = 106 + ShortCut = 24615 + end + item + Command = 10 + ShortCut = 34 + end + item + Command = 110 + ShortCut = 8226 + end + item + Command = 14 + ShortCut = 16418 + end + item + Command = 114 + ShortCut = 24610 + end + item + Command = 9 + ShortCut = 33 + end + item + Command = 109 + ShortCut = 8225 + end + item + Command = 13 + ShortCut = 16417 + end + item + Command = 113 + ShortCut = 24609 + end + item + Command = 7 + ShortCut = 36 + end + item + Command = 107 + ShortCut = 8228 + end + item + Command = 15 + ShortCut = 16420 + end + item + Command = 115 + ShortCut = 24612 + end + item + Command = 8 + ShortCut = 35 + end + item + Command = 108 + ShortCut = 8227 + end + item + Command = 16 + ShortCut = 16419 + end + item + Command = 116 + ShortCut = 24611 + end + item + Command = 223 + ShortCut = 45 + end + item + Command = 201 + ShortCut = 16429 + end + item + Command = 604 + ShortCut = 8237 + end + item + Command = 502 + ShortCut = 46 + end + item + Command = 603 + ShortCut = 8238 + end + item + Command = 501 + ShortCut = 8 + end + item + Command = 501 + ShortCut = 8200 + end + item + Command = 504 + ShortCut = 16392 + end + item + Command = 601 + ShortCut = 32776 + end + item + Command = 602 + ShortCut = 40968 + end + item + Command = 509 + ShortCut = 13 + end + item + Command = 199 + ShortCut = 16449 + end + item + Command = 201 + ShortCut = 16451 + end + item + Command = 610 + ShortCut = 24649 + end + item + Command = 509 + ShortCut = 16461 + end + item + Command = 510 + ShortCut = 16462 + end + item + Command = 503 + ShortCut = 16468 + end + item + Command = 611 + ShortCut = 24661 + end + item + Command = 604 + ShortCut = 16470 + end + item + Command = 603 + ShortCut = 16472 + end + item + Command = 507 + ShortCut = 16473 + end + item + Command = 506 + ShortCut = 24665 + end + item + Command = 601 + ShortCut = 16474 + end + item + Command = 602 + ShortCut = 24666 + end + item + Command = 301 + ShortCut = 16432 + end + item + Command = 302 + ShortCut = 16433 + end + item + Command = 303 + ShortCut = 16434 + end + item + Command = 304 + ShortCut = 16435 + end + item + Command = 305 + ShortCut = 16436 + end + item + Command = 306 + ShortCut = 16437 + end + item + Command = 307 + ShortCut = 16438 + end + item + Command = 308 + ShortCut = 16439 + end + item + Command = 309 + ShortCut = 16440 + end + item + Command = 310 + ShortCut = 16441 + end + item + Command = 351 + ShortCut = 24624 + end + item + Command = 352 + ShortCut = 24625 + end + item + Command = 353 + ShortCut = 24626 + end + item + Command = 354 + ShortCut = 24627 + end + item + Command = 355 + ShortCut = 24628 + end + item + Command = 356 + ShortCut = 24629 + end + item + Command = 357 + ShortCut = 24630 + end + item + Command = 358 + ShortCut = 24631 + end + item + Command = 359 + ShortCut = 24632 + end + item + Command = 360 + ShortCut = 24633 + end + item + Command = 231 + ShortCut = 24654 + end + item + Command = 232 + ShortCut = 24643 + end + item + Command = 233 + ShortCut = 24652 + end + item + Command = 612 + ShortCut = 9 + end + item + Command = 613 + ShortCut = 8201 + end + item + Command = 250 + ShortCut = 24642 + end> + Lines.Strings = ( + 'DiffSynEdit' + ) + ReadOnly = True + SelectedColor.OnChange = nil + Cursor = crIBeam + Left = 6 + Height = 159 + Top = 97 + Width = 588 + end + object Splitter: TSplitter + Align = alTop + Cursor = crVSplit + Height = 5 + Width = 600 + ResizeAnchor = akTop + Cursor = crVSplit + Height = 5 + Top = 92 + Width = 600 + end +end diff --git a/ide/diskdiffsdialog.lrs b/ide/diskdiffsdialog.lrs new file mode 100644 index 0000000000..1b7ba6079f --- /dev/null +++ b/ide/diskdiffsdialog.lrs @@ -0,0 +1,73 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TDiskDiffsDlg','FORMDATA',[ + 'TPF0'#13'TDiskDiffsDlg'#12'DiskDiffsDlg'#13'ActiveControl'#7#23'IgnoreDiskCh' + +'angesButton'#7'Caption'#6#12'DiskDiffsDlg'#12'ClientHeight'#3','#1#11'Clien' + +'tWidth'#3'X'#2#9'OnKeyDown'#7#19'DiskDiffsDlgKeyDown'#13'PixelsPerInch'#2'`' + +#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3'W'#2#18'VertScrol' + +'lBar.Page'#3'+'#1#4'Left'#3'T'#1#6'Height'#3','#1#3'Top'#3'{'#2#5'Width'#3 + +'X'#2#0#7'TButton'#23'IgnoreDiskChangesButton'#7'Anchors'#11#7'akRight'#8'ak' + +'Bottom'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#25'BorderSpacing.InnerB' + +'order'#2#2#7'Caption'#6#23'IgnoreDiskChangesButton'#11'ModalResult'#2#5#8'T' + +'abOrder'#2#0#23'AnchorSideRight.Control'#7#15'RevertAllButton'#4'Left'#3'V' + +#1#6'Height'#2#29#3'Top'#3#8#1#5'Width'#3#148#0#0#0#7'TButton'#15'RevertAllB' + +'utton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacin' + +'g.InnerBorder'#2#2#7'Caption'#6#15'RevertAllButton'#7'Default'#9#11'ModalRe' + +'sult'#2#10#8'TabOrder'#2#1#4'Left'#3#240#1#6'Height'#2#29#3'Top'#3#8#1#5'Wi' + +'dth'#2'b'#0#0#8'TListBox'#12'FilesListBox'#5'Align'#7#5'alTop'#18'BorderSpa' + +'cing.Left'#2#6#17'BorderSpacing.Top'#2#6#9'OnMouseUp'#7#19'FilesListBoxMous' + +'eUp'#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#2'V'#3'Top'#2#6#5'Width'#3'R'#2#0 + +#0#8'TSynEdit'#11'DiffSynEdit'#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#6 + +#19'BorderSpacing.Right'#2#6#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'a' + +'kBottom'#0#11'Font.Height'#2#244#9'Font.Name'#6#7'courier'#6'Height'#3#159#0 + +#4'Name'#6#11'DiffSynEdit'#11'ParentColor'#8#8'TabOrder'#2#3#5'Width'#3'L'#2 + +#23'BookMarkOptions.Xoffset'#2#238#24'BookMarkOptions.OnChange'#13#14'Gutter' + +'.Visible'#8#15'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2#14#10'Keys' + +'trokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut' + +#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCu' + +'t'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'Shor' + +'tCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'Short' + +'Cut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'Short' + +'Cut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'Short' + +'Cut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'Sho' + +'rtCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'Sh' + +'ortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'S' + +'hortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'Sh' + +'ortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'S' + +'hortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'Sh' + +'ortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'S' + +'hortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'Sh' + +'ortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'S' + +'hortCut'#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#11'DiffSynEdit'#0#8'ReadOnly'#9#22'SelectedColor.' + +'OnChange'#13#6'Cursor'#7#7'crIBeam'#4'Left'#2#6#6'Height'#3#159#0#3'Top'#2 + +'a'#5'Width'#3'L'#2#0#0#9'TSplitter'#8'Splitter'#5'Align'#7#5'alTop'#6'Curso' + +'r'#7#8'crVSplit'#6'Height'#2#5#5'Width'#3'X'#2#12'ResizeAnchor'#7#5'akTop'#6 + +'Cursor'#7#8'crVSplit'#6'Height'#2#5#3'Top'#2'\'#5'Width'#3'X'#2#0#0#0 +]); diff --git a/ide/diskdiffsdialog.pas b/ide/diskdiffsdialog.pas index a66c10a634..464336511a 100644 --- a/ide/diskdiffsdialog.pas +++ b/ide/diskdiffsdialog.pas @@ -34,7 +34,7 @@ interface uses Classes, SysUtils, Forms, Controls, Buttons, StdCtrls, LResources, Project, - SynEdit, LCLType, DiffPatch, LazarusIDEStrConsts; + SynEdit, LCLType, DiffPatch, LazarusIDEStrConsts, ComCtrls, ExtCtrls; type PDiffItem = ^TDiffItem; @@ -45,18 +45,18 @@ type TxtOnDisk: string; end; + { TDiskDiffsDlg } + TDiskDiffsDlg = class(TForm) - MainGroupBox: TGroupBox; - FilesListBox: TListBox; DiffSynEdit: TSynEdit; + FilesListBox: TListBox; RevertAllButton: TButton; IgnoreDiskChangesButton: TButton; + Splitter: TSplitter; procedure DiskDiffsDlgKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure DiskDiffsDlgResize(Sender: TObject); procedure FilesListBoxMouseUp(Sender: TOBject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure MainGroupBoxResize(Sender: TObject); private FUnitList: TList; FCachedDiffs: TList; // List of PDiffItem @@ -71,15 +71,12 @@ type destructor Destroy; override; end; - -var DiskDiffsDlg: TDiskDiffsDlg; - - function ShowDiskDiffsDialog(AnUnitList: TList): TModalResult; - implementation +var + DiskDiffsDlg: TDiskDiffsDlg = nil; function ShowDiskDiffsDialog(AnUnitList: TList): TModalResult; begin @@ -94,7 +91,6 @@ begin DiskDiffsDlg:=nil; end; - { TDiskDiffsDlg } procedure TDiskDiffsDlg.DiskDiffsDlgKeyDown(Sender: TObject; var Key: Word; @@ -104,37 +100,12 @@ begin ModalResult:=mrCancel; end; -procedure TDiskDiffsDlg.DiskDiffsDlgResize(Sender: TObject); -begin - with MainGroupBox do begin - Width:=Self.ClientWidth-2*Left; - Height:=Self.ClientHeight-50-Top; - end; - - with RevertAllButton do begin - Top:=Self.ClientHeight-40; - end; - - with IgnoreDiskChangesButton do begin - Left:=RevertAllButton.Left+RevertAllButton.Width+10; - Top:=RevertAllButton.Top; - end; -end; - procedure TDiskDiffsDlg.FilesListBoxMouseUp(Sender: TOBject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ShowDiff; end; -procedure TDiskDiffsDlg.MainGroupBoxResize(Sender: TObject); -begin - with DiffSynEdit do begin - Width:=MainGroupBox.ClientWidth; - Height:=MainGroupBox.ClientHeight-Top; - end; -end; - procedure TDiskDiffsDlg.FillFilesListBox; var i: integer; begin @@ -213,75 +184,11 @@ end; constructor TDiskDiffsDlg.Create(TheOwner: TComponent); begin inherited Create(TheOwner); - if LazarusResources.Find(ClassName)=nil then begin - Caption:=lisDiskDiffSomeFilesHaveChangedOnDisk; - Position:=poScreenCenter; - Width:=600; - Height:=300; - - MainGroupBox:=TGroupBox.Create(Self); - with MainGroupBox do begin - Name:='MainGroupBox'; - Parent:=Self; - Left:=5; - Top:=5; - Width:=Self.ClientWidth-2*Left; - Height:=Self.ClientHeight-50-Top; - Caption:=lisDiskDiffChangedFiles; - OnResize:=@MainGroupBoxResize; - end; - - FilesListBox:=TListBox.Create(Self); - with FilesListBox do begin - Name:='FilesListBox'; - Parent:=MainGroupBox; - Left:=0; - Top:=0; - Height:=60; - Align:=alTop; - OnMouseUp:=@FilesListBoxMouseUp; - end; - - DiffSynEdit:=TSynEdit.Create(Self); - with DiffSynEdit do begin - Name:='DiffSynEdit'; - Parent:=MainGroupBox; - Left:=0; - Top:=FilesListBox.Height+2; - Width:=MainGroupBox.ClientWidth; - Height:=MainGroupBox.ClientHeight-Top; - ReadOnly:=true; - Gutter.Visible:=false; - Lines.Text:=lisDiskDiffClickOnOneOfTheAboveItemsToSeeTheDiff; - end; - - RevertAllButton:=TButton.Create(Self); - with RevertAllButton do begin - Name:='RevertAllButton'; - Parent:=Self; - Left:=50; - Top:=Self.ClientHeight-40; - AutoSize:=true; - Caption:=lisDiskDiffRevertAll; - ModalResult:=mrYesToAll; - Default:=true; - end; - - IgnoreDiskChangesButton:=TButton.Create(Self); - with IgnoreDiskChangesButton do begin - Name:='IgnoreDiskChangesButton'; - Parent:=Self; - Left:=RevertAllButton.Left+RevertAllButton.Width+10; - Top:=RevertAllButton.Top; - AutoSize:=true; - AnchorToNeighbour(akLeft,10,RevertAllButton); - Caption:=lisDiskDiffIgnoreDiskChanges; - ModalResult:=mrIgnore; - end; - OnResize:=@DiskDiffsDlgResize; - OnKeyDown:=@DiskDiffsDlgKeyDown; - end; + Caption:=lisDiskDiffSomeFilesHaveChangedOnDisk; + DiffSynEdit.Lines.Text:=lisDiskDiffClickOnOneOfTheAboveItemsToSeeTheDiff; + RevertAllButton.Caption:=lisDiskDiffRevertAll; + IgnoreDiskChangesButton.Caption:=lisDiskDiffIgnoreDiskChanges; end; destructor TDiskDiffsDlg.Destroy; @@ -292,7 +199,7 @@ begin end; initialization - DiskDiffsDlg:=nil; + {$I diskdiffsdialog.lrs} end.