Rollout Control

Even thought this implementation seems to be a port of the MFC Rollup Control by Johann Nadalutti, I started to develop it some days before the first post of the above-mentioned article. Nevertheless, I need to thank Johann Nadalutti for his great work that gave me the opportunity to improve my implementation.

Rollout Control

This implementation consists of two classes: CRolldownCtrl<TChild> implements the actual Rolldown control while CRolldownContainer implements a manager, which provides the visual area for the Rolldown controls.

The class definitions and implementations are in the file AtlRolldownCtrl.h, which is included in the demo project.

How to use the control in your WTL App

To use this control in your application, add the header file AtlRolldownCtrl.h to your project and then add CRolloutContainer m_RolloutContainer; to the class definition that will be using the control.

  1. Create a dialog box in the resource editor with the WS_CHILD style and its WTL dialog class as usual (e.g. CDlg1).
    Note: Trap IDOK and IDCANCEL else the dialog will be destroyed if the user presses either RETURN or ESC.
  2. Add CRolloutCtrl<CDlg1> m_dlg1; to the class declaration that will be using the control.
  3. Create the control in the OnCreate function and add it to the container, e.g.:
        _T("My Rollout Control"));

Repeat these steps for additional Rolldown controls.

The final OnCreate function may look like this:

LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/,
    LPARAM /*lParam*/, BOOL& /*bHandled*/)
    _T("Rollout Control 1"));
    _T("Rollout Control 2"));
    _T("Rollout Control 3"));