- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

uflowlayout.hpp

00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/layouts/uflowlayout.hpp 00008 begin : Tue May 29 2001 00009 $Id: uflowlayout.hpp,v 1.7 2005/02/13 17:49:29 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UFLOWLAYOUT_HPP 00029 #define UFLOWLAYOUT_HPP 00030 00031 #include "ulayoutmanager.hpp" 00032 00033 namespace ufo { 00034 00040 class UFO_EXPORT UFlowLayout : public ULayoutManager { 00041 UFO_DECLARE_DYNAMIC_CLASS(UFlowLayout) 00042 public: 00045 UFlowLayout(); 00048 UFlowLayout(int hgap, int vgap); 00049 UFlowLayout(int hgap, int vgap, Alignment hAlign, Alignment vAlign); 00050 virtual ~UFlowLayout(); 00051 00052 public: // Implements ULayoutManager 00053 UDimension getPreferredLayoutSize(const UWidget * parent, 00054 const UDimension & maxSize) const; 00055 00056 void layoutContainer(const UWidget * parent); 00057 00058 public: // Public methods 00061 virtual void setHorizontalAlignment(Alignment newHAlign); 00064 virtual Alignment getHorizontalAlignment(); 00067 virtual void setVerticalAlignment(Alignment newVAlign); 00070 virtual Alignment getVerticalAlignment(); 00071 00072 private: // Private methods 00084 void moveWidgets(const UWidget * parent, 00085 int x, int y, int width, int height, int rowStart, int rowEnd) const; 00086 00087 protected: // Protected attributes 00089 int m_hgap; 00091 int m_vgap; 00092 00093 private: // Private attributes 00096 Alignment m_horizontalAlignment; 00099 Alignment m_verticalAlignment; 00100 }; 00101 00102 } // namespace ufo 00103 00104 #endif // UFLOWLAYOUT_HPP

The libUFO Project - written by Johannes Schmidt