Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

mmsarrowwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider,             *
00003  *                           Matthias Hardt, Guido Madaus                  *
00004  *                                                                         *
00005  *   Copyright (C) 2007-2008 BerLinux Solutions GbR                        *
00006  *                           Stefan Schwarzer & Guido Madaus               *
00007  *                                                                         *
00008  *   Copyright (C) 2009-2013 BerLinux Solutions GmbH                       *
00009  *                                                                         *
00010  *   Authors:                                                              *
00011  *      Stefan Schwarzer   <stefan.schwarzer@diskohq.org>,                 *
00012  *      Matthias Hardt     <matthias.hardt@diskohq.org>,                   *
00013  *      Jens Schneider     <jens.schneider@diskohq.org>,                   *
00014  *      Guido Madaus       <guido.madaus@diskohq.org>,                     *
00015  *      Patrick Helterhoff <patrick.helterhoff@diskohq.org>,               *
00016  *      René Bählkow       <rene.baehlkow@diskohq.org>                     *
00017  *                                                                         *
00018  *   This library is free software; you can redistribute it and/or         *
00019  *   modify it under the terms of the GNU Lesser General Public            *
00020  *   License version 2.1 as published by the Free Software Foundation.     *
00021  *                                                                         *
00022  *   This library is distributed in the hope that it will be useful,       *
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00025  *   Lesser General Public License for more details.                       *
00026  *                                                                         *
00027  *   You should have received a copy of the GNU Lesser General Public      *
00028  *   License along with this library; if not, write to the                 *
00029  *   Free Software Foundation, Inc.,                                       *
00030  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
00031  **************************************************************************/
00032 
00033 #ifndef MMSARROWWIDGET_H_
00034 #define MMSARROWWIDGET_H_
00035 
00036 #include "mmsgui/mmswidget.h"
00037 
00038 //! With this class you can draw an arrow.
00039 /*!
00040 The arrow here is nothing more than a triangle with a specified direction.
00041 The arrow widget cannot be focused.
00042 But if you click on it (e.g. mouse or touch screen), the arrow widget submits an input
00043 event (MMSKEY_CURSOR_LEFT, MMSKEY_CURSOR_RIGHT, MMSKEY_CURSOR_UP, MMSKEY_CURSOR_DOWN)
00044 to the toplevel parent window according to the direction parameter (see setDirection()).
00045 \author Jens Schneider
00046 */
00047 class MMSArrowWidget : public MMSWidget {
00048     private:
00049         string              className;
00050         MMSArrowWidgetClass *arrowWidgetClass;
00051         MMSArrowWidgetClass myArrowWidgetClass;
00052 
00053         bool last_pressed;
00054 
00055         //! current foreground values set?
00056         bool            current_fgset;
00057 
00058         //! current foreground color
00059         MMSFBColor      current_fgcolor;
00060 
00061         bool create(MMSWindow *root, string className, MMSTheme *theme);
00062 
00063         bool init();
00064         bool release();
00065 
00066         void getForeground(MMSFBColor *color);
00067         bool enableRefresh(bool enable = true);
00068         bool checkRefreshStatus();
00069 
00070         bool draw(bool *backgroundFilled = NULL);
00071 
00072         void handleInput(MMSInputEvent *inputevent);
00073 
00074     public:
00075         MMSArrowWidget(MMSWindow *root, string className, MMSTheme *theme = NULL);
00076         ~MMSArrowWidget();
00077 
00078         MMSWidget *copyWidget();
00079 
00080     public:
00081         /* theme access methods */
00082         MMSFBColor getColor();
00083         MMSFBColor getSelColor();
00084         MMSDIRECTION getDirection();
00085         bool getCheckSelected();
00086 
00087         void setColor(MMSFBColor color, bool refresh = true);
00088         void setSelColor(MMSFBColor selcolor, bool refresh = true);
00089         void setDirection(MMSDIRECTION direction, bool refresh = true);
00090         void setCheckSelected(bool checkselected);
00091 
00092         void updateFromThemeClass(MMSArrowWidgetClass *themeClass);
00093 };
00094 
00095 #endif /*MMSARROWWIDGET_H_*/

Generated by doxygen