本文整理汇总了C++中SyncDocument::sendSaveCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncDocument::sendSaveCommand方法的具体用法?C++ SyncDocument::sendSaveCommand怎么用?C++ SyncDocument::sendSaveCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncDocument
的用法示例。
在下文中一共展示了SyncDocument::sendSaveCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileSaveAs
bool fileSaveAs()
{
wchar_t temp[_MAX_FNAME + 1];
temp[0] = '\0';
OPENFILENAMEW ofn;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile = temp;
ofn.nMaxFile = _MAX_FNAME;
ofn.lpstrDefExt = L"rocket";
ofn.lpstrFilter = L"ROCKET File (*.rocket)\0*.rocket\0All Files (*.*)\0*.*\0\0";
ofn.Flags = OFN_SHOWHELP | OFN_OVERWRITEPROMPT;
if (GetSaveFileNameW(&ofn)) {
if (document.save(temp)) {
document.sendSaveCommand();
setWindowFileName(temp);
fileName = temp;
mruFileList.insert(temp);
mruFileList.update();
DrawMenuBar(hwnd);
return true;
} else
error("Failed to save file");
}
return false;
}
示例2: fileSave
bool fileSave()
{
if (fileName.empty())
return fileSaveAs();
if (!document.save(fileName.c_str())) {
document.sendSaveCommand();
error("Failed to save file");
return false;
}
return true;
}
示例3: DefWindowProcW
static LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
trackViewWin = trackView->create(hInst, hwnd);
InitCommonControls();
statusBarWin = createStatusBar(hInst, hwnd);
if (ERROR_SUCCESS != RegOpenKey(HKEY_CURRENT_USER, keyName, ®ConfigKey))
{
if (ERROR_SUCCESS != RegCreateKey(HKEY_CURRENT_USER, keyName, ®ConfigKey))
die("failed to create registry key");
}
/* Recent Files menu */
mruFileList = RecentFiles(findSubMenuContaining(GetMenu(hwnd), ID_RECENTFILES_NORECENTFILES));
mruFileList.load(regConfigKey);
}
break;
case WM_CLOSE:
attemptQuit();
break;
case WM_DESTROY:
mruFileList.save(regConfigKey);
RegCloseKey(regConfigKey);
regConfigKey = NULL;
PostQuitMessage(0);
break;
case WM_SIZE:
{
int width = LOWORD(lParam);
int height = HIWORD(lParam);
RECT statusBarRect;
GetClientRect(statusBarWin, &statusBarRect);
int statusBarHeight = statusBarRect.bottom - statusBarRect.top;
MoveWindow(trackViewWin, 0, 0, width, height - statusBarHeight, TRUE);
MoveWindow(statusBarWin, 0, height - statusBarHeight, width, statusBarHeight, TRUE);
}
break;
case WM_SETFOCUS:
SetFocus(trackViewWin); // needed to forward keyboard input
break;
case WM_SETROWS:
trackView->setRows(int(lParam));
break;
case WM_BIASSELECTION:
trackView->editBiasValue(float(lParam));
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_FILE_NEW:
fileNew();
InvalidateRect(trackViewWin, NULL, FALSE);
break;
case ID_FILE_OPEN:
fileOpen();
break;
case ID_FILE_SAVE_AS:
fileSaveAs();
break;
case ID_FILE_SAVE:
fileSave();
break;
case ID_EDIT_SELECTALL:
trackView->selectAll();
break;
case ID_EDIT_SELECTTRACK:
trackView->selectTrack(trackView->getEditTrack());
break;
case ID_EDIT_SELECTROW:
trackView->selectRow(trackView->getEditRow());
break;
case ID_FILE_REMOTEEXPORT:
document.sendSaveCommand();
break;
case ID_RECENTFILES_FILE1:
case ID_RECENTFILES_FILE2:
case ID_RECENTFILES_FILE3:
case ID_RECENTFILES_FILE4:
case ID_RECENTFILES_FILE5:
//.........这里部分代码省略.........