mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 16:00:30 +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;
|
Flags := SW_HIDE;
|
||||||
Windows.ShowWindow(PageHandle, Flags);
|
Windows.ShowWindow(PageHandle, Flags);
|
||||||
Windows.RedrawWindow(PageHandle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_ERASE);
|
Windows.RedrawWindow(PageHandle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_ERASE);
|
||||||
if Showing then
|
|
||||||
NotebookFocusNewControl(Notebook, PageIndex);
|
|
||||||
Result := PageIndex;
|
Result := PageIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2447,6 +2445,8 @@ begin
|
|||||||
TCN_SELCHANGING:
|
TCN_SELCHANGING:
|
||||||
if LMNotify.Result = 0 then
|
if LMNotify.Result = 0 then
|
||||||
ShowHideTabPage(HWndFrom, False);
|
ShowHideTabPage(HWndFrom, False);
|
||||||
|
TCN_SELCHANGE:
|
||||||
|
NotebookFocusNewControl(GetWindowInfo(hwndFrom)^.WinControl as TCustomNotebook, idFrom);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -229,6 +229,7 @@ var
|
|||||||
ControlList: TFPList;
|
ControlList: TFPList;
|
||||||
lWinControl: TWinControl;
|
lWinControl: TWinControl;
|
||||||
I: integer;
|
I: integer;
|
||||||
|
FocusSet: Boolean;
|
||||||
begin
|
begin
|
||||||
{ see if currently focused control is within notebook }
|
{ see if currently focused control is within notebook }
|
||||||
if not IsNotebookGroupFocused(ANotebook) then exit;
|
if not IsNotebookGroupFocused(ANotebook) then exit;
|
||||||
@ -239,16 +240,20 @@ begin
|
|||||||
try
|
try
|
||||||
Page.GetTabOrderList(ControlList);
|
Page.GetTabOrderList(ControlList);
|
||||||
I := 0;
|
I := 0;
|
||||||
|
FocusSet := False;
|
||||||
while I < ControlList.Count do
|
while I < ControlList.Count do
|
||||||
begin
|
begin
|
||||||
lWinControl := TWinControl(ControlList[I]);
|
lWinControl := TWinControl(ControlList[I]);
|
||||||
if lWinControl.TabStop and lWinControl.Enabled and lWinControl.CanFocus then
|
if lWinControl.TabStop and lWinControl.Enabled and lWinControl.CanFocus then
|
||||||
begin
|
begin
|
||||||
lWinControl.SetFocus;
|
lWinControl.SetFocus;
|
||||||
|
FocusSet := True;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
Inc(I);
|
Inc(I);
|
||||||
end;
|
end;
|
||||||
|
if not FocusSet then
|
||||||
|
Page.SetFocus;
|
||||||
finally
|
finally
|
||||||
ControlList.Free;
|
ControlList.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user