00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef DIALOGBOX_H
00018 # define DIALOGBOX_H
00019
00020 # include "Global.hh"
00021 # include "Button.hh"
00022 # include "Colors.hh"
00023 # include <vector>
00024
00036 class DialogBox: public Widget
00037 {
00038 protected:
00039 SDL_Surface *dialog_box_surf_sav;
00040 SDL_Surface *image;
00041 vector<ImageButton*> list_button;
00042 bool move_dialog;
00043
00045 void refresh();
00046
00050 void erase();
00051
00057
00059 ushort insidetitle(const uint mx, const uint my);
00060
00061 public:
00062 DialogBox(const uint x, const uint y, const uint w, const uint h,
00063 SDL_Surface* screen, const string filename);
00064 virtual ~DialogBox();
00065
00069 ushort mousebuttonup();
00070
00077 virtual ushort mousebuttondown(const uint mousex, const uint mousey);
00078
00091 ushort mousemotion(const uint mousex, const uint mousey, const uint xrel, const uint yrel);
00092
00093
00094 void mousemotion(const uint mousex, const uint mousey){};
00095
00097 virtual void draw() = 0;
00098
00102 void addButton(ImageButton* new_button);
00103
00105 ushort getnbButton();
00106 };
00107
00122 class DInfo : public DialogBox
00123 {
00124 string message;
00125 TTF_Font* font;
00126 SDL_Surface* icone;
00127
00128 public:
00129 DInfo(SDL_Surface*, const string);
00130 ~DInfo();
00131
00142 ushort mousebuttondown(const uint mx, const uint my);
00143
00148 void draw();
00149 };
00150
00151 #endif