OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Overriding Default Attributes

The following table shows some default values you might want to override for Attr members:

Note
A value of 0 means to use the Windows default value.
Attr memberDefault value
StyleWS_CHILD | WS_VISIBLE
ExStyle0
X0
Y0
W0
H0
Menu0
Id0
Param0
AccelTable0

You can override those defaults in a derived window class's constructor by changing the values in the Attr structure. For example:

TTestWindow::TTestWindow(TWindow* parent, const char* title)
: TFrameWindow(parent, title),
TWindow(parent, title)
{
Attr.Style &= (WS_SYSMENU | WS_MAXIMIZEBOX);
Attr.Style |= WS_MINIMIZEBOX;
Attr.X = 100;
Attr.Y = 100;
Attr.W = 415;
Attr.H = 355;
}

Child-window Attributes

You can set the attributes of a child window in the child window's constructor or in the code that creates the child window. When you change the attributes in the parent window object's constructor, you need to use a pointer to the child window object to get access to its Attr member.

TTestWindow::TTestWindow(TWindow* parent, const char* title)
: TWindow(parent, title)
{
TWindow *helpWindow = new TWindow(this, "Help System");
helpWindow->Attr.X = 100;
helpWindow->Attr.Y = 100;
helpWindow->Attr.W = 300;
helpWindow->Attr.H = 300;
helpWindow->SetCursor(0, IDC_HAND);
}