当前位置: 首页>>代码示例>>C++>>正文


C++ MainForm类代码示例

本文整理汇总了C++中MainForm的典型用法代码示例。如果您正苦于以下问题:C++ MainForm类的具体用法?C++ MainForm怎么用?C++ MainForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MainForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MainForm

bool
DrStrangecodeRssReader::OnAppInitializing(AppRegistry& appRegistry)
{

	// Create a form
	MainForm *pMainForm = new MainForm();
	pMainForm->Initialize();
	pMainForm->SetName(kMainFormNameString);

	ItemForm * pItemForm = new ItemForm();
	pItemForm->Initialize();
	pItemForm->SetName(kItemFormNameString);

	// Add the form to the frame
	Frame *pFrame = GetAppFrame()->GetFrame();

	pFrame->AddControl(*pMainForm);
	pFrame->AddControl(*pItemForm);

	// Set the current form
	pFrame->SetCurrentForm(*pMainForm);

	// Draw and Show the form
	pMainForm->Draw();
	pMainForm->Show();

	return true;
}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:28,代码来源:DrStrangecodeRssReader.cpp

示例2: main

int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    MainForm *w = new MainForm;
    w->show();
    return a.exec();
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:7,代码来源:main.cpp

示例3: MainForm

bool
UserInterface::OnAppInitializing(AppRegistry& appRegistry)
{
	// TODO:
	// Initialize UI resources and application specific data.
	// The application's permanent data and context can be obtained from the appRegistry.
	//
	// If this method is successful, return true; otherwise, return false.
	// If this method returns false, the application will be terminated.

	// Uncomment the following statement to listen to the screen on/off events.
	//PowerManager::SetScreenEventListener(*this);

	// Create a form
	MainForm *pMainForm = new MainForm();
	pMainForm->Initialize();

	// Add the form to the frame
	Frame *pFrame = GetAppFrame()->GetFrame();
	pFrame->AddControl(*pMainForm);

	// Set the current form
	pFrame->SetCurrentForm(*pMainForm);

	// Draw and Show the form
	pMainForm->Draw();
	pMainForm->Show();

	return true;
}
开发者ID:AlessioMTX,项目名称:UserInterface-Bada,代码行数:30,代码来源:UserInterface.cpp

示例4: unmapInstrument

bool Instrument::unmapInstrument (void)
{
#ifdef CONFIG_MIDI_INSTRUMENT

	if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0)
		return false;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return false;
	if (pMainForm->client() == NULL)
		return false;

	lscp_midi_instrument_t instr;

	instr.map  = m_iMap;
	instr.bank = (m_iBank & 0x0fff);
	instr.prog = (m_iProg & 0x7f);

	if (::lscp_unmap_midi_instrument(pMainForm->client(), &instr) != LSCP_OK) {
		pMainForm->appendMessagesClient("lscp_unmap_midi_instrument");
		return false;
	}

	return true;

#else

	return false;

#endif
}
开发者ID:lxlxlo,项目名称:LS-qsampler,代码行数:32,代码来源:qsamplerInstrument.cpp

示例5: getMapNames

// Instrument map name enumerator.
QStringList Instrument::getMapNames (void)
{
	QStringList maps;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return maps;
	if (pMainForm->client() == NULL)
		return maps;

#ifdef CONFIG_MIDI_INSTRUMENT
	int *piMaps = ::lscp_list_midi_instrument_maps(pMainForm->client());
	if (piMaps == NULL) {
		if (::lscp_client_get_errno(pMainForm->client()))
			pMainForm->appendMessagesClient("lscp_list_midi_instruments");
	} else {
		for (int iMap = 0; piMaps[iMap] >= 0; iMap++) {
			const QString& sMapName = getMapName(piMaps[iMap]);
			if (!sMapName.isEmpty())
				maps.append(sMapName);
		}
	}
#endif

	return maps;
}
开发者ID:lxlxlo,项目名称:LS-qsampler,代码行数:27,代码来源:qsamplerInstrument.cpp

示例6: openInstrumentFile

