mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 05:01:50 +02:00
IDE: message window: started line wrap
git-svn-id: trunk@53419 -
This commit is contained in:
parent
a2d289acd6
commit
e419a0c56c
@ -201,6 +201,7 @@ type
|
|||||||
procedure ImageListChange(Sender: TObject);
|
procedure ImageListChange(Sender: TObject);
|
||||||
procedure OnIdle(Sender: TObject; var {%H-}Done: Boolean);
|
procedure OnIdle(Sender: TObject; var {%H-}Done: Boolean);
|
||||||
procedure OnFilterChanged(Sender: TObject);
|
procedure OnFilterChanged(Sender: TObject);
|
||||||
|
function GetPageScroll: integer;
|
||||||
protected
|
protected
|
||||||
FViews: TFPList;// list of TMessagesViewMap
|
FViews: TFPList;// list of TMessagesViewMap
|
||||||
FStates: TMsgCtrlStates;
|
FStates: TMsgCtrlStates;
|
||||||
@ -1292,12 +1293,18 @@ begin
|
|||||||
// Scrolls to start / end of the text
|
// Scrolls to start / end of the text
|
||||||
SB_TOP: ScrollTop := 0;
|
SB_TOP: ScrollTop := 0;
|
||||||
SB_BOTTOM: ScrollTop := ScrollTopMax;
|
SB_BOTTOM: ScrollTop := ScrollTopMax;
|
||||||
|
{$IFDEF EnableMsgWndLineWrap}
|
||||||
|
// Scrolls one line up / down
|
||||||
|
SB_LINEDOWN: ScrollTop := ScrollTop + 1;
|
||||||
|
SB_LINEUP: ScrollTop := ScrollTop - 1;
|
||||||
|
{$ELSE}
|
||||||
// Scrolls one line up / down
|
// Scrolls one line up / down
|
||||||
SB_LINEDOWN: ScrollTop := ScrollTop + ItemHeight div 2;
|
SB_LINEDOWN: ScrollTop := ScrollTop + ItemHeight div 2;
|
||||||
SB_LINEUP: ScrollTop := ScrollTop - ItemHeight div 2;
|
SB_LINEUP: ScrollTop := ScrollTop - ItemHeight div 2;
|
||||||
|
{$ENDIF}
|
||||||
// Scrolls one page of lines up / down
|
// Scrolls one page of lines up / down
|
||||||
SB_PAGEDOWN: ScrollTop := ScrollTop + ClientHeight - ItemHeight;
|
SB_PAGEDOWN: ScrollTop := ScrollTop + GetPageScroll;
|
||||||
SB_PAGEUP: ScrollTop := ScrollTop - ClientHeight + ItemHeight;
|
SB_PAGEUP: ScrollTop := ScrollTop - GetPageScroll;
|
||||||
// Scrolls to the current scroll bar position
|
// Scrolls to the current scroll bar position
|
||||||
SB_THUMBPOSITION,
|
SB_THUMBPOSITION,
|
||||||
SB_THUMBTRACK: ScrollTop := Msg.Pos;
|
SB_THUMBTRACK: ScrollTop := Msg.Pos;
|
||||||
@ -1311,13 +1318,18 @@ begin
|
|||||||
if Mouse.WheelScrollLines=-1 then
|
if Mouse.WheelScrollLines=-1 then
|
||||||
begin
|
begin
|
||||||
// -1 : scroll by page
|
// -1 : scroll by page
|
||||||
ScrollTop := ScrollTop -
|
ScrollTop := ScrollTop - (Message.WheelDelta * GetPageScroll) div 120;
|
||||||
(Message.WheelDelta * (ClientHeight - ItemHeight)) div 120;
|
|
||||||
end else begin
|
end else begin
|
||||||
|
{$IFDEF EnableMsgWndLineWrap}
|
||||||
|
// scrolling one line -> see SB_LINEDOWN and SB_LINEUP handler in WMVScroll
|
||||||
|
ScrollTop := ScrollTop -
|
||||||
|
(Message.WheelDelta * Mouse.WheelScrollLines) div 240;
|
||||||
|
{$ELSE}
|
||||||
// scrolling one line -> scroll half an item, see SB_LINEDOWN and SB_LINEUP
|
// scrolling one line -> scroll half an item, see SB_LINEDOWN and SB_LINEUP
|
||||||
// handler in WMVScroll
|
// handler in WMVScroll
|
||||||
ScrollTop := ScrollTop -
|
ScrollTop := ScrollTop -
|
||||||
(Message.WheelDelta * Mouse.WheelScrollLines*ItemHeight) div 240;
|
(Message.WheelDelta * Mouse.WheelScrollLines*ItemHeight) div 240;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
Message.Result := 1;
|
Message.Result := 1;
|
||||||
end;
|
end;
|
||||||
@ -1393,6 +1405,15 @@ begin
|
|||||||
IdleConnected:=true;
|
IdleConnected:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMessagesCtrl.GetPageScroll: integer;
|
||||||
|
begin
|
||||||
|
{$IFDEF EnableMsgWndLineWrap}
|
||||||
|
Result:=Max(1,((ClientHeight-BorderWidth) div ItemHeight));
|
||||||
|
{$ELSE}
|
||||||
|
Result:=ClientHeight - ItemHeight;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
function TMessagesCtrl.GetSelectedLine: integer;
|
function TMessagesCtrl.GetSelectedLine: integer;
|
||||||
var
|
var
|
||||||
View: TLMsgWndView;
|
View: TLMsgWndView;
|
||||||
@ -1541,7 +1562,11 @@ begin
|
|||||||
LoSearchText:=fLastLoSearchText;
|
LoSearchText:=fLastLoSearchText;
|
||||||
|
|
||||||
// paint from top to bottom
|
// paint from top to bottom
|
||||||
|
{$IFDEF EnableMsgWndLineWrap}
|
||||||
|
y:=-ScrollTop*ItemHeight;
|
||||||
|
{$ELSE}
|
||||||
y:=-ScrollTop;
|
y:=-ScrollTop;
|
||||||
|
{$ENDIF}
|
||||||
for i:=0 to ViewCount-1 do begin
|
for i:=0 to ViewCount-1 do begin
|
||||||
if y>ClientHeight then break;
|
if y>ClientHeight then break;
|
||||||
View:=Views[i];
|
View:=Views[i];
|
||||||
@ -1743,13 +1768,13 @@ begin
|
|||||||
|
|
||||||
VK_PRIOR: // Page Up
|
VK_PRIOR: // Page Up
|
||||||
begin
|
begin
|
||||||
SelectNextShown(-1-Max(0,ClientHeight div ItemHeight));
|
SelectNextShown(-Max(1,ClientHeight div ItemHeight));
|
||||||
Key:=VK_UNKNOWN;
|
Key:=VK_UNKNOWN;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
VK_NEXT: // Page Down
|
VK_NEXT: // Page Down
|
||||||
begin
|
begin
|
||||||
SelectNextShown(1+Max(0,ClientHeight div ItemHeight));
|
SelectNextShown(Max(1,ClientHeight div ItemHeight));
|
||||||
Key:=VK_UNKNOWN;
|
Key:=VK_UNKNOWN;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2316,6 +2341,8 @@ var
|
|||||||
MinScrollTop: integer;
|
MinScrollTop: integer;
|
||||||
MaxScrollTop: Integer;
|
MaxScrollTop: Integer;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnableMsgWndLineWrap}
|
||||||
|
{$ELSE}
|
||||||
y:=GetLineTop(View,LineNumber,false);
|
y:=GetLineTop(View,LineNumber,false);
|
||||||
if FullyVisible then begin
|
if FullyVisible then begin
|
||||||
MinScrollTop:=Max(0,y+ItemHeight-ClientHeight);
|
MinScrollTop:=Max(0,y+ItemHeight-ClientHeight);
|
||||||
@ -2324,6 +2351,7 @@ begin
|
|||||||
MinScrollTop:=Max(0,y-1-ClientHeight);
|
MinScrollTop:=Max(0,y-1-ClientHeight);
|
||||||
MaxScrollTop:=y+ItemHeight-1;
|
MaxScrollTop:=y+ItemHeight-1;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
//debugln(['TMessagesCtrl.ScrollToLine ',LineNumber,' y=',y,' Min=',MinScrollTop,' Max=',MaxScrollTop]);
|
//debugln(['TMessagesCtrl.ScrollToLine ',LineNumber,' y=',y,' Min=',MinScrollTop,' Max=',MaxScrollTop]);
|
||||||
y:=Max(Min(ScrollTop,MaxScrollTop),MinScrollTop);
|
y:=Max(Min(ScrollTop,MaxScrollTop),MinScrollTop);
|
||||||
//debugln(['TMessagesCtrl.ScrollToLine y=',y,' ScrollTopMax=',ScrollTopMax]);
|
//debugln(['TMessagesCtrl.ScrollToLine y=',y,' ScrollTopMax=',ScrollTopMax]);
|
||||||
|
Loading…
Reference in New Issue
Block a user