コード例 #1
0
void k9astTitles::fill() {
    m_src->clear();
    m_currentItem=NULL;

    for (int i=0;i < m_dvd->gettitleCount();i++) {
        k9DVDTitle *title=m_dvd->gettitle(i);
        if (title->getIndexed()) {
            m_updating=true;

            _k9ItemWidget *item=new _k9ItemWidget(title,m_src,k9astTitles::TITLE );
            item->astTitle=this;
            item->setText(0,"");
            item->setText(1,QString("%1").arg(title->getname()));
	    item->setText(2,QString("%1").arg(title->getlength().toString("hh:mm:ss")));	
            item->setText(3,QString("%1 %2").arg(title->gettotalsize_mb(),0,'f',2).arg(i18n("MB")));
            if (!m_currentItem) {
                m_currentItem=item;
            }
            addChapters(item,title);
            // all streams are checked by default
            title->setSelected(true);
            m_updating=false;
            emit addTitle(title);
        }
    }
    m_src->sortItems(1,Qt::AscendingOrder);
}
コード例 #2
0
SelectPositionPage::SelectPositionPage(QWidget *parent) :
    Page(parent)
{
    addTitle(trUtf8("Choisir une position\n(2 / 5)"));

    CarteScene *scene = CarteScene::readSceneFile("data/xml/map_montreal.osm");
    CarteWidget::setScene(scene);

    mapWidget = new CarteWidget(this);
    addWidget(mapWidget);

    QPushButton *btnPrevious = new QPushButton(this);
    btnPrevious->setIcon(QIcon(":/icones/data/icons/arrow_left.png"));
    btnNext = new QPushButton(this);
    btnNext->setIcon(QIcon(":/icones/data/icons/arrow_right.png"));
    QPushButton *btnMenu = new QPushButton(trUtf8("Menu"), this);
    btnNext->setEnabled(false);

    addBottomButtons(btnPrevious, btnMenu, btnNext);

    connect(mapWidget, SIGNAL(editFinished()), this, SLOT(enableNextButton()));
    connect(btnPrevious, SIGNAL(clicked()), SIGNAL(Previous()));
    connect(btnMenu, SIGNAL(clicked()), SIGNAL(Menu()));
    connect(btnNext, SIGNAL(clicked()), SIGNAL(Next()));
}
コード例 #3
0
void k9astTitles::selectAll(bool _state) {
    bool oldState;
    for (int i=0; i < m_src->topLevelItemCount();i++) {
        _k9ItemWidget *item=(_k9ItemWidget*) m_src->topLevelItem(i);
        oldState=item->title->isSelected();
        if (_state) {
            m_updating=true;
            // all streams are checked by default
            for (int j=0;j < item->title->getaudioStreamCount();j++) {
                item->title->getaudioStream(j)->setselected(true);
                if (j==0)
                    item->title->setDefAudio(item->title->getaudioStream(j));
            }
            for (int j=0;j < item->title->getsubPictureCount();j++) {
                item->title->getsubtitle(j)->setselected(true);
                if (j==0)
                    item->title->setDefSubtitle(item->title->getsubtitle(j));
            }
            item->title->setvideoSelected(true);
            m_updating=false;
            if (_state!=oldState)
                emit addTitle(item->title);
        } else {
            m_updating=true;
            item->title->setSelected(false);
            item->title->setDefSubtitle(NULL);
            item->title->setDefAudio(NULL);
            m_updating=false;
            if (_state!=oldState)
                emit removeTitle(item->title);
        }
    }
}
コード例 #4
0
ConfirmPage::ConfirmPage(UsagerModel *umodel,
                         VehiculeModel *vmodel,
                         StationModel *smodel,
                         QWidget *parent) :
    Page(parent),
    umodel(umodel),
    vmodel(vmodel),
    smodel(smodel)
{
    addTitle(trUtf8("Confirmer la réservation"));


    editor = new QPlainTextEdit(this);
    editor->setReadOnly(true);
    editor->setFont(QFont("Courier"));


    addWidget(editor);

    QPushButton *btnPrevious = new QPushButton(this);
    btnPrevious->setIcon(QIcon(":/icones/data/icons/arrow_left.png"));
    QPushButton *btnConfirm= new QPushButton(trUtf8("Confirmer"), this);
    btnConfirm->setIcon(QIcon(":/icones/data/icons/tick.png"));
    QPushButton *btnMenu = new QPushButton(trUtf8("Menu"), this);

    addBottomButtons(btnPrevious, btnMenu, btnConfirm);

    connect(btnPrevious, SIGNAL(clicked()), SIGNAL(Previous()));
    connect(btnMenu, SIGNAL(clicked()), SIGNAL(Menu()));
    connect(btnConfirm, SIGNAL(clicked()), SIGNAL(Confirm()));
}
コード例 #5
0
SettingsPanel* SettingsPanel::fromJson(QJsonArray json, QSettings* settings, QWidget* parent)
{
    auto panel = new SettingsPanel(settings, parent);
    // extract info from the json array
    for(auto obj_ref : json)
    {
        if(!obj_ref.isObject())
        {
            qWarning() << "Json array does not contain json objects - skipping ...";
            continue;
        }
        QJsonObject obj = obj_ref.toObject();

        // sort out titles
        if(obj["type"].toString() == "title")
        {
            panel->addTitle(obj["title"].toString());
        }
        else
        {
            auto new_item = SettingItemCreation::createItemfromJson(obj, settings, panel);
            if(!new_item)
            {
                qWarning() << "SettingItemCreation for type " << obj["type"].toString() << " failed.";
                continue;
            }
            panel->addSettingItem(new_item);
        }
    }
    return panel;
}
コード例 #6
0
/*!
  \brief Deletes any details currently stored in the Smart Poster
  and re-initializes them by parsing the contents of the payload.
  */
