home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / WDOCK.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-02  |  7.7 KB  |  241 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. #ifndef _WDOCK_HPP_INCLUDED
  12. #define _WDOCK_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,4);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WFORM_HPP_INCLUDED
  20. #  include "wform.hpp"
  21. #endif
  22.  
  23. enum WDockInsertPosition {
  24.     WDIPLeft,           WDIPTop = WDIPLeft,
  25.     WDIPCenter,
  26.     WDIPRight,          WDIPBottom = WDIPRight,
  27. };
  28.  
  29. /*************************************************************************
  30.  *
  31.  * WDockFloatingForm
  32.  *
  33.  *   Events:
  34.  *
  35.  *************************************************************************/
  36.  
  37. class WCMCLASS WDockFloatingForm : public WForm {
  38.     WDeclareSubclass( WDockFloatingForm, WForm );
  39.  
  40.     public:
  41.  
  42.         /**********************************************************
  43.          * Constructors and Destructors
  44.          *********************************************************/
  45.  
  46.         WDockFloatingForm();
  47.         WDockFloatingForm( WWindow * parent, WWindowHandle hdl );
  48.  
  49.         ~WDockFloatingForm();
  50.     
  51.         /**********************************************************
  52.          * Properties
  53.          *********************************************************/
  54.  
  55.         // Client
  56.  
  57.         WWindow *GetClient() const;
  58.         WBool    SetClient( WWindow * client );
  59.  
  60.         // OverDockForm
  61.  
  62.         WBool GetOverDockForm() const;
  63.         WBool SetOverDockForm( WBool overDockForm );
  64.  
  65.         // CurrTrackPos
  66.  
  67.         WRect GetCurrTrackPos() const;
  68.         WBool SetCurrTrackPos( const WRect & currTrackPos );
  69.  
  70.         // StartingMousePos
  71.  
  72.         WPoint GetStartingMousePos() const;
  73.         WBool  SetStartingMousePos( const WPoint & startingMousePos );
  74.  
  75.         // FloatingPos
  76.  
  77.         WRect GetFloatingPos() const;
  78.         WBool SetFloatingPos( const WRect & floatingPos );
  79.  
  80.         // FixedHorzPos
  81.  
  82.         WRect GetFixedHorzPos() const;
  83.         WBool SetFixedHorzPos( const WRect & fixedHorzPos );
  84.  
  85.         // FixedVertPos
  86.  
  87.         WRect GetFixedVertPos() const;
  88.         WBool SetFixedVertPos( const WRect & fixedVertPos );
  89.  
  90.         // CurrDockPos
  91.  
  92.         WDockPosition GetCurrDockPos() const;
  93.         WBool         SetCurrDockPos( WDockPosition currDockPos );
  94.  
  95.         /**********************************************************
  96.          * Methods
  97.          *********************************************************/
  98.  
  99.         // CalculateSize
  100.  
  101.         virtual WRect CalculateSize( const WRect & size, WBool adjust );
  102.  
  103.         // DrawFocusRect
  104.  
  105.         virtual void DrawFocusRect( const WRect & r, const WPoint & p,
  106.                                     WBool drawOverLast,
  107.                                     WWindow ** winOver=NULL,
  108.                                     WDockInsertPosition * where=NULL );
  109.  
  110.         /**********************************************************
  111.          * Event handlers
  112.          *********************************************************/
  113.  
  114.         WBool LeftButtonUpHandler( WDockFloatingForm * window,
  115.                                    WMouseEventData * event );
  116.  
  117.         WBool KeyDownEventHandler( WDockFloatingForm * window,
  118.                                    WKeyPressEventData * event );
  119.  
  120.         WBool MouseMoveHandler( WDockFloatingForm * window,
  121.                                 WMouseEventData * event );
  122.  
  123.         WBool ResizeEventHandler( WWindow * window,
  124.                                   WResizeEventData * event );
  125.  
  126.         WBool SizeChangingEventHandler( WWindow * window,
  127.                                         WResizeEventData * event );
  128.  
  129.         WBool NeedToolTipTextEventHandler( WWindow * source,
  130.                                            WToolTipTextEventData * event );
  131.  
  132.         WBool CloseEventHandler( WForm * source, WEventData * event );
  133.  
  134.         /**********************************************************
  135.          * Overrides 
  136.          *********************************************************/
  137.     
  138.         virtual WBool DefaultProcess( const WMessage & msg,
  139.                                       WLong & returns );
  140.     
  141.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  142.                                    void * data=NULL );
  143.  
  144.         virtual WBool ProcessMessage( const WMessage & msg, WLong & returns );
  145.  
  146.         /**********************************************************
  147.          * Others
  148.          *********************************************************/
  149.     
  150.         static WBool GetButtonDown();
  151.  
  152.      private:
  153.  
  154.         void EventInit();
  155.  
  156.         /**********************************************************
  157.          * Data members
  158.          *********************************************************/
  159.     
  160.      private:
  161.  
  162.         WWindow *               _client;
  163.         WBool                   _overDockForm;
  164.         WRect                   _currTrackPos;
  165.         WPoint                  _startingMousePos;
  166.         WRect                   _floatingPos;
  167.         WRect                   _fixedVertPos;
  168.         WRect                   _fixedHorzPos;
  169.         WDockPosition           _currDockPos;
  170.         WRect                   _currToolbarPos;
  171.         WRect                   _lastPos;
  172.         WWindow *               _winOver;
  173.         WDockInsertPosition     _where;
  174. };
  175.  
  176. /*************************************************************************
  177.  *
  178.  * WDockFixedForm
  179.  *
  180.  *   Events:
  181.  *
  182.  *************************************************************************/
  183.  
  184. class WCMCLASS WDockFixedForm : public WForm {
  185.     WDeclareSubclass( WDockFixedForm, WForm );
  186.  
  187.     public:
  188.  
  189.         /**********************************************************
  190.          * Constructors and Destructors
  191.          *********************************************************/
  192.  
  193.         WDockFixedForm();
  194.         WDockFixedForm( WWindow * parent, WWindowHandle hdl );
  195.     
  196.         ~WDockFixedForm();
  197.  
  198.         /**********************************************************
  199.          * Properties
  200.          *********************************************************/
  201.  
  202.         // FixedDockedIndex
  203.  
  204.         WInt  GetFixedDockedIndex() const;
  205.         WBool SetFixedDockedIndex( WInt fixedDockedIndex );
  206.  
  207.         // FixedDockPosition
  208.  
  209.         WDockPosition GetFixedDockPosition() const;
  210.         WBool         SetFixedDockPosition( WDockPosition fixedDockPosition );
  211.  
  212.         /**********************************************************
  213.          * Methods
  214.          *********************************************************/
  215.  
  216.         /**********************************************************
  217.          * Event Handlers
  218.          *********************************************************/
  219.  
  220.         WBool PaintEventHandler( WForm * source, WPaintEventData * event );
  221.  
  222.         WBool NeedToolTipTextEventHandler( WWindow * source,
  223.                                            WToolTipTextEventData * event );
  224.  
  225.         /**********************************************************
  226.          * Data Members
  227.          *********************************************************/
  228.  
  229.     private:
  230.  
  231.         WDockPosition           _fixedDockPosition;
  232.         WInt                    _fixedDockedIndex;
  233. };
  234.  
  235. #ifndef _WNO_PRAGMA_PUSH
  236. #pragma enum pop;
  237. #pragma pack(pop);
  238. #endif
  239.  
  240. #endif // _WDOCK_HPP_INCLUDED
  241.