Improves TUntabbedNotebook

git-svn-id: trunk@27139 -
This commit is contained in:
sekelsenmat 2010-08-18 15:23:55 +00:00
parent 277dda4e82
commit 5be39fc3e2
3 changed files with 24 additions and 3 deletions

View File

@ -936,10 +936,17 @@ begin
end;
end;
procedure TUntabbedNotebookComponentEditor.ShowPageMenuItemClick(Sender: TObject
);
procedure TUntabbedNotebookComponentEditor.ShowPageMenuItemClick(Sender: TObject);
var
AMenuItem: TMenuItem;
NewPageIndex: integer;
begin
AMenuItem:=TMenuItem(Sender);
if (AMenuItem=nil) or (not (AMenuItem is TMenuItem)) then exit;
NewPageIndex:=AMenuItem.MenuIndex;
if (NewPageIndex<0) or (NewPageIndex>=Notebook.Pages.Count) then exit;
NoteBook.PageIndex:=NewPageIndex;
GetDesigner.SelectOnlyThisComponent(NoteBook.Page[NoteBook.PageIndex]);
end;
procedure TUntabbedNotebookComponentEditor.ExecuteVerb(Index: Integer);

View File

@ -323,6 +323,7 @@ type
TUNBPage = class(TCustomControl)
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;

View File

@ -21,6 +21,19 @@
{ TUNBPage }
constructor TUNBPage.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
ControlStyle := ControlStyle +
[csAcceptsControls, csDesignFixedBounds, csNoDesignVisible, csNoFocus];
// height and width depends on parent, align to client rect
Align := alClient;
Caption := '';
Visible := False;
end;
destructor TUNBPage.Destroy;
begin
{$ifdef DEBUG_NEW_NOTEBOOK}