AnimateBox.h
/*
* $Id: String.h 2839 2009-09-28 11:36:20Z karijes $
*
* Widget with animation support
* Copyright (c) 2005-2012 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_ANIMATEBOX_H__
#define __EDELIB_ANIMATEBOX_H__
#include "edelib-global.h"
#include <FL/Fl_Box.H>
#include <FL/Fl_Image.H>
#include "List.h"
EDELIB_NS_BEGIN
class EDELIB_API AnimateBox : public Fl_Box {
private:
float draw_rate;
int flags;
list<Fl_Image*> images;
list<Fl_Image*>::iterator curr_image;
public:
AnimateBox(int X, int Y, int W, int H, const char* l = 0) : Fl_Box(X, Y, W, H, l), draw_rate(0.2), flags(0)
{ align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); }
~AnimateBox();
bool append(Fl_Image *img);
bool append(const char *path);
void rate(float r) { draw_rate = r; }
float rate(void) { return draw_rate; }
void next_image(void);
void start_animation(void);
void stop_animation(void);
void rollover(void);
void animate_on_show(void);
int handle(int e);
};
EDELIB_NS_END
#endif
edelib::list< Fl_Image * >
edelib::AnimateBox::AnimateBox
AnimateBox(int X, int Y, int W, int H, const char *l=0)
Definition: AnimateBox.h:50
edelib::AnimateBox::rate
float rate(void)
Definition: AnimateBox.h:66
edelib::AnimateBox
Animate list of images inside box.
Definition: AnimateBox.h:41
edelib::AnimateBox::rate
void rate(float r)
Definition: AnimateBox.h:63