From b5b8a102632244ec36e504dfa99e625b392768d1 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 15 Oct 2012 16:41:10 +0000 Subject: [PATCH] SynEdit: formatting git-svn-id: trunk@39092 - --- components/synedit/synedit.pp | 50 ++++++++++---------------- components/synedit/syneditmousecmds.pp | 2 +- ide/main.pp | 33 ++++++----------- 3 files changed, 30 insertions(+), 55 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index a7e27cb4c7..850084ebbb 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -623,8 +623,7 @@ type function GetBracketMatchColor : TSynSelectedColor; function GetMouseLinkColor : TSynSelectedColor; function GetTrimSpaceType: TSynEditStringTrimmingType; - procedure SetBracketHighlightStyle( - const AValue: TSynEditBracketHighlightStyle); + procedure SetBracketHighlightStyle(const AValue: TSynEditBracketHighlightStyle); procedure SetOnGutterClick(const AValue : TGutterClickEvent); procedure SetSelectedColor(const AValue : TSynSelectedColor); procedure SetSpecialLineColors(const AValue : TSpecialLineColorsEvent); @@ -967,8 +966,7 @@ type function ScreenRowToRow(ScreenRow: integer; LimitToLines: Boolean = True): integer; function RowToScreenRow(PhysicalRow: integer): integer; - procedure Notification(AComponent: TComponent; - Operation: TOperation); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure RegisterCommandHandler(AHandlerProc: THookedCommandEvent; AHandlerData: pointer; AFlags: THookedCommandFlags = [hcfPreExec, hcfPostExec]); procedure UnregisterCommandHandler(AHandlerProc: THookedCommandEvent); @@ -1031,8 +1029,7 @@ type property LeftChar: Integer read GetLeftChar write SetLeftChar; property LineHeight: integer read GetLineHeight; property LinesInWindow: Integer read GetLinesInWindow; - property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar - default 1024; + property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar default 1024; property TopLine: Integer read GetTopLine write SetTopLine; property UseIncrementalColor : Boolean write SetUseIncrementalColor; @@ -1049,10 +1046,8 @@ type property Plugin[Index: Integer]: TLazSynEditPlugin read GetPlugin; function MarkupCount: Integer; property Markup[Index: integer]: TSynEditMarkup read GetMarkup; - property MarkupByClass[Index: TSynEditMarkupClass]: TSynEditMarkup - read GetMarkupByClass; - property TrimSpaceType: TSynEditStringTrimmingType - read GetTrimSpaceType write SetTrimSpaceType; + property MarkupByClass[Index: TSynEditMarkupClass]: TSynEditMarkup read GetMarkupByClass; + property TrimSpaceType: TSynEditStringTrimmingType read GetTrimSpaceType write SetTrimSpaceType; public // Caret property InsertCaret: TSynEditCaretType read FInsertCaret write SetInsertCaret default ctVerticalLine; @@ -1082,21 +1077,16 @@ type property Highlighter: TSynCustomHighlighter read fHighlighter write SetHighlighter; property Gutter: TSynGutter read FLeftGutter write SetGutter; property RightGutter: TSynGutter read FRightGutter write SetRightGutter; - property InsertMode: boolean read fInserting write SetInsertMode - default true; - property Keystrokes: TSynEditKeyStrokes - read FKeystrokes write SetKeystrokes; - property MouseActions: TSynEditMouseActions - read GetMouseActions write SetMouseActions; - property MouseTextActions: TSynEditMouseActions - read GetMouseTextActions write SetMouseTextActions; - property MouseSelActions: TSynEditMouseActions // Mouseactions, if mouse is over selection => fallback to normal - read GetMouseSelActions write SetMouseSelActions; + property InsertMode: boolean read fInserting write SetInsertMode default true; + property Keystrokes: TSynEditKeyStrokes read FKeystrokes write SetKeystrokes; + property MouseActions: TSynEditMouseActions read GetMouseActions write SetMouseActions; + property MouseTextActions: TSynEditMouseActions read GetMouseTextActions write SetMouseTextActions; + // Mouseactions, if mouse is over selection => fallback to normal + property MouseSelActions: TSynEditMouseActions read GetMouseSelActions write SetMouseSelActions; property MaxUndo: Integer read GetMaxUndo write SetMaxUndo default 1024; - property Options: TSynEditorOptions read FOptions write SetOptions // See SYNEDIT_UNIMPLEMENTED_OPTIONS for deprecated Values - default SYNEDIT_DEFAULT_OPTIONS; - property Options2: TSynEditorOptions2 read FOptions2 write SetOptions2 - default SYNEDIT_DEFAULT_OPTIONS2; + // See SYNEDIT_UNIMPLEMENTED_OPTIONS for deprecated Values + property Options: TSynEditorOptions read FOptions write SetOptions default SYNEDIT_DEFAULT_OPTIONS; + property Options2: TSynEditorOptions2 read FOptions2 write SetOptions2 default SYNEDIT_DEFAULT_OPTIONS2; property MouseOptions: TSynEditorMouseOptions read FMouseOptions write SetMouseOptions default SYNEDIT_DEFAULT_MOUSE_OPTIONS; property ShareOptions: TSynEditorShareOptions read FShareOptions write SetShareOptions @@ -1105,8 +1095,7 @@ type property ReadOnly: Boolean read GetReadOnly write SetReadOnly default FALSE; property RightEdge: Integer read GetRightEdge write SetRightEdge default 80; property RightEdgeColor: TColor read GetRightEdgeColor write SetRightEdgeColor default clSilver; - property ScrollBars: TScrollStyle - read FScrollBars write SetScrollBars default ssBoth; + property ScrollBars: TScrollStyle read FScrollBars write SetScrollBars default ssBoth; property BracketHighlightStyle: TSynEditBracketHighlightStyle read GetBracketHighlightStyle write SetBracketHighlightStyle; property TabWidth: integer read fTabWidth write SetTabWidth default 8; @@ -2491,8 +2480,7 @@ begin Result := FFoldedLinesView; end; -procedure TCustomSynEdit.SetBracketHighlightStyle( - const AValue: TSynEditBracketHighlightStyle); +procedure TCustomSynEdit.SetBracketHighlightStyle(const AValue: TSynEditBracketHighlightStyle); begin fMarkupBracket.HighlightStyle := AValue; end; @@ -2507,8 +2495,7 @@ begin fMarkupSelection.UseIncrementalColor:=AValue; end; -function TCustomSynEdit.GetCharLen(const Line: string; CharStartPos: integer - ): integer; +function TCustomSynEdit.GetCharLen(const Line: string; CharStartPos: integer): integer; begin if UseUTF8 and (length(Line)>=CharStartPos) then Result:=UTF8CharacterLength(@Line[CharStartPos]) @@ -5751,8 +5738,7 @@ begin end; end; -procedure TCustomSynEdit.Notification(AComponent: TComponent; - Operation: TOperation); +procedure TCustomSynEdit.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if Operation = opRemove then begin diff --git a/components/synedit/syneditmousecmds.pp b/components/synedit/syneditmousecmds.pp index d6c4818682..ec99bb19d2 100644 --- a/components/synedit/syneditmousecmds.pp +++ b/components/synedit/syneditmousecmds.pp @@ -127,7 +127,7 @@ type published property Shift: TShiftState read FShift write SetShift default []; property ShiftMask: TShiftState read FShiftMask write SetShiftMask default []; - property Button: TSynMouseButton read FButton write SetButton default mbXLeft; + property Button: TSynMouseButton read FButton write SetButton default mbXLeft; property ClickCount: TSynMAClickCount read FClickCount write SetClickCount default ccSingle; property ClickDir: TSynMAClickDir read FClickDir write SetClickDir default cdUp; property Command: TSynEditorMouseCommand read FCommand write SetCommand; diff --git a/ide/main.pp b/ide/main.pp index f09defcf2e..51291897f1 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -10408,8 +10408,7 @@ begin {$ENDIF} LogCaret:=ActiveSrcEdit.EditorComponent.LogicalCaretXY; if CodeToolBoss.JumpToMethod(ActiveUnitInfo.Source, - LogCaret.X,LogCaret.Y, - NewSource,NewX,NewY,NewTopLine,RevertableJump) then + LogCaret.X,LogCaret.Y,NewSource,NewX,NewY,NewTopLine,RevertableJump) then begin Flags := [jfFocusEditor]; if not RevertableJump then include(Flags, jfAddJumpPoint); @@ -10517,9 +10516,7 @@ begin if CodeToolsOpts.SkipForwardDeclarations then Include(FindFlags, fsfSkipClassForward); if CodeToolBoss.FindDeclaration(ActiveUnitInfo.Source, - LogCaretXY.X,LogCaretXY.Y, - NewSource,NewX,NewY,NewTopLine,FindFlags - ) + LogCaretXY.X, LogCaretXY.Y, NewSource, NewX, NewY, NewTopLine, FindFlags ) then begin //debugln(['TMainIDE.DoFindDeclarationAtCaret ',NewSource.Filename,' NewX=',Newx,',y=',NewY,' ',NewTopLine]); DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo, @@ -10643,8 +10640,7 @@ begin // create the file list Files:=TStringList.Create; Files.Add(TargetUnitInfo.Filename); - if CompareFilenames(DeclarationUnitInfo.Filename,TargetUnitInfo.Filename)<>0 - then + if CompareFilenames(DeclarationUnitInfo.Filename,TargetUnitInfo.Filename)<>0 then Files.Add(DeclarationUnitInfo.Filename); Options:=MiscellaneousOptions.FindRenameIdentifierOptions; @@ -11212,8 +11208,7 @@ begin Project1.UpdateVisibleUnit(ASrcEdit, SourceEditorManager.IndexOfSourceWindow(ASrcEdit.SourceNotebook)); - ActiveUnitInfo := - Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor); + ActiveUnitInfo := Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor); if ActiveUnitInfo = nil then Exit; ActiveUnitInfo.SetLastUsedEditor(SourceEditorManager.ActiveEditor); @@ -11737,8 +11732,7 @@ var end; // rename inherited component - InheritedComponent:= - DependingUnit.Component.FindComponent(AComponent.Name); + InheritedComponent:=DependingUnit.Component.FindComponent(AComponent.Name); if InheritedComponent<>nil then begin // inherited component found if FRenamingComponents=nil then @@ -12225,8 +12219,7 @@ begin DoViewJumpHistory(true); end; -procedure TMainIDE.OnSrcNoteBookPopupMenu( - const AddMenuItemProc: TAddMenuItemProc); +procedure TMainIDE.OnSrcNoteBookPopupMenu(const AddMenuItemProc: TAddMenuItemProc); begin PkgBoss.OnSourceEditorPopupMenu(AddMenuItemProc); end; @@ -12931,8 +12924,7 @@ begin Result:=nil; end; -function TMainIDE.GetProjectFileWithDesigner(ADesigner: TIDesigner - ): TLazProjectFile; +function TMainIDE.GetProjectFileWithDesigner(ADesigner: TIDesigner): TLazProjectFile; var TheDesigner: TDesigner; AComponent: TComponent; @@ -12944,8 +12936,7 @@ begin Result:=GetProjectFileWithRootComponent(AComponent); end; -function TMainIDE.OnPropHookMethodExists(const AMethodName: String; - TypeData: PTypeData; +function TMainIDE.OnPropHookMethodExists(const AMethodName: String; TypeData: PTypeData; var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean; var ActiveSrcEdit: TSourceEditor; @@ -12970,7 +12961,7 @@ end; function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString; ATypeInfo: PTypeInfo; APersistent: TPersistent; const APropertyPath: string): TMethod; -{ APersistent is the intance that gets the new method, not the lookuproot. +{ APersistent is the instance that gets the new method, not the lookuproot. For example assign 'Button1Click' to Form1.Button1.OnClick: APersistent = APersistent AMethodName = 'Button1Click' @@ -13296,8 +13287,7 @@ begin end; if (ADesigner<>nil) and ((RegComp<>nil) or (ClassUnitInfo<>nil)) then begin - if not BeginCodeTool(ADesigner,ActiveSrcEdit,ActiveUnitInfo, - [ctfSwitchToFormSource]) + if not BeginCodeTool(ADesigner,ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]) then exit; // remember cursor position @@ -13320,8 +13310,7 @@ begin // add component definitions to form source Ancestor:=GetAncestorLookupRoot(ActiveUnitInfo); - CodeToolBoss.CompleteComponent(ActiveUnitInfo.Source,ADesigner.LookupRoot, - Ancestor); + CodeToolBoss.CompleteComponent(ActiveUnitInfo.Source,ADesigner.LookupRoot,Ancestor); end; if ObjectInspector1<>nil then