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

todaybase.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) Maximilian Reiss <harlekin@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022  :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 */
00030 
00031 #include "todaybase.h"
00032 
00033 #include <opie2/oresource.h>
00034 
00035 #include <qpe/applnk.h>
00036 
00037 #include <qvbox.h>
00038 #include <qwhatsthis.h>
00039 
00040 using namespace Opie::Ui;
00041 TodayBase::TodayBase( QWidget* parent,  const char* name, WFlags )
00042     : QWidget( parent, name, WStyle_ContextHelp ) {
00043 
00044   QPixmap logo = Opie::Core::OResource::loadPixmap( "today/today_logo" ); // logo
00045   QImage  opiezillaimage = QImage( Opie::Core::OResource::loadImage( "logo/opielogo" ) );
00046   opiezillaimage = opiezillaimage.smoothScale( 45, 45 );
00047   QPixmap opiezilla; //the opiezilla
00048   opiezilla.convertFromImage( opiezillaimage );
00049   QPixmap config = Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon );
00050 
00051   layout = 0L;
00052 
00053   QPalette pal = this->palette();
00054   QColor col = pal.color( QPalette::Active, QColorGroup::Background );
00055   pal.setColor( QPalette::Active, QColorGroup::Button, col );
00056   pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
00057   pal.setColor( QPalette::Normal, QColorGroup::Button, col );
00058   pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
00059   this->setPalette( pal );
00060 
00061   // --- logo Section ---
00062   QPalette pal2;
00063   QColorGroup cg;
00064   cg.setColor( QColorGroup::Text, white );
00065   cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
00066   pal2.setActive( cg );
00067 
00068 // today logo
00069   Frame = new QLabel( this, "Frame" );
00070   Frame->setPalette( pal2 );
00071   Frame->setFrameShape( QFrame::StyledPanel );
00072   Frame->setFrameShadow( QFrame::Raised );
00073   Frame->setLineWidth( 0 );
00074 
00075   QHBoxLayout *frameLayout = new QHBoxLayout( Frame );
00076   QVBox *box1 = new QVBox( Frame );
00077 
00078   // Today text
00079   TodayLabel = new QLabel( box1, "TodayText" );
00080   QFont TodayLabel_font(  TodayLabel->font() );
00081   TodayLabel_font.setBold( TRUE );
00082   TodayLabel_font.setPointSize( 40 );
00083   TodayLabel->setFont( TodayLabel_font );
00084   TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
00085   TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
00086 
00087   // date
00088   DateLabel = new QLabel( box1, "TextLabel1" );
00089   QFont DateLabel_font( DateLabel->font() );
00090   DateLabel_font.setBold( TRUE );
00091   DateLabel->setFont( DateLabel_font );
00092   DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
00093   DateLabel->setTextFormat( RichText );
00094 
00095   // Opiezilla
00096   Opiezilla = new QLabel( Frame, "OpieZilla" );
00097   Opiezilla->setPixmap( opiezilla );
00098   QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Rei�" ) );
00099   Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
00100 
00101 
00102   // Ownerfield
00103   OwnerField = new OClickableLabel( this , "Owner" );
00104   OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
00105 
00106   // config
00107   ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
00108   ConfigButton->setPixmap( config );
00109   QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
00110   ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
00111 
00112   frameLayout->addWidget( box1, 1 );
00113   frameLayout->addStretch( 1 );
00114   frameLayout->addWidget( ConfigButton,  0, AlignBottom );
00115   frameLayout->addWidget( Opiezilla );
00116 }
00117 
00118 
00122 TodayBase::~TodayBase() {
00123 }
00124 

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