Flu_Button.h
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:3k
- /*
- * ===========================================================================
- * PRODUCTION $Log: Flu_Button.h,v $
- * PRODUCTION Revision 1000.1 2004/06/01 19:51:23 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.2
- * PRODUCTION
- * ===========================================================================
- */
- /*
- * These files were imported into NCBI's CVS directly from FLU version 2.9.1.
- * Modifications to the source are listed below.
- *
- * ==========================================================================
- * $Log: Flu_Button.h,v $
- * Revision 1000.1 2004/06/01 19:51:23 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.2
- *
- * Revision 1.2 2004/05/03 12:47:07 dicuccio
- * Added #include for gui/gui.hpp. gui/utils ->gui/objutils where needed.
- *
- * Revision 1.1 2004/03/11 13:51:54 dicuccio
- * Imported FLU version 2.9.1. Altered export specifiers to match NCBI layout.
- * Altered include paths to match NCBI toolkit layout.
- *
- * ==========================================================================
- */
- // $Id: Flu_Button.h,v 1000.1 2004/06/01 19:51:23 gouriano Exp $
- /***************************************************************
- * FLU - FLTK Utility Widgets
- * Copyright (C) 2002 Ohio Supercomputer Center, Ohio State University
- *
- * This file and its content is protected by a software license.
- * You should have received a copy of this license with this file.
- * If not, please contact the Ohio Supercomputer Center immediately:
- * Attn: Jason Bryan Re: FLU 1224 Kinnear Rd, Columbus, Ohio 43212
- *
- ***************************************************************/
- #ifndef _FLU_BUTTON_H
- #define _FLU_BUTTON_H
- #include <corelib/ncbistd.hpp>
- #include <gui/gui.hpp>
- #include <FL/Fl_Button.H>
- #include <FL/Fl_Image.H>
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- //! This class extends Fl_Button to make a more attractive alternative that hilights as the mouse enters/leaves and automatically grayscales any image for deactivation
- class NCBI_GUIWIDGETS_FLU_EXPORT Flu_Button : public Fl_Button
- {
- public:
- //! Normal FLTK widget constructor
- Flu_Button( int X,int Y,int W,int H,const char *l = 0 );
- //! Default destructor
- virtual ~Flu_Button();
- //! Override of Fl_Widget::color()
- inline void color( unsigned c )
- { col = (Fl_Color)c; Fl_Button::color(col); }
- //! Override of Fl_Widget::color()
- inline Fl_Color color() const
- { return col; }
- //! Override of Fl_Widget::selection_color()
- inline void selection_color( unsigned c )
- { sCol = (Fl_Color)c; Fl_Button::selection_color(sCol); }
- //! Override of Fl_Widget::selection_color()
- inline Fl_Color selection_color() const
- { return sCol; }
- //! Set the box to use when the mouse is over the button. If this is c FL_NO_BOX, then the regular box() is used
- inline void enter_box( Fl_Boxtype b )
- { eBox = b; }
- //! Get the box to use when the mouse enters
- inline Fl_Boxtype enter_box() const
- { return eBox; }
- //! Override of Fl_Widget::image()
- void image( Fl_Image *i );
- //! Override of Fl_Widget::image()
- inline void image( Fl_Image &i )
- { image( &i ); }
- //! Override of Fl_Button::handle()
- int handle( int event );
- // Override of Fl_Button::draw()
- void draw();
- protected:
- bool retBtn, linkBtn, overLink;
- private:
- void checkLink();
- int labelSize[4];
- bool hover;
- Fl_Color col, sCol;
- Fl_Image *inactiveImg;
- Fl_Boxtype eBox;
- };
- #endif