| 1 |
#include "avicapwnd_p.h" |
| 2 |
#include "avicapwnd_p.moc" |
| 3 |
|
| 4 |
#include <qframe.h> |
| 5 |
#include <qlabel.h> |
| 6 |
#include <qpushbutton.h> |
| 7 |
#include <qtabwidget.h> |
| 8 |
#include <qlayout.h> |
| 9 |
#include <qtooltip.h> |
| 10 |
#include <qcolor.h> |
| 11 |
#include <qwhatsthis.h> |
| 12 |
|
| 13 |
/* |
| 14 |
* Constructs a AviCapDlg which is a child of 'parent', with the |
| 15 |
* name 'name' and widget flags set to 'f' |
| 16 |
*/ |
| 17 |
AviCapDlg::AviCapDlg( QWidget* parent, const char* name, WFlags fl ) |
| 18 |
: QWidget( parent, name, fl ), avm::AvmOutputLog("AviCap") |
| 19 |
{ |
| 20 |
resize( 299, 422 ); |
| 21 |
setCaption( tr( "AVI capture" ) ); |
| 22 |
|
| 23 |
QVBoxLayout *vbmain=new QVBoxLayout(this); |
| 24 |
bigwidget=new QWidget(this); |
| 25 |
vbmain->addWidget(bigwidget); |
| 26 |
|
| 27 |
//bigwidget=this; |
| 28 |
|
| 29 |
QGridLayout* gl = new QGridLayout( bigwidget, 1, 1 ); |
| 30 |
gl->setSpacing( 5 ); |
| 31 |
gl->setMargin( 5 ); |
| 32 |
|
| 33 |
CaptureTab = new QTabWidget( bigwidget, "CaptureTab" ); |
| 34 |
#if QT_VERSION > 220 |
| 35 |
CaptureTab->setTabShape( QTabWidget::Rounded ); |
| 36 |
#endif |
| 37 |
//CaptureTab->setTabPosition( QTabWidget::Top ); |
| 38 |
|
| 39 |
gl->addWidget( CaptureTab, 0, 0 ); |
| 40 |
|
| 41 |
// first tab |
| 42 |
QWidget* w = new QWidget( CaptureTab ); |
| 43 |
|
| 44 |
CaptureTab->insertTab( w, tr( "Progress" ) ); |
| 45 |
QGridLayout* glt = new QGridLayout( w, 1, 1 ); |
| 46 |
glt->setSpacing( 5 ); |
| 47 |
glt->setMargin( 5 ); |
| 48 |
/* Frame34 = new QFrame( w ); |
| 49 |
glt->addWidget( Frame34, 0, 0 ); |
| 50 |
Frame34->setFrameShadow( QFrame::Sunken ); |
| 51 |
Frame34->setFrameShape( QFrame::StyledPanel ); |
| 52 |
QVBoxLayout* vl = new QVBoxLayout( Frame34 );*/ |
| 53 |
ProgressText = new QLabel( w ); |
| 54 |
glt->addWidget( ProgressText, 0, 0 ); |
| 55 |
//vl->addWidget( ProgressText ); |
| 56 |
//ProgressText->setBackgroundColor( QColor(255,255,0) ); |
| 57 |
ProgressText->setAlignment( Qt::AlignCenter ); |
| 58 |
|
| 59 |
// second tab |
| 60 |
w = new QWidget( CaptureTab ); |
| 61 |
CaptureTab->insertTab( w, tr( "Performance" ) ); |
| 62 |
glt = new QGridLayout( w, 1, 1 ); |
| 63 |
|
| 64 |
CaptureBufferText = new QLabel( tr( "Video capture buffer usage" ), w ); |
| 65 |
CaptureBufferText->setAlignment( int( QLabel::AlignCenter ) ); |
| 66 |
glt->addWidget( CaptureBufferText, 0, 0 ); |
| 67 |
glt->setSpacing( 5 ); |
| 68 |
glt->setMargin( 5 ); |
| 69 |
|
| 70 |
#if QT_VERSION > 220 |
| 71 |
|
| 72 |
Frame3 = new QFrame( w ); |
| 73 |
Frame3->setMinimumSize( QSize( 184, 94 ) ); |
| 74 |
Frame3->setFrameShadow( QFrame::Sunken ); |
| 75 |
Frame3->setFrameShape( QFrame::StyledPanel ); |
| 76 |
|
| 77 |
QPalette pal; |
| 78 |
QColorGroup cg1; |
| 79 |
QColorGroup cg2; |
| 80 |
|
| 81 |
cg1.setColor( QColorGroup::Foreground, black ); |
| 82 |
cg1.setColor( QColorGroup::Button, QColor( 192, 192, 192) ); |
| 83 |
cg1.setColor( QColorGroup::Light, white ); |
| 84 |
cg1.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) ); |
| 85 |
cg1.setColor( QColorGroup::Dark, QColor( 96, 96, 96) ); |
| 86 |
cg1.setColor( QColorGroup::Mid, QColor( 128, 128, 128) ); |
| 87 |
cg1.setColor( QColorGroup::Text, black ); |
| 88 |
cg1.setColor( QColorGroup::BrightText, white ); |
| 89 |
cg1.setColor( QColorGroup::ButtonText, black ); |
| 90 |
cg1.setColor( QColorGroup::Base, white ); |
| 91 |
cg1.setColor( QColorGroup::Background, black ); |
| 92 |
cg1.setColor( QColorGroup::Shadow, black ); |
| 93 |
cg1.setColor( QColorGroup::Highlight, black ); |
| 94 |
cg1.setColor( QColorGroup::HighlightedText, white ); |
| 95 |
|
| 96 |
pal.setActive( cg1 ); |
| 97 |
pal.setInactive( cg1 ); |
| 98 |
|
| 99 |
cg2 = cg1; |
| 100 |
cg2.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) ); |
| 101 |
cg2.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) ); |
| 102 |
pal.setDisabled( cg2 ); |
| 103 |
|
| 104 |
Frame3->setPalette( pal ); |
| 105 |
//Frame3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, Frame3->sizePolicy().hasHeightForWidth() ) ); |
| 106 |
|
| 107 |
TextLabel3 = new QLabel( tr( "0 %" ), w ); |
| 108 |
TextLabel3_2 = new QLabel( tr( " 100 % " ), w ); |
| 109 |
|
| 110 |
glt->addMultiCellWidget( Frame3, 1, 3, 0, 0 ); |
| 111 |
glt->addWidget( TextLabel3_2, 1, 1 ); |
| 112 |
glt->addWidget( TextLabel3, 3, 1 ); |
| 113 |
|
| 114 |
|
| 115 |
Frame3_2 = new QFrame( w ); |
| 116 |
Frame3_2->setMinimumSize( QSize( 184, 94 ) ); |
| 117 |
Frame3_2->setFrameShadow( QFrame::Sunken ); |
| 118 |
Frame3_2->setFrameShape( QFrame::StyledPanel ); |
| 119 |
Frame3_2->setPalette( pal ); |
| 120 |
|
| 121 |
MaxFrameSizeText = new QLabel( tr( "100 kb" ), w ); |
| 122 |
TextLabel3_3 = new QLabel( tr( "0 kb" ), w ); |
| 123 |
|
| 124 |
glt->addMultiCellWidget( Frame3_2, 4, 6, 0, 0 ); |
| 125 |
glt->addWidget( MaxFrameSizeText, 4, 1 ); |
| 126 |
glt->addWidget( TextLabel3_3, 6, 1 ); |
| 127 |
|
| 128 |
//QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
| 129 |
//glt->addItem( spacer, 1, 1 ); |
| 130 |
|
| 131 |
#endif |
| 132 |
QHBoxLayout* hbl = new QHBoxLayout( gl ); |
| 133 |
StartButton = new QPushButton( tr( "Start" ), bigwidget ); |
| 134 |
hbl->addWidget( StartButton ); |
| 135 |
SegmentButton = new QPushButton( tr( "Segment" ), bigwidget ); |
| 136 |
hbl->addWidget( SegmentButton ); |
| 137 |
MiniButton = new QPushButton( tr( "Mini" ), bigwidget ); |
| 138 |
hbl->addWidget( MiniButton ); |
| 139 |
CloseButton = new QPushButton( tr( "Close" ), bigwidget ); |
| 140 |
hbl->addWidget( CloseButton ); |
| 141 |
|
| 142 |
miniwidget = new QWidget(); |
| 143 |
//vbmain->addWidget(miniwidget); |
| 144 |
QVBoxLayout *vbmini = new QVBoxLayout(miniwidget); |
| 145 |
|
| 146 |
//minilabel=new QLabel("text",miniwidget); |
| 147 |
m_pMiniButton=new QPushButton("pressme",miniwidget); |
| 148 |
vbmini->addWidget(m_pMiniButton); |
| 149 |
|
| 150 |
miniwidget->hide(); |
| 151 |
} |
| 152 |
|
| 153 |
/* |
| 154 |
* Destroys the object and frees any allocated resources |
| 155 |
*/ |
| 156 |
AviCapDlg::~AviCapDlg() |
| 157 |
{ |
| 158 |
// no need to delete child widgets, Qt does it all for us |
| 159 |
} |