Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

olayout.cpp

Go to the documentation of this file.
00001 /*
00002                =.            This file is part of the OPIE Project
00003              .=l.            Copyright (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
00004            .>+-=
00005  _;:,     .>    :=|.         This library is free software; you can
00006 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00007 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00008 .="- .-=="i,     .._         License as published by the Free Software
00009  - .   .-<_>     .<>         Foundation; version 2 of the License.
00010      ._= =}       :
00011     .%`+i>       _;_.
00012     .i_,=:_.      -<s.       This library is distributed in the hope that
00013      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00014     : ..    .:,     . . .    without even the implied warranty of
00015     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00016   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00017 ..}^=.=       =       ;      Library General Public License for more
00018 ++=   -.     .`     .:       details.
00019  :     =  ...= . :.=-
00020  -.   .:....=;==+<;          You should have received a copy of the GNU
00021   -_. . .   )=.  =           Library General Public License along with
00022     --        :-=`           this library; see the file COPYING.LIB.
00023                              If not, write to the Free Software Foundation,
00024                              Inc., 59 Temple Place - Suite 330,
00025                              Boston, MA 02111-1307, USA.
00026 
00027 */
00028 
00029 #include "olayout.h"
00030 
00031 /* OPIE */
00032 #include <opie2/odebug.h>
00033 
00034 /* QT */
00035 #include <qapplication.h>
00036 
00037 namespace Opie {
00038 namespace Ui {
00039 
00040 OAutoBoxLayout::OAutoBoxLayout( QWidget *parent, int border, int space, const char *name )
00041                :QBoxLayout( parent, LeftToRight, border, space, name )
00042 {
00043     fixDirection();
00044 }
00045 
00046 
00047 OAutoBoxLayout::OAutoBoxLayout( QLayout *parentLayout, int space, const char *name )
00048                :QBoxLayout( parentLayout, LeftToRight, space, name )
00049 {
00050     fixDirection();
00051 }
00052 
00053 
00054 OAutoBoxLayout::OAutoBoxLayout( int space, const char *name )
00055                :QBoxLayout( LeftToRight, space, name )
00056 {
00057     fixDirection();
00058 }
00059 
00060 
00061 void OAutoBoxLayout::fixDirection()
00062 {
00063     QWidget* desktop = QApplication::desktop();
00064     int w = desktop->width();
00065     int h = desktop->height();
00066     if ( h > w )
00067     {
00068         odebug << "OAutoBoxLayout: h > w, setting orientation to TopToBottom" << oendl;
00069         setDirection( TopToBottom );
00070     }
00071 }
00072 
00073 
00074 OAutoBoxLayout::~OAutoBoxLayout()
00075 {
00076 }
00077 
00078 
00079 }; // namespace Ui
00080 }; // namespace Opie
00081 
00082 
00083 

Generated on Sat Nov 5 16:16:24 2005 for OPIE by  doxygen 1.4.2