Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ctrl_checkbox.hpp

00001 /*****************************************************************************
00002  * ctrl_checkbox.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: ctrl_checkbox.hpp 12053 2005-08-06 23:38:31Z asmax $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef CTRL_CHECKBOX_HPP
00026 #define CTRL_CHECKBOX_HPP
00027 
00028 #include "ctrl_generic.hpp"
00029 #include "../utils/fsm.hpp"
00030 #include "../utils/observer.hpp"
00031 
00032 class GenericBitmap;
00033 class OSGraphics;
00034 class CmdGeneric;
00035 
00036 
00038 class CtrlCheckbox: public CtrlGeneric
00039 {
00040     public:
00042         CtrlCheckbox( intf_thread_t *pIntf,
00043                       const GenericBitmap &rBmpUp1,
00044                       const GenericBitmap &rBmpOver1,
00045                       const GenericBitmap &rBmpDown1,
00046                       const GenericBitmap &rBmpUp2,
00047                       const GenericBitmap &rBmpOver2,
00048                       const GenericBitmap &rBmpDown2,
00049                       CmdGeneric &rCommand1, CmdGeneric &rCommand2,
00050                       const UString &rTooltip1, const UString &rTooltip2,
00051                       VarBool &rVariable, const UString &rHelp,
00052                       VarBool *pVisible);
00053 
00054         virtual ~CtrlCheckbox();
00055 
00057         virtual void handleEvent( EvtGeneric &rEvent );
00058 
00060         virtual bool mouseOver( int x, int y ) const;
00061 
00063         virtual void draw( OSGraphics &rImage, int xDest, int yDest );
00064 
00066         virtual UString getTooltipText() const { return *m_pTooltip; }
00067 
00069         virtual string getType() const { return "checkbox"; }
00070 
00071     private:
00073         FSM m_fsm;
00075         VarBool &m_rVariable;
00077         CmdGeneric &m_rCommand1, &m_rCommand2;
00079         CmdGeneric *m_pCommand;
00081         const UString m_tooltip1, m_tooltip2;
00083         const UString *m_pTooltip;
00085         OSGraphics *m_pImgUp1, *m_pImgOver1, *m_pImgDown1;
00086         OSGraphics *m_pImgUp2, *m_pImgOver2, *m_pImgDown2;
00092         OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown;
00094         OSGraphics *m_pImgCurrent;
00095 
00097         DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver )
00098         DEFINE_CALLBACK( CtrlCheckbox, DownOverUpOver )
00099         DEFINE_CALLBACK( CtrlCheckbox, DownOverDown )
00100         DEFINE_CALLBACK( CtrlCheckbox, DownDownOver )
00101         DEFINE_CALLBACK( CtrlCheckbox, UpOverUp )
00102         DEFINE_CALLBACK( CtrlCheckbox, UpUpOver )
00103         DEFINE_CALLBACK( CtrlCheckbox, DownUp )
00104         DEFINE_CALLBACK( CtrlCheckbox, UpHidden )
00105         DEFINE_CALLBACK( CtrlCheckbox, HiddenUp )
00106 
00108         virtual void onVarBoolUpdate( VarBool &rVariable );
00109 
00111         void changeButton();
00112 };
00113 
00114 
00115 #endif

Generated on Tue Dec 20 10:14:41 2005 for vlc-0.8.4a by  doxygen 1.4.2