home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WMDIPRT.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  166 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WMDIParent -- Wrapper for the Windows 95 MDI parent control.
  14.  *
  15.  *   Events:
  16.  *
  17.  *************************************************************************/
  18.  
  19. #ifndef _WMDIPRT_HPP_INCLUDED
  20. #define _WMDIPRT_HPP_INCLUDED
  21.  
  22. #ifndef _WNO_PRAGMA_PUSH
  23. #pragma pack(push,8);
  24. #pragma enum int;
  25. #endif
  26.  
  27. #ifndef _WFORM_HPP_INCLUDED
  28. #  include "wform.hpp"
  29. #endif
  30. #ifndef _WMDICHLD_HPP_INCLUDED
  31. #  include "wmdichld.hpp"
  32. #endif
  33.  
  34. class WCMCLASS WMDIParent : public WForm {
  35.     WDeclareSubclass( WMDIParent, WForm );
  36.  
  37.     friend class WMDIChild;
  38.     
  39.     public:
  40.  
  41.         /**************************************************************
  42.          * Constructors
  43.          **************************************************************/
  44.  
  45.         WMDIParent();
  46.         WMDIParent( WWindow *parent, WWindowHandle hdl );
  47.     
  48.         virtual ~WMDIParent();
  49.  
  50.         /**************************************************************
  51.          * Properties
  52.          **************************************************************/
  53.  
  54.         // ActiveChild
  55.         //
  56.         //    Returns the currently active MDI child.  Can optinally
  57.         //    return whether or not the child is maximized.
  58.  
  59.         WMDIChild *GetActiveChild( WBool *maximized=NULL );
  60.  
  61.         // WindowMenu
  62.         //
  63.         //     Sets the special window menu that MDI will update
  64.         //     automatically when child windows are created.
  65.  
  66.         WMenu *GetWindowMenu() const;
  67.         WBool  SetWindowMenu( WMenu *menu );
  68.  
  69.         /**************************************************************
  70.          * Methods
  71.          **************************************************************/
  72.  
  73.         // ActivateNext
  74.         //
  75.         //    Activates the next MDI child window from the given window.
  76.         //    If NULL is passed, uses the currently active window.
  77.  
  78.         WBool ActivateNext( WMDIChild *child=NULL );
  79.  
  80.         // ActivatePrevious
  81.         //
  82.         //    Activates the next MDI child window from the given window.
  83.         //    If NULL is passed, uses the currently active window.
  84.  
  85.         WBool ActivatePrevious( WMDIChild *child=NULL );
  86.  
  87.         // ArrangeMinimized
  88.         //
  89.         //    Arrange minimized child windows.
  90.  
  91.         WBool ArrangeMinimized();
  92.  
  93.         // Cascade
  94.         //
  95.         //    Cascade the children.
  96.  
  97.         WBool Cascade( WBool cascadeDisabledChildren=FALSE );
  98.  
  99.         // Tile
  100.         //
  101.         //    Tile the children.
  102.  
  103.         WBool Tile( WBool horizontal=TRUE,
  104.                     WBool tileDisabledChildren=FALSE );
  105.  
  106.         // UpdateWindowMenu
  107.         //
  108.         //    Redraw the window menu.
  109.  
  110.         WBool UpdateWindowMenu();
  111.  
  112.         /**************************************************************
  113.          * Message processing
  114.          **************************************************************/
  115.         
  116.         virtual WBool DefaultProcess( const WMessage & msg,
  117.                                       WLong & returns );
  118.     
  119.         /**************************************************************
  120.          * Others
  121.          **************************************************************/
  122.         
  123.         virtual int operator==( const WMDIParent & obj ) const;
  124.         virtual int operator!=( const WMDIParent & obj ) const;
  125.  
  126.         virtual WBool MakeWindow( WWindow * parent, WUInt id,
  127.                                   const WChar * className,
  128.                                   const WChar * title, const WRect & r,
  129.                                   WStyle style, WStyle exStyle,
  130.                                   void * data=NULL );
  131.  
  132.         virtual WBool FilterMessage( WMessage & msg, WBool & eatMessage );
  133.  
  134.         /**************************************************************
  135.          * Overrides
  136.          **************************************************************/
  137.         
  138.         virtual WBool Destroy();
  139.  
  140.         virtual WMenu *GetMenu() const;
  141.         virtual WBool  SetMenu( WMenu *menu );
  142.  
  143.         /**************************************************************
  144.          * Event handlers
  145.          **************************************************************/
  146.  
  147.         WBool DefaultEventHandler( WWindow * window, WEventData * event );
  148.         
  149.         /**************************************************************
  150.          * Data members
  151.          **************************************************************/
  152.         
  153.     private:
  154.         WWindowHandle           _clientHandle;
  155.         WWindow *               _client;
  156.         WMenu *                 _windowMenu;
  157.         WRect                   _originalClient;
  158. };
  159.  
  160. #ifndef _WNO_PRAGMA_PUSH
  161. #pragma enum pop;
  162. #pragma pack(pop);
  163. #endif
  164.  
  165. #endif // _WMDIPRT_HPP_INCLUDED
  166.