DialogBox.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006 The TBT Team.
00005 ** 
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 ** 
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 ** 
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
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; // the dialog_box_sav .. for refresh
00040   SDL_Surface *image; //background 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   // Class compatibility
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

Generated on Sat Jun 23 16:07:23 2007 for Stechec/TBT by  doxygen 1.4.7