diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index e27bf6a09a..f79868d638 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -3183,9 +3183,9 @@ var if (UnitName='libc') and (System.Pos(AppendPathDelim(FPCSrcDir)+'packages'+PathDelim,ADirPath)>0) then begin + // /rtl/netwlibc/libc.pp + // /packages/base/libc/libc.pp Priority:=2; - DebugLn(['BrowseDirectory OldFilename=',OldUnitLink.Filename,' Old.UsedMacroCount=',OldUnitLink.UsedMacroCount,' Old.MacroCount=',OldUnitLink.MacroCount,' Old.Priority=',OldUnitLink.Priority, - ' New=',AFilename,' New.MacroCount=',MacroCount,' New.UsedMacroCount=',UsedMacroCount,' New.Priority=',Priority]); end; if (UsedMacroCount>OldUnitLink.UsedMacroCount) or ((UsedMacroCount=OldUnitLink.UsedMacroCount) diff --git a/ide/main.pp b/ide/main.pp index dd1216ee53..d63f74c11f 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -9354,6 +9354,7 @@ var MaxMessages: integer; NewFilename: String; begin Result:=false; + MaxMessages:=MessagesView.VisibleItemCount; if Index>=MaxMessages then exit; if (Index<0) then begin diff --git a/ide/msgview.pp b/ide/msgview.pp index c8896ef83d..cbf10ed576 100644 --- a/ide/msgview.pp +++ b/ide/msgview.pp @@ -279,8 +279,9 @@ begin FLastSelectedIndex := -1; Caption := lisMenuViewMessages; - MessageListBox.Style := lbOwnerDrawFixed; - MessageListBox.OnDrawItem := @MessageViewDrawItem; + MessageListBox.Style := lbOwnerDrawFixed; + MessageListBox.OnDrawItem := @MessageViewDrawItem; + MessageListBox.ClickOnSelChange := false; // assign the root TMenuItem to the registered menu root. // This will automatically create all registered items @@ -397,6 +398,7 @@ begin FVisibleItems.Add(NewMsg); FLastLineIsProgress := ProgressLine; MessageListBox.TopIndex := MessageListBox.Items.Count - 1; + //DebugLn(['TMessagesView.Add ',MessageListBox.TopIndex]); end; //ConsistencyCheck; end; @@ -525,8 +527,10 @@ end; procedure TMessagesView.ShowTopMessage; begin - if MessageListBox.Items.Count > 0 then + if MessageListBox.Items.Count > 0 then begin MessageListBox.TopIndex := 0; + //DebugLn(['TMessagesView.ShowTopMessage ']); + end; end; function TMessagesView.MsgCount: integer; diff --git a/lcl/interfaces/gtk/gtkwsstdctrls.pp b/lcl/interfaces/gtk/gtkwsstdctrls.pp index 80d5740f13..5839b062aa 100644 --- a/lcl/interfaces/gtk/gtkwsstdctrls.pp +++ b/lcl/interfaces/gtk/gtkwsstdctrls.pp @@ -568,7 +568,6 @@ var ListItemWidget: PGtkWidget; i: Integer; begin - DebugLn(['TGtkWSCustomListBox.SetTopIndex ',DbgSName(ACustomListBox),' NewTopIndex=',NewTopIndex,' ',GetWidgetDebugReport(PGtkWidget(ACustomListBox.Handle))]); AWidget:=PGtkWidget(ACustomListBox.Handle); ListWidget:=PGtkList(GetWidgetInfo(AWidget, True)^.CoreWidget); ScrolledWindow:=PGtkScrolledWindow(AWidget); @@ -597,6 +596,7 @@ var GListItem: PGList; ListItemWidget: PGtkWidget; i: Integer; + requisition: TGtkRequisition; begin //if CompareText(ACustomListBox.Name,'LBProperties')=0 then // debugln('TGtkWSCustomListBox.SetTopIndex ',DbgSName(ACustomListBox)); @@ -609,13 +609,16 @@ begin while GListItem<>nil do begin ListItemWidget:=PGtkWidget(GListItem^.data); if i>=NewTopIndex then break; - inc(AdjValue,ListItemWidget^.Allocation.Height); + gtk_widget_size_request(ListItemWidget,@requisition); + inc(AdjValue,requisition.height); + //DebugLn(['TGtkWSCustomListBox.SetTopIndex ',i,' AdjValue=',AdjValue,' Flags=',WidgetFlagsToString(ListItemWidget)]); inc(i); GListItem:=GListItem^.next; end; VertAdj:=gtk_scrolled_window_get_vadjustment(ScrolledWindow); - MaxAdjValue:=RoundToInt(VertAdj^.upper-VertAdj^.page_size); + MaxAdjValue:=RoundToInt(VertAdj^.upper); if AdjValue>MaxAdjValue then AdjValue:=MaxAdjValue; + //DebugLn(['TGtkWSCustomListBox.SetTopIndex AdjValue=',AdjValue,' VertAdj^.upper=',VertAdj^.upper,' VertAdj^.page_size=',VertAdj^.page_size]); gtk_adjustment_set_value(VertAdj,AdjValue); end; {$EndIf}