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

containergui.h

00001 /***************************************************************************
00002                           containergui.h  -  description
00003                              -------------------
00004     begin                : Sat May 3 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.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 CONTAINER_GUI_H
00019 #define CONTAINER_GUI_H
00020 
00021 #include <iostream>
00022 #include <string>
00023 #include "constants.h"
00024 #include "scourge.h"
00025 #include "item.h"
00026 #include "gui/window.h"
00027 #include "gui/widget.h"
00028 #include "gui/button.h"
00029 #include "gui/scrollinglist.h"
00030 #include "gui/draganddrop.h"
00031 
00032 class ContainerGui : public DragAndDropHandler {
00033 
00034  private:
00035   Scourge *scourge;
00036   Item *container;
00037   Window *win;
00038   Button *openButton, *infoButton, *closeButton;
00039   ScrollingList *list;
00040   Label *label;
00041   char **containedItemNames;
00042   Color *itemColor;
00043   GLuint *itemIcon;
00044 
00045  public:
00046   ContainerGui(Scourge *scourge, Item *container, int x, int y);
00047   ~ContainerGui();
00048 
00049   bool handleEvent(SDL_Event *event);
00050   bool handleEvent(Widget *widget, SDL_Event *event);
00051 
00052   inline Item *getContainer() { return container; }
00053   inline Window *getWindow() { return win; }
00054   inline void refresh() { showContents(); }
00055 
00056   // drag and drop handling
00057   void receive(Widget *widget);
00058   bool startDrag(Widget *widget, int x=0, int y=0);
00059 
00060  private:
00061   void showContents();
00062   void dropItem();
00063   
00064 };
00065 
00066 #endif

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