mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 21:16:05 +02:00
LCL: PageControl, changing (moving) the tab position of a page, would sometimes (but not always) trigger OnChanging. OnChanging could prevent the change, while it must always be allowed during moving tabs.
git-svn-id: trunk@42682 -
This commit is contained in:
parent
5364c52f95
commit
3c9900948e
@ -416,6 +416,7 @@ type
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure ReadState(Reader: TReader); override;
|
||||
function DialogChar(var Message: TLMKey): boolean; override;
|
||||
procedure InternalSetPageIndex(AValue: Integer); // No OnChange
|
||||
procedure ShowControl(APage: TControl); override;
|
||||
procedure UpdateTabProperties; virtual;
|
||||
class function GetControlClassDefaultSize: TSize; override;
|
||||
|
@ -206,7 +206,7 @@ begin
|
||||
|
||||
// update PageIndex
|
||||
if ActivePage <> nil then
|
||||
FNotebook.PageIndex := IndexOfPage(ActivePage)
|
||||
FNotebook.InternalSetPageIndex(IndexOfPage(ActivePage))
|
||||
else // Can not restore an invalid page index.
|
||||
if FNotebook.PageIndex >= 0 then // keep if -1
|
||||
FNotebook.PageIndex := NewIndex;
|
||||
@ -578,9 +578,7 @@ begin
|
||||
if not CanChangePageIndex then exit;
|
||||
//debugln('TCustomTabControl.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated));
|
||||
|
||||
FPageIndex := AValue;
|
||||
UpdateAllDesignerFlags;
|
||||
DoSendPageIndex;
|
||||
InternalSetPageIndex(AValue);
|
||||
if ([csDesigning, csLoading, csDestroying] * ComponentState = []) then
|
||||
DoChange;
|
||||
end;
|
||||
@ -977,6 +975,13 @@ begin
|
||||
Result := destPage.DialogChar(Message);
|
||||
end;
|
||||
|
||||
procedure TCustomTabControl.InternalSetPageIndex(AValue: Integer);
|
||||
begin
|
||||
FPageIndex := AValue;
|
||||
UpdateAllDesignerFlags;
|
||||
DoSendPageIndex;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TCustomTabControl CNNotify
|
||||
------------------------------------------------------------------------------}
|
||||
|
Loading…
Reference in New Issue
Block a user