home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IFRAME.HPP < prev    next >
Text File  |  1993-10-22  |  40KB  |  743 lines

  1. #ifndef _IFRAME_
  2. #define _IFRAME_
  3. /*******************************************************************************
  4. * FILE NAME: iframe.hpp                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IFrameWindow - Class representing OS/2 PM "frame" windows.               *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or               *
  15. *   disclosure                                                                 *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IBASE_
  20.   #include <ibase.hpp>
  21. #endif
  22.  
  23. #ifndef _IWINDOW_
  24.   #include <iwindow.hpp>
  25. #endif
  26.  
  27. #ifndef _IHANDLE_
  28.   #include <ihandle.hpp>
  29. #endif
  30.  
  31. #ifndef _IRESLIB_
  32.   #include <ireslib.hpp>
  33. #endif
  34.  
  35. #ifndef _ICCONST_
  36.   #include <icconst.h>
  37. #endif
  38.  
  39. #ifndef _IRECT_
  40.   #include <irect.hpp>
  41. #endif
  42.  
  43. #ifndef _ICMDEVT_
  44.   #include <icmdevt.hpp>
  45. #endif
  46.  
  47.  
  48. /*----------------------------------------------------------------------------*/
  49. /* Align classes on four byte boundary.                                       */
  50. /*----------------------------------------------------------------------------*/
  51. #pragma pack(4)
  52.  
  53. /*----------------------------------------------------------------------------*/
  54. /* Turn off warning for compiler generated copy/assignment                    */
  55. /*----------------------------------------------------------------------------*/
  56. #pragma info(nocpy)
  57.  
  58.  
  59. class IFrameExtensions;
  60. class IFrameExtension;
  61. class IFrameHandler;
  62. class IColor;
  63. class IFrameWindowData;
  64.  
  65. class IFrameWindow : public IWindow {
  66. typedef IWindow
  67.   Inherited;
  68. /*******************************************************************************
  69. * The IFrameWindow class is used to create OS/2 frame windows.  Such windows   *
  70. * are typically children of the desktop and parent/owner windows of the User   *
  71. * Interface Class Library dialogs and controls.                                *
  72. *                                                                              *
  73. * The primary distinction between an IFrameWindow and a generic IWindow is     *
  74. * that frame windows are conceptually comprised of a number of child windows.  *
  75. * Frame windows can include any combination of the following.  Components      *
  76. * that have an asterisk (*) next to them are default components.               *
  77. *                                                                              *
  78. *  - A title bar *                                                             *
  79. *  - A system menu *                                                           *
  80. *  - Minimize and maximize buttons *                                           *
  81. *  - A window list *                                                           *
  82. *  - A sizing border *                                                         *
  83. *  - A double-byte character set (DBCS) status area *                          *
  84. *  - A menu bar                                                                *
  85. *  - A client window                                                           *
  86. *                                                                              *
  87. * The User Interface Class Library has classes that allow you to manipulate    *
  88. * several of these components.  Those classes are:                             *
  89. *                                                                              *
  90. *  - ITitle      (title bar)                                                   *
  91. *  - ISystemMenu (system menu)                                                 *
  92. *  - IMenuBar    (menu bar)                                                    *
  93. *                                                                              *
  94. * The frame's client window is essentially the control that corresponds to     *
  95. * the rectangular portion of the frame window not occupied by the other frame  *
  96. * controls.                                                                    *
  97. *                                                                              *
  98. * In addition to the standard Presentation Manager frame controls,             *
  99. * IFrameWindow supports additional frame extensions.  These extensions are     *
  100. * primarily application-specific, although a general-purpose information area  *
  101. * extension is provided by the IInfoArea class.  Extensions are added to the   *
  102. * frame by providing an IWindow and specifying the portion of the frame to be  *
  103. * occupied by the window.  The extension can fill a portion of the standard    *
  104. * title bar area (the left- or right-hand side of a given width) or the        *
  105. * standard client area (the top or bottom edge of a given height).             *
  106. *******************************************************************************/
  107. public:
  108. class Style;
  109. /*------------------------- Constructors/Destructor ----------------------------
  110. | There are eight ways to construct frame windows.  The first three ways use   |
  111. | the given window or resource ID to attempt to create the frame from a        |
  112. | dialog template that contains the frame attributes.  If no dialog resource   |
  113. | is found, a plain frame window is constructed and given the window ID        |
  114. | specified in the argument resource ID.  You can construct frame windows      |
  115. | from a dialog template as follows:                                           |
  116. |                                                                              |
  117. |    - From a given window ID.                                                 |
  118. |    - From a given resource ID and optional owner window pointer.             |
  119. |    - From a given resource ID, parent window, and owner window.              |
  120. |                                                                              |
  121. | The remaining constructors presume that the window to be constructed is not  |
  122. | to be created from a dialog template.  Instead, the frame attributes are     |
  123. | specified as additional constructor arguments.  You can construct frame      |
  124. | windows without a dialog template as follows:                                |
  125. |                                                                              |
  126. |    - From the window handle of an existing frame window.                     |
  127. |    - From a resource ID and frame style.                                     |
  128. |    - From a frame style and optional resource ID.                            |
  129. |    - From a title, and optional resource ID and frame style.                 |
  130. |    - From a full set of frame attributes:  resource ID, parent, owner,       |
  131. |      initial rectangle (position and size), and optional style and title.    |
  132. ------------------------------------------------------------------------------*/
  133.   IFrameWindow ( unsigned long id = IC_DEFAULT_FRAME_ID );
  134.  
  135.   IFrameWindow ( const IResourceId &resId,
  136.                  IWindow           *owner = 0 );
  137.  
  138.   IFrameWindow ( const IResourceId &resId,
  139.                  IWindow           *parent,
  140.                  IWindow           *owner );
  141.  
  142.   IFrameWindow ( const IWindowHandle &hwnd );
  143.  
  144.   IFrameWindow ( const IResourceId         &resId,
  145.                  const IFrameWindow::Style &style );
  146.  
  147.   IFrameWindow ( const IFrameWindow::Style &style,
  148.                  const IResourceId         &resId = IC_DEFAULT_FRAME_ID );
  149.  
  150.   IFrameWindow ( const char                *title,
  151.                  const IResourceId         &resId = IC_DEFAULT_FRAME_ID,
  152.                  const IFrameWindow::Style &style = defaultStyle() );
  153.  
  154.   IFrameWindow ( const IResourceId         &resId,
  155.                  IWindow                   *parent,
  156.                  IWindow                   *owner,
  157.                  const IRectangle          &initRect,
  158.                  const IFrameWindow::Style &style = defaultStyle(),
  159.                  const char                *title = 0 );
  160.  
  161. virtual
  162.   ~IFrameWindow ( );
  163.  
  164. /*---------------------------------- Style -------------------------------------
  165. | The following functions provide a means to set and query frame window        |
  166. | styles:                                                                      |
  167. |   Style - Nested class that provides static members that define the set of   |
  168. |           valid frame window styles.  These styles can be used in            |
  169. |           conjunction with the styles defined by the IWindow::Style nested   |
  170. |           class.                                                             |
  171. |                                                                              |
  172. | The valid frame window styles are:                                           |
  173. |                                                                              |
  174. |   classDefaultStyle   - The original default style for this class, which is  |
  175. |                         titleBar | systemMenu | minimizeButton | windowList  |
  176. |                         maximizeButton | sizingBorder | appDBCSStatus.       |
  177. |   accelerator         - Associates an accelerator key table with the frame   |
  178. |                         window.  The table is loaded from the application's  |
  179. |                         resource library.                                    |
  180. |   alignNoAdjust       - Restricts adjustment of the frame position.  As a    |
  181. |                         consequence of setting this style, certain           |
  182. |                         performance optimizations obtained by such           |
  183. |                         alignment are lost.                                  |
  184. |   animated            - Shows the frame window with "animation" when it is   |
  185. |                         opened, closed, or restored.                         |
  186. |   appDBCSStatus       - Includes a DBCS status area in the frame window      |
  187. |                         when it is displayed in a DBCS environment.          |
  188. |   border              - Puts a border around the frame window.               |
  189. |   dialogBackground    - Gives a frame (not created from a dialog template)   |
  190. |                         the system dialog background color.  Without this    |
  191. |                         style, the frame has the system window background    |
  192. |                         color.                                               |
  193. |   dialogBorder        - Puts a dialog border around the frame window.        |
  194. |   hideButton          - Provides the frame window with a hide button.  This  |
  195. |                         style is mutually exclusive with the minimizeButton  |
  196. |                         style.                                               |
  197. |   horizontalScroll    - Provides a horizontal scroll bar in the frame        |
  198. |                         window.                                              |
  199. |   maximizeButton      - Provides a maximize button in the frame window.      |
  200. |   maximized           - Causes the frame window to be created in the         |
  201. |                         maximized state.                                     |
  202. |   menuBar             - Provides the frame window with a menu bar, which is  |
  203. |                         loaded from the application's resource library.      |
  204. |                         If you want to construct the frame window            |
  205. |                         dynamically instead of from a resource library, use  |
  206. |                         the IMenuBar class instead of the menuBar style.     |
  207. |   minimizeButton      - Provides a minimize button in the frame window.      |
  208. |                         This style is mutually exclusive with the            |
  209. |                         hideButton style.                                    |
  210. |   minimized           - Causes the frame window to be created in the         |
  211. |                         minimized state.                                     |
  212. |   minimizedIcon       - Associates an icon with the frame window.  This      |
  213. |                         icon is used when the frame window is minimized.     |
  214. |   noMoveWithOwner     - Disables the default behavior of moving frame        |
  215. |                         windows automatically with their owner.              |
  216. |   shellPosition       - Sets the initial position of the window to a         |
  217. |                         location and size dictated by the system shell.      |
  218. |   sizingBorder        - Puts a sizing border around the frame window.        |
  219. |   systemMenu          - Provides a system menu in the frame window.          |
  220. |   systemModal         - Sets the frame window in system modal mode.          |
  221. |   titleBar            - Provides a title bar for the frame window.           |
  222. |   verticalScroll      - Provides a vertical scroll bar in the frame window.  |
  223. |   windowList          - Adds an entry for this frame window to the system    |
  224. |                         window list.                                         |
  225. |                                                                              |
  226. | The following functions provide means of getting and setting the default     |
  227. | style for this class:                                                        |
  228. |                                                                              |
  229. |   defaultStyle    - Returns the current default style.  This is the same as  |
  230. |                     classDefaultStyle unless setDefaultStyle has been        |
  231. |                     called.                                                  |
  232. |   setDefaultStyle - Sets the default style for all subsequent frame windows. |
  233.  -----------------------------------------------------------------------------*/
  234. INESTEDBITFLAGCLASSDEF1( Style, IFrameWindow, IWindow );
  235.  
  236. static const Style
  237.   classDefaultStyle,
  238.   accelerator,
  239.   alignNoAdjust,
  240.   animated,
  241.   appDBCSStatus,
  242.   border,
  243.   dialogBackground,
  244.   dialogBorder,
  245.   hideButton,
  246.   horizontalScroll,
  247.   maximizeButton,
  248.   maximized,
  249.   menuBar,
  250.   minimizeButton,
  251.   minimized,
  252.   minimizedIcon,
  253.   noMoveWithOwner,
  254.   shellPosition,
  255.   sizingBorder,
  256.   systemMenu,
  257.   systemModal,
  258.   titleBar,
  259.   verticalScroll,
  260.   windowList;
  261.  
  262. static Style
  263.   defaultStyle ( );
  264.  
  265. static void
  266.   setDefaultStyle ( const Style &aStyle );
  267.  
  268. /*----------------------- System Menu Related Actions --------------------------
  269. | These functions deal with frame operations related to the actions on the     |
  270. | system menu:                                                                 |
  271. |   close            - Closes the frame window.                                |
  272. |   maximize         - Maximizes the window.                                   |
  273. |   maximizeRect     - Returns the window rectangle coordinates to which it is |
  274. |                      maximized.                                              |
  275. |   minimize         - Minimizes the window.                                   |
  276. |   minimizeRect     - Returns the window rectangle coordinates to which it is |
  277. |                      minimized.                                              |
  278. |   restore          - Restores a maximized or minimized window.               |
  279. |   restoreRect      - Returns the window rectangle coordinates to which the   |
  280. |                      window is restored.                                     |
  281. |   setRestoreRect   - Changes the rectangle coordinates to which the window   |
  282. |                      is restored.                                            |
  283. |   nextShellRect    - Returns the system-recommended coordinates of the next  |
  284. |                      main window.                                            |
  285. ------------------------------------------------------------------------------*/
  286. virtual IFrameWindow
  287.  &close    ( ),
  288.  &maximize ( ),
  289.  &minimize ( ),
  290.  &restore  ( ),
  291.  
  292.  &setRestoreRect ( const IRectangle &aRect );
  293.  
  294. virtual IRectangle
  295.   maximizeRect ( ) const,
  296.   minimizeRect ( ) const,
  297.   restoreRect  ( ) const;
  298.  
  299. static IRectangle
  300.   nextShellRect ( );
  301.  
  302. /*---------------------- Moving/Sizing Related Actions -------------------------
  303. | These functions deal with moving and sizing the frame and client windows:    |
  304. |   moveSizeToClient -Sizes and positions the frame window around the client  |
  305. |                      rectangle.                                              |
  306. |   clientRectFor    - Returns the client window rectangle based on the size   |
  307. |                      and position of the frame window and its extensions.    |
  308. |   frameRectFor     - Returns the frame window rectangle based on the size    |
  309. |                      and position of the client rectangle, and the frame     |
  310. |                      window's extensions.                                    |
  311. ------------------------------------------------------------------------------*/
  312. virtual IFrameWindow
  313.  &moveSizeToClient ( const IRectangle& clientRect );
  314.  
  315. virtual IRectangle
  316.   clientRectFor ( const IRectangle& frameRect ) const,
  317.   frameRectFor  ( const IRectangle& clientRect ) const;
  318.  
  319. /*----------------------- Set and Query Size Border-----------------------------
  320. | The following functions provide a means to set or query either the width     |
  321. | or height of the frame window, or both simultaneously:                       |
  322. |   borderWidth     - Returns the screen coordinates for the width of the      |
  323. |                     frame window's border.                                   |
  324. |   borderHeight    - Returns the screen coordinates for the height of the     |
  325. |                     frame window's border.                                   |
  326. |   borderSize      - Returns the screen coordinates for both the width and    |
  327. |                     the height of the frame window's border.                 |
  328. |   setBorderWidth  - Sets the screen coordinates for the width of the frame   |
  329. |                     window's border.                                         |
  330. |   setBorderHeight - Sets the screen coordinates for the height of the frame  |
  331. |                     window's border.                                         |
  332. |   setBorderSize   - Sets the screen coordinates for both the width and the   |
  333. |                     height of the frame window's border.                     |
  334. ------------------------------------------------------------------------------*/
  335. unsigned short
  336.   borderWidth  ( ) const,
  337.   borderHeight ( ) const;
  338.  
  339. ISize
  340.   borderSize ( ) const;
  341.  
  342. IFrameWindow
  343.   &setBorderWidth  ( unsigned short cx ),
  344.   &setBorderHeight ( unsigned short cy ),
  345.   &setBorderSize   ( const ISize &size ),
  346.   &setBorderSize   ( unsigned short cxcy ),
  347.   &setBorderSize   ( unsigned short cx, unsigned short cy );
  348.  
  349. /*------------------------------ Modal Display ---------------------------------
  350. | These functions are applied to use a frame window (dialog) in an             |
  351. | application-modal fashion:                                                   |
  352. |   showModally - Causes the frame to be displayed in application-modal mode   |
  353. |                 (all other application windows are disabled).                |
  354. |   dismiss     - Dismisses a frame window by hiding it and, if modal, causes  |
  355. |                 the completion of the showModally function call that         |
  356. |                 triggered its display.                                       |
  357. |   result      - Returns the most recent result for this frame.  The most     |
  358. |                 recent result is the value specified when the window was     |
  359. |                 last dismissed.                                              |
  360. |   setResult   - Sets the result for this frame.                              |
  361. |   notifyOwner - Posts a command event to the frame's (dialog's) owner.       |
  362. ------------------------------------------------------------------------------*/
  363. virtual unsigned long
  364.   showModally ( ),
  365.   result      ( ) const;
  366.  
  367. virtual IFrameWindow
  368.  &dismiss     ( unsigned long result = 0 ),
  369.  &setResult   ( unsigned long result ),
  370.  
  371.  ¬ifyOwner ( unsigned short        id,
  372.                 ICommandEvent::Source source    = ICommandEvent::unknown,
  373.                 Boolean               ptrDevice = false );
  374.  
  375. /*----------------------------- Application Icon -------------------------------
  376. | These functions permit management of the application icon used in the        |
  377. | frame's system menu or when the frame is minimized:                          |
  378. |   icon    - Returns the pointer handle of the window icon.                   |
  379. |   setIcon - Sets the window icon.                                            |
  380. ------------------------------------------------------------------------------*/
  381. virtual IPointerHandle
  382.   icon ( ) const;
  383.  
  384. virtual IFrameWindow
  385.  &setIcon ( const IPointerHandle &icon ),
  386.  &setIcon ( const IResourceId    &iconResId ),
  387.  &setIcon ( unsigned long         iconResId );
  388.  
  389. /*---------------------- ColorArea Enumeration ---------------------------------
  390. | ColorArea - Enumeration that is used to replace the color for a particular   |
  391. |             area of the frame window.  The valid values are:                 |
  392. |               background        - Sets the color of the frame window's       |
  393. |                                   background.                                |
  394. |               foreground        - Sets the color of the frame window's       |
  395. |                                   foreground.                                |
  396. |               shadow            - Sets the color of the frame window's       |
  397. |                                   shadow.                                    |
  398. |               disableBackground - Sets the color of the frame window's       |
  399. |                                   background when the frame window is        |
  400. |                                   disabled.                                  |
  401. |               activeBorder      - Sets the color to be used for the frame    |
  402. |                                   window's border when the frame window is   |
  403. |                                   active.                                    |
  404. |               inactiveBorder    - Sets the color to be used for the frame    |
  405. |                                   window's border when the frame window is   |
  406. |                                   inactive.                                  |
  407. |               frameBorder       - Sets the color to be used for the border   |
  408. |                                   drawn around the children of the frame     |
  409. |                                   window.                                    |
  410. ------------------------------------------------------------------------------*/
  411. enum ColorArea {
  412.   background,
  413.   foreground,
  414.   shadow,
  415.   disableBackground,
  416.   activeBorder,
  417.   inactiveBorder,
  418.   frameBorder };
  419.  
  420. /*-------------------------- Set and Query Color ------------------------------
  421. | The following functions provide  a mean to set and query the frame window    |
  422. | color:                                                                       |
  423. |   setColor - Changes the color of the specified frame window area.           |
  424. |   color    - Returns the color of the specified frame window area.           |
  425. |   usesDialogBackground - Returns if the frame uses the system dialog         |
  426. |              background color (rather than the system window background      |
  427. |              color).  This function is not sensitive to whether an           |
  428. |              overriding background color has not been assigned with the      |
  429. |              setColor function.                                              |
  430. ------------------------------------------------------------------------------*/
  431. IFrameWindow
  432.   &setColor ( ColorArea     value,
  433.               const IColor& color );
  434. IColor
  435.   color ( ColorArea value ) const;
  436. Boolean
  437.   usesDialogBackground ( ) const;
  438.  
  439.  
  440. /*------------------------------ Client Control --------------------------------
  441. | These functions are used to manipulate the frame client control.  The frame  |
  442. | client is much like any of the other frame controls, but this control will   |
  443. | receive notification of certain events not handled by the frame itself.      |
  444. | For example, it receives notification for most ICommandEvents that originate |
  445. | from the frame menu bar.                                                     |
  446. |   clientHandle - Returns the IWindowHandle of the client window or a NULL    |
  447. |                  handle if no client window exists.                          |
  448. |   client       - Returns a pointer to the IWindow that corresponds to the    |
  449. |                  client window or 0 if no client window exists.              |
  450. |   setClient    - Specifies the IWindow that corresponds to the frame client  |
  451. |                  area.                                                       |
  452. ------------------------------------------------------------------------------*/
  453. virtual IWindowHandle
  454.   clientHandle ( ) const;
  455.  
  456. virtual IWindow
  457.  *client ( ) const;
  458.  
  459. virtual IFrameWindow
  460.  &setClient ( IWindow *newClient );
  461.  
  462. /*----------------------------- Frame Extensions -------------------------------
  463. | These functions provide the capability to add extensions to the standard     |
  464. | frame window.  Such extensions are simply additional windows placed in       |
  465. | specific locations.  The information area implemented by the IInfoArea       |
  466. | class is an example of such an extension.                                    |
  467. |   Location         - Enumeration that provides the possible locations at     |
  468. |                      which an extension can be located.  The valid values    |
  469. |                      are:                                                    |
  470. |                        leftOfTitleBar  - To the left of the frame title      |
  471. |                                          area (but to the right of the       |
  472. |                                          system menu, if there is one).      |
  473. |                        rightOfTitleBar - To the right of the frame title.    |
  474. |                        leftOfMenuBar   - To the left of the menu bar.        |
  475. |                        rightOfMenuBar  - To the right of the menu bar.       |
  476. |                        leftOfClient    - At the left-hand side of the        |
  477. |                                          client area.                        |
  478. |                        rightOfClient   - At the right-hand side of the       |
  479. |                                          client area.                        |
  480. |                        aboveClient     - At the top of the client area.      |
  481. |                        belowClient     - At the bottom of the client area.   |
  482. |   SeparatorType    - Enumerator that provides the possible types of          |
  483. |                      separators that will be drawn between the extension     |
  484. |                      and the window to which it is attached:                 |
  485. |                        none      - No separator will be drawn.               |
  486. |                        thinLine  - A thin separator line (1 pel wide) will   |
  487. |                                    be drawn.                                 |
  488. |                        thickLine - A thick separator line (3 pels wide)      |
  489. |                                    will be drawn.                            |
  490. |   addExtension     - Adds a window as a frame extension.  Arguments          |
  491. |                      indicate where the extension is to be located and what  |
  492. |                      portion of the location window is to be allocated to    |
  493. |                      this extension.  The portion can be specified as        |
  494. |                      either a fixed width and height or a floating point     |
  495. |                      value holding a percentage.  For example, 0 < x < 1.0.  |
  496. |   removeExtension  - Removes a frame extension (window).                     |
  497. |   setExtensionSize - Resets a frame extension's size.                        |
  498. |   update           - Causes the frame window to reconfigure all its          |
  499. |                      controls and extensions.  This function is called       |
  500. |                      automatically by the addExtension and setClient member  |
  501. |                      functions.                                              |
  502. ------------------------------------------------------------------------------*/
  503. enum Location
  504.   {
  505.   leftOfTitleBar,
  506.   rightOfTitleBar,
  507.   leftOfMenuBar,
  508.   rightOfMenuBar,
  509.   leftOfClient,
  510.   rightOfClient,
  511.   aboveClient,
  512.   belowClient
  513.   };
  514.  
  515. enum SeparatorType
  516.   {
  517.   none,
  518.   thinLine,
  519.   thickLine
  520.   };
  521.  
  522. virtual IFrameWindow
  523.  &addExtension ( IWindow       *aWindow,
  524.                  Location       aLocation,
  525.                  unsigned long  widthOrHeight,
  526.                  SeparatorType  separator = thinLine ),
  527.  &addExtension ( IWindow       *aWindow,
  528.                  Location       aLocation,
  529.                  int            widthOrHeight,
  530.                  SeparatorType  separator = thinLine ),
  531.  &addExtension ( IWindow       *aWindow,
  532.                  Location       aLocation,
  533.                  double         percentage,
  534.                  SeparatorType  separator = thinLine ),
  535.  
  536.  &removeExtension ( IWindow   *aWindow ),
  537.  
  538.  &setExtensionSize ( IWindow  *aWindow,
  539.                      int       widthOrHeight ),
  540.  &setExtensionSize ( IWindow  *aWindow,
  541.                      double    widthOrHeight ),
  542.  
  543.  &show ( Boolean showWindow = true ),
  544.  
  545.  &update ( );
  546.  
  547. /*---------------------------- Window Destruction ------------------------------
  548. | These functions deal with the destruction of the PM window associated        |
  549. | with this object when the window is closed:                                  |
  550. |   setDestroyOnClose  - Sets the destroy window flag on or off.               |
  551. |   willDestroyOnClose - Returns the state of the destroy window flag; the     |
  552. |                        default is on.                                        |
  553. ------------------------------------------------------------------------------*/
  554. virtual IFrameWindow
  555.  &setDestroyOnClose ( Boolean onOrOff = true );
  556.  
  557. Boolean
  558.   willDestroyOnClose ( ) const;
  559.  
  560. /*--------------------------------- Testing ------------------------------------
  561. | These functions test various attributes of the frame window:                 |
  562. |   isFlashing  - Returns true if the frame is currently flashing.             |
  563. |   isMaximized - Returns true if the frame window is currently maximized.     |
  564. |   isMinimized - Returns true if the frame window is currently minimized.     |
  565. |   isModal     - Returns true if the window is currently being displayed in   |
  566. |                 application-modal mode.                                      |
  567. ------------------------------------------------------------------------------*/
  568. Boolean
  569.   isFlashing  ( ) const,
  570.   isMaximized ( ) const,
  571.   isMinimized ( ) const,
  572.   isModal     ( ) const;
  573.  
  574. /*------------------------------- Window List ----------------------------------
  575. |These functions are used to add and remove frame titles from the window list: |
  576. | addToWindowList      - Adds this frame's title as a window list entry.       |
  577. |                        This is done automatically if the frame is            |
  578. |                        constructed with the windowList style flag set.       |
  579. | removeFromWindowList - Removes this frame's entry from the window list.      |
  580. ------------------------------------------------------------------------------*/
  581. virtual IFrameWindow
  582.  &addToWindowList      ( ),
  583.  &removeFromWindowList ( );
  584.  
  585. /*------------------------- Standard Control Access ----------------------------
  586. |This function is used to get information about the standard controls:         |
  587. | handleFor - Returns the IWindowHandle that corresponds to a standard frame   |
  588. |             control.  If the control is not present, the function returns 0. |
  589. ------------------------------------------------------------------------------*/
  590. virtual IWindowHandle
  591.   handleFor ( const Style &aStdConstrol ) const;
  592.  
  593. /*------------------------------ Miscellaneous ---------------------------------
  594. |These functions are used to make the frame start and stop flashing:           |
  595. | beginFlashing - Starts flashing the frame to alert the user to something     |
  596. |                 that requires immediate attention.                           |
  597. | endFlashing   - Stops flashing the frame window.                             |
  598. ------------------------------------------------------------------------------*/
  599. virtual IFrameWindow
  600.  &beginFlashing ( ),
  601.  &endFlashing   ( );
  602.  
  603. /*------------------------------- DBCS Support ---------------------------------
  604. |This function is used to share DBCS information between a parent and child    |
  605. |frame:                                                                        |
  606. | shareParentDBCSStatus - Causes a child frame to share the DBCS status        |
  607. |                         control of its parent.  If either the child or       |
  608. |                         parent do not have the appDBCSStatus style set,      |
  609. |                         then this function has no effect.                    |
  610. ------------------------------------------------------------------------------*/
  611. virtual IFrameWindow
  612.  &shareParentDBCSStatus ( );
  613.  
  614. /*------------------------- Sibling Order --------------------------------------
  615. | These functions affect the ordering of windows with their siblings. The      |
  616. | window order (or Z Order) is used when tabbing or painting sibling windows.  |
  617. | Window painting starts from the bottom sibling and proceeds to the top       |
  618. | window.  Cursor tabbing occurs from the top sibling and proceeds             |
  619. | to the bottom window.                                                        |
  620. |   setDefaultOrdering      - Determines whether new windows are created on    |
  621. |                             top of their sibling windows or behind them. By  |
  622. |                             default, windows are created behind their        |
  623. |                             other siblings.  If this function is called      |
  624. |                             with a value of IWindow::onTopOfSiblings, new    |
  625. |                             windows will be created on top of their siblings.|
  626. |   defaultOrdering         - Returns the order in which new windows will be   |
  627. |                             created relative to their sibling windows.       |
  628. ------------------------------------------------------------------------------*/
  629. static void
  630.  setDefaultOrdering     ( IWindow::SiblingOrder ordering);
  631. static IWindow::SiblingOrder
  632.  defaultOrdering        ( );
  633.  
  634. protected:
  635. /*------------------------------ Implementation --------------------------------
  636. | extensions           - Returns a pointer to the frame extensions collection. |
  637. | setExtensions        - Sets a pointer to the frame extensions collection.    |
  638. | findExtension        - Locates the extension that corresponds to a given     |
  639. |                        IWindow.                                              |
  640. | initialize           - Specifies to use a common frame window construction.  |
  641. | tryToLoadDialog      - Attempts to load the dialog window and if it fails,   |
  642. |                        calls initialize.                                     |
  643. | create               - Creates a Presentation Manager frame window.          |
  644. | start                - Creates a frame handler and adds it to the (newly     |
  645. |                        created) frame window.                                |
  646. | flagsFrom            - Converts the Style value to the corresponding FCF_*   |
  647. |                        flags.                                                |
  648. | styleFrom            - Converts the Style value to the corresponding WS_*    |
  649. |                        flags.                                                |
  650. | deferCreation        - Additional style that can be specified by derived     |
  651. |                        classes in cases where the derived class will create  |
  652. |                        the frame window (perhaps by calling                  |
  653. |                        IFrameWindow::initialize or IFrameWindow::create).    |
  654. | addDefaultHandler    - Adds the default frame handler to a newly created     |
  655. |                        frame.                                                |
  656. | removeDefaultHandler - Removes the default frame handler from the frame      |
  657. |                        upon destruction.                                     |
  658. ------------------------------------------------------------------------------*/
  659. IFrameExtensions
  660.  *extensions ( ) const;
  661.  
  662. static const Style
  663.   deferCreation;
  664.  
  665. unsigned
  666.   findExtension ( IWindow *window );
  667.  
  668. IFrameWindow
  669.  &setExtensions ( IFrameExtensions *p ),
  670.  
  671.  &tryToLoadDialog ( const IResourceId &resId,
  672.                     IWindow           *parent   = 0,
  673.                     IWindow           *owner    = 0 ),
  674.  
  675.  &initialize ( const IResourceId &resId,
  676.                const Style       &style,
  677.                IWindow           *parent   = 0,
  678.                IWindow           *owner    = 0,
  679.                const IRectangle  &initRect = nextShellRect(),
  680.                const char        *title    = 0 );
  681.  
  682. IWindowHandle
  683.   create ( unsigned long         id,
  684.            const char           *title,
  685.            unsigned long         style,
  686.            const char           *windowClass,
  687.            const IWindowHandle  &parent,
  688.            const IWindowHandle  &owner,
  689.            const IRectangle     &initRect,
  690.            const void           *ctlData,
  691.            const void           *presParams,
  692.            IWindow::SiblingOrder ordering=defaultOrdering());
  693.  
  694. IFrameWindow
  695.  &start ( const IWindowHandle &hwnd ),
  696.  
  697.  &addDefaultHandler    ( ),
  698.  &removeDefaultHandler ( );
  699.  
  700. static unsigned long
  701.   flagsFrom ( const Style &style ),
  702.   styleFrom ( const Style &style );
  703.  
  704. private: /*------------------------ PRIVATE ----------------------------------*/
  705. static const Style
  706.   styleBits;
  707. static Style
  708.   currentDefault;
  709. static IWindow::SiblingOrder
  710.   siblingCreateOrder;
  711. IFrameExtensions
  712.  *pExtensions;
  713. IFrameWindow
  714.  &addExtension ( IFrameExtension *p );
  715. IFrameWindowData
  716.  *pData;
  717. unsigned
  718.   flags;
  719. unsigned long
  720.   rc;
  721. IPointerHandle
  722.   frameIcon;
  723. static const unsigned
  724.   destroyOnClose,
  725.   hasDefaultHandler,
  726.   modal,
  727.   needsUpdating,
  728.   fromDlgTemplate,
  729.   standardFrame,
  730.   hasBeenClosed;
  731. friend class IFrameHandler;
  732. }; // class IFrame
  733.  
  734. INESTEDBITFLAGCLASSFUNCS(Style, IFrameWindow);
  735.  
  736. /*----------------------------------------------------------------------------*/
  737. /* Resume compiler default packing and warning messages.                      */
  738. /*----------------------------------------------------------------------------*/
  739. #pragma pack()
  740. #pragma info(restore)
  741.  
  742. #endif // _IFRAME_
  743.