本文整理汇总了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();
}
示例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();
}
示例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);
}
}
示例4: main
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
MainWin win;
win.show();
return app.exec();
}
示例5: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWin w;
w.show();
return a.exec();
}
示例6: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setStyle("plastique");
MainWin fenetre;
fenetre.show();
return app.exec();
}
示例7: main
int main (int argc, char **argv)
{
QApplication a(argc, argv);
MainWin w;
w.resize(300,600);
w.show();
return a.exec();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例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;
}