QIArrowButtonSwitch.cpp revision ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeef
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * VirtualBox Qt extensions: QIArrowButtonSwitch class implementation
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * Copyright (C) 2006-2008 Sun Microsystems, Inc.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * available from http://www.virtualbox.org. This file is free software;
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * you can redistribute it and/or modify it under the terms of the GNU
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * General Public License (GPL) as published by the Free Software
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * additional information or have any questions.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync/* VBox includes */
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync/* Qt includes */
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync/** @class QIArrowButtonSwitch
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * The QIArrowButtonSwitch class is an arrow tool-botton with text-label,
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync * used as collaps/expand switch in QIMessageBox class.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncQIArrowButtonSwitch::QIArrowButtonSwitch (QWidget *aParent)
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncQIArrowButtonSwitch::QIArrowButtonSwitch (const QString &aName, QWidget *aParent)
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync mButton->setIcon (VBoxGlobal::iconSet (mIsExpanded ?
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync ":/arrow_down_10px.png" : ":/arrow_right_10px.png"));
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncbool QIArrowButtonSwitch::eventFilter (QObject *aObject, QEvent *aEvent)
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync /* Process only QIArrowButtonSwitch or children */
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync if (!(aObject == this || children().contains (aObject)))
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync return QIRichToolButton::eventFilter (aObject, aEvent);
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync /* Process keyboard events */
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync QKeyEvent *kEvent = static_cast <QKeyEvent*> (aEvent);
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync if ((mIsExpanded && kEvent->key() == Qt::Key_Minus) ||
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync /* Default one handler */