QvisLineStyleWidget::QvisLineStyleWidget(int style, QWidget *parent) : QWidget(parent) { // Create some pixmaps and store them in the application global // pixmap cache. QPixmap style1Pixmap; if(!QPixmapCache::find("visit_gui_linestyle1", style1Pixmap)) { AugmentPixmap(style1); QPixmap s1p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linestyle1", s1p); style1Pixmap = s1p; } QPixmap style2Pixmap; if(!QPixmapCache::find("visit_gui_linestyle2", style2Pixmap)) { AugmentPixmap(style2); QPixmap s2p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linestyle2", s2p); style2Pixmap = s2p; } QPixmap style3Pixmap; if(!QPixmapCache::find("visit_gui_linestyle3", style3Pixmap)) { AugmentPixmap(style3); QPixmap s3p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linestyle3", s3p); style3Pixmap = s3p; } QPixmap style4Pixmap; if(!QPixmapCache::find("visit_gui_linestyle4", style4Pixmap)) { AugmentPixmap(style4); QPixmap s4p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linestyle4", s4p); style4Pixmap = s4p; } // Create the combo box and add the pixmaps to it. QHBoxLayout *topLayout = new QHBoxLayout(this); topLayout->setMargin(0); lineStyleComboBox = new QComboBox(this); lineStyleComboBox->addItem(QIcon(style1Pixmap), "solid"); lineStyleComboBox->addItem(QIcon(style2Pixmap), "dash"); lineStyleComboBox->addItem(QIcon(style3Pixmap), "dash/dot"); lineStyleComboBox->addItem(QIcon(style4Pixmap), "dotted"); lineStyleComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); lineStyleComboBox->setCurrentIndex(style); topLayout->addWidget(lineStyleComboBox); connect(lineStyleComboBox, SIGNAL(activated(int)), this, SIGNAL(lineStyleChanged(int))); }
QvisVCRControl::QvisVCRControl(QWidget *parent) : QWidget(parent) { // Make the stop button active. activeButton = 2; // Create pixmaps for the buttons. AugmentPixmap(frevpix_icon); QPixmap p1((const char **)augmentedData); AugmentPixmap(backpix_icon); QPixmap p2((const char **)augmentedData); AugmentPixmap(stoppix_icon); QPixmap p3((const char **)augmentedData); AugmentPixmap(playpix_icon); QPixmap p4((const char **)augmentedData); AugmentPixmap(fadvpix_icon); QPixmap p5((const char **)augmentedData); // Create the top layout. QHBoxLayout *topLayout = new QHBoxLayout(this); topLayout->setMargin(0); #if defined(Q_WS_MACX) || defined(Q_OS_MAC) topLayout->setSpacing(1); #else topLayout->setSpacing(10); #endif QSize iconsize(34,20); // Create the buttons and add the pixmaps to them. buttons[0] = new QPushButton(this); buttons[0]->setIcon(QIcon(p1)); buttons[0]->setIconSize(iconsize); buttons[1] = new QPushButton(this); buttons[1]->setIcon(QIcon(p2)); buttons[1]->setCheckable(true); buttons[1]->setDown(false); buttons[1]->setIconSize(iconsize); buttons[2] = new QPushButton(this); buttons[2]->setIcon(QIcon(p3)); buttons[2]->setCheckable(true); buttons[2]->setDown(true); buttons[2]->setIconSize(iconsize); buttons[3] = new QPushButton(this); buttons[3]->setIcon(QIcon(p4)); buttons[3]->setCheckable(true); buttons[3]->setDown(false); buttons[3]->setIconSize(iconsize); buttons[4] = new QPushButton(this); buttons[4]->setIcon(QIcon(p5)); buttons[4]->setIconSize(iconsize); // Connect the buttons' "pressed" signals to the appropriate VCR // clicked slot. connect(buttons[0], SIGNAL(pressed()), this, SLOT(b0_clicked())); connect(buttons[1], SIGNAL(pressed()), this, SLOT(b1_clicked())); connect(buttons[2], SIGNAL(pressed()), this, SLOT(b2_clicked())); connect(buttons[3], SIGNAL(pressed()), this, SLOT(b3_clicked())); connect(buttons[4], SIGNAL(pressed()), this, SLOT(b4_clicked())); // Add all the buttons to the top layout. for(int i = 0; i < 5; ++i) topLayout->addWidget(buttons[i]); }
QvisLineWidthWidget::QvisLineWidthWidget(int width_, QWidget *parent) : QWidget(parent) { // Create some pixmaps and store them in the application global // pixmap cache. QPixmap style1Pixmap; if(!QPixmapCache::find("visit_gui_linewidth1", style1Pixmap)) { AugmentPixmap(style1); QPixmap s1p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth1", s1p); style1Pixmap = s1p; } QPixmap style2Pixmap; if(!QPixmapCache::find("visit_gui_linewidth2", style2Pixmap)) { AugmentPixmap(style2); QPixmap s2p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth2", s2p); style2Pixmap = s2p; } QPixmap style3Pixmap; if(!QPixmapCache::find("visit_gui_linewidth3", style3Pixmap)) { AugmentPixmap(style3); QPixmap s3p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth3", s3p); style3Pixmap = s3p; } QPixmap style4Pixmap; if(!QPixmapCache::find("visit_gui_linewidth4", style4Pixmap)) { AugmentPixmap(style4); QPixmap s4p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth4", s4p); style4Pixmap = s4p; } QPixmap style5Pixmap; if(!QPixmapCache::find("visit_gui_linewidth5", style5Pixmap)) { AugmentPixmap(style5); QPixmap s5p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth5", s5p); style5Pixmap = s5p; } QPixmap style6Pixmap; if(!QPixmapCache::find("visit_gui_linewidth6", style6Pixmap)) { AugmentPixmap(style6); QPixmap s6p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth6", s6p); style6Pixmap = s6p; } QPixmap style7Pixmap; if(!QPixmapCache::find("visit_gui_linewidth7", style7Pixmap)) { AugmentPixmap(style7); QPixmap s7p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth7", s7p); style7Pixmap = s7p; } QPixmap style8Pixmap; if(!QPixmapCache::find("visit_gui_linewidth8", style8Pixmap)) { AugmentPixmap(style8); QPixmap s8p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth8", s8p); style8Pixmap = s8p; } QPixmap style9Pixmap; if(!QPixmapCache::find("visit_gui_linewidth9", style9Pixmap)) { AugmentPixmap(style9); QPixmap s9p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth9", s9p); style9Pixmap = s9p; } QPixmap style10Pixmap; if(!QPixmapCache::find("visit_gui_linewidth10", style10Pixmap)) { AugmentPixmap(style10); QPixmap s10p((const char **)augmentedData); QPixmapCache::insert("visit_gui_linewidth10", s10p); style10Pixmap = s10p; } // Create the combo box and add the pixmaps to it. QHBoxLayout *topLayout = new QHBoxLayout(this); topLayout->setMargin(0); topLayout->setSpacing(0); lineWidthComboBox = new QComboBox(this); lineWidthComboBox->addItem(QIcon(style1Pixmap),"1"); lineWidthComboBox->addItem(QIcon(style2Pixmap),"2"); lineWidthComboBox->addItem(QIcon(style3Pixmap),"3"); lineWidthComboBox->addItem(QIcon(style4Pixmap),"4"); lineWidthComboBox->addItem(QIcon(style5Pixmap),"5"); lineWidthComboBox->addItem(QIcon(style6Pixmap),"6"); lineWidthComboBox->addItem(QIcon(style7Pixmap),"7"); lineWidthComboBox->addItem(QIcon(style8Pixmap),"8"); lineWidthComboBox->addItem(QIcon(style9Pixmap),"9"); lineWidthComboBox->addItem(QIcon(style10Pixmap),"10"); lineWidthComboBox->setCurrentIndex(width_); topLayout->addWidget(lineWidthComboBox); connect(lineWidthComboBox, SIGNAL(activated(int)), this, SIGNAL(lineWidthChanged(int))); }