00001 /* 00002 ParaGUI - crossplatform widgetset 00003 Copyright (C) 2000 Alexander Pipelka 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Alexander Pipelka 00020 pipelka@teleweb.at 00021 00022 Last Update: $Author: pipelka $ 00023 Update Date: $Date: 2001/01/31 17:23:17 $ 00024 Source File: $Source: /usr/local/CVSROOT/linux/paragui/doc/html/sdlwidgetlist_h-source.html,v $ 00025 CVS/RCS Revision: $Revision: 1.34 $ 00026 Status: $State: Exp $ 00027 */ 00028 00029 #ifndef SDLWIDGETLIST_H 00030 #define SDLWIDGETLIST_H 00031 00032 #ifdef SWIG 00033 %include "swigcommon.h" 00034 %module sdlwidgetlist 00035 %{ 00036 #include "sdlwidgetlist.h" 00037 %} 00038 #endif 00039 00040 #include "sdlgradientwidget.h" 00041 #include "sdlscrollbar.h" 00042 00043 #include <vector> 00044 00054 class DECLSPEC SDLWidgetList : public SDLGradientWidget { 00055 public: 00056 00060 SDLWidgetList(SDLWidget* parent, SDL_Rect& r); 00061 00065 ~SDLWidgetList(); 00066 00072 void AddWidget(SDLWidget* w); 00073 00079 bool RemoveWidget(SDLWidget* w); 00080 00087 SDLWidget* FindWidget(int index); 00088 00092 void RemoveAll(); 00093 00097 void DeleteAll(); 00098 00102 int GetWidgetCount(); 00103 00104 protected: 00105 00107 void eventShow(); 00108 00110 void eventSizeWindow(int w, int h); 00111 00113 bool eventScrollPos(int id, SDLWidget* widget, unsigned long data); 00114 00116 bool eventScrollTrack(int id, SDLWidget* widget, unsigned long data); 00117 00119 void ScrollToY(Sint32 position); 00120 00127 SDLWidget* GetWidgetFromPos(Sint32 y); 00128 00129 SDLScrollBar* my_objScrollbar; 00130 00131 SDL_Rect my_rectScrollbar; 00132 SDL_Rect my_rectList; 00133 00134 int my_widthScrollbar; 00135 00137 #ifndef SWIG 00138 std::vector < SDLWidget* > my_widgetList; // Hmmm, I know about this: vector :)) 00139 #endif 00140 00141 int my_widgetCount; 00142 int my_firstWidget; 00143 Uint32 my_height; 00144 00145 private: 00146 00147 SDLWidgetList(const SDLWidgetList&); 00148 SDLWidgetList& operator=(const SDLWidgetList&); 00149 00150 }; 00151 00152 #endif // SDLWIDGETLIST_H