Esempio n. 1
0
void BookmarkView::recentSelection(BookmarkEntryPtr bmSel) {
    
    m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency));
    m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth));
    m_modulationVal->SetLabelText(bmSel->type);
    m_labelText->SetValue(bmSel->label);
    
    hideProps();
    
    m_frequencyVal->Show();
    m_frequencyLabel->Show();
    
    m_bandwidthVal->Show();
    m_bandwidthLabel->Show();
    
    m_modulationVal->Show();
    m_modulationLabel->Show();
    
    m_labelText->Show();
    m_labelLabel->Show();
    
    clearButtons();
    
    addBookmarkChoice(m_buttonPanel);
    addButton(m_buttonPanel, "Activate Recent", wxCommandEventHandler( BookmarkView::onActivateRecent ));
    addButton(m_buttonPanel, "Remove Recent", wxCommandEventHandler( BookmarkView::onRemoveRecent ));
    
    showProps();
    showButtons();
    refreshLayout();
}
Esempio n. 2
0
void BookmarkView::rangeSelection(BookmarkRangeEntryPtr re) {
    
    clearButtons();
    
    hideProps();
    
    m_labelText->SetValue(re->label);
    
    m_labelText->Show();
    m_labelLabel->Show();

    m_frequencyVal->Show();
    m_frequencyLabel->Show();

    std::string strFreq = frequencyToStr(re->startFreq) + "-" + frequencyToStr(re->endFreq);
    
    m_frequencyVal->SetLabelText(wxString(strFreq));
    
    showProps();

    addButton(m_buttonPanel, "Go to Range", wxCommandEventHandler( BookmarkView::onActivateRange ));
    addButton(m_buttonPanel, "Update Range", wxCommandEventHandler( BookmarkView::onUpdateRange ))->SetToolTip("Update range by setting it to the active range.");
    addButton(m_buttonPanel, "Remove Range", wxCommandEventHandler( BookmarkView::onRemoveRange ));
    
    showButtons();
    refreshLayout();
}
Esempio n. 3
0
void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
   
    if (dsel == nullptr) {
        hideProps();
        clearButtons();
        showProps();
        showButtons();
        refreshLayout();
        return;
    }

    m_frequencyVal->SetLabelText(frequencyToStr(dsel->getFrequency()));
    m_bandwidthVal->SetLabelText(frequencyToStr(dsel->getBandwidth()));
    m_modulationVal->SetLabelText(dsel->getDemodulatorType());
    m_labelText->SetValue(dsel->getDemodulatorUserLabel());
    
    hideProps();
    
    m_frequencyVal->Show();
    m_frequencyLabel->Show();
    
    m_bandwidthVal->Show();
    m_bandwidthLabel->Show();
    
    m_modulationVal->Show();
    m_modulationLabel->Show();
    
    m_labelText->Show();
    m_labelLabel->Show();
    
    clearButtons();

    addBookmarkChoice(m_buttonPanel);
    
    if (!(dsel->isRecording())) {
         addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler(BookmarkView::onStartRecording));
     } else {
         addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler(BookmarkView::onStopRecording));
     }
   
    addButton(m_buttonPanel, "Remove Active", wxCommandEventHandler( BookmarkView::onRemoveActive ));
    
    showProps();
    showButtons();
    refreshLayout();
}
Esempio n. 4
0
    /**
     * @brief ComponentsModel::addExists
     * @param inserter
     * @param count
     * @param pos
     */
    void ComponentsModel::addExists(const std::function<void (int)> &inserter, int count, int pos)
    {
        int innerIndex = pos == -1 ? count : pos;
        beginInsertRows(QModelIndex(), innerIndex, innerIndex);
        inserter(innerIndex);
        endInsertRows();

        showButtons(QModelIndexList() << index(innerIndex, 1));
    }
