00001 /* $Id: panel.hpp 26774 2008-05-22 16:30:51Z mordante $ */ 00002 /* 00003 copyright (C) 2008 by mark de wever <koraq@xs4all.nl> 00004 part of the battle for wesnoth project http://www.wesnoth.org/ 00005 00006 this program is free software; you can redistribute it and/or modify 00007 it under the terms of the gnu general public license version 2 00008 or at your option any later version. 00009 this program is distributed in the hope that it will be useful, 00010 but without any warranty. 00011 00012 see the copying file for more details. 00013 */ 00014 00015 #ifndef __GUI_WIDGETS_PANEL_HPP_INCLUDED__ 00016 #define __GUI_WIDGETS_PANEL_HPP_INCLUDED__ 00017 00018 #include "gui/widgets/container.hpp" 00019 00020 namespace gui2 { 00021 00022 //! Visible container to hold children. 00023 class tpanel : public tcontainer_ 00024 { 00025 00026 public: 00027 //! Constructor. 00028 //! 00029 //! @param canvas_count The canvas count for tcontrol. 00030 tpanel(const unsigned canvas_count = 2) : 00031 tcontainer_(canvas_count) 00032 { 00033 } 00034 00035 twidget* find_widget(const tpoint& coordinate, const bool must_be_active) 00036 { return tcontainer_::find_widget(coordinate, must_be_active); } 00037 00038 const twidget* find_widget(const tpoint& coordinate, 00039 const bool must_be_active) const 00040 { return tcontainer_::find_widget(coordinate, must_be_active); } 00041 00042 twidget* find_widget(const std::string& id, const bool must_be_active) 00043 { return tcontainer_::find_widget(id, must_be_active); } 00044 00045 const twidget* find_widget(const std::string& id, 00046 const bool must_be_active) const 00047 { return tcontainer_::find_widget(id, must_be_active); } 00048 00049 bool has_vertical_scrollbar() const { return false; } 00050 00051 //! A panel is always active atm so ignore the request. 00052 void set_active(const bool /*active*/) {} 00053 bool get_active() const { return true; } 00054 unsigned get_state() const { return 0; } 00055 00056 //! Inherited from tcontrol. 00057 void draw(surface& surface); 00058 00059 SDL_Rect get_client_rect() const; 00060 00061 private: 00062 00063 //! Inherited from tcontrol. 00064 const std::string& get_control_type() const 00065 { static const std::string type = "panel"; return type; } 00066 00067 /** Inherited from tcontainer_. */ 00068 tpoint border_space() const; 00069 }; 00070 00071 } // namespace gui2 00072 00073 #endif 00074 00075
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |