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


C++ MainWin类代码示例

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


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

示例1: NewWindow

void
MainApp::ReadyToRun()
{
	// make sure we have at least one window open
	if (fPlayerCount == 0) {
		MainWin* window = NewWindow();
		if (window == NULL) {
			PostMessage(B_QUIT_REQUESTED);
			return;
		}
		BMessage lastPlaylistArchive;
		if (_RestoreCurrentPlaylist(&lastPlaylistArchive) == B_OK) {
			lastPlaylistArchive.what = M_OPEN_PREVIOUS_PLAYLIST;
			window->PostMessage(&lastPlaylistArchive);
		} else
			window->Show();
	}

	// setup the settings window now, we need to have it
	fSettingsWindow = new SettingsWindow(BRect(150, 150, 450, 520));
	fSettingsWindow->Hide();
	fSettingsWindow->Show();

	_InstallPlaylistMimeType();
}
开发者ID:DonCN,项目名称:haiku,代码行数:25,代码来源:MainApp.cpp

示例2: _

bool
MainApp::QuitRequested()
{
	// Make sure we store the current playlist, if applicable.
	for (int32 i = 0; BWindow* window = WindowAt(i); i++) {
		MainWin* playerWindow = dynamic_cast<MainWin*>(window);
		if (playerWindow == NULL)
			continue;

		BAutolock _(playerWindow);

		BMessage quitMessage;
		playerWindow->GetQuitMessage(&quitMessage);

		// Store the playlist if there is one. If the user has multiple
		// instances playing audio at the this time, the first instance wins.
		BMessage playlistArchive;
		if (quitMessage.FindMessage("playlist", &playlistArchive) == B_OK) {
			_StoreCurrentPlaylist(&playlistArchive);
			break;
		}
	}

	// Note: This needs to be done here, SettingsWindow::QuitRequested()
	// returns "false" always. (Standard BApplication quit procedure will
	// hang otherwise.)
	if (fSettingsWindow && fSettingsWindow->Lock())
		fSettingsWindow->Quit();
	fSettingsWindow = NULL;

	// store the current file panel ref in the global settings
	Settings::Default()->SetFilePanelFolder(fLastFilePanelFolder);

	return BApplication::QuitRequested();
}
开发者ID:DonCN,项目名称:haiku,代码行数:35,代码来源:MainApp.cpp

示例3: BMessage

void
MainWin::PlayBuffer(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format) {
    int64 frames = 0;

    playTrack->ReadFrames(buffer, &frames);

    MainWin *window = (MainWin *)cookie;

    bigtime_t now;

    if (sp->CurrentTime() < time)
        now = time + sp->CurrentTime();
    else
        now = time = sp->CurrentTime();

    char timestamp[64];

    MainWin::Timestamp(timestamp, time);

    BMessage *update = new BMessage(MSG_UPDATE_PROGRESS);
    update->AddFloat("current", (float) now);
    update->AddString("time", timestamp);

    window->PostMessage(update);

    if (frames <= 0) {
        sp->SetHasData(false);
        window->PostMessage(MSG_NEXT);
    }
}
开发者ID:vito,项目名称:MusicPlayer,代码行数:30,代码来源:MainWin.cpp

示例4: main

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

    MainWin win;
    win.show();
    return app.exec();
}
开发者ID:diogodadalt,项目名称:Tetralath,代码行数:8,代码来源:main.cpp

示例5: main

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	MainWin w;
	w.show();

	return a.exec();
}
开发者ID:samuelohterion,项目名称:ShaderToyQt,代码行数:8,代码来源:main.cpp

示例6: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setStyle("plastique");
 
    MainWin fenetre;
    fenetre.show();
 
    return app.exec();
}
开发者ID:Hybryd,项目名称:Ovobose,代码行数:10,代码来源:main_gui.cpp

示例7: main

int main (int argc, char **argv)
{
    QApplication a(argc, argv);

    MainWin w;

    w.resize(300,600);
    w.show();

    return a.exec();
}
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:11,代码来源:curvdemo1.cpp

示例8: main

int main(int argc, char *argv[])
{
   //setup application
   QApplication app(argc, argv);
   //execute app
   //show Windows
   MainWin *window;
   window = new MainWin();
   window->show();
   return app.exec();
}
开发者ID:journalehsan,项目名称:CutePad,代码行数:11,代码来源:main.cpp

示例9: main

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

	QApplication::setApplicationName("Redis Desktop Manager");
	QApplication::setApplicationVersion("0.6.3-dev");	
	QApplication::setOrganizationDomain("redisdesktop.com");

	MainWin w;
	w.show();
	return a.exec();
}
开发者ID:demonlife,项目名称:RedisDesktopManager,代码行数:12,代码来源:main.cpp

示例10: main

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

    MainWin win;

#ifdef _DEBUG
    win.show();
#else
    win.showMaximized();
#endif

    return app.exec();
}
开发者ID:Rillke,项目名称:AMA,代码行数:14,代码来源:main.cpp

示例11: app

// TODO: TestModels error. Why?
void TestEmanualCmd::test_gui()
{
    int test_gui = 0;
    
    if (test_gui){
	int argc = 0;
	char* argv[1] = {0};
	QApplication app(argc, argv);
	
	MainWin win;
	win.show();
	app.exec();
    }
}
开发者ID:ptmono,项目名称:eManual-gui,代码行数:15,代码来源:test_emanualcmd_flymake.cpp

示例12: main

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

    CrashHandler::instance()->Init(QDir::homePath());

    QApplication::setApplicationName("Redis Desktop Manager");
    QApplication::setApplicationVersion(RDM_VERSION);    
    QApplication::setOrganizationDomain("redisdesktop.com");

    MainWin w;
    w.show();
    return a.exec();
}
开发者ID:TracyHu,项目名称:RedisDesktopManager,代码行数:14,代码来源:main.cpp

示例13: main

int main (int argc, char **argv)
{
    QApplication a(argc, argv);

    MainWin w;

#if QT_VERSION < 0x040000
    a.setMainWidget(&w);
#endif
    w.resize(300,600);
    w.show();

    return a.exec();
}
开发者ID:376473984,项目名称:pvb,代码行数:14,代码来源:curvdemo1.cpp

示例14: main

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

    MainWin mainWin;
    
    cout << "MothDB" << endl;   

    if(mainWin.init() != 0)
    {
        app.exit();
    }
    else
    {    
        mainWin.showWidgets();
        mainWin.show(); 
        return app.exec();
    }
}
开发者ID:mejwaller,项目名称:MothDB,代码行数:19,代码来源:main.cpp

示例15: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	int ret = FALSE;
	WSADATA wsad;

	ret = WSAStartup(MAKEWORD(2, 2), &wsad);
	if (ret != 0) {
		OutputDebugString(_T("WSAStartup failed!\n"));
		return FALSE;
	}

	GdiplusStartupInput	gdiplusStartupInput;
	ULONG_PTR			gdiplusToken;
	GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	MWinMgr::Init(hInstance);
	MWinMgr* mgr = MWinMgr::GetInstance();

	MainWin* mainWin = new MainWin();
	if (mainWin->Create(NULL)) {
		mainWin->Show(nCmdShow);
		mainWin->Update();

		mgr->LoadAccelerators(IDC_NBKSHELL);
		ret = mgr->MainLoop();
	}

	delete mainWin;
	mgr->Quit();

	GdiplusShutdown(gdiplusToken);
	WSACleanup();

	return ret;
}
开发者ID:github188,项目名称:homebrew,代码行数:41,代码来源:AppMain.cpp


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