1 /* GG is a GUI for OpenGL. 2 3 Copyright (C) 2015 Mitten-O 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public License 7 as published by the Free Software Foundation; either version 2.1 8 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free 17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 02111-1307 USA 19 20 If you do not wish to comply with the terms of the LGPL please 21 contact the author as other terms are available for a fee. 22 23 Zach Laine 24 whatwasthataddress@gmail.com */ 25 26 #ifndef BLOCKCONTROL_H 27 #define BLOCKCONTROL_H 28 29 #include <GG/Control.h> 30 31 namespace GG { 32 33 /** \brief BlockControl is an abstract base class for controls that can determine their height 34 * when you set their width. 35 * 36 * BlockControls are used for embedding controls in text. 37 */ 38 class GG_API BlockControl : public Control 39 { 40 public: 41 //! Create a block control. 42 BlockControl(X x, Y y, X w, GG::Flags<GG::WndFlag> flags); 43 44 //! Set the maximum width of the block control. Returns the size based on the width. 45 virtual Pt SetMaxWidth(X width) = 0; 46 47 //! Redirect size move to setmaxwidth. 48 void SizeMove(const Pt& ul, const Pt& lr) override; 49 }; 50 51 } 52 53 #endif // BLOCKCONTROL_H 54