• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdemdi
 

tdemdi

  • tdemdi
tdemdichildfrm.h
1 //----------------------------------------------------------------------------
2 // filename : tdemdichildfrm.h
3 //----------------------------------------------------------------------------
4 // Project : KDE MDI extension
5 //
6 // begin : 07/1999 by Szymon Stefanek as part of kvirc
7 // (an IRC application)
8 // changes : 09/1999 by Falk Brettschneider to create an
9 // - 06/2000 stand-alone Qt extension set of
10 // classes and a Qt-based library
11 // 2000-2003 maintained by the KDevelop project
12 // patches : */2000 Lars Beikirch (Lars.Beikirch@gmx.net)
13 //
14 // copyright : (C) 1999-2003 by Falk Brettschneider
15 // and
16 // Szymon Stefanek (stefanek@tin.it)
17 // email : falkbr@kdevelop.org (Falk Brettschneider)
18 //----------------------------------------------------------------------------
19 //
20 //----------------------------------------------------------------------------
21 //
22 // This program is free software; you can redistribute it and/or modify
23 // it under the terms of the GNU Library General Public License as
24 // published by the Free Software Foundation; either version 2 of the
25 // License, or (at your option) any later version.
26 //
27 //------------------------------------------------------------------------------
28 #ifndef _TDEMDI_CHILD_FRM_H_
29 #define _TDEMDI_CHILD_FRM_H_
30 
31 #include <tqptrlist.h>
32 #include <tqpixmap.h>
33 #include <tqpushbutton.h>
34 #include <tqlabel.h>
35 #include <tqdatetime.h>
36 #include <tqlayout.h>
37 
38 #include <tqdict.h>
39 
40 #include "tdemdichildfrmcaption.h"
41 
42 class KMdiChildArea;
43 class KMdiChildView;
44 class TQPopupMenu;
45 class TQToolButton;
46 
47 //==============================================================================
52 class KMDI_EXPORT KMdiWin32IconButton : public TQLabel
53 {
54  TQ_OBJECT
55 public:
56  KMdiWin32IconButton( TQWidget* parent, const char* name = 0 );
57  virtual void mousePressEvent( TQMouseEvent* );
58 
59 signals:
60  void pressed();
61 };
62 
63 //==============================================================================
64 /* some special events, see tdemdidefines.h
65 */
66 //------------------------------------------------------------------------------
71 class KMDI_EXPORT KMdiChildFrmMoveEvent : public TQCustomEvent
72 {
73 public:
74  KMdiChildFrmMoveEvent( TQMoveEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_Move ) ), e ) {}
75 
76 };
77 
78 //------------------------------------------------------------------------------
83 class KMDI_EXPORT KMdiChildFrmDragBeginEvent : public TQCustomEvent
84 {
85 public:
86  KMdiChildFrmDragBeginEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_DragBegin ) ), e ) {}
87 };
88 
89 //------------------------------------------------------------------------------
94 class KMDI_EXPORT KMdiChildFrmDragEndEvent : public TQCustomEvent
95 {
96 public:
97  KMdiChildFrmDragEndEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_DragEnd ) ), e ) {}
98 };
99 
100 //------------------------------------------------------------------------------
105 class KMDI_EXPORT KMdiChildFrmResizeBeginEvent : public TQCustomEvent
106 {
107 public:
108  KMdiChildFrmResizeBeginEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_ResizeBegin ) ), e ) {}
109 };
110 
111 //------------------------------------------------------------------------------
116 class KMDI_EXPORT KMdiChildFrmResizeEndEvent : public TQCustomEvent
117 {
118 public:
119  KMdiChildFrmResizeEndEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_ResizeEnd ) ), e ) {}
120 };
121 
122 
123 class KMdiChildFrmPrivate;
124 //==============================================================================
129 //------------------------------------------------------------------------------
130 class KMDI_EXPORT KMdiChildFrm : public TQFrame
131 {
132  friend class KMdiChildArea;
133  friend class KMdiChildFrmCaption;
134 
135  TQ_OBJECT
136 
137  // attributes
138 public:
139  enum MdiWindowState { Normal, Maximized, Minimized };
140  //positions same in h and cpp for fast order check
141  KMdiChildView* m_pClient;
142 
143 protected:
144  KMdiChildArea* m_pManager;
145  KMdiChildFrmCaption* m_pCaption;
146  KMdiWin32IconButton* m_pWinIcon;
147  TQToolButton* m_pUnixIcon;
148  TQToolButton* m_pMinimize;
149  TQToolButton* m_pMaximize;
150  TQToolButton* m_pClose;
151  TQToolButton* m_pUndock;
152  MdiWindowState m_state;
153  TQRect m_restoredRect;
154  int m_iResizeCorner;
155  int m_iLastCursorCorner;
156  bool m_bResizing;
157  bool m_bDragging;
158  TQPixmap* m_pIconButtonPixmap;
159  TQPixmap* m_pMinButtonPixmap;
160  TQPixmap* m_pMaxButtonPixmap;
161  TQPixmap* m_pRestoreButtonPixmap;
162  TQPixmap* m_pCloseButtonPixmap;
163  TQPixmap* m_pUndockButtonPixmap;
164 
168  int m_windowMenuID;
169 
173  TQPopupMenu* m_pSystemMenu;
174 
175  TQSize m_oldClientMinSize;
176  TQSize m_oldClientMaxSize;
177  TQLayout::ResizeMode m_oldLayoutResizeMode;
178  TQTime m_timeMeasure;
179 
180  // methods
181 public:
182 
186  KMdiChildFrm( KMdiChildArea *parent );
187 
192  ~KMdiChildFrm();
193 
199  void setClient( KMdiChildView *w, bool bAutomaticResize = false );
200 
205  void unsetClient( TQPoint positionOffset = TQPoint( 0, 0 ) );
206 
210  void setIcon( const TQPixmap &pxm );
211 
215  TQPixmap* icon() const;
216 
220  void enableClose( bool bEnable );
221 
225  void setCaption( const TQString& text );
226 
230  const TQString& caption() { return m_pCaption->m_szCaption; }
231 
235  void setState( MdiWindowState state, bool bAnimate = true );
236 
240  inline MdiWindowState state() const { return m_state; }
241 
245  TQRect mdiAreaContentsRect() const;
246 
250  TQRect restoreGeometry() const;
251 
255  void setRestoreGeometry( const TQRect& newRestGeo );
256 
261  void updateRects() { resizeEvent( 0 ); }
262 
266  TQPopupMenu* systemMenu() const;
267 
271  inline int captionHeight() const { return m_pCaption->height(); }
272 
276  void redecorateButtons();
277 
281  bool isInDrag() const { return m_bDragging; }
282 
286  bool isInResize() const { return m_bResizing; }
287 
292  void raiseAndActivate();
293 
299  virtual void setMinimumSize ( int minw, int minh );
300 
301 public slots:
302 
303  void slot_resizeViaSystemMenu();
304 
305 protected:
306 
312  virtual void resizeEvent( TQResizeEvent * );
313 
319  virtual void mouseMoveEvent( TQMouseEvent *e );
320 
326  virtual void mousePressEvent( TQMouseEvent *e );
327 
332  virtual void mouseReleaseEvent( TQMouseEvent * );
333 
339  virtual void moveEvent( TQMoveEvent* me );
340 
344  virtual void leaveEvent( TQEvent * );
345 
352  virtual bool eventFilter( TQObject*, TQEvent* );
353 
358  void resizeWindow( int resizeCorner, int x, int y );
359 
363  void setResizeCursor( int resizeCorner );
364 
368  void unsetResizeCursor();
369 
374  virtual void switchToMinimizeLayout();
375 
379  void doResize();
380 
385  void doResize( bool captionOnly );
386 
387 protected slots:
388 
392  void maximizePressed();
393 
397  void restorePressed();
398 
402  void minimizePressed();
403 
407  void closePressed();
408 
412  void undockPressed();
413 
417  void showSystemMenu();
418 
419 protected:
420 
425  void linkChildren( TQDict<TQWidget::FocusPolicy>* pFocPolDict );
426 
431  TQDict<TQWidget::FocusPolicy>* unlinkChildren();
432 
438  int getResizeCorner( int ax, int ay );
439 
440 private:
441  KMdiChildFrmPrivate *d;
442 };
443 
444 #endif //_TDEMDI_CHILDFRM_H_
KMdiChildArea
Internal class.
Definition: tdemdichildarea.h:53
KMdiChildFrmCaption
Internal class.
Definition: tdemdichildfrmcaption.h:45
KMdiChildFrmCaption::mousePressEvent
virtual void mousePressEvent(TQMouseEvent *)
The same as KMdiChildFrmCaption::slot_moveViaSystemMenu.
Definition: tdemdichildfrmcaption.cpp:86
KMdiChildFrmCaption::m_szCaption
TQString m_szCaption
the title string shown in the caption bar
Definition: tdemdichildfrmcaption.h:116
KMdiChildFrmCaption::mouseReleaseEvent
virtual void mouseReleaseEvent(TQMouseEvent *)
Restore the normal mouse cursor, set the state variable back to 'not moving'.
Definition: tdemdichildfrmcaption.cpp:106
KMdiChildFrmCaption::setCaption
void setCaption(const TQString &text)
Repaint with a new caption bar title.
Definition: tdemdichildfrmcaption.cpp:190
KMdiChildFrmCaption::mouseMoveEvent
virtual void mouseMoveEvent(TQMouseEvent *e)
Checks if out of move range of the KMdiChildArea and calls KMdiChildFrm::move.
Definition: tdemdichildfrmcaption.cpp:131
KMdiChildFrmDragBeginEvent
a TQCustomEvent for begin of dragging This special event will be useful, to inform view about child f...
Definition: tdemdichildfrm.h:84
KMdiChildFrmDragEndEvent
a TQCustomEvent for end of dragging This special event will be useful, to inform view about child fra...
Definition: tdemdichildfrm.h:95
KMdiChildFrmMoveEvent
a TQCustomEvent for move This special event will be useful, to inform view about child frame event.
Definition: tdemdichildfrm.h:72
KMdiChildFrmResizeBeginEvent
a TQCustomEvent for begin of resizing This special event will be useful, to inform view about child f...
Definition: tdemdichildfrm.h:106
KMdiChildFrmResizeEndEvent
a TQCustomEvent for end of resizing This special event will be useful, to inform view about child fra...
Definition: tdemdichildfrm.h:117
KMdiChildFrm
Internal class.
Definition: tdemdichildfrm.h:131
KMdiChildFrm::m_windowMenuID
int m_windowMenuID
Every child frame window has an temporary ID in the Window menu of the child area.
Definition: tdemdichildfrm.h:168
KMdiChildFrm::state
MdiWindowState state() const
Returns the current state of the window.
Definition: tdemdichildfrm.h:240
KMdiChildFrm::isInResize
bool isInResize() const
returns the mouse state "In Resize"
Definition: tdemdichildfrm.h:286
KMdiChildFrm::caption
const TQString & caption()
Gets the caption of this mdi child.
Definition: tdemdichildfrm.h:230
KMdiChildFrm::isInDrag
bool isInDrag() const
returns the mouse state "In Drag"
Definition: tdemdichildfrm.h:281
KMdiChildFrm::m_pSystemMenu
TQPopupMenu * m_pSystemMenu
Imitates a system menu for child frame windows.
Definition: tdemdichildfrm.h:173
KMdiChildFrm::captionHeight
int captionHeight() const
Returns the caption bar height.
Definition: tdemdichildfrm.h:271
KMdiChildFrm::updateRects
void updateRects()
Forces updating the rects of the caption and so...
Definition: tdemdichildfrm.h:261
KMdiChildView
Base class for all your special view windows.
Definition: tdemdichildview.h:109
KMdiWin32IconButton
Internal class, only used on Win32.
Definition: tdemdichildfrm.h:53

tdemdi

Skip menu "tdemdi"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdemdi

Skip menu "tdemdi"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdemdi by doxygen 1.9.1
This website is maintained by Timothy Pearson.