author | zautrix <zautrix> | 2005-07-10 10:17:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-10 10:17:55 (UTC) |
commit | 58b7818a74809dc9280a3249eeb7e0195a66f93d (patch) (side-by-side diff) | |
tree | 04b04b867647a8c48d59e7a0fa89df6430039599 /microkde/kdeui | |
parent | e8b6635ef7c98996f0415e6a77394569493ab151 (diff) | |
download | kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.zip kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.gz kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.bz2 |
fixx
-rw-r--r-- | microkde/kdeui/kbuttonbox.cpp | 2 | ||||
-rw-r--r-- | microkde/kdeui/kpopupmenu.cpp | 19 | ||||
-rw-r--r-- | microkde/kdeui/kpopupmenu.h | 22 |
3 files changed, 40 insertions, 3 deletions
diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp index 16206e8..83d622a 100644 --- a/microkde/kdeui/kbuttonbox.cpp +++ b/microkde/kdeui/kbuttonbox.cpp @@ -1,97 +1,97 @@ /* This file is part of the KDE libraries Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com) This library 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * KButtonBox class * * A container widget for buttons. Uses Qt layout control to place the * buttons, can handle both vertical and horizontal button placement. * * HISTORY * * 03/08/2000 Mario Weilguni <mweilguni@kde.org> * Removed all those long outdated Motif stuff * Improved and clarified some if conditions (easier to understand) * * 11/13/98 Reginald Stadlbauer <reggie@kde.org> * Now in Qt 1.4x motif default buttons have no extra width/height anymore. * So the KButtonBox doesn't add this width/height to default buttons anymore * which makes the buttons look better. * * 01/17/98 Mario Weilguni <mweilguni@sime.com> * Fixed a bug in sizeHint() * Improved the handling of Motif default buttons * * 01/09/98 Mario Weilguni <mweilguni@sime.com> * The last button was to far right away from the right/bottom border. * Fixed this. Removed old code. Buttons get now a minimum width. * Programmer may now override minimum width and height of a button. * */ //US #include "kbuttonbox.moc" - + #include <kbuttonbox.h> #include <qpushbutton.h> #include <qptrlist.h> #include <assert.h> #define minButtonWidth 50 class KButtonBox::Item { public: QPushButton *button; bool noexpand; unsigned short stretch; unsigned short actual_size; }; template class QPtrList<KButtonBox::Item>; class KButtonBoxPrivate { public: unsigned short border; unsigned short autoborder; unsigned short orientation; bool activated; QPtrList<KButtonBox::Item> buttons; }; KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, int border, int autoborder) : QWidget(parent) { data = new KButtonBoxPrivate; assert(data != 0); data->orientation = _orientation; data->border = border; data->autoborder = autoborder < 0 ? border : autoborder; data->buttons.setAutoDelete(TRUE); } KButtonBox::~KButtonBox() { delete data; } QPushButton *KButtonBox::addButton(const QString& text, bool noexpand) { Item *item = new Item; item->button = new QPushButton(text, this); item->noexpand = noexpand; diff --git a/microkde/kdeui/kpopupmenu.cpp b/microkde/kdeui/kpopupmenu.cpp new file mode 100644 index 0000000..96d2a87 --- a/dev/null +++ b/microkde/kdeui/kpopupmenu.cpp @@ -0,0 +1,19 @@ + +#include <kpopupmenu.h> +#include <qtimer.h> + + +KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) + : QPopupMenu ( parent, name ) {;} + + + +KMenuBar::KMenuBar ( QWidget * parent, const char * name ) + : QPEMenuBar ( parent, name ) {} + +void KMenuBar::focusOutEvent ( QFocusEvent * e) +{ + QPEMenuBar::focusOutEvent( e ); + QTimer::singleShot( 100, this, SIGNAL ( lostFocus() ) ); + +} diff --git a/microkde/kdeui/kpopupmenu.h b/microkde/kdeui/kpopupmenu.h index 1352429..f16ce77 100644 --- a/microkde/kdeui/kpopupmenu.h +++ b/microkde/kdeui/kpopupmenu.h @@ -1,14 +1,32 @@ #ifndef KPOPUPMENU_H #define KPOPUPMENU_H #include <qpopupmenu.h> +#ifdef DESKTOP_VERSION +#include <qmenubar.h> +#define QPEMenuBar QMenubar +#else +#include <qpe/qpemenubar.h> +#endif class KPopupMenu : public QPopupMenu { +Q_OBJECT public: - KPopupMenu ( QWidget * parent=0, const char * name=0 ) - : QPopupMenu ( parent, name ) {} + KPopupMenu ( QWidget * parent=0, const char * name=0 ); + +}; + +class KMenuBar : public QPEMenuBar +{ +Q_OBJECT + public: + KMenuBar ( QWidget * parent=0, const char * name=0 ); + signals: + void lostFocus(); + protected: + void focusOutEvent ( QFocusEvent * e); }; #endif |