Esempio n. 5
0
void VotePanel::onVoteBegins(const wxString& msg)
{
	//Parse vote description string to find text rounded by quotes
	wxString voteDescr = "Vote for: " + msg.AfterFirst('"').BeforeFirst('"') + " ";

	showButtons(true);
	voteTextLabel->SetLabel(voteDescr);
	parentWnd->Layout();
	parentWnd->Update();
}
Esempio n. 6
0
void BookmarkView::bookmarkBranchSelection() {
    
    clearButtons();
    hideProps();
    
    addButton(m_buttonPanel, BOOKMARK_VIEW_STR_ADD_GROUP, wxCommandEventHandler( BookmarkView::onAddGroup ));
    
    showButtons();
    refreshLayout();
}
Esempio n. 7
0
    /**
     * @brief ComponentsModel::updateAll
     */
    void ComponentsModel::updateAllComponents()
    {
        int componentsCount = count(m_Components, m_display);
        QModelIndexList out;
        out.reserve(componentsCount);
        for (int i = 0; i < componentsCount; ++i) {
            out << index(i, 1);
        }

       emit showButtons(out);
    }
Esempio n. 8
0
void TabBar::updateVisibilityWithFullscreen(bool visible)
{
    if (visible) {
        emit showButtons();
    }
    else {
        emit hideButtons();
    }

    QTabBar::setVisible(visible);
}
Esempio n. 9
0
void BookmarkView::recentBranchSelection() {
    clearButtons();
    hideProps();
    
    addButton(m_buttonPanel, BOOKMARK_VIEW_STR_CLEAR_RECENT, wxCommandEventHandler( BookmarkView::onClearRecents ));
    
    showButtons();
    refreshLayout();

    this->Layout();
}
Esempio n. 10
0
//Clear state of the panel, hide buttons
void VotePanel::ResetState()
{
	if (yesButton == nullptr || noButton == nullptr || dontCareButton == nullptr) {
		return;
	}

	voteTextLabel->SetLabel(wxEmptyString);
	showButtons(false);

	//Just to be safe. Maybe this is not needed
	player = nullptr;
}
Esempio n. 11
0
/** Default constructor */
StyleDialog::StyleDialog(RSStyle &style, QWidget *parent)
	: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
	/* Invoke Qt Designer generated QObject setup routine */
	ui.setupUi(this);

	ui.headerFrame->setHeaderImage(QPixmap(":/images/library.png"));
	ui.headerFrame->setHeaderText(tr("Define Style"));

	/* Load window postion */
	QByteArray geometry = Settings->valueFromGroup("StyleDialog", "Geometry", QByteArray()).toByteArray();
	if (geometry.isEmpty() == false) {
		restoreGeometry(geometry);
	}

	connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
	connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

	connect(ui.color1Button, SIGNAL(clicked()), this, SLOT(chooseColor()));
	connect(ui.color2Button, SIGNAL(clicked()), this, SLOT(chooseColor()));

	/* Initialize style combobox */
	ui.styleComboBox->addItem(tr("None"), RSStyle::STYLETYPE_NONE);
	ui.styleComboBox->addItem(tr("Solid"), RSStyle::STYLETYPE_SOLID);
	ui.styleComboBox->addItem(tr("Gradient"), RSStyle::STYLETYPE_GRADIENT);

	ui.styleComboBox->setCurrentIndex(style.styleType);
	connect(ui.styleComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(showButtons()));

	/* Add pushbuttons and labels */
	pushButtons.append(ui.color1Button);
	pushButtons.append(ui.color2Button);

	labels.append(ui.color1Label);
	labels.append(ui.color2Label);

	/* Set pushbuttons visible */
	showButtons();

	/* Init colors */
	for (int i = 0; i < pushButtons.size(); ++i) {
		if (i < style.colors.size()) {
			colors[pushButtons[i]] = style.colors[i];
		} else {
			colors[pushButtons[i]] = Qt::white;
		}
	}

	drawButtons();
	drawPreview();
}
Esempio n. 12
0
void TabBar::setVisible(bool visible)
{
    if (visible) {
        if (p_QupZilla->isFullScreen()) {
            return;
        }

        emit showButtons();
    }
    else {
        emit hideButtons();
    }

    QTabBar::setVisible(visible);
}
Esempio n. 13
0
void BookmarkView::rangeBranchSelection() {
    clearButtons();
    hideProps();
    
    m_labelText->SetValue(wxT(""));
    m_labelText->Show();
    m_labelLabel->Show();

    showProps();

    addButton(m_buttonPanel, "Add Active Range", wxCommandEventHandler( BookmarkView::onAddRange ));
    
    showButtons();
    refreshLayout();
    
    this->Layout();
}
Esempio n. 14
0
void LLSplitButton::onArrowBtnDown()
{
	if (!mItemsPanel->getVisible())
	{
		showButtons();

		setFocus(TRUE);

		if (mArrowBtn->hasMouseCapture() || mShownItem->hasMouseCapture())
		{
			gFocusMgr.setMouseCapture(this);
		}
	}
	else
	{
		hideButtons();
	}
}
Esempio n. 15
0
void BookmarkView::groupSelection(std::string groupName) {
    
    clearButtons();
    
    hideProps();
    
    m_labelText->SetValue(groupName);
    
    m_labelText->Show();
    m_labelLabel->Show();
    
    addButton(m_buttonPanel, "Remove Group", wxCommandEventHandler( BookmarkView::onRemoveGroup ));
    
    showProps();
    
    showButtons();
    refreshLayout();
}
Esempio n. 16
0
// Call individual methods to show each part of Dashboard
Dashboard::Dashboard(QWidget *parent)
    : QWidget(parent)
{
    //setStyleSheet("background: url(E:/Stevens/C++/Projects/Dashboard_final/images/background1.jpg)");
    showUserName();
    showTimeline();
    showButtons();
    combineTimelineButtons();
    showFigures();
    combineFiguresTimelineButtons();
    showGraph();
    combineGraphFiguresTimelineButtons();
    showMainLayout();

    //setStyleSheet("background: url(E:/Stevens/C++/Projects/Dashboard_final/images/background_home.jpg)");
    //qApp->setStyleSheet("QWidget {background-image: url(./background_home.jpg) }");
    //setStyleSheet("background: url(E:/Stevens/C++/Projects/Dashboard_final/images/background1.jpg)");
    connect(timelineCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(getTimeline(int)));
    connect(addExpenseButton, SIGNAL(clicked()), this, SLOT(showExpenseWindow()));
    connect(addIncomeButton, SIGNAL(clicked()), this, SLOT(showIncomeWindow()));
}
Esempio n. 17
0
medAlgorithmPaintToolbox::medAlgorithmPaintToolbox(QWidget *parent ) :
    medSegmentationAbstractToolBox( parent),
    m_MinValueImage(0),
    m_MaxValueImage(500),
    m_strokeRadius(4),
    m_strokeLabel(1),
    m_paintState(PaintState::None)
{
    QWidget *displayWidget = new QWidget(this);
    this->addWidget(displayWidget);

    this->setTitle(this->name());

    QVBoxLayout * layout = new QVBoxLayout(displayWidget);

    m_strokeButton = new QPushButton( tr("Paint / Erase") , displayWidget);
    m_strokeButton->setToolTip(tr("Left-click: Start painting with specified label.\nRight-click: Erase painted voxels."));
    m_strokeButton->setCheckable(true);

    m_magicWandButton = new QPushButton(tr("Magic Wand"), displayWidget);
    QPixmap pixmap(":medSegmentation/pixmaps/magic_wand.png");
    QIcon buttonIcon(pixmap);
    m_magicWandButton->setIcon(buttonIcon);
    m_magicWandButton->setToolTip(tr("Magic wand to automatically paint similar voxels."));
    m_magicWandButton->setCheckable(true);

    QHBoxLayout * addRemoveButtonLayout = new QHBoxLayout();
    addRemoveButtonLayout->addWidget( m_strokeButton );
    addRemoveButtonLayout->addWidget( m_magicWandButton );
    layout->addLayout( addRemoveButtonLayout );


    QHBoxLayout * brushSizeLayout = new QHBoxLayout();
    m_brushSizeSlider = new QSlider(Qt::Horizontal, displayWidget);
    m_brushSizeSlider->setToolTip(tr("Changes the brush radius."));
    m_brushSizeSlider->setValue(this->m_strokeRadius);
    m_brushSizeSlider->setRange(1, 10);
    m_brushSizeSlider->hide();
    m_brushSizeSpinBox = new QSpinBox(displayWidget);
    m_brushSizeSpinBox->setToolTip(tr("Changes the brush radius."));
    m_brushSizeSpinBox->setValue(this->m_strokeRadius);
    m_brushSizeSpinBox->setMinimum(1);
    m_brushSizeSpinBox->setMaximum(10);
    m_brushSizeSpinBox->hide();
    m_brushRadiusLabel = new QLabel(tr("Brush Radius"), displayWidget);
    m_brushRadiusLabel->hide();

    connect(m_brushSizeSpinBox, SIGNAL(valueChanged(int)),m_brushSizeSlider,SLOT(setValue(int)) );
    connect(m_brushSizeSlider,SIGNAL(valueChanged(int)),m_brushSizeSpinBox,SLOT(setValue(int)) );

    brushSizeLayout->addWidget(m_brushRadiusLabel);
    brushSizeLayout->addWidget( m_brushSizeSlider );
    brushSizeLayout->addWidget( m_brushSizeSpinBox );
    layout->addLayout( brushSizeLayout );

    QHBoxLayout * magicWandLayout = new QHBoxLayout();

    m_wandThresholdSizeSlider = new QSlider(Qt::Horizontal, displayWidget);
    m_wandThresholdSizeSlider->setValue(100);
    m_wandThresholdSizeSlider->setMinimum(0);
    m_wandThresholdSizeSlider->setMaximum(1000);
    m_wandThresholdSizeSlider->hide();

    m_wandThresholdSizeSpinBox = new QDoubleSpinBox(displayWidget);
    m_wandThresholdSizeSpinBox->setMinimum(0);
    m_wandThresholdSizeSpinBox->setMaximum(1000000);
    m_wandThresholdSizeSpinBox->setDecimals(2);
    m_wandThresholdSizeSpinBox->hide();

    this->setWandSpinBoxValue(100);

    connect(m_wandThresholdSizeSpinBox, SIGNAL(valueChanged(double)),this,SLOT(setWandSliderValue(double)) );
    connect(m_wandThresholdSizeSlider,SIGNAL(valueChanged(int)),this,SLOT(setWandSpinBoxValue(int)) );

    m_wand3DCheckbox = new QCheckBox (tr("3D"), displayWidget);
    m_wand3DCheckbox->setCheckState(Qt::Unchecked);
    m_wand3DCheckbox->hide();

    magicWandLayout->addWidget( m_wand3DCheckbox );
    magicWandLayout->addWidget( m_wandThresholdSizeSlider );
    magicWandLayout->addWidget( m_wandThresholdSizeSpinBox );
    layout->addLayout( magicWandLayout );

    this->generateLabelColorMap(24);

    QHBoxLayout * labelSelectionLayout = new QHBoxLayout();

    m_strokeLabelSpinBox = new QSpinBox(displayWidget);
    m_strokeLabelSpinBox->setToolTip(tr("Changes the painted label."));
    m_strokeLabelSpinBox->setValue(this->m_strokeLabel);
    m_strokeLabelSpinBox->setMinimum(1);
    m_strokeLabelSpinBox->setMaximum(24);
    m_strokeLabelSpinBox->hide();
    connect (m_strokeLabelSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setLabel(int)));

    m_labelColorWidget = new QPushButton(displayWidget);
    m_labelColorWidget->setToolTip(tr("Current label color"));
    m_labelColorWidget->setStyleSheet("background-color: rgb(255, 0, 0);border:0;border-radius: 0px;width:20px;height:20px;");
    m_labelColorWidget->setCheckable(false);
    m_labelColorWidget->setText("");
    m_labelColorWidget->hide();
    connect(m_labelColorWidget, SIGNAL(clicked()), this, SLOT(setLabelColor()));

    m_colorLabel = new QLabel(tr("Label:"), displayWidget);
    m_colorLabel->hide();

    labelSelectionLayout->addStretch();
    labelSelectionLayout->addWidget(m_colorLabel );
    labelSelectionLayout->addWidget( m_labelColorWidget );
    labelSelectionLayout->addWidget( m_strokeLabelSpinBox );

    layout->addLayout( labelSelectionLayout );

    m_clearMaskButton = new QPushButton( tr("Clear Mask") , displayWidget);
    m_clearMaskButton->setToolTip(tr("Resets the mask."));
    QHBoxLayout * dataButtonsLayout = new QHBoxLayout();
    dataButtonsLayout->addWidget(m_clearMaskButton);
    layout->addLayout(dataButtonsLayout);

    connect (m_strokeButton, SIGNAL(pressed()), this, SLOT(activateStroke ()));
    connect (m_magicWandButton, SIGNAL(pressed()),this,SLOT(activateMagicWand()));
    connect (m_clearMaskButton, SIGNAL(pressed()), this, SLOT(clearMask()));
    connect(this->segmentationToolBox(), SIGNAL(inputChanged()), this, SLOT(updateMouseInteraction()));

    showButtons(false);
}