Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

multiplelabel.h

00001 /***************************************************************************
00002                       multiplelabel.h  -  description
00003                              -------------------
00004     begin                : Thu Mar 09 2004
00005     copyright            : (C) 2004 by Daroth-U
00006     email                : daroth-u@ifrance.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MULTIPLE_LABEL_H
00019 #define MULTIPLE_LABEL_H
00020 
00021 #include <vector>
00022 #include "../constants.h"
00023 #include "widget.h"
00024 #include "label.h"
00025 
00030 class SDLHandler;
00031 class Label;
00032 
00033 class MultipleLabel : public Widget {
00034  private:
00035   int x2, y2;
00036   int dynWidth;
00037   vector<char *> vText;
00038   Label *staticLabel;
00039   Label *dynamicLabel;
00040   bool inside;
00041   int currentTextInd;   
00042   
00043  public: 
00044 
00045   MultipleLabel(int x1, int y1, int x2, int y2, char *staticText, int dynWidth);
00046   ~MultipleLabel();
00047   bool isInside(int x, int y);
00048   void addText(char *s);
00049   void setText(int i);  
00050   void setNextText();
00051   inline char * getText(int i){if(i >= 0 && i < (int)vText.size()){return vText[i];} else return NULL;}
00052   inline int getCurrentTextInd(){ return currentTextInd; }
00053   inline char * getCurrentText() { return vText[currentTextInd]; }
00054   inline int getNbText(){ return vText.size();}
00055         
00056   bool handleEvent(Widget *parent, SDL_Event *event, int x, int y);
00057   void drawWidget(Widget *parent);
00058 };
00059 
00060 #endif
00061 

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0