void NdefNfcSpRecord::parseRecords()
{
    initializeData();
    QNdefMessage message = QNdefMessage::fromByteArray(payload());
    qDebug() << "Sp Record Count: " << message.count();

    foreach (const QNdefRecord &record, message) {
        qDebug() << "Sp Record type: " << QString(record.type());
        qDebug() << "Sp Type name: " << record.typeNameFormat();

        // URI
        if (record.isRecordType<QNdefNfcUriRecord>()) {
            if (recordUri) { delete recordUri; recordUri = NULL; }
            recordUri = new QNdefNfcUriRecord(record);
            qDebug() << "Sp URI: " << recordUri->uri().toString();
        }
        // Title
        else if (record.isRecordType<QNdefNfcTextRecord>()) {
            QNdefNfcTextRecord* recordTitle = new QNdefNfcTextRecord(record);
            addTitle(*recordTitle);
            if (!recordTitleList.isEmpty()) {
                qDebug() << "Sp Title: " << recordTitleList.last().text();
            }
        }
        // Image
        else if (record.typeNameFormat() == QNdefRecord::Mime &&
                   record.type().startsWith("image/")) {
            if (recordImage) { delete recordImage; recordImage = NULL; }
            recordImage = new NdefNfcMimeImageRecord(record);
            qDebug() << "Sp Image: " << recordImage->format();
        }
        // Action
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "act") {
            if (recordAction) { delete recordAction; recordAction = NULL; }
            recordAction = new NdefNfcActRecord(record);
            qDebug() << "Sp Action: " << action();
        }
        // Size
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "s") {
            if (recordSize) { delete recordSize; recordSize = NULL; }
            recordSize = new NdefNfcSizeRecord(record);
            qDebug() << "Sp Size: " << size();
        }
        // Type
        else if (record.typeNameFormat() == QNdefRecord::NfcRtd &&
                 QString(record.type()) == "t") {
            if (recordType) { delete recordType; recordType = NULL; }
            recordType = new NdefNfcTypeRecord(record);
            qDebug() << "Sp Type: " << type();
        }
        else
        {
            // This class handles all records defined in the Smart Poster
            // specification, so this case should never happen for a valid
            // Smart Poster record in the current version.
            qDebug() << "Sp: Don't know how to handle this record";
        }
    }
