mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 23:18:44 +02:00
IDE: Scroll Procedure List with mouse-wheel always. Issue #38477, patch by Alexey Torgashin.
This commit is contained in:
parent
677b96455e
commit
e4e8a05a64
@ -13,7 +13,7 @@ object ProcedureListForm: TProcedureListForm
|
||||
OnResize = FormResize
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
LCLVersion = '2.3.0.0'
|
||||
object StatusBar: TStatusBar
|
||||
Left = 0
|
||||
Height = 21
|
||||
@ -234,6 +234,7 @@ object ProcedureListForm: TProcedureListForm
|
||||
TabOrder = 3
|
||||
OnDblClick = SGDblClick
|
||||
OnDrawCell = SGDrawCell
|
||||
OnMouseWheel = SGMouseWheel
|
||||
OnSelectCell = SGSelectCell
|
||||
end
|
||||
end
|
||||
|
@ -94,6 +94,8 @@ type
|
||||
procedure SGDblClick(Sender: TObject);
|
||||
procedure SGDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect;
|
||||
{%H-}aState: TGridDrawState);
|
||||
procedure SGMouseWheel(Sender: TObject; Shift: TShiftState;
|
||||
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
||||
procedure SGSelectCell(Sender: TObject; {%H-}aCol, aRow: Integer;
|
||||
var {%H-}CanSelect: Boolean);
|
||||
procedure SomethingChange(Sender: TObject);
|
||||
@ -311,13 +313,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TProcedureListForm.SGMouseWheel(Sender: TObject; Shift: TShiftState;
|
||||
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
||||
var
|
||||
NLines: integer;
|
||||
begin
|
||||
NLines := -WheelDelta * 3 div 120;
|
||||
SG.TopRow := Max(SG.FixedRows, Min(SG.RowCount - 1, SG.TopRow + NLines));
|
||||
Handled := True;
|
||||
end;
|
||||
|
||||
procedure TProcedureListForm.SGSelectCell(Sender: TObject; aCol, aRow: Integer;
|
||||
var CanSelect: Boolean);
|
||||
var
|
||||
rowObject: TGridRowObject;
|
||||
begin
|
||||
rowObject := TGridRowObject(TStringGrid(Sender).Rows[aRow].Objects[0]);
|
||||
|
||||
if Assigned(rowObject) then
|
||||
begin
|
||||
StatusBar.Panels[0].Text := rowObject.FullProcedureName;
|
||||
|
Loading…
Reference in New Issue
Block a user