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.
115 lines
3.5 KiB
115 lines
3.5 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 1997, 1998, 1999, 2000 Sven Radej (radej@kde.org)
|
||
|
Copyright (C) 1997, 1998, 1999, 2000 Matthias Ettrich (ettrich@kde.org)
|
||
|
Copyright (C) 1999, 2000 Daniel "Mosfet" Duley (mosfet@kde.org)
|
||
|
|
||
|
|
||
|
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., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
//$Id$
|
||
|
|
||
|
#ifndef _KMENUBAR_H
|
||
|
#define _KMENUBAR_H
|
||
|
|
||
15 years ago
|
#include <tqmenubar.h>
|
||
15 years ago
|
|
||
13 years ago
|
#include <tdelibs_export.h>
|
||
15 years ago
|
|
||
|
/**
|
||
|
* %KDE Style-able menubar.
|
||
|
*
|
||
15 years ago
|
* This is required since TQMenuBar is currently not handled by
|
||
|
* TQStyle.
|
||
15 years ago
|
*
|
||
|
* @author Daniel "Mosfet" Duley.
|
||
|
* @version $Id$
|
||
|
*/
|
||
|
|
||
13 years ago
|
class TDEUI_EXPORT KMenuBar : public TQMenuBar
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
|
||
15 years ago
|
KMenuBar (TQWidget *parent=0, const char *name=0);
|
||
15 years ago
|
~KMenuBar ();
|
||
|
|
||
|
/**
|
||
|
* This controls whether or not this menubar will be a top-level
|
||
|
* bar similar to the way Macintosh handles menubars. This
|
||
|
* overrides any global config settings.
|
||
|
*
|
||
|
* Keep in mind that it is probably a really bad idea to use this
|
||
|
* unless you really know what you're doing. A feature like a
|
||
|
* top-level menubar is one that should really be shared by all
|
||
|
* applications. If your app is the only one with a top-level
|
||
|
* bar, then things might look very... odd.
|
||
|
*
|
||
|
* This is included only for those people that @p do know that
|
||
|
* they need to use it.
|
||
|
*
|
||
|
* @param top_level If set to true, then this menubar will be a
|
||
|
* top-level menu
|
||
|
*/
|
||
|
void setTopLevelMenu(bool top_level = true);
|
||
|
|
||
|
/**
|
||
|
* Is our menubar a top-level (Macintosh style) menubar?
|
||
|
*
|
||
|
* @return True if it is top-level.
|
||
|
*/
|
||
|
bool isTopLevelMenu() const;
|
||
|
|
||
|
// TT are overloading virtuals :(
|
||
15 years ago
|
virtual void setGeometry( const TQRect &r );
|
||
15 years ago
|
virtual void setGeometry( int x, int y, int w, int h );
|
||
|
virtual void resize( int w, int h );
|
||
15 years ago
|
void resize( const TQSize& s ) { TQMenuBar::resize( s ); }
|
||
15 years ago
|
|
||
|
virtual void show();
|
||
|
virtual void setFrameStyle( int );
|
||
|
virtual void setLineWidth( int );
|
||
|
virtual void setMargin( int );
|
||
13 years ago
|
virtual TQSize sizeHint() const;
|
||
15 years ago
|
protected slots:
|
||
|
void slotReadConfig();
|
||
|
protected:
|
||
15 years ago
|
virtual void showEvent( TQShowEvent* );
|
||
|
virtual void resizeEvent( TQResizeEvent* );
|
||
|
virtual bool eventFilter(TQObject *, TQEvent *);
|
||
15 years ago
|
#ifdef Q_WS_X11
|
||
|
virtual bool x11Event( XEvent* );
|
||
|
#endif
|
||
15 years ago
|
virtual void closeEvent( TQCloseEvent* );
|
||
|
virtual void drawContents( TQPainter* );
|
||
15 years ago
|
private slots:
|
||
|
void updateFallbackSize();
|
||
|
void selectionTimeout();
|
||
|
private:
|
||
|
void setTopLevelMenuInternal(bool top_level);
|
||
|
void updateMenuBarSize();
|
||
|
void checkSize( int& w, int& h );
|
||
|
static int block_resize;
|
||
|
protected:
|
||
|
virtual void virtual_hook( int id, void* data );
|
||
|
private:
|
||
|
class KMenuBarPrivate;
|
||
|
KMenuBarPrivate *d;
|
||
|
};
|
||
|
|
||
|
#endif
|