// Browse and open an instrument file.
void InstrumentForm::openInstrumentFile (void)
{
	MainForm* pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;

	Options *pOptions = pMainForm->options();
	if (pOptions == NULL)
		return;

	// FIXME: the instrument file filters should be restricted,
	// depending on the current engine.
	const QString& sEngineName = m_ui.EngineNameComboBox->currentText().toUpper();
	QStringList filters;
	if (sEngineName.contains("GIG"))
		filters << tr("GIG Instrument files") + " (*.gig *.dls)";
	if (sEngineName.contains("SFZ"))
		filters << tr("SFZ Instrument files") + " (*.sfz)";
	if (sEngineName.contains("SF2"))
		filters << tr("SF2 Instrument files") + " (*.sf2)";
	const QString& filter = filters.join(";;");

	QString sInstrumentFile = QFileDialog::getOpenFileName(this,
		QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
		pOptions->sInstrumentDir, // Start here.
		filter                    // File filter.
	);

	if (sInstrumentFile.isEmpty())
		return;

	m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
	updateInstrumentName();
}
开发者ID:lxlxlo,项目名称:LS-qsampler,代码行数:35,代码来源:qsamplerInstrumentForm.cpp

示例7: channelFxEdit

bool ChannelStrip::channelFxEdit (void)
{
	MainForm *pMainForm = MainForm::getInstance();
	if (!pMainForm || !channel())
		return false;

	pMainForm->appendMessages(QObject::tr("channel fx sends..."));

	bool bResult = false;

#if CONFIG_FXSEND
	ChannelFxForm *pChannelFxForm =
		new ChannelFxForm(channel(), parentWidget());
	if (pChannelFxForm) {
		//pChannelForm->setup(this);
		bResult = pChannelFxForm->exec();
		delete pChannelFxForm;
	}
#else // CONFIG_FXSEND
	QMessageBox::critical(this,
		QSAMPLER_TITLE ": " + tr("Unavailable"),
			tr("Sorry, QSampler was built without FX send support!\n\n"
			   "(Make sure you have a recent liblscp when recompiling QSampler)"));
#endif // CONFIG_FXSEND

	return bResult;
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:27,代码来源:qsamplerChannelStrip.cpp

示例8: openInstrumentFile

// Browse and open an instrument file.
void ChannelForm::openInstrumentFile (void)
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;
	if (pMainForm->client() == NULL)
		return;

	Options *pOptions = pMainForm->options();
	if (pOptions == NULL)
		return;

	// FIXME: the instrument file filters should be restricted,
	// depending on the current engine.
	QString sInstrumentFile = QFileDialog::getOpenFileName(this,
		QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
		pOptions->sInstrumentDir,                 // Start here.
		tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files)
	);

	if (sInstrumentFile.isEmpty())
		return;

	m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
	updateInstrumentName();
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:27,代码来源:qsamplerChannelForm.cpp

示例9: updateChannelUsage

// Update whole channel usage state.
bool ChannelStrip::updateChannelUsage (void)
{
	if (m_pChannel == NULL)
		return false;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm->client() == NULL)
		return false;

	// This only makes sense on fully loaded channels...
	if (m_pChannel->instrumentStatus() < 100)
		return false;

	// Get current channel voice count.
	int iVoiceCount  = ::lscp_get_channel_voice_count(
		pMainForm->client(), m_pChannel->channelID());
// Get current stream count.
	int iStreamCount = ::lscp_get_channel_stream_count(
		pMainForm->client(), m_pChannel->channelID());
	// Get current channel buffer fill usage.
	// As benno has suggested this is the percentage usage
	// of the least filled buffer stream...
	int iStreamUsage = ::lscp_get_channel_stream_usage(
		pMainForm->client(), m_pChannel->channelID());;

	// Update the GUI elements...
	m_ui.StreamUsageProgressBar->setValue(iStreamUsage);
	m_ui.StreamVoiceCountTextLabel->setText(
		QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount));

	// We're clean.
	return true;
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:34,代码来源:qsamplerChannelStrip.cpp

示例10: setupDevice

// Show device options dialog.
void ChannelForm::setupDevice ( Device *pDevice,
	Device::DeviceType deviceTypeMode,
	const QString& sDriverName )
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;
	if (pMainForm->client() == NULL)
		return;

	// Create the device form if not already...
	if (m_pDeviceForm == NULL) {
		m_pDeviceForm = new DeviceForm(this, Qt::Dialog);
		m_pDeviceForm->setAttribute(Qt::WA_ShowModal);
		QObject::connect(m_pDeviceForm, SIGNAL(devicesChanged()),
			this, SLOT(updateDevices()));
	}

	// Refresh the device form with selected data.
	if (m_pDeviceForm) {
		m_pDeviceForm->setDeviceTypeMode(deviceTypeMode);
		m_pDeviceForm->refreshDevices();
		m_pDeviceForm->setDevice(pDevice);
		m_pDeviceForm->setDriverName(sDriverName);
		m_pDeviceForm->show();
	}
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:28,代码来源:qsamplerChannelForm.cpp

示例11: appendMessagesColor

void Channel::appendMessagesColor( const QString& s,
	const QString& c ) const
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm)
		pMainForm->appendMessagesColor(channelName() + ' ' + s, c);
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:7,代码来源:qsamplerChannel.cpp

示例12: loadInstrument

// Instrument file loader.
bool Channel::loadInstrument ( const QString& sInstrumentFile, int iInstrumentNr )
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return false;
	if (pMainForm->client() == NULL || m_iChannelID < 0)
		return false;
	if (!isInstrumentFile(sInstrumentFile))
		return false;
	if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)
		return true;

	if (
		::lscp_load_instrument_non_modal(
			pMainForm->client(),
			qsamplerUtilities::lscpEscapePath(
				sInstrumentFile).toUtf8().constData(),
			iInstrumentNr, m_iChannelID
		) != LSCP_OK
	) {
		appendMessagesClient("lscp_load_instrument");
		return false;
	}

	appendMessages(QObject::tr("Instrument: \"%1\" (%2).")
		.arg(sInstrumentFile).arg(iInstrumentNr));

	return setInstrument(sInstrumentFile, iInstrumentNr);
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:30,代码来源:qsamplerChannel.cpp

示例13: OnInit

    virtual bool OnInit(void) override
    {
        Application::InitializeBase();

        Url::Ptr pUrl;

        if (argc < 2) {
            wxConfig config("IcingaStudio");
            wxString wUrl;

            if (!config.Read("url", &wUrl))
                wUrl = "https://localhost:5665/";

            std::string url = wUrl.ToStdString();

            ConnectForm f(NULL, new Url(url));
            if (f.ShowModal() != wxID_OK)
                return false;

            pUrl = f.GetUrl();
            url = pUrl->Format(true);
            wUrl = url;
            config.Write("url", wUrl);
        } else {
            pUrl = new Url(argv[1].ToStdString());
        }

        MainForm *m = new MainForm(NULL, pUrl);
        m->Show();

        return true;
    }
开发者ID:hannesbe,项目名称:icinga2,代码行数:32,代码来源:icinga-studio.cpp

示例14: main

int main(int argc, char *argv[]) {

    QApplication app(argc, argv);
    app.setApplicationName(APPLICATION_NAME);

//    for (int i = 0; i < QStyleFactory::keys().length(); i++) {
//        std::cout << QStyleFactory::keys().at(i).toStdString() << std::endl;
//    }
//    app.setStyle("Fusion");

    qRegisterMetaType<streamer::DownloadError>("streamer::DownloadError");
    qRegisterMetaType<streamer::MessageType>("streamer::MessageType");
    qRegisterMetaType<streamer::PlaybackCallbackType>("streamer::MPVCallbackType");
    qRegisterMetaType<streamer::DownloadInfo>("streamer::DownloadInfo");
    qRegisterMetaType<std::string>("std::string");
    qRegisterMetaType<std::list<std::string>>("std::list<std::string>");
    qRegisterMetaType<std::list<std::string>>("std::list<std::string>&");
    qRegisterMetaType<QTextBlock>("QTextBlock");
    qRegisterMetaType<QTextCursor>("QTextCursor");

    setlocale(LC_NUMERIC, "C"); // libmpv needs this :/


#if defined(MINGW)
    QIcon::setThemeName("icons");
#endif

    MainForm *form = new MainForm();
    form->show();

    if (form->disclaimer) {
        return 0;
    }
    return app.exec();
}
开发者ID:maxammann,项目名称:aqueduct,代码行数:35,代码来源:main.cpp

示例15: main

int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    MainForm w;
    w.show();
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    return a.exec();
}
开发者ID:Spontz,项目名称:VisualsPreview,代码行数:8,代码来源:main.cpp


注:本文中的MainForm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。