rkamarowski
Programmer
i'm creating a component based on TPanel. i can get a button to be visible, and a tmemo, but the toolbar is not visible. any ideas?
thanks,
bob k.
----------
unit KMPDGlobalLister;
interface
uses
SysUtils, Classes, ComCtrls, Controls, ExtCtrls, StdCtrls;
type
TKMPDGlobalLister = class(TPanel)
private
{ Private declarations }
// memGlobalLister: TMemo;
function GetGlobalName: string;
function GetLastNodeAccessed: string;
procedure SetGlobalName(sVal: string);
procedure SetLastNodeAccessed(sVal: string);
protected
{ Protected declarations }
public
{ Public declarations }
button: TButton;
// properites
property GlobalName: string read GetGlobalName write SetGlobalName;
property LastNodeAccessed: string read GetLastNodeAccessed write SetLastNodeAccessed;
// methods
Constructor Create(AnOwner:TComponent); Override;
Destructor Destroy; Override;
published
{ Published declarations }
memToolBar: TToolBar;
end;
procedure Register;
implementation
Constructor TKMPDGlobalLister.Create(AnOwner:TComponent);
begin
inherited Create(AnOwner);
Align:=alClient;
Anchors:=[akLeft,AkRight,akTop,akBottom];
Height:=200;
Width:=200;
memToolBar:=TToolBar.Create(Self);
memToolBar.Parent:=Self;
with memToolBar do
begin
Align:=alTop;
Anchors:=[akLeft,akRight,akTop];
Caption:='here ';
Enabled:=True;
Flat:=True;
Height:=30;
Visible:=True;
Width:=175;
end;
memToolBar.Show;
button:=TButton.Create(Self);
with button do
begin
Parent:=Self;
Caption:='button';
Enabled:=true;
Height:=20;
Width:=120;
ParentFont:=true;
show;
Visible:=true;
end;
{
// memo for text
memGlobalLister:=Tmemo.Create(Self);
memGlobalLister.Parent:=Self;
with memGlobalLister do
begin
BevelInner:=bvRaised;
BevelKind:=bkNone;
BevelOuter:=bvLowered;
// BorderStyle:=bsSingle;
Enabled:=True;
Height:=150;
ReadOnly:=True;
ScrollBars:=ssBoth;
Width:=150;
end; // memGlobalLister
memGlobalLister.Show;
}
end; // constructor
Destructor TKMPDGlobalLister.Destroy;
begin
inherited Destroy;
end;
// functions and procedures
function TKMPDGlobalLister.GetGlobalName: string;
begin
result:=GlobalName;
end;
function TKMPDGlobalLister.GetLastNodeAccessed: string;
begin
result:=LastNodeAccessed;
end;
procedure TKMPDGlobalLister.SetGlobalName(sVal: string);
begin
GlobalName:=sVal;
end;
procedure TKMPDGlobalLister.SetLastNodeAccessed(sVal: string);
begin
LastNodeAccessed:=sVal;
end;
procedure Register;
begin
RegisterComponents('Capacity Planning', [TKMPDGlobalLister]);
end;
end.
thanks,
bob k.
----------
unit KMPDGlobalLister;
interface
uses
SysUtils, Classes, ComCtrls, Controls, ExtCtrls, StdCtrls;
type
TKMPDGlobalLister = class(TPanel)
private
{ Private declarations }
// memGlobalLister: TMemo;
function GetGlobalName: string;
function GetLastNodeAccessed: string;
procedure SetGlobalName(sVal: string);
procedure SetLastNodeAccessed(sVal: string);
protected
{ Protected declarations }
public
{ Public declarations }
button: TButton;
// properites
property GlobalName: string read GetGlobalName write SetGlobalName;
property LastNodeAccessed: string read GetLastNodeAccessed write SetLastNodeAccessed;
// methods
Constructor Create(AnOwner:TComponent); Override;
Destructor Destroy; Override;
published
{ Published declarations }
memToolBar: TToolBar;
end;
procedure Register;
implementation
Constructor TKMPDGlobalLister.Create(AnOwner:TComponent);
begin
inherited Create(AnOwner);
Align:=alClient;
Anchors:=[akLeft,AkRight,akTop,akBottom];
Height:=200;
Width:=200;
memToolBar:=TToolBar.Create(Self);
memToolBar.Parent:=Self;
with memToolBar do
begin
Align:=alTop;
Anchors:=[akLeft,akRight,akTop];
Caption:='here ';
Enabled:=True;
Flat:=True;
Height:=30;
Visible:=True;
Width:=175;
end;
memToolBar.Show;
button:=TButton.Create(Self);
with button do
begin
Parent:=Self;
Caption:='button';
Enabled:=true;
Height:=20;
Width:=120;
ParentFont:=true;
show;
Visible:=true;
end;
{
// memo for text
memGlobalLister:=Tmemo.Create(Self);
memGlobalLister.Parent:=Self;
with memGlobalLister do
begin
BevelInner:=bvRaised;
BevelKind:=bkNone;
BevelOuter:=bvLowered;
// BorderStyle:=bsSingle;
Enabled:=True;
Height:=150;
ReadOnly:=True;
ScrollBars:=ssBoth;
Width:=150;
end; // memGlobalLister
memGlobalLister.Show;
}
end; // constructor
Destructor TKMPDGlobalLister.Destroy;
begin
inherited Destroy;
end;
// functions and procedures
function TKMPDGlobalLister.GetGlobalName: string;
begin
result:=GlobalName;
end;
function TKMPDGlobalLister.GetLastNodeAccessed: string;
begin
result:=LastNodeAccessed;
end;
procedure TKMPDGlobalLister.SetGlobalName(sVal: string);
begin
GlobalName:=sVal;
end;
procedure TKMPDGlobalLister.SetLastNodeAccessed(sVal: string);
begin
LastNodeAccessed:=sVal;
end;
procedure Register;
begin
RegisterComponents('Capacity Planning', [TKMPDGlobalLister]);
end;
end.