コード例 #7
0
QTitleWidget::QTitleWidget(QWidget *parent) :
    QWidget(parent)
{
    QHBoxLayout *hl = new QHBoxLayout;
    hl->setMargin(0);
    hl->setSpacing(0);
    setObjectName("titleWidget");
    QLabel * label = new QLabel;
    QImage image(":/inner/images/begin.png");
    label->setPixmap(QPixmap::fromImage(image));
    label->setFixedSize(16,16);
    QAction * ac = new QAction(QIcon(":/inner/images/delete_item.png"),tr("Remove Item"),this);
    m_delButton = new QToolBarButton(ac);
    ac = new QAction(QIcon(":/inner/images/add.png"),tr("Add Title"),this);
    m_addTitleButton = new QToolBarButton(ac);
    m_addTitleButton->setVisible(true);
    hl->addWidget(m_addTitleButton);
    hl->addWidget(label);
    hl->addSpacerItem(new QSpacerItem(1,1,QSizePolicy::Expanding,
                                      QSizePolicy::Expanding));
    hl->addWidget(m_delButton);
    setLayout(hl);

    setStyleSheet("#titleWidget{background-color:rgb(255,220,180);}");
    setFixedHeight(22);

    connect(m_addTitleButton,SIGNAL(clicked()),this,SIGNAL(addTitle()));
    connect(m_delButton,SIGNAL(clicked()),this,SIGNAL(delItem()));
}
コード例 #8
0
void KlipperPopup::buildFromScratch() {
    addTitle(KIcon("klipper"), i18n("Klipper - Clipboard Tool"));

    m_filterWidget = new KLineEditBlackKey(this);
    m_filterWidget->setFocusPolicy( Qt::NoFocus );
    m_filterWidgetAction = new QWidgetAction(this);
    m_filterWidgetAction->setDefaultWidget(m_filterWidget);
    m_filterWidgetAction->setVisible(false);
    addAction(m_filterWidgetAction);

    addSeparator();
    for (int i = 0; i < m_actions.count(); i++) {

        if (i + 1 == m_actions.count()) {
            addMenu(m_helpMenu->menu())->setIcon(KIcon("help-contents"));
            addSeparator();
        }

        addAction(m_actions.at(i));
    }

    if ( KGlobalSettings::insertTearOffHandle() ) {
        setTearOffEnabled(true);
    }

}
コード例 #9
0
void KexiItemMenu::update(KexiPart::Info* partInfo, KexiPart::Item* partItem)
{
    clear();
    QString title_text(partItem->name());
    if (partInfo && !partInfo->instanceCaption().isEmpty()) {
        title_text += (" : " + partInfo->instanceCaption());
    }
    addTitle(KIcon(partInfo->itemIconName()), title_text);

    if (m_actionCollection->action("open_object")
            && m_actionCollection->action("open_object")->isEnabled()
            && partItem && (partInfo->supportedViewModes() & Kexi::DataViewMode)) {
        addAction("open_object");
    }
    if (m_actionCollection->action("design_object")
            && m_actionCollection->action("design_object")->isEnabled()
            && partItem && (partInfo->supportedViewModes() & Kexi::DesignViewMode)) {
        addAction("design_object");
    }
    if (m_actionCollection->action("editText_object")
            && m_actionCollection->action("editText_object")->isEnabled()
            && partItem && (partInfo->supportedViewModes() & Kexi::TextViewMode)) {
        addAction("editText_object");
    }
    addSeparator();

#ifdef KEXI_SHOW_UNIMPLEMENTED
    //! @todo plugSharedAction("edit_cut", m_itemMenu);
    //! @todo plugSharedAction("edit_copy", m_itemMenu);
    //! @todo addSeparator();
#endif
    bool addSep = false;
    if (partItem && partInfo->isExecuteSupported()) {
        addAction("data_execute");
        addSep = true;
    }
    if (partItem && partInfo->isDataExportSupported()) {
        addAction("export_object");
        addSep = true;
    }
    if (addSep)
        addSeparator();

#ifndef KEXI_NO_QUICK_PRINTING
    if (partItem && partInfo->isPrintingSupported())
        addAction("print_object");
    if (partItem && partInfo->isPrintingSupported())
        addAction("pageSetupForObject");
    if (m_actionCollection->action("edit_rename") || m_actionCollection->action("edit_delete"))
        addSeparator();
#endif
    addAction("edit_rename");
    addAction("edit_delete");
}
コード例 #10
0
ファイル: dialog.cpp プロジェクト: IMAN4K/QtPro
MessageDialog::MessageDialog(const QString &title, const QString &content, Buttons f, QWidget *parent) : Dialog(parent) {
	_mainLayout.setContentsMargins(24, 24, 24, 8);
	_mainLayout.setSpacing(24);
	_mainLayout.addLayout(&_titleLayout);
	_mainLayout.addLayout(&_contentLayout);
	_mainLayout.addLayout(&_actionLayout);
	setLayout(&_mainLayout);

	addTitle(title);
	addButtons(f);
	addContent(content);
}
コード例 #11
0
/**
 * Add data to the contact.
 * All fields must be empty.
 */
void PIMContact::addDataToContact()
{
    printf("\n==============Add data to contact==============\n");
    printf(sFieldSeparator);

    addContactName();
    waitForClick();

    addAddress();
    waitForClick();

    addBirthday();
    waitForClick();

    addEmail();
    waitForClick();

    addNickname();
    waitForClick();

    addNote();
    waitForClick();

    addOrg();
    waitForClick();

    // If you want to set a photo URL call addPhotoURL method instead of
    // addPhoto method.
    addPhoto();
    waitForClick();

    addPhone();
    waitForClick();

    addTitle();
    waitForClick();

    addURL();
    waitForClick();

    addIM();
    waitForClick();

    addRelation();
    waitForClick();

    addOrgInfo();
    waitForClick();
}
コード例 #12
0
void addLyricsToScore(const std::multimap<ReducedFraction, std::string> &lyricTrack,
                      const Staff *staffAddTo)
      {
      Score *score = staffAddTo->score();
      int textCounter = 0;

      for (const auto &e: lyricTrack) {
            const auto &tick = e.first;
            QString str = MidiCharset::convertToCharset(e.second);
            if (tick == ReducedFraction(0, 1)) {
                  addTitle(score, str, &textCounter);
                  }
            else {
                  QString text = removeSlashes(str);
                  score->addLyrics(tick.ticks(), staffAddTo->idx(), text);
                  }
            }
      }
