Objective Toolkit : Chapter 15 User Interface Extensions : Bitmapped Dialog
Bitmapped Dialog
SECBitmapDialog lets you create dialogs with tiled or centered bitmaps in the background. Use SECBitmapDialog to decorate your application dialogs with 16 or 256 color bitmaps.
The following figure demonstrates how you can use bitmaps in your dialogs.
Figure 114 – Objective Toolkit BmpDialog32 Sample Dialog
SECBitmapDialog is a direct enhancement of CDialog.
Figure 115 – Objective Toolkit SECBitmapDialog Class Hierarchy
Using SECBitmapDialog
The following sections describe how you can implement Objective Toolkit’s User Interface Extensions.
To incorporate the SECBitmapDialog class into your code
Use the SECBitmapDialog as you would use CDialog. SECBitmapDialog adds a SetBitmap() member function. Use SetBitmap() to specify the bitmap and a display mode. The following display modes are available.
Display mode flag
Description
SEC_BITMAP_TILE
Tiles the bitmap in the dialog’s background.
SEC_BITMAP_CENTER
Centers the bitmap in the dialog’s background.
SEC_BITMAP_FILL
Fills the dialog with the specified bitmap.
The following code creates a dialog with a tiled bitmap in the background.
 
SECBitmapDialog bmpDlg(IDD_MODAL_BMPDLG);
bmpDlg.SetBitmap(IDB_BRICKWALL, SEC_BITMAP_TILE);
bmpDlg.DoModal();
To set the image used by the SECBitmapDialog class
You can set the bitmap used in an SECBitmapDialog by calling the SetBitmap() method, which has three overloads. The first overload accepts a resource ID of a bitmap resource. The second overload accepts the filename of a bitmap file. The third overload takes a pointer to an SECImage-derived object. Objective Toolkit can use any of the overloads for 256-color support.
To change the bitmap at run time, the application can call SetBitmap() multiple times. Use SetNullBitmap() to remove the bitmap from the dialog.
Customizing SECBitmapDialog
There is one overridable method in the SECBitmapDialog class: OnStaticCtlColor(). You can override this function to set the text color for Static controls.
SECBitmapDialog features are demonstrated in the sample DmpDialog32. SECBitmapDialog modes are demonstrated in the sample TodTest. These samples do not ship with the product. For information on how to obtain these samples, see “Location of Sample Code” in the Getting Started part.