BCGSuite for MFC
CBCGPPopupWindow

Detailed Description

The CBCGPPopupWindow class implements the functionality of a modeless dialog which appears on the screen to inform the user about some event.

The dialog may be transparent, may appear with some animation effects and may disappear with a delay or may be dismissed by click on a close button.

It's possible to show the "default" dialog containing an icon, a message text (label) and a link. You can handle clicks on the link and perform some actions upon the click. Another option is to create the dialog from application resources and put any controls you want.

You should create a popup window in two steps. First, call the constructor CBCGPPopupWindow to construct the CBCGPPopupWindow object, then call the CBCGPPopupWindow::Create member function to create the window and attach it to the CBCGPPopupWindow object.

The CBCGPPopupWindow creates a special child dialog that covers the entire client area of the popup window and owns all controls the framework or developer place on it.

Perform the following steps to display a custom dialog on the popup window:

  • Derive a class from CBCGPPopupDlg
  • Create a dialog template in the resources (must be a child dialog)
  • Call CBCGPPopupWindow::Create with resource ID of the dialog template and pointer to runtime class information of the derived class.

The custom dialog may handle all notifications coming from the hosted controls.

Use the following functions to control the popup window behavior:

The following code illustrates usage of CBCGPPopupWindow in application:

Copy
// construct the popup window object. Note, that you don't need to call delete pWndPopup.
// The pointer is deleted in OnNcDestroy
// set up the window parameters
pWndPopup->SetAnimationType(CBCGPPopupMenu::FADE);
pWndPopup->SetTransparency(200);
params.m_strText = _T("You have 3 new messages");
params.m_strURL = _T("Click here to open");
params.m_nURLCmdID = ID_OPEN_MSG;
// Create and display the popup window
pWndPopup->Create(this, params);

Inherits CWnd.

Public Types

enum  BCGPPopupWindowStemLocation
 
enum  BCGPPopupWindowTheme
 

Public Member Functions

 CBCGPPopupWindowDefault constructor.
 
 AreRoundedCornersTells whether the popup window has rounded corners.
 
 CreateCreates and initializes the popup window.
 
 CreateCreates and initializes the popup window.
 
 EnableCloseButtonEnables or disables the popup window close button.
 
 EnablePinButtonEnables or disables the popup window pin button.
 
 GetAnimationSpeedReturns the animation speed of the popup window.
 
 GetAnimationTypeReturns the animation type.
 
 GetAutoCloseTimeReturns the auto-close time out.
 
 GetCaptionHeightReturns the caption height
 
 GetLastPosReturns the last valid position of the popup window on the screen.
 
 GetStemLocationReturns the popup window stem location.
 
 GetStemSizeReturns the stem size.
 
 GetThemeReturns the currently selected Popup window color theme.
 
 GetTransparencyReturns the transparency level.
 
 HasCloseButtonTells whether the popup window has a close button.
 
 HasPinButtonTells whether the popup window has a pin button.
 
 HasSmallCaptionTells whether the popup window is displayed with the small caption, or with normal caption.
 
 IsCloseOnOwnerChangeTells whether the popup window is closed when the owner window is changed (e.g., moved or resized).
 
 IsLargeCaptionFontTells whether the popup window caption is displayed with a large or normal font.
 
 IsPinnedTells whether the popup window is pinned.
 
 IsShadowTells whether the popup window has a shadow.
 
 IsSmallCaptionGripperTells whether the popup window small caption is displayed with a gripper.
 
 OnClickCloseButtonCalled by the framework when user clicks a close button.
 
 OnClickLinkButtonCalled by the framework when user clicks a link button located on popup menu.
 
 SetAnimationSpeedSets the new animation speed.
 
 SetAnimationTypeSets the animation type.
 
 SetAutoCloseTimeSets the auto close time out.
 
 SetCloseOnOwnerChangeSpecify whether the popup window is closed when the owner window is changed (e.g., moved or resized).
 
 SetCustomThemeSets custom color theme.
 
 SetRoundedCornersSpecify whether the popup window should be created with the rounded corners.
 
 SetShadowEnables/disable the popup window shadow.
 
 SetSmallCaptionSwitches between small and normal captions.
 
 SetSmallCaptionGripperSpecify whether the popup window small caption should be displayed with a gripper.
 
 SetStemLocationSets a stem location.
 
 SetThemeSets a predefined color theme.
 
 SetTransparencySets transparency level.
 

Static Public Member Functions

 CloseActivePopupCloses an active popup (if available).