home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WDOCK.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-12
|
8KB
|
254 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#ifndef _WDOCK_HPP_INCLUDED
#define _WDOCK_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WFORM_HPP_INCLUDED
# include "wform.hpp"
#endif
enum WDockInsertPosition {
WDIPLeft, WDIPTop = WDIPLeft,
WDIPCenter,
WDIPRight, WDIPBottom = WDIPRight,
};
/*************************************************************************
*
* WDockFloatingForm
*
* Events:
*
*************************************************************************/
class WCMCLASS WDockFloatingForm : public WForm {
WDeclareSubclass( WDockFloatingForm, WForm );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WDockFloatingForm();
WDockFloatingForm( WWindow * parent, WWindowHandle hdl );
~WDockFloatingForm();
/**********************************************************
* Properties
*********************************************************/
// Client
WWindow *GetClient() const;
WBool SetClient( WWindow * client );
// OverDockForm
WBool GetOverDockForm() const;
WBool SetOverDockForm( WBool overDockForm );
// CurrTrackPos
WRect GetCurrTrackPos() const;
WBool SetCurrTrackPos( const WRect & currTrackPos );
// StartingMousePos
WPoint GetStartingMousePos() const;
WBool SetStartingMousePos( const WPoint & startingMousePos );
// FloatingPos
WRect GetFloatingPos() const;
WBool SetFloatingPos( const WRect & floatingPos );
// FixedHorzPos
WRect GetFixedHorzPos() const;
WBool SetFixedHorzPos( const WRect & fixedHorzPos );
// FixedVertPos
WRect GetFixedVertPos() const;
WBool SetFixedVertPos( const WRect & fixedVertPos );
// CurrDockPos
WDockPosition GetCurrDockPos() const;
WBool SetCurrDockPos( WDockPosition currDockPos );
/**********************************************************
* Methods
*********************************************************/
// CalculateSize
virtual WRect CalculateSize( const WRect & size, WBool adjust );
// DrawFocusRect
virtual void DrawFocusRect( const WRect & r, const WPoint & p,
WBool drawOverLast,
WWindow ** winOver=NULL,
WDockInsertPosition * where=NULL );
/**********************************************************
* Event handlers
*********************************************************/
WBool LeftButtonUpHandler( WDockFloatingForm * window,
WMouseEventData * event );
WBool KeyDownEventHandler( WDockFloatingForm * window,
WKeyPressEventData * event );
WBool MouseMoveHandler( WDockFloatingForm * window,
WMouseEventData * event );
WBool ResizeEventHandler( WWindow * window,
WResizeEventData * event );
WBool SizeChangingEventHandler( WWindow * window,
WResizeEventData * event );
WBool NeedToolTipTextEventHandler( WWindow * source,
WToolTipTextEventData * event );
WBool CloseEventHandler( WForm * source, WEventData * event );
WBool DockingChangeEventHandler( WWindow * source,
WDockingChangeEventData * event );
/**********************************************************
* Overrides
*********************************************************/
virtual WBool DefaultProcess( const WMessage & msg,
WLong & returns );
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool ProcessMessage( const WMessage & msg, WLong & returns );
/**********************************************************
* Others
*********************************************************/
static WBool GetButtonDown();
private:
void EventInit();
/**********************************************************
* Data members
*********************************************************/
private:
WWindow * _client;
WBool _overDockForm;
WRect _currTrackPos;
WPoint _startingMousePos;
WRect _floatingPos;
WRect _fixedVertPos;
WRect _fixedHorzPos;
WDockPosition _currDockPos;
WRect _currToolbarPos;
WRect _lastPos;
WWindow * _winOver;
WDockInsertPosition _where;
WBool _inSizeChanging;
};
/*************************************************************************
*
* WDockFixedForm
*
* Events:
*
*************************************************************************/
class WCMCLASS WDockFixedForm : public WForm {
WDeclareSubclass( WDockFixedForm, WForm );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WDockFixedForm();
WDockFixedForm( WWindow * parent, WWindowHandle hdl );
~WDockFixedForm();
/**********************************************************
* Properties
*********************************************************/
// FixedDockedIndex
WInt GetFixedDockedIndex() const;
WBool SetFixedDockedIndex( WInt fixedDockedIndex );
// FixedDockPosition
WDockPosition GetFixedDockPosition() const;
WBool SetFixedDockPosition( WDockPosition fixedDockPosition );
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Overrides
*********************************************************/
virtual WStyle GetDefaultStyle() const;
/**********************************************************
* Event Handlers
*********************************************************/
WBool PaintEventHandler( WForm * source, WPaintEventData * event );
WBool DockingChangeEventHandler( WWindow * source,
WDockingChangeEventData * event );
WBool NeedToolTipTextEventHandler( WWindow * source,
WToolTipTextEventData * event );
/**********************************************************
* Data Members
*********************************************************/
private:
WDockPosition _fixedDockPosition;
WInt _fixedDockedIndex;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WDOCK_HPP_INCLUDED