mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 11:38:04 +02:00
Merged revision(s) 63732 #c5dd93a0e4, 63788 #40ffa448fe, 63797 #52b4b42968, 63802-63803 #8b34fff80b-#8b34fff80b from trunk:
LCL-GTK2: Apply DisplaySettings properties of TCalendar also during runtime. Issue #37450, patch from Cyrax. ........ IDE: Update "search results" scrollbars after filling the tree. Issue #37582, patch from BrunoK. ........ IDE, LCL: Fix the search results scrollbar issue in a generic way in TreeView. Issue #37582, patch from BrunoK. ........ MenuEditor: Prevent assertion failure when separator selected, right click, "Remove all separators". Issue #37595. ........ MenuEditor: Update menuitems correctly when adding or removing separators. Patch from BrunoK, issue #37595. ........ git-svn-id: branches/fixes_2_0@64609 -
This commit is contained in:
parent
c00cb12cca
commit
9b78caaf21
@ -482,7 +482,7 @@ begin
|
||||
if (selMI=nil) then
|
||||
Exit;
|
||||
selShadow:=TShadowItem(FShadowMenu.GetShadowForMenuItem(selMI));
|
||||
Assert(selShadow<>nil,'TFake.SetVisibilitySizeAndPosition: selectedItem is nil');
|
||||
if selShadow=nil then Exit;
|
||||
if not ShouldBeVisible then begin
|
||||
if selMI.IsInMenuBar then
|
||||
selShadow.BottomFake:=nil
|
||||
@ -534,7 +534,7 @@ begin
|
||||
if (selMI=nil) then
|
||||
Exit;
|
||||
selShadow:=TShadowItem(FShadowMenu.GetShadowForMenuItem(selMI));
|
||||
Assert(selShadow<>nil,'TFake.SetVisibilitySizeAndPosition: selectedItem is nil');
|
||||
if selShadow=nil then Exit;
|
||||
if not ShouldBeVisible then begin
|
||||
if selMI.IsInMenuBar then
|
||||
selShadow.RightFake:=nil
|
||||
@ -2007,9 +2007,14 @@ begin
|
||||
if (sepCount > 0) then begin
|
||||
FShadowMenu.HideFakes;
|
||||
ShowAllUnSelected;
|
||||
nearestMI:=GetNextNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||
if (nearestMI = nil) then
|
||||
nearestMI:=GetPreviousNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||
nearestMI:=FShadowMenu.SelectedMenuItem;
|
||||
if assigned(nearestMI) and nearestMI.IsLine then begin
|
||||
nearestMI:=GetNextNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||
if (nearestMI = nil) then
|
||||
nearestMI:=GetPreviousNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||
end
|
||||
else
|
||||
FShadowMenu.SelectedMenuItem := nil;
|
||||
if (nearestMI = nil) then
|
||||
nearestMI:=FParentMenuItem;
|
||||
for i:=ParentMenuItem.Count-1 downto 0 do
|
||||
@ -2030,6 +2035,7 @@ begin
|
||||
else begin
|
||||
FShadowMenu.UpdateBoxLocationsAndSizes;
|
||||
FShadowMenu.SetSelectedMenuItem(nearestMI, False, True);
|
||||
LocateShadows;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -2042,6 +2048,7 @@ begin
|
||||
if (ShadowList.Count = 0) then
|
||||
Exit;
|
||||
FShadowList.Sort(@SortByItemMenuIndex);
|
||||
DisableAutoSizing;
|
||||
if IsMenuBar then begin
|
||||
len:=0;
|
||||
for si in FShadowList do begin
|
||||
@ -2059,6 +2066,7 @@ begin
|
||||
Inc(t, h);
|
||||
end;
|
||||
end;
|
||||
EnableAutoSizing;
|
||||
end;
|
||||
|
||||
constructor TShadowBox.CreateWithParentBox(aSMenu: TShadowMenu;
|
||||
|
@ -1185,21 +1185,17 @@ var
|
||||
begin
|
||||
if (fUpdateCount = 0) then
|
||||
RaiseGDBException('TLazSearchResultTV.EndUpdate');
|
||||
|
||||
Dec(fUpdateCount);
|
||||
if (fUpdateCount = 0) then
|
||||
begin
|
||||
ShortenPaths;
|
||||
fUpdating:= false;
|
||||
FreeObjectsTN(Items);
|
||||
|
||||
Items.BeginUpdate;
|
||||
Items.Clear;
|
||||
fFilenameToNode.Clear;
|
||||
|
||||
for i := 0 to fUpdateStrings.Count - 1 do
|
||||
AddNode(fUpdateStrings[i], TLazSearchMatchPos(fUpdateStrings.Objects[i]));
|
||||
|
||||
Items.EndUpdate;
|
||||
end;//if
|
||||
end;//EndUpdate
|
||||
@ -1225,7 +1221,6 @@ begin
|
||||
FreeSrcList:=true;
|
||||
end;
|
||||
try
|
||||
|
||||
// find shared path (the path of all filenames, that is the same)
|
||||
SharedPath:='';
|
||||
for i:=0 to SrcList.Count-1 do begin
|
||||
|
@ -2576,10 +2576,12 @@ begin
|
||||
//SendMessage(Handle, WM_SETREDRAW, Ord(not Updating), 0);
|
||||
if Updating then
|
||||
Include(Owner.FStates,tvsUpdating)
|
||||
else
|
||||
else begin
|
||||
Exclude(Owner.FStates,tvsUpdating);
|
||||
if not Updating then
|
||||
Include(Owner.FStates,tvsScrollbarChanged);
|
||||
Owner.UpdateScrollbars;
|
||||
Owner.Invalidate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTreeNodes.EndUpdate;
|
||||
|
@ -85,6 +85,25 @@ type
|
||||
max_week_char_width: guint;
|
||||
end;
|
||||
PGtkCalendarPrivate = ^TGtkCalendarPrivate;
|
||||
TGtkCalendarInternalTimer = record
|
||||
ACalendar : TCustomCalendar;
|
||||
gtkcalendardisplayoptions: TGtkCalendarDisplayOptions;
|
||||
ATimerSourceID: guint;
|
||||
end;
|
||||
PGtkCalendarInternalTimer = ^TGtkCalendarInternalTimer;
|
||||
|
||||
function SetCalendarDisplayOptionsTimer(data: gpointer): gboolean; cdecl;
|
||||
Var
|
||||
AGtkCalendarInternalTimer : PGtkCalendarInternalTimer absolute data;
|
||||
Agboolean : gboolean;
|
||||
AGtkCalendar: PGtkCalendar;
|
||||
begin
|
||||
Result := False;
|
||||
AGtkCalendar := TGtk2WSCustomCalendar.GetCalendar(AGtkCalendarInternalTimer^.ACalendar);
|
||||
gtk_Calendar_Display_options(AGtkCalendar, AGtkCalendarInternalTimer^.gtkcalendardisplayoptions);
|
||||
Agboolean := g_source_remove(AGtkCalendarInternalTimer^.ATimerSourceID);
|
||||
Dispose(AGtkCalendarInternalTimer);
|
||||
end;
|
||||
|
||||
{ TGtk2WSCustomCalendar }
|
||||
|
||||
@ -267,9 +286,11 @@ class procedure TGtk2WSCustomCalendar.SetDisplaySettings(const ACalendar: TCusto
|
||||
var
|
||||
num: dword;
|
||||
gtkcalendardisplayoptions : TGtkCalendarDisplayOptions;
|
||||
AGtkCalendarInternalTimer : PGtkCalendarInternalTimer;
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACalendar, 'SetDisplaySettings') then
|
||||
Exit;
|
||||
|
||||
num := 0;
|
||||
if (dsShowHeadings in ADisplaySettings) then
|
||||
num := Num + (1 shl 0);
|
||||
@ -287,7 +308,11 @@ begin
|
||||
num := Num + (1 shl 4);
|
||||
|
||||
gtkCalendarDisplayOptions := TGtkCalendarDisplayOptions(num);
|
||||
gtk_Calendar_Display_options(GetCalendar(ACalendar), gtkCalendarDisplayOptions);
|
||||
|
||||
New(AGtkCalendarInternalTimer);
|
||||
AGtkCalendarInternalTimer^.ACalendar := ACalendar;
|
||||
AGtkCalendarInternalTimer^.gtkcalendardisplayoptions := gtkCalendarDisplayOptions;
|
||||
AGtkCalendarInternalTimer^.ATimerSourceID := g_timeout_add(1, @SetCalendarDisplayOptionsTimer, AGtkCalendarInternalTimer);
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomCalendar.GetPreferredSize(
|
||||
|
Loading…
Reference in New Issue
Block a user