summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c440b2)
raw | patch | inline | side by side (parent: 8c440b2)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 26 Sep 2017 06:21:53 +0000 (09:21 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 26 Sep 2017 06:22:06 +0000 (09:22 +0300) |
src/gx/gh_ui.pas | patch | blob | history |
diff --git a/src/gx/gh_ui.pas b/src/gx/gh_ui.pas
index 85a4a5ff67af8b0dfc792556119c218d9fbbb749..46bbbf6565225c771f8f69d6cb845d2ff9daf8e5 100644 (file)
--- a/src/gx/gh_ui.pas
+++ b/src/gx/gh_ui.pas
mFreeOnClose: Boolean; // default: false
protected
+ procedure activated (); override;
procedure blurred (); override;
public
if (not mEnabled) or (not mCanFocus) then exit;
if (tl.mFocused <> self) then
begin
- tl.mFocused.blurred();
+ if (tl.mFocused <> nil) then tl.mFocused.blurred();
tl.mFocused := self;
if (tl.mGrab <> self) then tl.mGrab := nil;
activated();
if (mWidth+mFrameWidth < ctl.mX+ctl.mWidth) then mWidth := ctl.mX+ctl.mWidth+mFrameWidth;
if (mHeight+mFrameHeight < ctl.mY+ctl.mHeight) then mHeight := ctl.mY+ctl.mHeight+mFrameHeight;
end;
- if (mFocused = nil) and ctl.mEnabled and ctl.mCanFocus and (ctl.mWidth > 0) and (ctl.mHeight > 0) then mFocused := ctl;
+ //if (mFocused = nil) and ctl.mEnabled and ctl.mCanFocus and (ctl.mWidth > 0) and (ctl.mHeight > 0) then mFocused := ctl;
end;
end;
+procedure THTopWindow.activated ();
+begin
+ if (mFocused = nil) or (mFocused = self) then
+ begin
+ mFocused := findFirstFocus();
+ if (mFocused <> nil) and (mFocused <> self) then mFocused.activated();
+ end;
+ inherited;
+end;
+
+
procedure THTopWindow.blurred ();
begin
mDragging := false;