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

pickboard.cpp

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #include "pickboard.h"
00021 #include "pickboardpicks.h"
00022 #include "pickboardcfg.h"
00023 
00024 #include <qpe/global.h>
00025 #include <qpe/config.h>
00026 #include <qpainter.h>
00027 #include <qlist.h>
00028 #include <qbitmap.h>
00029 #include <qlayout.h>
00030 #include <qvbox.h>
00031 #include <qdialog.h>
00032 #include <qscrollview.h>
00033 #include <qpopupmenu.h>
00034 #include <qhbuttongroup.h>
00035 #include <qpushbutton.h>
00036 #include <qmessagebox.h>
00037 #ifdef QWS
00038 #include <qwindowsystem_qws.h>
00039 #endif
00040 
00057 /* XPM */
00058 static const char * const menu_xpm[]={
00059 "9 9 2 1",
00060 "a c #000000",
00061 ". c None",
00062 ".........",
00063 ".........",
00064 ".........",
00065 "....a....",
00066 "...aaa...",
00067 "..aaaaa..",
00068 ".aaaaaaa.",
00069 ".........",
00070 "........."};
00071 
00072 class PickboardPrivate {
00073 public:
00074     PickboardPrivate(Pickboard* parent)
00075     {
00076         picks = new PickboardPicks(parent);
00077         picks->initialise();
00078         menu = new QPushButton(parent);
00079         menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding));
00080         menu->setPixmap(QPixmap((const char **)menu_xpm));
00081         QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu()));
00082         QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)),
00083             parent,SIGNAL(key(ushort,ushort,ushort,bool,bool)));
00084     }
00085 
00086     PickboardPicks* picks;
00087     QPushButton* menu;
00088 };
00089 
00090 Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) :
00091     QFrame(parent,name,f)
00092 {
00093     (new QHBoxLayout(this))->setAutoAdd(TRUE);
00094     d = new PickboardPrivate(this);
00095 
00096     // get the default font
00097     Config *config = new Config( "qpe" );
00098     config->setGroup( "Appearance" );
00099     QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
00100     int fontSize = config->readNumEntry( "FontSize", 10 );
00101     delete config;
00102 
00103     setFont( QFont( familyStr, fontSize ) );
00104 }
00105 
00106 Pickboard::~Pickboard()
00107 {
00108     delete d;
00109 }
00110 
00111 void Pickboard::resetState()
00112 {
00113     d->picks->resetState();
00114 }
00115 

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