SECFullScreenView is a utility component that allows you to integrate full-screen display into your MDI/SDI based applications. SECFullScreenView is designed to be used as a stand-alone component. It hooks into your application and manages the full-screen activation without any need for subclassing your existing frame window classes.
This plug-in design makes it simple to add the full-screen capability to existing applications. All you need to do is add an SECFullScreenView member to your main frame class and invoke the SECFullScreenView::SetFSMode() API to trigger the full-screen display. Once this mode is set, SECFullScreenView steps into your application's activation mechanism and manages it until the user exits full-screen view mode, by pressing the ESCAPE key or clicking the full-screen toolbar.
The full-screen toolbar is a dynamically created toolbar that is instantiated as either an SECCustomToolBar or CToolBar/SECToolBar, depending on the run-time class of the frame. The SECCustomToolBar component provides the same cool-look full-screen user interface that is found in Microsoft VC++ and Microsoft Office. Both the standard bitmap toolbar and text toolbar are supported. The default toolbar offers certain pre-set styles. However, you can change the default styles with the help of an application-defined callback.
Another feature of SECFullScreenView is the drop-down menu style that allows the temporary display of the application's main window menu when the cursor is placed over the top portion of the screen like the Windows Taskbar. The default behavior is to hide all docking windows (control bars) except in the case of docking views when in the application is in full-screen mode. However, SECFullScreenView allows you to selectively include control bars you want to display in full-screen mode.
The SECFullScreenView class simply derives from CWnd.
The SECFullScreenView has a number of styles that control its behavior. These styles are used with the SetFSMode() method.
Style flag | Description |
SEC_FS_DROPDOWNMENU | The application's main window menu is displayed when the cursor hovers over the top section of the screen. Moving the cursor hides the menu. |
SEC_FS_TEXTTOOLBAR | The full-screen toolbar is a text-only toolbar. The label can be set while invoking the full-screen mode. |
SEC_FS_TASKBARHIDE | Forcibly hides the Windows task bar when full-screen mode is triggered. Exiting full-screen mode retrieves the task bar. Default is false. |
SEC_FS_NOCUSTTOOLBAR | SECFullScreenView defaults to using SECCustomToolBar when the Objective Toolkit frame window classes are used. Setting this style creates the toolbar as an SECToolBar. |
The following topics describe how to utilize the full-screen view in your applications.
Add an SECFullScreenView member to your CFrameWnd-derived main frame class. From a command handler, call the SetFSMode() function with the required parameters. For example:
// m_FSView is the SECFullScreenView object m_FSView.SetFSMode(); // The following call triggers the full-screen view with // drop-down // menus enabled and a text-only toolbar. The second // parameter // specifies the toolbar text. m_FSView.SetFSMode(SEC_FS_TEXTTOOLBAR|SEC_FS_DROPDOWNMENU, "Close Full Screen"); // A bitmap toolbar with the IDR_FSBITMAP resource is set m_FSView.SetFSMode( SEC_FS_DEFAULT, IDR_FSBITMAP ); |
Use the SECFullScreenView::SetFSStyle() and GetFSStyle() methods.
SECFullScreenView::GetFSMode() returns a BOOL that specifies whether the full-screen mode is currently set.
Use the CloseFSMode() method to terminate the full-screen display.
Use the SECFSBarState structure and the SetBarStateArray() method to specify the control bars to be displayed during full-screen view mode. The following excerpt from the SCREENVIEW sample demonstrates the usage:
// Setting the second member of SECFSBarState to TRUE indicates // the control bar is visible only during the full-screen mode. // The 'full screen only' bars will be displayed when the FS mode // is set and will automatically be hidden when FS mode exits. SECFSBarState barState[2] = { { &m_wndCloudToolBar, FALSE }, { &m_wndPalette, TRUE } }; m_FSView.SetBarStateArray(barState, 2); m_FSView.SetFSMode(SEC_FS_DROPDOWNMENU); |
SECFullScreenView only performs show/hide operations on the respective control bars. It is your responsibility to ensure that the control bars have been created and that they remain in scope throughout the time the application is in full-screen view mode.
The full-screen view toolbar class is instantiated dynamically based on the application's frame classes. So changing the default styles involves defining a callback function within your application and specifying this function pointer to the SECFullScreenView object. When the callback is invoked, you can examine the existing styles and change them as required.
Declare the callback.
// Callback definition within your main frame class static void CALLBACK SetToolBarStyles(UINT& dwStyle, UINT& dwStyleEx); |
Define the callback function.
// Callback implementation. // This example creates the toolbar without the "cool-look" // double gripper and with a visible border void CALLBACK CMainFrame::SetToolBarStyles(UINT& dwStyle, UINT& dwStyleEx) { dwStyle |= CBRS_BORDER_ANY; dwStyleEx &= ~CBRS_EX_GRIPPER; } |
Before invoking the full-screen view mode, call the SetFSToolBarStylesCB() method, providing the address of the callback function.
// Specifying the callback to SECFullScreenView m_FSView.SetFSToolBarStylesCB(SetToolBarStyles); m_FSView.SetFSMode(SEC_FS_DROPDOWNMENU, "Close Full Screen"); |
The Objective Toolkit sample screenview demonstrates usage of this class. This sample does not ship with the product. For information on how to obtain this sample, see Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.