fix TPageControl.OnChanging event (issue #1984)

git-svn-id: trunk@9632 -
This commit is contained in:
micha 2006-07-19 09:34:42 +00:00
parent 67458062b3
commit cfd72aa2fb
4 changed files with 23 additions and 15 deletions

View File

@ -221,7 +221,6 @@ type
TPageControl = class(TCustomNotebook)
private
FOnChanging: TTabChangingEvent;
function GetActivePageIndex: Integer;
function GetActiveTabSheet: TTabSheet;
function GetTabIndex: Integer;
@ -271,7 +270,7 @@ type
//property TabWidth;
property Visible;
property OnChange: TNotifyEvent read fOnPageChanged write fOnPageChanged;
property OnChanging: TTabChangingEvent read FOnChanging write FOnChanging;
property OnChanging;
property OnContextPopup;
//property OnDockDrop;
//property OnDockOver;

View File

@ -2338,12 +2338,13 @@ function DoControlMsg(Handle: hwnd; var Message): Boolean;
var
AWinControl: TWinControl;
begin
Result := False;
Result := false;
AWinControl := FindOwnerControl(Handle);
if AWinControl <> nil then begin
if AWinControl <> nil then
begin
with TLMessage(Message) do
AWinControl.Perform(Msg + CN_BASE, WParam, LParam);
Result:= True;
Result := AWinControl.Perform(Msg + CN_BASE, WParam, LParam);
Result := true;
end;
end;

View File

@ -1022,8 +1022,8 @@ begin
Message.WParam := WParam;
Message.LParam := LParam;
Message.Result := 0;
If Self <> nil then WindowProc(Message);
Result := Message.Result;
if Self <> nil then WindowProc(Message);
Result := Message.Result;
end;
{------------------------------------------------------------------------------

View File

@ -1489,13 +1489,11 @@ Begin
Msg := LM_NOTIFY;
IDCtrl := WParam;
NMHdr := PNMHDR(LParam);
With NMHdr^ do
case code of
TCN_SELCHANGING:
ShowHideTabPage(HWndFrom, False);
TCN_SELCHANGE:
idFrom := ShowHideTabPage(HWndFrom, true);
end;
with NMHdr^ do
case code of
TCN_SELCHANGE:
idFrom := ShowHideTabPage(HWndFrom, true);
end;
end;
end;
end;
@ -1864,6 +1862,16 @@ Begin
WParam := LMKey.CharCode;
end;
LM_NOTIFY:
begin
with LMNotify.NMHdr^ do
case code of
TCN_SELCHANGING:
if LMNotify.Result = 0 then
ShowHideTabPage(HWndFrom, False);
end;
end;
else
case Msg of
WM_LBUTTONDOWN, WM_LBUTTONUP: