FLTK Utility Library and Widget Collection (FLU): Flu_Button.h Source File

Main Page | Class Hierarchy | Class List | File List | Class Members

# Flu_Button.h

    00001 // $Id: Flu_Button.h,v 1.11 2003/12/21 15:58:31 jbryan Exp $
    00002
    00003 /***************************************************************
    00004  *                FLU - FLTK Utility Widgets
    00005  *  Copyright (C) 2002 Ohio Supercomputer Center, Ohio State University
    00006  *
    00007  * This file and its content is protected by a software license.
    00008  * You should have received a copy of this license with this file.
    00009  * If not, please contact the Ohio Supercomputer Center immediately:
    00010  * Attn: Jason Bryan Re: FLU 1224 Kinnear Rd, Columbus, Ohio 43212
    00011  *
    00012  ***************************************************************/
    00013
    00014
    00015
    00016 #ifndef _FLU_BUTTON_H
    00017 #define _FLU_BUTTON_H
    00018
    00019 #include <FL/Fl_Button.H>
    00020 #include <FL/Fl_Image.H>
    00021
    00022 #include <stdlib.h>
    00023 #include <string.h>
    00024 #include <stdio.h>
    00025
    00026 #include "FLU/flu_export.h"
    00027
    00029 class FLU_EXPORT Flu_Button : public Fl_Button
    00030 {
    00031  public:
    00032
    00034   Flu_Button( int X,int Y,int W,int H,const char *l = 0 );
    00035
    00037   virtual ~Flu_Button();
    00038
    00040   inline void color( unsigned c )
    00041     { col = (Fl_Color)c; Fl_Button::color(col); }
    00042
    00044   inline Fl_Color color() const
    00045     { return col; }
    00046
    00048   inline void selection_color( unsigned c )
    00049     { sCol = (Fl_Color)c; Fl_Button::selection_color(sCol); }
    00050
    00052   inline Fl_Color selection_color() const
    00053     { return sCol; }
    00054
    00056   inline void enter_box( Fl_Boxtype b )
    00057     { eBox = b; }
    00058
    00060   inline Fl_Boxtype enter_box() const
    00061     { return eBox; }
    00062
    00064   void image( Fl_Image *i );
    00065
    00067   inline void image( Fl_Image &i )
    00068     { image( &i ); }
    00069
    00071   int handle( int event );
    00072
    00073   // Override of Fl_Button::draw()
    00074   void draw();
    00075
    00076  protected:
    00077
    00078   bool retBtn, linkBtn, overLink;
    00079
    00080  private:
    00081
    00082   void checkLink();
    00083   int labelSize[4];
    00084   bool hover;
    00085   Fl_Color col, sCol;
    00086   Fl_Image *inactiveImg;
    00087   Fl_Boxtype eBox;
    00088
    00089 };
    00090
    00091 #endif