コード例 #13
0
ファイル: PopChoiceDlg.cpp プロジェクト: zoominhao/CountMoney
bool PopChoiceDlg::init()
{
	if (!LayerColor::initWithColor(ccc4(25, 25, 25, 125))) 
		return false;

	auto visibleSize = Director::getInstance()->getVisibleSize();
	//auto origin = Director::getInstance()->getVisibleOrigin();

	addBgImg();

	//获得背景sprite的大小
	m_size = m_bgSprite->getContentSize();
	auto yesItem = MenuItemImage::create(
		"popdlg/popy.png",
		"popdlg/popy.png",
		CC_CALLBACK_1(PopChoiceDlg::yesButton, this));

	auto noItem = MenuItemImage::create(
		"popdlg/popn.png",
		"popdlg/popn.png",
		CC_CALLBACK_1(PopChoiceDlg::noButton, this));

	// create menu, it's an autorelease object
	auto menu = Menu::create(yesItem, noItem, NULL);
	menu->alignItemsHorizontallyWithPadding(5);
	menu->setPosition(ccp(visibleSize.width / 2, visibleSize.height * 0.42));

	this->addChild(menu, 1);

	addTitle();
	addContent();

	//保证是模态对话框
	auto touchlistenter = EventListenerTouchOneByOne::create();
	touchlistenter->setSwallowTouches(true);
	touchlistenter->onTouchBegan = CC_CALLBACK_2(PopChoiceDlg::onTouchBegan, this);
	_eventDispatcher->addEventListenerWithSceneGraphPriority(touchlistenter, this);

	return true;
}
コード例 #14
0
void k9astTitles::updateTitles() {
    for (int j=0;j< m_src->topLevelItemCount();j++) {
        _k9ItemWidget *item=(_k9ItemWidget*)m_src->topLevelItem(j);
        if (item->checkState(0)==Qt::Unchecked) {
            item->title->setSelected(false);

        } else if (!item->title->isSelected()) {
            m_updating=true;
            
	    for(int iChapter=0;iChapter<item->childCount();iChapter++) {
		_k9ItemWidget *itc=(_k9ItemWidget*)item->child(iChapter);
		itc->chapter->setSelected(itc->checkState(0)==Qt::Checked);
	    }
	    item->title->setSelected(true);
            emit addTitle(item->title);

            m_updating=false;

        }
    }
//reselectionner les titres qui ont été recochés
}
コード例 #15
0
ファイル: bathmoi.c プロジェクト: LinuxTeam-teilar/Bathmoi
int main(int argc, char *argv[])
{
    GtkWidget *exp, *vbox1, *vbox, *hbox;
    gint kateuth = 0;
    i = 0;

    gtk_init (&argc, &argv);

    kateuth = epilogiKate();

    main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
//    gtk_window_set_icon (GTK_WINDOW(main_window), gdk_pixbuf_new_from_xpm_data((const char **) pixmap));
    gtk_window_set_icon (GTK_WINDOW(main_window), gdk_pixbuf_new_from_xpm_data((const char **) icon()));
    gtk_window_set_title (GTK_WINDOW (main_window), "Βαθμός πτυχίου!");
    gtk_window_set_default_size (GTK_WINDOW (main_window), (gint) 700, (gint) 300);
    gtk_window_set_position (GTK_WINDOW (main_window), GTK_WIN_POS_CENTER);
    gtk_window_set_resizable(GTK_WINDOW (main_window), FALSE);
    g_signal_connect (G_OBJECT (main_window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
    gtk_container_set_border_width (GTK_CONTAINER (main_window), 10);
    vbox = gtk_vbox_new (FALSE, 5);

    hbox = gtk_hbox_new (FALSE, 5);
    gtk_box_pack_start (GTK_BOX(hbox), gtk_label_new("Κωδικός"), FALSE, FALSE, 5);
    gtk_box_pack_start (GTK_BOX(hbox), gtk_label_new("Όνομα μαθήματος"), FALSE, FALSE, 5);
    gtk_box_pack_end (GTK_BOX(hbox), gtk_label_new("Δ.Μ."), FALSE, FALSE, 5);
    gtk_box_pack_end (GTK_BOX(hbox), gtk_label_new("Βαθμός"), FALSE, FALSE, 5);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 5);

    /* PROTO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("1o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    addLesson("Μαθηματική ανάλυση I", 0, "5", "[120]", vbox1);
    addLesson("Φυσική", 0, "5", "[121]", vbox1);
    addLesson("Προγραμματισμός I", 0, "5", "[122]", vbox1);
    addLesson("Αρχές Τηλεπικοινωνιών", 0, "5", "[123]", vbox1);
    addLesson("Ηλεκτρονικά", 0, "5", "[124]", vbox1);
    addLesson("Διακριτά συστήματα", 0, "5", "[125]", vbox1);

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);

    /* DEYTERO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("2o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    addLesson("Μαθηματική ανάλυση II", 0, "5", "[220]", vbox1);
    addLesson("Φυσικές Αρχές Τεχνολογίας Επικοινωνιών", 0, "6", "[221]", vbox1);
    addLesson("Αρχιτεκτονική Η/Υ I", 0, "5", "[223]", vbox1);
    addLesson("Ηλεκτρονικές Τηλεπικοινωνίες", 0, "5", "[224]", vbox1);
    addLesson("Αριθμητική ανάλυση", 0, "5", "[225]", vbox1);
    addLesson("Προγραμματισμός II", 0, "5", "[226]", vbox1);

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);

    /* TRITO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("3o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    addLesson("Βάσεις δεδομένων I", 0, "5", "[320]", vbox1);
    addLesson("Δομές δεδομένων και αλγόριθμοι", 0, "5", "[321]", vbox1);
    addLesson("Θεωρία πιθανοτήτων και στατιστική", 0, "5", "[322]", vbox1);
    addLesson("Δίκτυα I", 0, "5", "[323]", vbox1);
    addLesson("Λειτουργικά συστήματα I", 0, "5", "[324]", vbox1);
    addLesson("Εφαρμογές γραμμική άλγεβρας", 0, "5", "[325]", vbox1);

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);

    /* TETARTO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("4o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    addLesson("Αλγόριθμοι και πολυπλοκότητα", 0, "5", "[421]", vbox1);
    addLesson("Αρχιτεκτονική II", 0, "5", "[422]", vbox1);
    addLesson("Ανάλυση και σχεδιασμός Π.Σ.", 0, "5", "[425]", vbox1);
    addLesson("Θεωρία συστημάτων - ΣΑΕ", 0, "5", "[426]", vbox1);
    addLesson("Δίκτυα II", 0, "5", "[427]", vbox1);
    gtk_box_pack_start (GTK_BOX(vbox1), gtk_hseparator_new(), FALSE, FALSE, 5);
    gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("1 από τα 2"), FALSE, FALSE, 5);
    addLesson("Υπολογισιμότητα", 1, "5", "[423]", vbox1);
    addLesson("Αρχές γλωσσών προγραμματισμού", 1, "5", "[424]", vbox1);

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);

    /* PEMPTO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("5o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    addLesson("Οικονομικά των επιχειρήσεων", 0, "5", "[920]", vbox1);

    if (kateuth == 0) {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση πληροφορικής"), FALSE, FALSE, 5);
        addLesson("Προγραμματισμός III", 0, "7", "[531Π]", vbox1);
        addLesson("Τεχνολογία λογισμικού", 0, "7", "[532Π]", vbox1);
        addLesson("Βάσεις δεδομένων II", 0, "6", "[533Π]", vbox1);
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("1 από τα 2"), FALSE, FALSE, 5);
        addLesson("Λογικός προγραμματισμός", 1, "5", "[534Π]", vbox1);
        addLesson("Οργάνωση και διαχείριση αρχείων ", 1, "5", "[535Π]", vbox1);
    } else {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση τηλεπικοινωνιών και δικτύων"), FALSE, FALSE, 5);
        addLesson("Επεξεργασία σήματος", 0, "7", "[541Τ]", vbox1);
        addLesson("Τηλεπικοινωνιακά συστήματα I", 0, "7", "[542Τ]", vbox1);
        addLesson("Οπτικές επικοινωνίες", 0, "6", "[543Τ]", vbox1);
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("1 από τα 2"), FALSE, FALSE, 5);
        addLesson("Κινητές επικοινωνίες", 1, "5", "[544Τ]", vbox1);
        addLesson("Σχεδίαση, μελέτη και υλοποίηση δικτύων", 1, "5", "[545Τ]", vbox1);
    }

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);


    /* ΕΚΤΟ EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("6o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("ΔΟΝΑ"), FALSE, FALSE, 5);
    addLesson("Τεχνική νομοθεσία", 0, "5", "[921]", vbox1);
    gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("1 από τα 2"), FALSE, FALSE, 5);
    addLesson("Επιχειρησιακή έρευνα", 1, "5", "[930]", vbox1);
    addLesson("Διαχείριση έργων πληροφορικής", 1, "5", "[931]", vbox1);

    if (kateuth == 0) {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση πληροφορικής  (4 από τα 6)"), FALSE, FALSE, 5);
        addLesson("Τεχνητή νοημοσύνη", 1, "5", "[631Π]", vbox1);
        addLesson("Προχωρημένες εφαρμογές προγραμματισμού", 1, "5", "[632Π]", vbox1);
        addLesson("Πολυμέσα", 1, "5", "[633Π]", vbox1);
        addLesson("Λειτουργικά συστήματα II", 1, "5", "[634Π]", vbox1);
        addLesson("Δικτυακός προγραμματισμός", 1, "5", "[655]", vbox1);
        addLesson("Ασφάλεια πληροφοριακών συστημάτων", 1, "5", "[656]", vbox1);
    } else {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση τηλεπικοινωνιών και δικτύων  (4 από τα 6)"), FALSE, FALSE, 5);
        addLesson("Επικοινωνίες δεδομένων", 1, "5", "[641Τ]", vbox1);
        addLesson("Τηλεπικοινωνιακά συστήματα II", 1, "5", "[642Τ]", vbox1);
        addLesson("Ειδικά θέματα οπτικών επικοινωνιών", 1, "5", "[643Τ]", vbox1);
        addLesson("Ασύρματες επικοινωνίες", 1, "5", "[644Τ]", vbox1);
        addLesson("Δικτυακός προγραμματισμός", 1, "5", "[655]", vbox1);
        addLesson("Ασφάλεια πληροφοριακών συστημάτων", 1, "5", "[656]", vbox1);
    }

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);

    /* EBDOMO EKSAMINO */
    vbox1 = gtk_vbox_new (FALSE, 5);
    exp = addTitle("7o εξάμηνο");
    gtk_container_add (GTK_CONTAINER (exp), vbox1);

    gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("ΔΟΝΑ  (1 από τα 2)"), FALSE, FALSE, 5);
    addLesson("Μάρκετινγκ πληροφοριακών συστημάτων", 1, "3", "[922]", vbox1);
    addLesson("Διδακτική της πληροφορικής", 1, "3", "[923]", vbox1);

    if (kateuth == 0) {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση πληροφορικής"), FALSE, FALSE, 5);
        addLesson("Σεμινάριο θεμάτων τεχνολογικής αιχμής", 0, "6", "[731Π]", vbox1);
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("3 από τα 6"), FALSE, FALSE, 5);
        addLesson("Ειδικά θέματα βάσεων δεδομένων", 1, "7", "[732Π]", vbox1);
        addLesson("Ηλεκτρονικό εμπόριο", 1, "7", "[733Π]", vbox1);
        addLesson("Προγραμματισμός Ιντερνετ", 1, "7", "[734Π]", vbox1);
        addLesson("Υπολογιστικό πλέγμα", 1, "7", "[735Π]", vbox1);
        addLesson("Μεταγλωττιστές", 1, "7", "[736Π]", vbox1);
        addLesson("Κατανεμημένα συστήματα", 1, "7", "[757]", vbox1);
    } else {
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("Κατεύθυνση τηλεπικοινωνιών και δικτύων"), FALSE, FALSE, 5);
        addLesson("Σεμινάριο θεμάτων τεχνολογικής αιχμής", 0, "6", "[741Τ]", vbox1);
        gtk_box_pack_start (GTK_BOX(vbox1), gtk_label_new("3 από τα 6"), FALSE, FALSE, 5);
        addLesson("Δορυφορικές επικοινωνίες", 1, "7", "[742Τ]", vbox1);
        addLesson("CDMA", 1, "7", "[743Τ]", vbox1);
        addLesson("Δικτύωση και αυτοματοποίηση", 1, "7", "[744Τ]", vbox1);
        addLesson("Ευρυζωνικά δίκτυα", 1, "7", "[745Τ]", vbox1);
        addLesson("Απόδοση δικτύων", 1, "7", "[746Τ]", vbox1);
        addLesson("Κατανεμημένα συστήματα", 1, "7", "[757]", vbox1);
    }

    gtk_box_pack_start (GTK_BOX(vbox), exp, FALSE, FALSE, 0);
    addLesson("Πτυχιακή εργασία", 0, "20", "[801]", vbox);

    gtk_box_pack_start (GTK_BOX(vbox), addButtons(), FALSE, FALSE, 5);

    gtk_container_add (GTK_CONTAINER (main_window), vbox);

    gtk_widget_show_all (main_window);

    gtk_main ();
    return 0;
}
コード例 #16
0
ファイル: ofApp.cpp プロジェクト: elliotwoods/ofxMultiTrack
//--------------------------------------------------------------
void ofApp::setup() {
    this->gui.init();

    auto widgets = this->gui.addWidgets();
    widgets->addTitle("MultiTrack Receive");
    widgets->addFps();
    widgets->addMemoryUsage();
    widgets->addLiveValue<int>("Receiving on port", [this]() {
        return (float) this->receiver.getReceiver().getPort();
    });
    widgets->addIndicator("Frame incoming", [this]() {
        return this->newFrame;
    });
    widgets->addLiveValueHistory("Receiver incoming frame rate", [this]() {
        return (float) this->receiver.getReceiver().getIncomingFramerate();
    });
    widgets->addLiveValueHistory("Dropped frames", [this]() {
        return (float) this->receiver.getReceiver().getDroppedFrames().size();
    });
    widgets->addLiveValue<string>("Sending Body OSC to ", [this]() {
        return this->oscHost + ":" + ofToString(this->oscPort);;
    });

    //initialise receiver
    {
        auto port = 4444;

        while (!this->receiver.init(port)) {
            port++;
        }

        this->clientIndex = port - 4444;
        widgets->addLiveValue<float>("Client index", [this]() {
            return this->clientIndex;
        });

        this->oscPort = port + 1000;

        this->gui.add(ofxCvGui::Panels::makeTexture(this->color.texture, "Color"));
        this->gui.add(ofxCvGui::Panels::makeTexture(this->depth.texture, "Depth"));
        this->gui.add(ofxCvGui::Panels::makeTexture(this->infrared.texture, "Infrared"));
        this->gui.add(ofxCvGui::Panels::makeTexture(this->bodyIndex.texture, "BodyIndex"));
        this->gui.add(ofxCvGui::Panels::makeTexture(this->colorCoordInDepthFrame.texture, "ColorCoordInDepthView"));

        auto worldPanel = this->gui.addWorld();
        worldPanel->onDrawWorld += [this](ofCamera &) {
            auto & frame = this->receiver.getFrame();
            const auto & bodies = frame.getBodies();
            const auto & boneAtlas = ofxKinectForWindows2::Data::Body::getBonesAtlas();
            for (const auto & body : bodies) {
                body.drawWorld();
            }
        };
    }


    //initialise texture sharing
    {
        try {
            auto suffix = ofToString(this->clientIndex);

            this->color.sender.init("color" + suffix);
            this->depth.sender.init("depth" + suffix);
            this->infrared.sender.init("infrared" + suffix);
            this->bodyIndex.sender.init("bodyIndex" + suffix);
            this->colorCoordInDepthFrame.sender.init("colorCoordInDepthFrame" + suffix);
        }
        catch (std::exception e) {
            ofSystemAlertDialog(string("Couldn't initialise Spout texture sharing : ") + e.what());
        }
        catch (...) {
            ofSystemAlertDialog("Couldn't initialise Spout texture sharing");
        }
    }


    //initialise osc (not a standard format)
    {
        this->oscSender.setup(this->oscHost, this->oscPort);
    }

    ofSetFrameRate(60);
}
コード例 #17
0
void k9astTitles::titleSelected(k9DVDTitle *_title) {
    if (!m_updating)
        emit addTitle(_title);
}
コード例 #18
0
ファイル: Programme.cpp プロジェクト: juriad/tvp
void Programme::addSubElement( QDomElement &element) {
  if(element.localName().compare("Icon", Qt::CaseInsensitive)==0) {
    Icon *cn = Icon::fromElement(element);
    addIcon(cn);
    return;
  }
  if(element.localName().compare("Category", Qt::CaseInsensitive)==0) {
    Category *cn = Category::fromElement(element);
    addCategory(cn);
    return;
  }
  if(element.localName().compare("SubTitle", Qt::CaseInsensitive)==0) {
    SubTitle *cn = SubTitle::fromElement(element);
    addSubTitle(cn);
    return;
  }
  if(element.localName().compare("LastChance", Qt::CaseInsensitive)==0) {
    LastChance *cn = LastChance::fromElement(element);
    addLastChance(cn);
    return;
  }
  if(element.localName().compare("Audio", Qt::CaseInsensitive)==0) {
    Audio *cn = Audio::fromElement(element);
    addAudio(cn);
    return;
  }
  if(element.localName().compare("Subtitles", Qt::CaseInsensitive)==0) {
    Subtitles *cn = Subtitles::fromElement(element);
    addSubtitles(cn);
    return;
  }
  if(element.localName().compare("Date", Qt::CaseInsensitive)==0) {
    Date *cn = Date::fromElement(element);
    addDate(cn);
    return;
  }
  if(element.localName().compare("PreviouslyShown", Qt::CaseInsensitive)==0) {
    PreviouslyShown *cn = PreviouslyShown::fromElement(element);
    addPreviouslyShown(cn);
    return;
  }
  if(element.localName().compare("Country", Qt::CaseInsensitive)==0) {
    Country *cn = Country::fromElement(element);
    addCountry(cn);
    return;
  }
  if(element.localName().compare("OrigLanguage", Qt::CaseInsensitive)==0) {
    OrigLanguage *cn = OrigLanguage::fromElement(element);
    addOrigLanguage(cn);
    return;
  }
  if(element.localName().compare("StarRating", Qt::CaseInsensitive)==0) {
    StarRating *cn = StarRating::fromElement(element);
    addStarRating(cn);
    return;
  }
  if(element.localName().compare("Credits", Qt::CaseInsensitive)==0) {
    Credits *cn = Credits::fromElement(element);
    addCredits(cn);
    return;
  }
  if(element.localName().compare("Title", Qt::CaseInsensitive)==0) {
    Title *cn = Title::fromElement(element);
    addTitle(cn);
    return;
  }
  if(element.localName().compare("Video", Qt::CaseInsensitive)==0) {
    Video *cn = Video::fromElement(element);
    addVideo(cn);
    return;
  }
  if(element.localName().compare("New", Qt::CaseInsensitive)==0) {
    New *cn = New::fromElement(element);
    addNew(cn);
    return;
  }
  if(element.localName().compare("Rating", Qt::CaseInsensitive)==0) {
    Rating *cn = Rating::fromElement(element);
    addRating(cn);
    return;
  }
  if(element.localName().compare("EpisodeNum", Qt::CaseInsensitive)==0) {
    EpisodeNum *cn = EpisodeNum::fromElement(element);
    addEpisodeNum(cn);
    return;
  }
  if(element.localName().compare("Length", Qt::CaseInsensitive)==0) {
    Length *cn = Length::fromElement(element);
    addLength(cn);
    return;
  }
  if(element.localName().compare("Url", Qt::CaseInsensitive)==0) {
    Url *cn = Url::fromElement(element);
    addUrl(cn);
    return;
  }
  if(element.localName().compare("Review", Qt::CaseInsensitive)==0) {
    Review *cn = Review::fromElement(element);
    addReview(cn);
    return;
  }
  if(element.localName().compare("Language", Qt::CaseInsensitive)==0) {
    Language *cn = Language::fromElement(element);
    addLanguage(cn);
    return;
  }
  if(element.localName().compare("Premiere", Qt::CaseInsensitive)==0) {
    Premiere *cn = Premiere::fromElement(element);
    addPremiere(cn);
    return;
  }
  if(element.localName().compare("Desc", Qt::CaseInsensitive)==0) {
    Desc *cn = Desc::fromElement(element);
    addDesc(cn);
    return;
  }
}
コード例 #19
0
//--------------------------------------------------------------
void ofApp::setup(){
	kinect.open();
	kinect.initDepthSource();
	kinect.initColorSource();
	kinect.initInfraredSource();
	kinect.initBodyIndexSource();
	kinect.initBodySource();

	gui.init();

	//setup a gui panel for the widgets at top-left
	auto widgets = gui.addWidgets();
	widgets->addTitle("ofxKinectForWindows2");
	widgets->addFps();
	widgets->addMemoryUsage();

	//setup a gui panel for the 3D view
	auto worldView = gui.addWorld("World");
	worldView->onDrawWorld += [this](ofCamera &) {
		this->kinect.drawWorld();
	};

	//setup a gui panel for every kinect source
	auto sources = kinect.getSources();
	for(auto source : sources) {
		auto sourceWithTexture = dynamic_pointer_cast<ofBaseHasTexture>(source);
		if (sourceWithTexture) {
			auto panel = gui.add(sourceWithTexture->getTexture(), source->getTypeName());

			//if it's the colour panel, let's do something special by writing some info on top
			auto colorSource = dynamic_pointer_cast<ofxKFW2::Source::Color>(source);
			if (colorSource) {
				panel->onDraw += [colorSource] (ofxCvGui::DrawArguments &) {
					stringstream message;
					message << "Exposure : " << colorSource->getExposure() << "us" << endl;
					message << "FrameInterval : " << colorSource->getFrameInterval() << "us" << endl;
					message << "Gain : " << colorSource->getGain() << endl;
					message << "Gamma : " << colorSource->getGamma() << endl;
					ofxCvGui::Utils::drawText(message.str(), 20, 60);
				};
			}

			//if it's the depth panel, set some scaling
			auto depthSource = dynamic_pointer_cast<ofxKFW2::Source::Depth>(source);
			if (depthSource) {
				auto style = make_shared<ofxCvGui::Panels::Texture::Style>();
				style->rangeMaximum = 0.25f;
				panel->setStyle(style);
			}

			//if it's the body index panel, let's draw the joints on top
			auto bodyIndexSource = dynamic_pointer_cast<ofxKFW2::Source::BodyIndex>(source);
			if(bodyIndexSource) {
				panel->onDrawImage += [this](ofxCvGui::DrawImageArguments & args) {
					auto bodySource = this->kinect.getBodySource();
					const auto & bodies = bodySource->getBodies();

					ofPushStyle();
					{
						ofColor color(200, 100, 100);
						int index = 0;
						for (const auto & body : bodies) {
							color.setHueAngle((index * 50) % 360);
							ofSetColor(color);
							for (const auto & joint : body.joints) {
								ofDrawCircle(joint.second.getPositionInDepthMap(), 5);
							}
							index++;
						}
					}
					ofPopStyle();
				};
			}
		}

		//add an 'isFrameNew' widget to the panel
		widgets->addIndicatorBool(source->getTypeName() + " frame new", [source]() {
			return source->isFrameNew();
		});
	}

	//if we press the 'c' key on the World panel, then toggle the camera's cursor. This works best when you fullscreen that panel
	worldView->onKeyboard += [this, worldView] (ofxCvGui::KeyboardArguments & args) {
		if (args.action == ofxCvGui::KeyboardArguments::Action::Pressed && args.key =='c') {
			worldView->getCamera().toggleCursorDrawEnabled();
		}
	};
}
コード例 #20
0
ファイル: DrawToMemory.cpp プロジェクト: audioplastic/conplot
//MAIN RENDER CODE ================================================
void DataGrid::render()
{
    //vector<T> xData(_xData); //Assign xData to non-const so we can pass by const reference.
    
    // Add the border if flagged
    if (flags & (int)o_t::BORDER) {
        addBorder();
        const int shrink = 4;
        plotArea.setSize(plotArea.getWidth()-shrink, plotArea.getHeight()-shrink);
        plotArea.translate(shrink/2, shrink/2);
    }
    
    // Add the title if flagged
    if (flags & (int)o_t::TITLE) {
        addTitle();
    }
    
    // Abort if series vec is empty
    if (series.getNumSeries()==0){
        cout << "No data series available, aborting. \n";
        return;
    }
    
    // get ranges
    const float xMin = series.getXmin();
    const float xMax = series.getXmax();
    const float yMin = series.getYmin();
    const float yMax = series.getYmax();
    // Another way of aliasing - pointless here bu I <3 lambdas
    // To use this alternative, replace xMin with xMin() below
    // auto xMin = [&](){return series.getXmin();};  
    
    // Add the y-axis if flagged
    if (flags & (int)o_t::YAXIS) {
        const int yaxWidth = 10;
        Rectangle rAx = Rectangle(plotArea.getTL(), yaxWidth, plotArea.getHeight());
        addYAxis(yMin, yMax, rAx);
        
        // Shift the plot area
        plotArea.setWidth(plotArea.getWidth()-yaxWidth);
        plotArea.translate(yaxWidth, 0);
    }
    
    // Add simple x-axis indicators if requested
    if (flags & (int)o_t::XAXIS) {
        addXAxis(xMin, xMax, plotArea);
    }
    
    
    for (size_t ii=0; ii<series.getNumSeries(); ++ii){
        // Warn if input is messed up
        vector<float> xData(series.getXdata(ii));
        vector<float> yData(series.getYdata(ii));
        
        if (xData.size()!=yData.size()) {
            cout << "WARNING: x and y data size mismatch, not plotting.\n";
            return;
        }
        
        
        for(size_t nn=0; nn<xData.size(); ++nn){
            int intX = mapVal(   xData[nn], xMin, xMax, plotArea.getLeft(), plotArea.getRight()   );
            // Notice the subtle reversal of yMax and yMin here so data flipped the correct way
            int intY = mapVal(   yData[nn], yMax, yMin, plotArea.getTop(), plotArea.getBtm()   );
            addPoint(Point(intX, intY), series.getMarker(ii) );
        }
    }
    
    // Add the legend if flagged
    if (flags & (int)o_t::LEGEND) {
        addLegend();
    }
    
} // End of rendering function
コード例 #21
0
ファイル: kmenu.cpp プロジェクト: vasi/kdelibs
QAction* KMenu::addTitle(const QString &text, QAction* before)
{
    return addTitle(QIcon(), text, before);
}