home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WDOCK.HPP < prev    next >
C/C++ Source or Header  |  1996-11-12  |  8KB  |  254 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,8);
  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.         WBool DockingChangeEventHandler( WWindow * source,
  135.                                          WDockingChangeEventData * event );
  136.  
  137.         /**********************************************************
  138.          * Overrides 
  139.          *********************************************************/
  140.     
  141.         virtual WBool DefaultProcess( const WMessage & msg,
  142.                                       WLong & returns );
  143.     
  144.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  145.                                    void * data=NULL );
  146.  
  147.         virtual WBool ProcessMessage( const WMessage & msg, WLong & returns );
  148.  
  149.         /**********************************************************
  150.          * Others
  151.          *********************************************************/
  152.     
  153.         static WBool GetButtonDown();
  154.  
  155.      private:
  156.  
  157.         void EventInit();
  158.  
  159.         /**********************************************************
  160.          * Data members
  161.          *********************************************************/
  162.     
  163.      private:
  164.  
  165.         WWindow *               _client;
  166.         WBool                   _overDockForm;
  167.         WRect                   _currTrackPos;
  168.         WPoint                  _startingMousePos;
  169.         WRect                   _floatingPos;
  170.         WRect                   _fixedVertPos;
  171.         WRect                   _fixedHorzPos;
  172.         WDockPosition           _currDockPos;
  173.         WRect                   _currToolbarPos;
  174.         WRect                   _lastPos;
  175.         WWindow *               _winOver;
  176.         WDockInsertPosition     _where;
  177.         WBool                   _inSizeChanging;
  178. };
  179.  
  180. /*************************************************************************
  181.  *
  182.  * WDockFixedForm
  183.  *
  184.  *   Events:
  185.  *
  186.  *************************************************************************/
  187.  
  188. class WCMCLASS WDockFixedForm : public WForm {
  189.     WDeclareSubclass( WDockFixedForm, WForm );
  190.  
  191.     public:
  192.  
  193.         /**********************************************************
  194.          * Constructors and Destructors
  195.          *********************************************************/
  196.  
  197.         WDockFixedForm();
  198.         WDockFixedForm( WWindow * parent, WWindowHandle hdl );
  199.     
  200.         ~WDockFixedForm();
  201.  
  202.         /**********************************************************
  203.          * Properties
  204.          *********************************************************/
  205.  
  206.         // FixedDockedIndex
  207.  
  208.         WInt  GetFixedDockedIndex() const;
  209.         WBool SetFixedDockedIndex( WInt fixedDockedIndex );
  210.  
  211.         // FixedDockPosition
  212.  
  213.         WDockPosition GetFixedDockPosition() const;
  214.         WBool         SetFixedDockPosition( WDockPosition fixedDockPosition );
  215.  
  216.         /**********************************************************
  217.          * Methods
  218.          *********************************************************/
  219.  
  220.         /**********************************************************
  221.          * Overrides
  222.          *********************************************************/
  223.  
  224.         virtual WStyle GetDefaultStyle() const;
  225.  
  226.         /**********************************************************
  227.          * Event Handlers
  228.          *********************************************************/
  229.  
  230.         WBool PaintEventHandler( WForm * source, WPaintEventData * event );
  231.  
  232.         WBool DockingChangeEventHandler( WWindow * source,
  233.                                          WDockingChangeEventData * event );
  234.  
  235.         WBool NeedToolTipTextEventHandler( WWindow * source,
  236.                                            WToolTipTextEventData * event );
  237.  
  238.         /**********************************************************
  239.          * Data Members
  240.          *********************************************************/
  241.  
  242.     private:
  243.  
  244.         WDockPosition           _fixedDockPosition;
  245.         WInt                    _fixedDockedIndex;
  246. };
  247.  
  248. #ifndef _WNO_PRAGMA_PUSH
  249. #pragma enum pop;
  250. #pragma pack(pop);
  251. #endif
  252.  
  253. #endif // _WDOCK_HPP_INCLUDED
  254.