00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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