Exemple #1
0
FilterHeader::FilterHeader(QList<QTreeWidget *> &treewidgets, QWidget *parent)
  : QWidget( parent ), mItemNameNone( i18n("No Items")),
  mItemNameOne( i18n("1 Item") ),
  mItemNameMultiple( i18n("%1 of %2 Items") )
{
  QBoxLayout *topLayout = new QVBoxLayout;
  setLayout( topLayout );
  topLayout->setSpacing( KDialog::spacingHint() );
  topLayout->setMargin( KDialog::marginHint() );

  mTitleLabel = new QLabel();
  topLayout->addWidget( mTitleLabel );

  QBoxLayout *filterLayout = new QHBoxLayout;
  topLayout->addLayout( filterLayout );
  QLabel *label = new QLabel( i18n("Search:"));
  filterLayout->addWidget( label );

  mSearchLine = new CountingSearchLine( parent, treewidgets );

  mSearchLine-> setClearButtonShown(true);
  connect( mSearchLine, SIGNAL( searchCountChanged() ),
    SLOT( setTitleLabel() ) );
  filterLayout->addWidget( mSearchLine );

  //setTabOrder( mSearchLine, listView );

  setTitleLabel();
}
Exemple #2
0
void FTitleBar::initUI()
{
    setTitleBarHeight(Title_Height);

    setLogoButton(":/skin/images/QFramer.png", "Logo");
    setTitleLabel(tr("QFramer"), "TitleLabel");
    setSettingButton(":/skin/icons/dark/appbar.control.down.png");
    setSkinButton(":/skin/icons/dark/appbar.clothes.shirt.png");
    setMinButton(":/skin/icons/dark/appbar.minus.png");
    setMaxButton(":/skin/icons/dark/appbar.app.png");
    setCloseButton(":/skin/icons/dark/appbar.close.png", "close");

    QHBoxLayout* mainlayout = new QHBoxLayout;
    mainlayout->addWidget(logoButton);
    mainlayout->addWidget(titleLabel);
    mainlayout->addStretch();
    mainlayout->addWidget(settingButton);
    mainlayout->addWidget(skinButton);
    mainlayout->addWidget(minButton);
    mainlayout->addWidget(maxButton);
    mainlayout->addWidget(closeButton);
    mainlayout->setContentsMargins(0, 0, 5, 0);
    mainlayout->setSpacing(0);
    setLayout(mainlayout);

    settingMenu = new FSettingMenu;
    setSettingMenu(settingMenu);

}
Exemple #3
0
void FilterHeader::setItemName( const QString &none, const QString &one,
      const QString &multiple )
{
  mItemNameNone = none;
  mItemNameOne = one;
  mItemNameMultiple = multiple;

  setTitleLabel();
}
Exemple #4
0
EventViewer::EventViewer(QWidget *parent) :
    QWidget(parent)
{
    EVLayout = new QVBoxLayout(this);
    m_data = 0;
    setMinimumHeight(500);

    titleLabel = new QLabel;
    setTitleLabel("DEMO");
    EVLayout->addWidget(titleLabel);


    evt_plot = new Plot(this);
    rasterData = (SpectrogramData*)  evt_plot->getSpectrogram()->data();
    rasterData->resetData();
    evt_plot->setMaximumSize(640,160);
    evt_plot->setMinimumSize(640,160);
    evt_plot->showContour(false);
    evt_plot->updateScale();

    EVLayout->addWidget(evt_plot);

    btnLayout = new QHBoxLayout();

    evtN_lab = new QLabel("Event N:",this);
    evtN_lcd = new QLCDNumber(6,this);
    integrate_chbx = new QCheckBox("Integrate",this);
    integrate_chbx->setProperty("isPixel",false);

    nextEvent_pbtn = new QPushButton(QIcon(":/images/next.png"),"Next",this);
    prevEvent_pbtn= new QPushButton(QIcon(":/images/prev.png"),"Prev",this);;
    rwd_pbtn = new QPushButton(QIcon(":/images/rew.png"),"RWD",this);
    fwd_pbtn = new QPushButton(QIcon(":/images/fwd.png"),"FWD",this);

    connect(nextEvent_pbtn, SIGNAL(clicked()), this, SLOT(nextEvent()));
    connect(prevEvent_pbtn, SIGNAL(clicked()), this, SLOT(prevEvent()));
    connect(rwd_pbtn, SIGNAL(clicked()), this, SLOT(rewindEvent()));
    connect(fwd_pbtn, SIGNAL(clicked()), this, SLOT(forwardEvent()));


    btnLayout->addWidget(evtN_lab);
    btnLayout->addWidget(evtN_lcd);
    btnLayout->addWidget(integrate_chbx);
    btnLayout->addWidget(prevEvent_pbtn);
    btnLayout->addWidget(nextEvent_pbtn);
    btnLayout->addWidget(rwd_pbtn);
    btnLayout->addWidget(fwd_pbtn);
    EVLayout->addLayout(btnLayout);

    evtView = new QTreeView(this);
    setupModel();
    evtView->setColumnWidth(0 , 180);
    EVLayout->addWidget(evtView);



}
bool MyControlButton::initWithLabelAndBackgroundSprite(Node* node, ui::Scale9Sprite* backgroundSprite,bool isSallowTouch)
{
    if (init(isSallowTouch))
    {
        CCASSERT(node != nullptr, "node must not be nil.");
        LabelProtocol* label = dynamic_cast<LabelProtocol*>(node);
        CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil.");
        CCASSERT(label != nullptr, "label must not be nil.");
        
        _parentInited = true;
        
        _isPushed = false;
        
        // Adjust the background image by default
        setAdjustBackgroundImage(true);
        setPreferredSize(Size::ZERO);
        // Zooming button by default
        _zoomOnTouchDown = true;
        _scaleRatio = 1.1f;
        
        // Set the default anchor point
        ignoreAnchorPointForPosition(false);
        setAnchorPoint(Vec2::ANCHOR_MIDDLE);
        
        // Set the nodes
        setTitleLabel(node);
        setBackgroundSprite(backgroundSprite);
        
        // Set the default color and opacity
        setColor(Color3B::WHITE);
        setOpacity(255.0f);
        setOpacityModifyRGB(true);
        
        // Initialize the dispatch table
        
        setTitleForState(label->getString(), Control::State::NORMAL);
        setTitleColorForState(node->getColor(), Control::State::NORMAL);
        setTitleLabelForState(node, Control::State::NORMAL);
        setBackgroundSpriteForState(backgroundSprite, Control::State::NORMAL);
        
        setLabelAnchorPoint(Vec2::ANCHOR_MIDDLE);
        
        // Layout update
        needsLayout();
        
        return true;
    }
    //couldn't init the Control
    else
    {
        return false;
    }
}
TreasureExploreLayer::~TreasureExploreLayer()
{
    setTitleLabel(NULL);
    setLabel1(NULL);
    setLabel2(NULL);
    setLabel3(NULL);
    setLabel4(NULL);
    setLabel5(NULL);
    setLabel6(NULL);
    setLabel7(NULL);
    setCloseBtn(NULL);
    setExploreBtn(NULL);
    setGetRewardBtn(NULL);
    setCurMapName(NULL);
    setSuccessNum(NULL);
    setMaterialNum(NULL);
    setDiamondNum(NULL);
    setRemainNum(NULL);
    setProgressTimer(NULL);
    setRateLayer(NULL);
    setPercentSprite1(NULL);
    setPercentSprite2(NULL);
    setPercentSprite3(NULL);
    setRateEffectLayer(NULL);
    setTableView(NULL);
    setTableViewLayer(NULL);
    setBgSprite(NULL);
    setDiamondOwn(NULL);
    setMaterialOwn(NULL);
    setLabel8(NULL);
    setLabel9(NULL);
    setRefreshBtn(NULL);
    setLabel10(NULL);    
    setRefreshDiamond(NULL);
    //setRefreshTimes(NULL);	
    setWordRefresh(NULL); 
    setWordUpgrade(NULL);  
    setBallEffectLayer(NULL);
	setLabel11(NULL);
	setLabel12(NULL);
	setResetTimes(NULL);
    UIManager::sharedManager()->RemoveLayout("TreasureExploreLayer");
    delete m_uiLayer;
    CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "updateTreasureInfo");
    CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "refreshTreasureItems");    
    CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "treasure_upgrade_success");
}
void DocumentationWidget::initWithProcessor(const Processor* processor) {
    processor_ = processor;
    module_ = 0;

    setTitleLabel(processor->getClassName());
    const VoreenModule* module = VoreenApplication::app()->getModule(processor_->getModuleName());
    std::string description = module->getDocumentationDescription(processor->getClassName());
    descriptionEdit_->setPlainText(QString::fromStdString(description));

    propertyIDMap_.clear();
    propertyTree_->clear();
    propertyValueMap_.clear();
    propertyEdit_->setPlainText("");
    const std::vector<Property*>& properties = processor->getProperties();
    QList<QTreeWidgetItem*> items;
    foreach (Property* prop, properties) {
        QTreeWidgetItem* item = new QTreeWidgetItem(propertyTree_, QStringList(QString::fromStdString(prop->getGuiName())));
        propertyIDMap_.insert(item, prop->getID());
        items.append(item);
    }
Exemple #8
0
void EventViewer::attachMatrixData(QPair<matrixData*, QString> inspectData)
{

    m_data = inspectData.first;
    if (!matrixDataIsAvailable()) return;
    m_data->ResetReadPointer();

    rasterData = new SpectrogramData(m_data->GetMatrixXSize(),m_data->GetMatrixYSize());

    //setData delete previous rasterData if different
    evt_plot->getSpectrogram()->setData(rasterData);

    setTitleLabel(inspectData.second);

    //delete all children of matrixDataItem;
    deleteAllChildren(matrixDataItem);

    //set MData on model
    QList<QStandardItem *> row;

    row << new QStandardItem("X size")<< new QStandardItem(QString::number(m_data->GetMatrixXSize()));
    foreach (QStandardItem * item, row) item->setEditable(false);
    matrixDataItem->appendRow(row);
    row.clear();

    row << new QStandardItem("Y size")<< new QStandardItem(QString::number(m_data->GetMatrixYSize()));
    foreach (QStandardItem * item, row) item->setEditable(false);
    matrixDataItem->appendRow(row);
    row.clear();

    row << new QStandardItem("Events")<< new QStandardItem(QString::number(m_data->GetSize()));
    foreach (QStandardItem * item, row) item->setEditable(false);
    matrixDataItem->appendRow(row);
    eventsItem = row.at(0);
    row.clear();


    nextEvent();

    evtView->expandAll();
}
bool ark_SwallowButton::init()
{
	if (Layer::init())
	{
		// Initialise instance variables
		_state=Control::State::NORMAL;
		setEnabled(true);
		setSelected(false);
		setHighlighted(false);

		auto dispatcher = Director::getInstance()->getEventDispatcher();
		auto touchListener = EventListenerTouchOneByOne::create();
		touchListener->setSwallowTouches(true);

		touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this);
		touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this);
		touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this);
		touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this);

		dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);

		Scale9Sprite * backgroundSprite = Scale9Sprite::create();
		Label *node = Label::createWithSystemFont("", "Helvetica", 12);
		CCASSERT(node != nullptr, "Label must not be nil.");
		LabelProtocol* label = dynamic_cast<LabelProtocol*>(node);
		CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil.");
		CCASSERT(label != nullptr || backgroundSprite != nullptr, "");

		_parentInited = true;

		_isPushed = false;

		// Adjust the background image by default
		setAdjustBackgroundImage(true);
		setPreferredSize(Size::ZERO);
		// Zooming button by default
		_zoomOnTouchDown = true;
		_scaleRatio = 1.1f;

		// Set the default anchor point
		ignoreAnchorPointForPosition(false);
		setAnchorPoint(Point(0.5f, 0.5f));

		// Set the nodes
		setTitleLabel(node);
		setBackgroundSprite(backgroundSprite);

		// Set the default color and opacity
		setColor(Color3B(255.0f, 255.0f, 255.0f));
		setOpacity(255.0f);
		setOpacityModifyRGB(true);

		// Initialize the dispatch table

		setTitleForState(label->getString(), Control::State::NORMAL);
		setTitleColorForState(node->getColor(), Control::State::NORMAL);
		setTitleLabelForState(node, Control::State::NORMAL);
		setBackgroundSpriteForState(backgroundSprite, Control::State::NORMAL);

		setLabelAnchorPoint(Point(0.5f, 0.5f));

		// Layout update
		needsLayout();

		return true;
	}
	else
	{
		return false;
	}
}
Exemple #10
0
void FilterHeader::clear()
{
  mSearchLine->setText( QString::null );

  setTitleLabel();
}