mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 16:51:20 +02: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);
|
||||
|
||||
// used to get the word at the mouse cursor
|
||||
function GetWordAtPosition(Position: TPoint): String;
|
||||
function GetWordFromCaret(const ACaretPos: TPoint): String;
|
||||
function GetWordAtCurrentCaret: String;
|
||||
function GetOperandFromCaret(const ACaretPos: TPoint): String;
|
||||
function GetOperandAtCurrentCaret: String;
|
||||
function CaretInSelection(const ACaretPos: TPoint): Boolean;
|
||||
function PositionInSelection(const APosition: TPoint): Boolean;
|
||||
|
||||
// cursor
|
||||
function GetCaretPosFromCursorPos(const CursorPos: TPoint): TPoint;
|
||||
procedure CenterCursor;
|
||||
function TextToScreenPosition(const Position: TPoint): TPoint; override;
|
||||
function ScreenToTextPosition(const Position: TPoint): TPoint; override;
|
||||
@ -503,7 +500,6 @@ type
|
||||
FNotebook: TDragableNotebook;
|
||||
SrcPopUpMenu: TPopupMenu;
|
||||
protected
|
||||
procedure AddBreakpointClicked(Sender: TObject);
|
||||
procedure CompleteCodeMenuItemClick(Sender: TObject);
|
||||
procedure EncloseSelectionMenuItemClick(Sender: TObject);
|
||||
procedure ExtractProcMenuItemClick(Sender: TObject);
|
||||
@ -516,7 +512,6 @@ type
|
||||
procedure FindOverloadsMenuItemClick(Sender: TObject);
|
||||
procedure RunToClicked(Sender: TObject);
|
||||
procedure ViewCallStackClick(Sender: TObject);
|
||||
procedure AddWatchAtCursor(Sender: TObject);
|
||||
procedure EditorPropertiesClicked(Sender: TObject);
|
||||
procedure LineEndingClicked(Sender: TObject);
|
||||
procedure EncodingClicked(Sender: TObject);
|
||||
@ -684,7 +679,6 @@ type
|
||||
function GetActiveSE: TSourceEditor; { $note deprecate and use SetActiveEditor}
|
||||
procedure CheckCurrentCodeBufferChanged;
|
||||
|
||||
function ActiveFileName: AnsiString;
|
||||
procedure UpdateStatusBar;
|
||||
procedure ClearErrorLines; override;
|
||||
procedure ClearExecutionLines;
|
||||
@ -723,7 +717,6 @@ type
|
||||
procedure ReloadEditorOptions;
|
||||
procedure ReloadHighlighters;
|
||||
procedure CheckFont;
|
||||
procedure GetSynEditPreviewSettings(APreviewEditor: TObject);
|
||||
function GetEditorControlSettings(EditControl: TControl): boolean; override;
|
||||
deprecated {$IFDEF VER2_5}'use SourceEditorManager'{$ENDIF}; // deprecated in 0.9.29 March 2010
|
||||
function GetHighlighterSettings(Highlighter: TObject): boolean; override;
|
||||
@ -3847,15 +3840,6 @@ begin
|
||||
OnMouseWheel(Self, Shift, WheelDelta, MousePos, Handled)
|
||||
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;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
@ -3871,28 +3855,6 @@ begin
|
||||
OnKeyDown(Sender, Key, Shift);
|
||||
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
|
||||
Params: none
|
||||
@ -4105,11 +4067,6 @@ begin
|
||||
and (CompareCaret(ACaretPos, EditorComponent.BlockEnd) >= 0);
|
||||
end;
|
||||
|
||||
function TSourceEditor.PositionInSelection(const APosition: TPoint): Boolean;
|
||||
begin
|
||||
Result := CaretInSelection(GetCaretPosfromCursorPos(APosition));
|
||||
end;
|
||||
|
||||
function TSourceEditor.IsActiveOnNoteBook: boolean;
|
||||
begin
|
||||
if FSourceNoteBook<>nil then
|
||||
@ -5594,16 +5551,6 @@ begin
|
||||
ControlDocker.ShowDockingEditor;
|
||||
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);
|
||||
var
|
||||
P: TPoint;
|
||||
@ -5825,11 +5772,6 @@ begin
|
||||
Cursor:=crDefault;
|
||||
end;
|
||||
|
||||
Function TSourceNotebook.ActiveFileName: AnsiString;
|
||||
Begin
|
||||
Result := GetActiveSE.FileName;
|
||||
end;
|
||||
|
||||
function TSourceNotebook.GetEditors(Index:integer):TSourceEditor;
|
||||
begin
|
||||
Result:=TSourceEditor(FSourceEditorList[Index]);
|
||||
@ -6443,11 +6385,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSourceNotebook.AddWatchAtCursor(Sender: TObject);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TSourceNotebook.SetIncrementalSearchStr(const AValue: string);
|
||||
begin
|
||||
if FIncrementalSearchStr=AValue then exit;
|
||||
@ -6523,15 +6460,6 @@ begin
|
||||
AEditor.UseIncrementalColor:= snIncrementalFind in States;
|
||||
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
|
||||
): boolean;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user