You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
3.9 KiB
147 lines
3.9 KiB
15 years ago
|
//----------------------------------------------------------------------------
|
||
12 years ago
|
// filename : tdemdichildfrmcaption.h
|
||
15 years ago
|
//----------------------------------------------------------------------------
|
||
|
// Project : KDE MDI extension
|
||
|
//
|
||
|
// begin : 07/1999 by Szymon Stefanek as part of kvirc
|
||
|
// (an IRC application)
|
||
|
// changes : 09/1999 by Falk Brettschneider to create an
|
||
14 years ago
|
// - 06/2000 stand-alone TQt extension set of
|
||
|
// classes and a TQt-based library
|
||
15 years ago
|
// 2000-2003 maintained by the KDevelop project
|
||
|
//
|
||
|
// copyright : (C) 1999-2003 by Falk Brettschneider
|
||
|
// and
|
||
|
// Szymon Stefanek (stefanek@tin.it)
|
||
13 years ago
|
// email : falkbr@tdevelop.org (Falk Brettschneider)
|
||
15 years ago
|
//----------------------------------------------------------------------------
|
||
|
//
|
||
|
//----------------------------------------------------------------------------
|
||
|
//
|
||
|
// This program is free software; you can redistribute it and/or modify
|
||
|
// it under the terms of the GNU Library General Public License as
|
||
|
// published by the Free Software Foundation; either version 2 of the
|
||
|
// License, or (at your option) any later version.
|
||
|
//
|
||
|
//----------------------------------------------------------------------------
|
||
|
#ifndef _KMDI_CHILD_FRM_CAPTION_H_
|
||
|
#define _KMDI_CHILD_FRM_CAPTION_H_
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include "tdemdidefines.h"
|
||
15 years ago
|
|
||
|
class KMdiChildFrm;
|
||
|
|
||
|
|
||
|
class KMdiChildFrmCaptionPrivate;
|
||
|
|
||
|
/**
|
||
|
* @short Internal class.
|
||
|
*
|
||
|
* It's the caption bar of a child frame widget.
|
||
|
*/
|
||
14 years ago
|
class KMDI_EXPORT KMdiChildFrmCaption : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
/**
|
||
|
* Constructor
|
||
|
*/
|
||
14 years ago
|
KMdiChildFrmCaption( KMdiChildFrm *parent );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Destructor
|
||
|
*/
|
||
|
~KMdiChildFrmCaption();
|
||
|
|
||
|
/**
|
||
|
* Repaint the caption bar in active background colors
|
||
|
*/
|
||
|
void setActive( bool bActive );
|
||
|
|
||
|
/**
|
||
|
* Repaint with a new caption bar title
|
||
|
*/
|
||
15 years ago
|
void setCaption( const TQString& text );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Returns the caption bar height depending on the used font
|
||
|
*/
|
||
|
int heightHint();
|
||
|
|
||
|
public slots:
|
||
|
/**
|
||
|
* Grabs the mouse, a move cursor, sets a move indicator variable to true and keeps the global mouse position in mind
|
||
|
*/
|
||
|
void slot_moveViaSystemMenu();
|
||
|
|
||
|
protected:
|
||
|
/**
|
||
|
* Draws the caption bar and its title using the settings
|
||
|
*/
|
||
15 years ago
|
virtual void paintEvent( TQPaintEvent *e );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* The same as KMdiChildFrmCaption::slot_moveViaSystemMenu
|
||
|
*/
|
||
15 years ago
|
virtual void mousePressEvent( TQMouseEvent * );
|
||
15 years ago
|
|
||
|
/**
|
||
14 years ago
|
* Calls maximizePressed of the parent widget ( KMdiChildFrm )
|
||
15 years ago
|
*/
|
||
15 years ago
|
virtual void mouseDoubleClickEvent( TQMouseEvent * );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Restore the normal mouse cursor, set the state variable back to 'not moving'
|
||
|
*/
|
||
15 years ago
|
virtual void mouseReleaseEvent( TQMouseEvent * );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Checks if out of move range of the KMdiChildArea and calls KMdiChildFrm::move
|
||
|
*/
|
||
15 years ago
|
virtual void mouseMoveEvent( TQMouseEvent *e );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Computes a new abbreviated string from a given string depending on a given maximum width
|
||
|
* @TODO Replace with a call to a KStringHandler function instead of rolling our own
|
||
|
*/
|
||
15 years ago
|
TQString abbreviateText( TQString origStr, int maxWidth );
|
||
15 years ago
|
|
||
|
// attributes
|
||
|
public:
|
||
|
/**
|
||
|
* the title string shown in the caption bar
|
||
|
*/
|
||
15 years ago
|
TQString m_szCaption;
|
||
15 years ago
|
|
||
|
protected: // Protected attributes
|
||
|
/**
|
||
14 years ago
|
* parent widget
|
||
15 years ago
|
*/
|
||
|
KMdiChildFrm *m_pParent;
|
||
|
|
||
|
/**
|
||
|
* state variable indicating whether activated or not activated
|
||
|
*/
|
||
|
bool m_bActive;
|
||
|
|
||
|
/**
|
||
14 years ago
|
* the position offset related to its parent widget (internally used for translating mouse move positions
|
||
15 years ago
|
*/
|
||
15 years ago
|
TQPoint m_offset;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* True if the child knows that it is currently being dragged.
|
||
|
*/
|
||
|
bool m_bChildInDrag;
|
||
|
|
||
|
private:
|
||
|
KMdiChildFrmCaptionPrivate *d;
|
||
|
};
|
||
|
|
||
|
#endif //_KMDICAPTION_H_
|
||
|
|
||
14 years ago
|
// kate: space-indent off; replace-tabs off; indent-mode csands; tab-width 4;
|