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

editScheme.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (c)  2002 Dan Williams <drw@handhelds.org>
00005                              Copyright (c)  2002 Robert Griebl <sandman@handhelds.org>
00006               =.
00007             .=l.
00008            .>+-=
00009  _;:,     .>    :=|.         This program is free software; you can
00010 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00011 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00012 .="- .-=="i,     .._         License as published by the Free Software
00013  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00014      ._= =}       :          or (at your option) any later version.
00015     .%`+i>       _;_.
00016     .i_,=:_.      -<s.       This program is distributed in the hope that
00017      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00018     : ..    .:,     . . .    without even the implied warranty of
00019     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00020   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00021 ..}^=.=       =       ;      Library General Public License for more
00022 ++=   -.     .`     .:       details.
00023 :     =  ...= . :.=-
00024  -.   .:....=;==+<;          You should have received a copy of the GNU
00025   -_. . .   )=.  =           Library General Public License along with
00026     --        :-=`           this library; see the file COPYING.LIB.
00027                              If not, write to the Free Software Foundation,
00028                              Inc., 59 Temple Place - Suite 330,
00029                              Boston, MA 02111-1307, USA.
00030 */
00031 
00032 #include "editScheme.h"
00033 
00034 #include <qaction.h>
00035 #include <qlabel.h>
00036 #include <qlayout.h>
00037 #include <qpopupmenu.h>
00038 #include <qscrollview.h>
00039 #include <qtoolbutton.h>
00040 #include <qwhatsthis.h>
00041 
00042 using namespace Opie::Ui;
00043 EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent,  const char* name, bool modal, WFlags )
00044     : QDialog ( parent, name, modal, WStyle_ContextHelp )
00045 {
00046     setCaption ( tr( "Edit scheme" ) );
00047     QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 );
00048 
00049     m_count = cnt;
00050     m_buttons = new Opie::OColorButton * [cnt];
00051     m_colors = colors;
00052 
00053     for ( int i = 0; i < cnt; i++ )
00054     {
00055         QLabel *l = new QLabel ( labels [i], this );
00056         layout-> addWidget ( l, i, 0 );
00057         QWhatsThis::add( l, tr( "Click here to select a color for: " ).arg( labels [i] ) );
00058 
00059         m_buttons [i] = new Opie::OColorButton ( this, colors [i] );
00060         layout-> addWidget ( m_buttons [i], i, 1 );
00061         QWhatsThis::add( m_buttons [i], tr( "Click here to select a color for: " ).arg( labels [i] ) );
00062     }
00063 }
00064 
00065 EditScheme::~EditScheme ( )
00066 {
00067     delete [] m_buttons;
00068 }
00069 
00070 void EditScheme::accept ( )
00071 {
00072     for ( int i = 0; i < m_count; i++ )
00073         m_colors [i] = m_buttons [i]-> color ( );
00074 
00075     QDialog::accept ( );
00076 }
00077 

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