//**************************************************************************** //! \file tstatusbar.hpp //! \date 04-10-2004 //! \class TStatusBar //! \brief The main status bar of the Weird Reader //**************************************************************************** // This file is part of Weird Reader. // // The Weird Reader is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // The Weird Reader 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Weird Reader; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //**************************************************************************** #ifndef TSTATUSBAR_HPP #define TSTATUSBAR_HPP #include #include #include #include #include #include #include class TStatusBar : public KStatusBar { Q_OBJECT QLabel *sbMessageLabel; //!< the Status Bar Label displaying Messages KProgress *progBar; //!< Shows current position in the book QFrame *sbF1; //!< the middle Frame QFrame *sbF2; //!< the left Frame public slots: virtual inline void progForward(); //!< makes one step on the progressbar virtual inline void progBackward(); //!< one step backward on the progressbar //! \brief new Status Bar message slot that displays message in the left frame //! \param message the message virtual inline void message( const QString &message); virtual inline void clear(); //!< Clears the message //! \brief reset the number of steps on the Progrssbar //! \param leng the new number of steps virtual inline void resetProgLength( const int leng=100); //! \brief goto a certain page number //! \param pos the Page number virtual inline void proGoto( const int pos=0); virtual inline void menuStatus( KAction *act, bool sw); public: inline TStatusBar( QWidget *parent = 0, const char * name = 0); ~TStatusBar() {}; }; //*************************************************************************** // Implementation //*************************************************************************** // public slots //*************************************************************************** //*************************************************************************** void TStatusBar::progBackward() //*************************************************************************** { progBar->advance( -1); } //*************************************************************************** void TStatusBar::progForward() //*************************************************************************** { progBar->advance( 1); } //*************************************************************************** void TStatusBar::message( const QString &message) //*************************************************************************** { sbMessageLabel->setText( message); // KStatusBar::message( message); } //*************************************************************************** void TStatusBar::clear() //*************************************************************************** { sbMessageLabel->setText( ""); } //*************************************************************************** void TStatusBar::resetProgLength( const int leng) //*************************************************************************** { progBar->setTotalSteps( leng); } //*************************************************************************** void TStatusBar::proGoto( const int pos) //*************************************************************************** { progBar->setProgress( pos); } //*************************************************************************** void TStatusBar::menuStatus( KAction *act, bool sw) //*************************************************************************** { // std::cout<<"Yo"<toolTip()); else clear(); } //*************************************************************************** // public methods //*************************************************************************** //*************************************************************************** TStatusBar::TStatusBar( QWidget *parent, const char * name) : KStatusBar( parent, name) //*************************************************************************** { sbF1 = new QFrame; sbF2 = new QFrame; sbMessageLabel = new QLabel( sbF2); sbMessageLabel->setGeometry( 0, 0, 200, 16); progBar = new KProgress( this); progBar->setFixedSize( QSize( 140, 16)); progBar->setFormat( "Page %v of %m"); this->addWidget( sbF2, 6, true); this->addWidget( sbF1, 10, true); this->addWidget( progBar, 10, true); } #endif // TSTATUSBAR_HPP