mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-01 05:07:11 +01:00
SourceEdito: Clean up; removed unused(duplicate) methods
git-svn-id: trunk@24175 -
This commit is contained in:
parent
2a5d82df8c
commit
a06e2d5c99
@ -347,16 +347,13 @@ type
|
|||||||
procedure DoEditorExecuteCommand(EditorCommand: word);
|
procedure DoEditorExecuteCommand(EditorCommand: word);
|
||||||
|
|
||||||
// used to get the word at the mouse cursor
|
// used to get the word at the mouse cursor
|
||||||
function GetWordAtPosition(Position: TPoint): String;
|
|
||||||
function GetWordFromCaret(const ACaretPos: TPoint): String;
|
function GetWordFromCaret(const ACaretPos: TPoint): String;
|
||||||
function GetWordAtCurrentCaret: String;
|
function GetWordAtCurrentCaret: String;
|
||||||
function GetOperandFromCaret(const ACaretPos: TPoint): String;
|
function GetOperandFromCaret(const ACaretPos: TPoint): String;
|
||||||
function GetOperandAtCurrentCaret: String;
|
function GetOperandAtCurrentCaret: String;
|
||||||
function CaretInSelection(const ACaretPos: TPoint): Boolean;
|
function CaretInSelection(const ACaretPos: TPoint): Boolean;
|
||||||
function PositionInSelection(const APosition: TPoint): Boolean;
|
|
||||||
|
|
||||||
// cursor
|
// cursor
|
||||||
function GetCaretPosFromCursorPos(const CursorPos: TPoint): TPoint;
|
|
||||||
procedure CenterCursor;
|
procedure CenterCursor;
|
||||||
function TextToScreenPosition(const Position: TPoint): TPoint; override;
|
function TextToScreenPosition(const Position: TPoint): TPoint; override;
|
||||||
function ScreenToTextPosition(const Position: TPoint): TPoint; override;
|
function ScreenToTextPosition(const Position: TPoint): TPoint; override;
|
||||||
@ -503,7 +500,6 @@ type
|
|||||||
FNotebook: TDragableNotebook;
|
FNotebook: TDragableNotebook;
|
||||||
SrcPopUpMenu: TPopupMenu;
|
SrcPopUpMenu: TPopupMenu;
|
||||||
protected
|
protected
|
||||||
procedure AddBreakpointClicked(Sender: TObject);
|
|
||||||
procedure CompleteCodeMenuItemClick(Sender: TObject);
|
procedure CompleteCodeMenuItemClick(Sender: TObject);
|
||||||
procedure EncloseSelectionMenuItemClick(Sender: TObject);
|
procedure EncloseSelectionMenuItemClick(Sender: TObject);
|
||||||
procedure ExtractProcMenuItemClick(Sender: TObject);
|
procedure ExtractProcMenuItemClick(Sender: TObject);
|
||||||
@ -516,7 +512,6 @@ type
|
|||||||
procedure FindOverloadsMenuItemClick(Sender: TObject);
|
procedure FindOverloadsMenuItemClick(Sender: TObject);
|
||||||
procedure RunToClicked(Sender: TObject);
|
procedure RunToClicked(Sender: TObject);
|
||||||
procedure ViewCallStackClick(Sender: TObject);
|
procedure ViewCallStackClick(Sender: TObject);
|
||||||
procedure AddWatchAtCursor(Sender: TObject);
|
|
||||||
procedure EditorPropertiesClicked(Sender: TObject);
|
procedure EditorPropertiesClicked(Sender: TObject);
|
||||||
procedure LineEndingClicked(Sender: TObject);
|
procedure LineEndingClicked(Sender: TObject);
|
||||||
procedure EncodingClicked(Sender: TObject);
|
procedure EncodingClicked(Sender: TObject);
|
||||||
@ -684,7 +679,6 @@ type
|
|||||||
function GetActiveSE: TSourceEditor; { $note deprecate and use SetActiveEditor}
|
function GetActiveSE: TSourceEditor; { $note deprecate and use SetActiveEditor}
|
||||||
procedure CheckCurrentCodeBufferChanged;
|
procedure CheckCurrentCodeBufferChanged;
|
||||||
|
|
||||||
function ActiveFileName: AnsiString;
|
|
||||||
procedure UpdateStatusBar;
|
procedure UpdateStatusBar;
|
||||||
procedure ClearErrorLines; override;
|
procedure ClearErrorLines; override;
|
||||||
procedure ClearExecutionLines;
|
procedure ClearExecutionLines;
|
||||||
@ -723,7 +717,6 @@ type
|
|||||||
procedure ReloadEditorOptions;
|
procedure ReloadEditorOptions;
|
||||||
procedure ReloadHighlighters;
|
procedure ReloadHighlighters;
|
||||||
procedure CheckFont;
|
procedure CheckFont;
|
||||||
procedure GetSynEditPreviewSettings(APreviewEditor: TObject);
|
|
||||||
function GetEditorControlSettings(EditControl: TControl): boolean; override;
|
function GetEditorControlSettings(EditControl: TControl): boolean; override;
|
||||||
deprecated {$IFDEF VER2_5}'use SourceEditorManager'{$ENDIF}; // deprecated in 0.9.29 March 2010
|
deprecated {$IFDEF VER2_5}'use SourceEditorManager'{$ENDIF}; // deprecated in 0.9.29 March 2010
|
||||||
function GetHighlighterSettings(Highlighter: TObject): boolean; override;
|
function GetHighlighterSettings(Highlighter: TObject): boolean; override;
|
||||||
@ -3847,15 +3840,6 @@ begin
|
|||||||
OnMouseWheel(Self, Shift, WheelDelta, MousePos, Handled)
|
OnMouseWheel(Self, Shift, WheelDelta, MousePos, Handled)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TSourceEditor.GetWordAtPosition(Position: TPoint): String;
|
|
||||||
var
|
|
||||||
CaretPos: TPoint;
|
|
||||||
begin
|
|
||||||
Result := '';
|
|
||||||
Caretpos := ScreenToTextPosition(GetCaretPosfromCursorPos(Position));
|
|
||||||
Result := GetWordFromCaret(CaretPos);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Procedure TSourceEditor.EditorMouseDown(Sender: TObject; Button: TMouseButton;
|
Procedure TSourceEditor.EditorMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
@ -3871,28 +3855,6 @@ begin
|
|||||||
OnKeyDown(Sender, Key, Shift);
|
OnKeyDown(Sender, Key, Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TSourceEditor.GetCaretPosFromCursorPos(const CursorPos: TPoint): TPoint;
|
|
||||||
var
|
|
||||||
NewTopLine: Integer;
|
|
||||||
LineHeight: Integer;
|
|
||||||
LineNum: Integer;
|
|
||||||
XLine: Integer;
|
|
||||||
begin
|
|
||||||
//Figure out the line number
|
|
||||||
NewTopLine := FEditor.TopLine;
|
|
||||||
LineHeight := FEditor.LineHeight;
|
|
||||||
if CursorPos.Y > 1 then
|
|
||||||
LineNum := CursorPos.Y div LineHeight
|
|
||||||
else
|
|
||||||
LineNum := 1;
|
|
||||||
LineNum := LineNum + NewTopLine;
|
|
||||||
XLine := CursorPos.X div FEditor.CharWidth;
|
|
||||||
if XLine = 0 then inc(XLine);
|
|
||||||
|
|
||||||
Result.X := XLine;
|
|
||||||
Result.Y := LineNum;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
method TSourceEditor.CenterCursor
|
method TSourceEditor.CenterCursor
|
||||||
Params: none
|
Params: none
|
||||||
@ -4105,11 +4067,6 @@ begin
|
|||||||
and (CompareCaret(ACaretPos, EditorComponent.BlockEnd) >= 0);
|
and (CompareCaret(ACaretPos, EditorComponent.BlockEnd) >= 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSourceEditor.PositionInSelection(const APosition: TPoint): Boolean;
|
|
||||||
begin
|
|
||||||
Result := CaretInSelection(GetCaretPosfromCursorPos(APosition));
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TSourceEditor.IsActiveOnNoteBook: boolean;
|
function TSourceEditor.IsActiveOnNoteBook: boolean;
|
||||||
begin
|
begin
|
||||||
if FSourceNoteBook<>nil then
|
if FSourceNoteBook<>nil then
|
||||||
@ -5594,16 +5551,6 @@ begin
|
|||||||
ControlDocker.ShowDockingEditor;
|
ControlDocker.ShowDockingEditor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.AddBreakpointClicked(Sender: TObject );
|
|
||||||
var
|
|
||||||
ASrcEdit: TSourceEditor;
|
|
||||||
begin
|
|
||||||
ASrcEdit:=GetActiveSE;
|
|
||||||
if ASrcEdit=nil then exit;
|
|
||||||
DebugBoss.DoCreateBreakPoint(ASrcEdit.Filename,
|
|
||||||
ASrcEdit.EditorComponent.CaretY,true);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSourceNotebook.StatusBarDblClick(Sender: TObject);
|
procedure TSourceNotebook.StatusBarDblClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
@ -5825,11 +5772,6 @@ begin
|
|||||||
Cursor:=crDefault;
|
Cursor:=crDefault;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TSourceNotebook.ActiveFileName: AnsiString;
|
|
||||||
Begin
|
|
||||||
Result := GetActiveSE.FileName;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TSourceNotebook.GetEditors(Index:integer):TSourceEditor;
|
function TSourceNotebook.GetEditors(Index:integer):TSourceEditor;
|
||||||
begin
|
begin
|
||||||
Result:=TSourceEditor(FSourceEditorList[Index]);
|
Result:=TSourceEditor(FSourceEditorList[Index]);
|
||||||
@ -6443,11 +6385,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.AddWatchAtCursor(Sender: TObject);
|
|
||||||
begin
|
|
||||||
//
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSourceNotebook.SetIncrementalSearchStr(const AValue: string);
|
procedure TSourceNotebook.SetIncrementalSearchStr(const AValue: string);
|
||||||
begin
|
begin
|
||||||
if FIncrementalSearchStr=AValue then exit;
|
if FIncrementalSearchStr=AValue then exit;
|
||||||
@ -6523,15 +6460,6 @@ begin
|
|||||||
AEditor.UseIncrementalColor:= snIncrementalFind in States;
|
AEditor.UseIncrementalColor:= snIncrementalFind in States;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TSourceNotebook.GetSynEditPreviewSettings(APreviewEditor: TObject);
|
|
||||||
var ASynEdit: TSynEdit;
|
|
||||||
begin
|
|
||||||
if not (APreviewEditor is TSynEdit) then exit;
|
|
||||||
ASynEdit:=TSynEdit(APreviewEditor);
|
|
||||||
EditorOpts.GetSynEditPreviewSettings(ASynEdit);
|
|
||||||
ASynEdit.Highlighter:=Highlighters[lshFreePascal];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TSourceNotebook.GetEditorControlSettings(EditControl: TControl
|
function TSourceNotebook.GetEditorControlSettings(EditControl: TControl
|
||||||
): boolean;
|
): boolean;
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user