lcl: revert r52377 #a7f5af9c78, it collided with Gtk2 WS code.

git-svn-id: trunk@52380 -
This commit is contained in:
ondrej 2016-05-24 03:50:42 +00:00
parent 735b948b78
commit 92c16d5513
6 changed files with 15 additions and 18 deletions

View File

@ -176,7 +176,7 @@ type
TCaption = TTranslateString;
TCursor = -32768..32767;
TFormStyle = (fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop, fsSplash, fsSystemStayOnTop, fsIgnoreMouseEvents);
TFormStyle = (fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop, fsSplash, fsSystemStayOnTop);
TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow,
bsSizeToolWin);
TBorderStyle = bsNone..bsSingle;
@ -2972,7 +2972,7 @@ begin
if Frm=nil then
Exit;
if Frm.FormStyle <> fsIgnoreMouseEvents then
if Frm.Perform(WM_NCHITTEST, 0, 0) <> HTTRANSPARENT then
Exit;
Handle := 0;
@ -2985,7 +2985,7 @@ begin
NewFrm := Screen.CustomFormsZOrdered[I];
if (NewFrm<>Frm)
and PtInRect(NewFrm.BoundsRect, MousePos)
and (NewFrm.FormStyle <> fsIgnoreMouseEvents)
and (NewFrm.Perform(WM_NCHITTEST, 0, 0) <> HTTRANSPARENT)
then
Break;

View File

@ -508,7 +508,6 @@ type
procedure CMActivate(var Message: TLMessage); message CM_ACTIVATE;
procedure CMDeactivate(var Message: TLMessage); message CM_DEACTIVATE;
procedure CMShowingChanged(var Message: TLMessage); message CM_SHOWINGCHANGED;
procedure WMNCHitTest(var Message: TLMessage); message LM_NCHITTEST;
protected
FActionLists: TList; // keep this TList for Delphi compatibility
FFormBorderStyle: TFormBorderStyle;
@ -859,6 +858,7 @@ type
procedure SetHintRectAdjust(AValue: TRect);
protected
class procedure WSRegisterClass; override;
procedure WMNCHitTest(var Message: TLMessage); message LM_NCHITTEST;
procedure ActivateSub;
procedure DoShowWindow; override;
procedure UpdateRegion;

View File

@ -2214,7 +2214,7 @@ begin
if (FMainForm = nil)
and (FCreatingForm=AForm)
and (not (AppDestroying in FFlags))
and not (AForm.FormStyle in [fsMDIChild, fsSplash, fsIgnoreMouseEvents])
and not (AForm.FormStyle in [fsMDIChild, fsSplash])
then
FMainForm := AForm;
end;

View File

@ -728,14 +728,6 @@ begin
Application.QueueAsyncCall(@Moved, 0)
end;
procedure TCustomForm.WMNCHitTest(var Message: TLMessage);
begin
if FormStyle=fsIgnoreMouseEvents then
Message.Result := HTTRANSPARENT
else
inherited;
end;
procedure TCustomForm.Moved(Data: PtrInt);
begin
if WindowState = wsNormal then
@ -1957,10 +1949,10 @@ Begin
FFormStyle := Value;
Include(FFormState, fsFormStyleChanged);
if FFormStyle in [fsSplash, fsIgnoreMouseEvents] then
if FFormStyle = fsSplash then
BorderStyle := bsNone
else
if OldFormStyle in [fsSplash, fsIgnoreMouseEvents] then
if OldFormStyle = fsSplash then
BorderStyle := bsSizeable;
if HandleAllocated then
TWSCustomFormClass(WidgetSetClass).SetFormStyle(Self, Value, OldFormStyle);

View File

@ -30,7 +30,7 @@ begin
Canvas.Font := Screen.HintFont;
Canvas.Brush.Style := bsClear;
FAlignment := taLeftJustify;
FormStyle := fsIgnoreMouseEvents;
BorderStyle := bsNone;
Caption := '';
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
@ -69,6 +69,11 @@ begin
RegisterHintWindow;
end;
procedure THintWindow.WMNCHitTest(var Message: TLMessage);
begin
Message.Result := HTTRANSPARENT;
end;
procedure THintWindow.DoShowWindow;
begin
if (ActiveControl = nil) and (not (csDesigning in ComponentState)) and (Parent=nil) then

View File

@ -222,7 +222,7 @@ begin
win.setLevel(HintWindowLevel);
TCocoaPanel(win).callback := TLCLWindowCallback.Create(win, AWinControl);
win.setDelegate(win);
if Form.FormStyle=fsIgnoreMouseEvents then
if AWinControl.Perform(WM_NCHITTEST, 0, 0)=HTTRANSPARENT then
win.setIgnoresMouseEvents(True)
else
win.setAcceptsMouseMovedEvents(True);
@ -480,7 +480,7 @@ var
win.setTitle(ns);
ns.release;
win.setAcceptsMouseMovedEvents(True);
if Form.FormStyle=fsIgnoreMouseEvents then
if AWinControl.Perform(WM_NCHITTEST, 0, 0)=HTTRANSPARENT then
win.setIgnoresMouseEvents(True);
cnt.callback := TCocoaWindow(win).callback;