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

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

# Flu_Toggle_Group.h

    00001 // $Id: Flu_Toggle_Group.h,v 1.8 2003/08/20 16:29:43 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_TOGGLE_GROUP_H
    00017 #define _FLU_TOGGLE_GROUP_H
    00018
    00019 #include <stdio.h>
    00020 #include <string.h>
    00021
    00022 /* fltk includes */
    00023 #include <FL/Fl.H>
    00024 #include <FL/Fl_Check_Button.H>
    00025 #include <FL/fl_draw.H>
    00026 #include <FL/Fl_Group.H>
    00027
    00028 #include "FLU/Flu_Enumerations.h"
    00029
    00031 class FLU_EXPORT Flu_Toggle_Group : public Fl_Group
    00032 {
    00033
    00034  public:
    00035
    00037   Flu_Toggle_Group( int x, int y, int w, int h, const char *l = 0 );
    00038
    00040   inline void activate()
    00041     { value(1); }
    00042
    00044   inline void deactivate()
    00045     { value(0); }
    00046
    00048   inline int active() const
    00049     { return value(); }
    00050
    00052   inline void value( int v )
    00053     { chkBtn->value(v); redraw(); }
    00054
    00056   inline int value() const
    00057     { return chkBtn->value(); }
    00058
    00060   void draw();
    00061
    00062  protected:
    00063
    00064   static void _toggleCB( Fl_Widget *w, void *arg )
    00065     { ((Flu_Toggle_Group*)arg)->toggleCB(); }
    00066   void toggleCB();
    00067
    00068   Fl_Check_Button *chkBtn;
    00069
    00070 };
    00071
    00072 #endif