Creating the List Window
The list window will be created as a child of another window (called
TLWWindow here). There is no need to subclass the TListWindow.
To create the list window we write:
//--------------------------------------------------------
// TLWWindow
// ~~~~~~~~~
// Construction/Destruction handling.
//
TLWWindow::TLWWindow(TWindow* parent,
const char far* title,
TModule* module)
:
TWindow(parent, title, module)
{
// create the list window (the size is unimportant - see EvSize)
//
List = new TListWindow(this, kListId, 0, 0, 0, 0, module);
List->Attr.Style |= LVS_REPORT;
}
and to resize the list window to fill the client area:
DEFINE_RESPONSE_TABLE1(TLWWindow, TWindow)
//...
EV_WM_SIZE,
//...
END_RESPONSE_TABLE;
void TLWWindow::EvSize(uint sizeType, TSize& size)
{
TWindow::EvSize(sizeType, size);
List->MoveWindow(GetClientRect(), true);
}
Next Page