mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 20:10:27 +02:00
win32: set focus on first focusable control or on page itself if no such control on pagecontrol page change (bug #0012692)
git-svn-id: trunk@18213 -
This commit is contained in:
parent
2d45ac454b
commit
69bd358a27
@ -275,8 +275,6 @@ var
|
||||
Flags := SW_HIDE;
|
||||
Windows.ShowWindow(PageHandle, Flags);
|
||||
Windows.RedrawWindow(PageHandle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_ERASE);
|
||||
if Showing then
|
||||
NotebookFocusNewControl(Notebook, PageIndex);
|
||||
Result := PageIndex;
|
||||
end;
|
||||
|
||||
@ -2447,6 +2445,8 @@ begin
|
||||
TCN_SELCHANGING:
|
||||
if LMNotify.Result = 0 then
|
||||
ShowHideTabPage(HWndFrom, False);
|
||||
TCN_SELCHANGE:
|
||||
NotebookFocusNewControl(GetWindowInfo(hwndFrom)^.WinControl as TCustomNotebook, idFrom);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -229,6 +229,7 @@ var
|
||||
ControlList: TFPList;
|
||||
lWinControl: TWinControl;
|
||||
I: integer;
|
||||
FocusSet: Boolean;
|
||||
begin
|
||||
{ see if currently focused control is within notebook }
|
||||
if not IsNotebookGroupFocused(ANotebook) then exit;
|
||||
@ -239,16 +240,20 @@ begin
|
||||
try
|
||||
Page.GetTabOrderList(ControlList);
|
||||
I := 0;
|
||||
FocusSet := False;
|
||||
while I < ControlList.Count do
|
||||
begin
|
||||
lWinControl := TWinControl(ControlList[I]);
|
||||
if lWinControl.TabStop and lWinControl.Enabled and lWinControl.CanFocus then
|
||||
begin
|
||||
lWinControl.SetFocus;
|
||||
FocusSet := True;
|
||||
break;
|
||||
end;
|
||||
Inc(I);
|
||||
end;
|
||||
if not FocusSet then
|
||||
Page.SetFocus;
|
||||
finally
|
||||
ControlList.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user