arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TFWinBase.cpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 
00019 ///TFWinBase.cpp
00020 ///  simianUI
00021 
00022 #include "TFWinBase.h"
00023 #include "TFWidget.h"
00024 #include <iostream>
00025 
00026 using namespace std;
00027 
00028 //////////////////////////////////////////////////////////////////////////
00029 /// construction
00030 //////////////////////////////////////////////////////////////////////////
00031 TFWinBase::TFWinBase(QWidget *parent, const char *name, WFlags wf)
00032 : QMainWindow(parent,name,wf), _qcentral(new QWidget(this))
00033 {
00034    setCaption("Simian 3.0 ~ Transfer Function");
00035    setCentralWidget(_qcentral);
00036    confView();
00037 }
00038 
00039 //////////////////////////////////////////////////////////////////////////
00040 /// destruction
00041 //////////////////////////////////////////////////////////////////////////
00042 TFWinBase::~TFWinBase()
00043 {
00044 
00045 }
00046 
00047 //////////////////////////////////////////////////////////////////////////
00048 //////////////////////////////////////////////////////////////////////////
00049 /// public slots
00050 //////////////////////////////////////////////////////////////////////////
00051 //////////////////////////////////////////////////////////////////////////
00052 
00053 void TFWinBase::setVolume(VolumeSP vol)
00054 {
00055    iVolumeChanged(vol);
00056 }
00057 
00058 //////////////////////////////////////////////////////////////////////////
00059 //////////////////////////////////////////////////////////////////////////
00060 /// protected members
00061 //////////////////////////////////////////////////////////////////////////
00062 //////////////////////////////////////////////////////////////////////////
00063 
00064 void TFWinBase::keyPressEvent(QKeyEvent *key)
00065 {
00066    switch(key->key())
00067    {
00068    case 4096: //< escape key
00069       key->accept();
00070       close();
00071       break;
00072 
00073    default:
00074       cerr << "Key event : " << key->key() << " = ' " << char(key->ascii()) << " ' " << endl;
00075       break;
00076    }
00077 }
00078 
00079 //////////////////////////////////////////////////////////////////////////
00080 /// conf view
00081 //////////////////////////////////////////////////////////////////////////
00082 void TFWinBase::confView()
00083 {
00084    // Create a layout to position the widgets
00085    QHBoxLayout *topLayout = new QHBoxLayout( _qcentral, 1 );
00086 
00087    /// one rows, one column
00088    QGridLayout *_mainGrid = new QGridLayout(topLayout, 1, 1);
00089 
00090    TFWidget *tfw = new TFWidget(_qcentral,"The TF Widget", 0);
00091    tfw->connect(this,SIGNAL(iVolumeChanged(VolumeSP)),SLOT(setVolume(VolumeSP)));
00092    _mainGrid->addWidget(tfw,0,0);
00093 
00094 }

Send questions, comments, and bug reports to:
jmk