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

kmdi

kmdifocuslist.cpp
00001 /* This file is part of the KDE project
00002   Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License version 2 as published by the Free Software Foundation.
00007 
00008   This library is distributed in the hope that it will be useful,
00009   but WITHOUT ANY WARRANTY; without even the implied warranty of
00010   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011   Library General Public License for more details.
00012 
00013   You should have received a copy of the GNU Library General Public License
00014   along with this library; see the file COPYING.LIB.  If not, write to
00015   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016   Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "kmdifocuslist.h"
00020 #include "kmdifocuslist.moc"
00021 #include <tqobjectlist.h>
00022 #include <kdebug.h>
00023 
00024 KMdiFocusList::KMdiFocusList( TQObject *parent ) : TQObject( parent )
00025 {}
00026 
00027 KMdiFocusList::~KMdiFocusList()
00028 {}
00029 
00030 void KMdiFocusList::addWidgetTree( TQWidget* w )
00031 {
00032     //this method should never be called twice on the same hierarchy
00033     m_list.insert( w, w->focusPolicy() );
00034     w->setFocusPolicy( TQ_ClickFocus );
00035     kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding toplevel" << endl;
00036     connect( w, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
00037     TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
00038     TQObjectListIt it( *l );
00039     TQObject *obj;
00040     while ( ( obj = it.current() ) != 0 )
00041     {
00042         TQWidget * wid = ( TQWidget* ) obj;
00043         m_list.insert( wid, wid->focusPolicy() );
00044         wid->setFocusPolicy( TQ_ClickFocus );
00045         kdDebug( 760 ) << "KMdiFocusList::addWidgetTree: adding widget" << endl;
00046         connect( wid, TQT_SIGNAL( destroyed( TQObject * ) ), this, TQT_SLOT( objectHasBeenDestroyed( TQObject* ) ) );
00047         ++it;
00048     }
00049     delete l;
00050 }
00051 
00052 void KMdiFocusList::restore()
00053 {
00054     for ( TQMap<TQWidget*, TQ_FocusPolicy>::const_iterator it = m_list.constBegin();it != m_list.constEnd();++it )
00055     {
00056         it.key() ->setFocusPolicy( it.data() );
00057     }
00058     m_list.clear();
00059 }
00060 
00061 
00062 void KMdiFocusList::objectHasBeenDestroyed( TQObject * o )
00063 {
00064     if ( !o || !o->isWidgetType() )
00065         return ;
00066     TQWidget *w = ( TQWidget* ) o;
00067     m_list.remove( w );
00068 }
00069 
00070 // kate: space-indent off; tab-width 4; replace-tabs off; indent-mode csands;

kmdi

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

kmdi

Skip menu "kmdi"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kmdi by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |