revert r52338 #e26e156a5c

git-svn-id: trunk@52341 -
This commit is contained in:
ondrej 2016-05-22 10:06:52 +00:00
parent c3114ad322
commit 958c53a72e
7 changed files with 9 additions and 57 deletions

View File

@ -25,7 +25,7 @@ interface
uses
Classes, SysUtils, TypInfo, LCLProc, AvgLvlTree, Dialogs, Controls, ComCtrls,
Graphics, ExtCtrls, LMessages,
Graphics, ExtCtrls,
ObjInspStrConsts, PropEdits, PropEditUtils;
type
@ -286,7 +286,6 @@ var
ANode: TTreeNode;
APersistent: TPersistent;
NewSelection: TPersistentSelectionList;
Msg: TLMessage;
begin
NewSelection := TPersistentSelectionList.Create;
try
@ -309,26 +308,13 @@ begin
if NewSelection.IsEqual(FComponentList.Selection) then
Exit;
FComponentList.Selection.Assign(NewSelection);
if (NewSelection.Count=1) then
if (NewSelection.Count=1) and
(NewSelection[0] is TCustomPage) and
(TCustomPage(NewSelection[0]).Parent is TCustomTabControl) then
begin
ANode := GetFirstMultiSelected;
FillChar(Msg{%H-}, SizeOf(Msg), 0);
Msg.msg := CM_OBJECTINSPECTORSELECT;
while Assigned(ANode) do
begin
APersistent := TPersistent(ANode.Data);
if Assigned(APersistent) then
begin
if APersistent is TControl then
TControl(APersistent).Perform(Msg.msg, Msg.wParam, Msg.lParam)
else // support TComponent(s) as well
APersistent.Dispatch(Msg);
end;
Msg.lParam := 1; // see comment at CM_OBJECTINSPECTORSELECT for more info
ANode := ANode.Parent;
end;
TCustomTabControl(TCustomPage(NewSelection[0]).Parent).PageIndex :=
TCustomPage(NewSelection[0]).PageIndex;
end;
inherited DoSelectionChanged;
finally
NewSelection.Free;

View File

@ -244,7 +244,6 @@ type
procedure SetParent(AParent: TWinControl); override;
property Flags: TPageFlags read FFlags write FFlags;
procedure CMHitTest(var Message: TLMNCHITTEST); message CM_HITTEST;
procedure CMObjectInspectorSelect(var Message: TLMessage); message CM_OBJECTINSPECTORSELECT;
procedure CMVisibleChanged(var Message: TLMessage); message CM_VISIBLECHANGED;
function GetPageIndex: integer; virtual;
procedure SetPageIndex(AValue: Integer); virtual;

View File

@ -42,15 +42,11 @@ type
TPage = class(TCustomControl)
private
FOnBeforeShow: TBeforeShowPageEvent;
function GetPageIndex: Integer;
protected
procedure CMObjectInspectorSelect(var Message: TLMessage); message CM_OBJECTINSPECTORSELECT;
procedure SetParent(AParent: TWinControl); override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
public
property PageIndex: Integer read GetPageIndex;
published
// Lazarus-specific TPage events
// OnBeforeShow occurs before a page is displayed, so that
@ -132,8 +128,8 @@ type
{ function TabIndexAtClientPos(ClientPos: TPoint): integer;
function TabRect(AIndex: Integer): TRect;
function GetImageIndex(ThePageIndex: Integer): Integer; virtual;
function IndexOf(APage: TCustomPage): integer;
function CustomPage(Index: integer): TCustomPage;}
function IndexOf(APage: TPage): integer;
public
property ActivePage: String read GetActivePage;// write SetActivePage; // should not be published because the read can raise an exception
property ActivePageComponent: TPage read GetActivePageComponent;// write SetActivePage; // should not be published because the read can raise an exception

View File

@ -102,9 +102,8 @@ const
CM_TABLETOPTIONSCHANGED = CM_BASE + 87 unimplemented;
CM_PARENTTABLETOPTIONSCHANGED = CM_BASE + 88 unimplemented;
// LCL only
CM_APPSHOWBTNGLYPHCHANGED = CM_BASE + CM_LCLOFFSET + 68;
CM_APPSHOWMENUGLYPHCHANGED = CM_BASE + CM_LCLOFFSET + 69;
CM_OBJECTINSPECTORSELECT = CM_BASE + CM_LCLOFFSET + 70; // sent when this or a child node is selected in the OI (LParam = 0 for this node, LParam = 1 for a child node)
CM_APPSHOWBTNGLYPHCHANGED = CM_BASE + CM_LCLOFFSET + 68;
CM_APPSHOWMENUGLYPHCHANGED = CM_BASE + CM_LCLOFFSET + 69;
CN_BASE = $BC00;
CN_CHARTOITEM = CN_BASE + LM_CHARTOITEM;

View File

@ -195,12 +195,6 @@ begin
FOnHide(Self);
end;
procedure TCustomPage.CMObjectInspectorSelect(var Message: TLMessage);
begin
if (Parent is TCustomTabControl) and (csDesigning in ComponentState) then
TCustomTabControl(Parent).PageIndex := PageIndex;
end;
procedure TCustomPage.DoShow;
begin
if Assigned(FOnShow) then

View File

@ -154,15 +154,6 @@ begin
Result := FPageIndex;
end;
function TNotebook.IndexOf(APage: TPage): integer;
begin
for Result := 0 to PageCount-1 do
if Page[Result] = APage then
Exit;
Result := -1;
end;
procedure TNotebook.InsertPage(APage: TPage; Index: Integer);
begin
if FPageList.IndexOf(APage) >= 0 then Exit;

View File

@ -56,12 +56,6 @@ begin
Visible := False;
end;
procedure TPage.CMObjectInspectorSelect(var Message: TLMessage);
begin
if (Parent is TNotebook) and (csDesigning in ComponentState) then
TNotebook(Parent).PageIndex := PageIndex;
end;
destructor TPage.Destroy;
begin
{$ifdef DEBUG_NEW_NOTEBOOK}
@ -79,13 +73,6 @@ begin
inherited Destroy;
end;
function TPage.GetPageIndex: Integer;
begin
if Parent is TNotebook then
Result := TNotebook(Parent).IndexOf(Self)
else
Result := -1;
end;
// included by extctrls.pp