cascadelayout.h

Go to the documentation of this file.
00001 /*
00002   libwt - Vassilis Virvilis Toolkit - a widget library
00003   Copyright (C) 2006 Vassilis Virvilis <vasvir2@fastmail.fm>
00004  
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 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   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the
00017   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018   Boston, MA  02111-1307, SA.
00019 */
00020 
00021 #ifndef WT_CASCADELAYOUT_H
00022 #define WT_CASCADELAYOUT_H
00023 
00024 #include <wt/layout.h>
00025 
00026 namespace Wt {
00027 
00028 class CascadeLayoutItemValue {
00029 public:
00030 };
00031 
00032 typedef LayoutItemCompound<CascadeLayoutItemValue> CascadeLayoutItemCompound;
00033 typedef std::list<CascadeLayoutItemCompound> CascadeLayoutItemList;
00034 
00035 class CascadeLayoutIterator : public LayoutStdContainerIterator<CascadeLayoutItemList> {
00036 public:
00037     CascadeLayoutIterator(CascadeLayoutItemList& list) :
00038     LayoutStdContainerIterator<CascadeLayoutItemList>(list) {}
00039 private:
00040 };
00041 
00042 typedef LayoutStdContainer<CascadeLayoutItemList> CascadeLayoutBase;
00043 
00044 class CascadeLayout : public CascadeLayoutBase {
00045 public:
00046     CascadeLayout(Widget *parent, int margin = 0,
00047                   int horizontal_advance = 5, int vertical_advance = 5,
00048                   const std::string &name = "CascadeLayout::anon") :
00049             CascadeLayoutBase(parent, margin, -1, name),
00050             horizontalAdvance(horizontal_advance),
00051     verticalAdvance(vertical_advance) {
00052         init();
00053     }
00054 
00055     CascadeLayout(Layout * parent_layout, int margin = 0,
00056                   int horizontal_advance = 5, int vertical_advance = 5,
00057                   const std::string &name = "CascadeLayout::anon") :
00058             CascadeLayoutBase(parent_layout, margin, -1, name),
00059             horizontalAdvance(horizontal_advance),
00060     verticalAdvance(vertical_advance) {
00061         init();
00062     }
00063 
00064     CascadeLayout(int horizontal_advance = 5, int vertical_advance = 5,
00065                   const std::string &name = "CascadeLayout::anon") :
00066             CascadeLayoutBase(-1, name),
00067             horizontalAdvance(horizontal_advance),
00068     verticalAdvance(vertical_advance) {
00069         init();
00070     }
00071 
00072     virtual void setGeometry(const Rect& r);
00073 
00074     WVar<int> horizontalAdvance;
00075     WVar<int> verticalAdvance;
00076 
00077 protected:
00078     virtual void validate();
00079 
00080 private:
00081     void init();
00082 };
00083 
00084 } // namespace
00085 
00086 #endif // WT_CASCADELAYOUT_H

Generated Fri Jul 28 19:22:59 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.