Example #1
0
void Player::handle_input() {
	
	updateCombo();
	
	// Updating player velocity
	if (control->isPressed(KEY_UP, n_player, 0)) {
		v.y = -vy;
	} else if (control->isPressed(KEY_DOWN, n_player, 0)) {
		v.y = vy;
	} else
		v.y = 0;
	
}
void KPrSoundEventActionWidget::setData( KPrEventActionData * eventActionData )
{
    m_shape = eventActionData->shape();
    m_eventAction = eventActionData->eventAction();
    // TODO get the sound out ot the action
    QString title;
    KPrSoundEventAction * eventAction = dynamic_cast<KPrSoundEventAction *>( m_eventAction );
    if (eventAction) {
        title = eventAction->soundData()->title();
    }
    m_soundCollection = eventActionData->soundCollection();
    setEnabled( m_shape && m_soundCollection );
    updateCombo( title );
}
KPrSoundEventActionWidget::KPrSoundEventActionWidget( QWidget * parent )
: KPrEventActionWidget( parent )
, m_shape( 0 )
, m_eventAction( 0 )
, m_soundCollection( 0 )
, m_soundCombo( new QComboBox() )
{
    QVBoxLayout* layout = new QVBoxLayout( this );
    layout->addWidget( m_soundCombo );

    connect( m_soundCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(soundComboChanged()) );

    setEnabled( false );
    updateCombo( "" );
}
Example #4
0
int ComboWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = CmdWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: { QString _r = text();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 1: setText((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 2: updateCombo(); break;
        case 3: updateComboVariableSafet((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: updateComboVariableSafet(); break;
        case 5: updateComboAutofilterSafet((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: updateComboAutofilterSafet(); break;
        case 7: updateComboRecursivefilterSafet((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: updateComboRecursivefilterSafet(); break;
        case 9: updateComboListTable((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: updateComboListTable(); break;
        case 11: updateComboListLiteral(); break;
        case 12: updateVarGlobal((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 13: updateComboFlow((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 14: updateComboFlow(); break;
        case 15: updateComboConffileSafet((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 16: updateComboConffileSafet(); break;
        case 17: updateComboColorSafet((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 18: updateComboColorSafet(); break;
        case 19: viewdoc(); break;
        case 20: selColor(); break;
        case 21: insertAndClose(); break;
        case 22: { QString _r = getRealValue((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 23: { QString _r = getVarValue((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 24: itemsValueList(); break;
        case 25: itemsRealValueList(); break;
        case 26: { QComboBox* _r = combo();
            if (_a[0]) *reinterpret_cast< QComboBox**>(_a[0]) = _r; }  break;
        case 27: { QString _r = findkeyvalue((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        }
        _id -= 28;
    }
    return _id;
}
Example #5
0
void WindowApp::viewSummary(GtkWidget *widget, WindowApp *theApp){
	gtk_widget_destroy(theApp->admin_window);
	gtk_widget_destroy(theApp->appFrame);
	theApp->appFrame = gtk_fixed_new();
	
	
	theApp->admin_combo =  gtk_combo_box_text_new();
	
	theApp->admin_cancel = gtk_button_new_with_label("Cancel");
	gtk_widget_set_size_request(theApp->admin_cancel, 80, 35);
	gtk_fixed_put(GTK_FIXED(theApp->appFrame), theApp->admin_cancel , 100, 150);
	gtk_fixed_put(GTK_FIXED(theApp->appFrame), theApp->admin_combo, 50, 50);
	theApp->summary_combo =  gtk_combo_box_text_new();
	gtk_fixed_put(GTK_FIXED(theApp->appFrame), theApp->summary_combo, 50, 100);
	
	gtk_container_add(GTK_CONTAINER(theApp->window), theApp->appFrame);
	
	gtk_widget_show_all(theApp->window);

	

	char text[800];
	string courses[800];



	ifstream inFile("courses.txt", ios::in);

	if (!inFile) {
		cout<<"Could not open file"<<endl;
		exit(1);
	}	
	while (!inFile.eof()) {
		inFile.getline(text, 800);
		
		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(theApp->admin_combo), text);
	}
	g_signal_connect(theApp->admin_cancel, "clicked", G_CALLBACK (Control::submitToMain), theApp);
	g_signal_connect(GTK_COMBO_BOX(theApp->admin_combo), "changed", G_CALLBACK   (WindowApp::updateCombo), theApp);
	if(theApp->allCourses)
		updateCombo(widget,theApp);
}
void KPrSoundEventActionWidget::soundComboChanged()
{
    if ( ! m_shape ) {
        return;
    }

    KPrSoundData * soundData = 0;
    if ( m_soundCombo->currentIndex() > 1 ) { // a previous sound was chosen
        // copy it rather then just point to it - so the refcount is updated
        soundData = new KPrSoundData(*m_soundCollection->findSound( m_soundCombo->currentText() ) );
    }
    else if ( m_soundCombo->currentIndex() == 1 ) { // "Import..." was chosen
        KUrl url = KFileDialog::getOpenUrl();
        if ( !url.isEmpty() ) {
            soundData = new KPrSoundData( m_soundCollection, url.toLocalFile() );
            // TODO shouldn't that come from the sound collection
            // what if the user opens a already opened sound again?
            QFile *file = new QFile( url.toLocalFile() );
            file->open( QIODevice::ReadOnly );
            soundData->loadFromFile( file ); //also closes the file and deletes the class
        }
    }

    // TODO better name e.g. on new or remove sound
    KUndo2Command * cmd = new KUndo2Command( i18nc("(qtundo-format)", "Change sound action" ) );
    if ( m_eventAction ) {
        new KoEventActionRemoveCommand( m_shape, m_eventAction, cmd );
        m_eventAction = 0;
    }

    if ( soundData ) {
        KPrSoundEventAction * eventAction = new KPrSoundEventAction();
        eventAction->setSoundData( soundData );
        m_eventAction = eventAction;
        new KoEventActionAddCommand( m_shape, eventAction, cmd );
    }

    emit( addCommand( cmd ) );

    updateCombo( soundData ? soundData->title() : "" );
}
void ADM_Qbitrate::comboChanged(int i)
{
	updateCombo(readPulldown(compress,i));
}
void ADM_Qbitrate::updateMe()
{
	updateCombo(compress->mode);
}