void CEzShortcutDlg::OnBnClickedButtonEdit() { int nCursel = m_listboxShortCutInfo.GetCurSel(); if(nCursel < 0) { AfxMessageBox(_T("You are not select Shortcut.")); return; } CString strShortCutName; m_listboxShortCutInfo.GetText(nCursel, strShortCutName); SHORTCUT_INFO* pShortCutInfo = GetShortCutInfo(strShortCutName.GetBuffer()); if( NULL == pShortCutInfo) { AfxMessageBox(_T("Not find shortcut Information")); return; } if( false == OnEditShortcutDlg( *pShortCutInfo ) ) { return; } if( _tcsicmp(strShortCutName.GetBuffer(), pShortCutInfo->m_strShortcutName.c_str()) != 0 ) { AddShortCutInfo(*pShortCutInfo); RemoveShortCutInfo(strShortCutName.GetBuffer()); RebuildShortcutList(); } OnLbnSelchangeListShortcut(); AutoSave(); }
// Hard 버튼 클릭 이벤트 void CRankDlg::OnBnClickedButtonHard() { AutoSave () ; rankName =_T ("C:\\image\\HardRanking.txt") ; rankList.DeleteAllItems () ; AutoLoad () ; }
/** * Évènement - Active/Désactive les listes permettant une lecture de musique sans donner de paramètre à l'application */ void PreferenceDefaut::Defaut_CheckBoxReprise(wxCommandEvent &event) { if (event.IsChecked()) { m_choix->Enable(true); if (m_choix->GetSelection() == MP3)//m_listeM3u_mp3 == MP3) { m_listeReprise->Enable(false); m_boiteCheminChansonRep->Enable(true); m_boutonRecherche->Enable(true); } else if (/*m_listeM3u_mp3 */m_choix->GetSelection() == M3U) { m_listeReprise->Enable(true); m_boiteCheminChansonRep->Enable(false); m_boutonRecherche->Enable(false); } } else { m_choix->Enable(false); m_listeReprise->Enable(false); m_boiteCheminChansonRep->Enable(false); m_boutonRecherche->Enable(false); } AutoSave(); }
// Easy 버튼 클릭 이벤트 void CRankDlg::OnBnClickedButtonEasy() { AutoSave () ; // 이전 목록은 저장 rankName =_T ("C:\\image\\EasyRanking.txt") ; // 파일명 정의 rankList.DeleteAllItems () ; // 목록을 비우고 AutoLoad () ; // 현재 목록 불러오기 }
SubsController::SubsController(agi::Context *context) : context(context) , undo_connection(context->ass->AddUndoManager(&SubsController::OnCommit, this)) , commit_id(0) , saved_commit_id(0) , autosaved_commit_id(0) { autosave_timer_changed(&autosave_timer); OPT_SUB("App/Auto/Save", autosave_timer_changed, &autosave_timer); OPT_SUB("App/Auto/Save Every Seconds", autosave_timer_changed, &autosave_timer); autosave_timer.Bind(wxEVT_TIMER, [=](wxTimerEvent&) { try { auto fn = AutoSave(); if (!fn.empty()) StatusTimeout(wxString::Format(_("File backup saved as \"%s\"."), fn.wstring())); } catch (const agi::Exception& err) { StatusTimeout(to_wx("Exception when attempting to autosave file: " + err.GetMessage())); } catch (...) { StatusTimeout("Unhandled exception when attempting to autosave file."); } }); }
void CMainFrame::OnTimer(UINT nIDEvent) { static int count; switch(nIDEvent) { case 1: { CString dstr, tstr; time_t osBinaryTime; // C run-time time (defined in <time.h>) time( &osBinaryTime ) ; // Get the current time from the ... CTime time3( osBinaryTime ); // operating system. tstr.Format("%02d:%02d:%02d", (int)time3.GetHour(), (int)time3.GetMinute(), (int)time3.GetSecond()); ((CMainFrame*)AfxGetApp()->m_pMainWnd)->m_wndStatusBar .SetPaneText(3, tstr); dstr.Format("%02d/%02d/%02d", (int)time3.GetMonth(), (int)time3.GetDay(), (int)time3.GetYear()); ((CMainFrame*)AfxGetApp()->m_pMainWnd)->m_wndStatusBar .SetPaneText(4, dstr); if(timer_in) timer_in--; if(timer_in == 1) message("Idle"); // Handle autosave lastkeypress++; if(lastkeypress == AUTOSAVETICKS) message("Autosave within 2 seconds ..."); if(lastkeypress == AUTOSAVETICKS + 6) AutoSave(); } break; case 2: //P2N("CMainFrame::OnTimer(UINT nIDEvent=%d)\r\n", nIDEvent); spp.Hide(); KillTimer(nIDEvent); break; } CMDIFrameWnd::OnTimer(nIDEvent); }
void CEzShortcutDlg::OnDropFiles(HDROP hDropInfo) { TCHAR szPathName[MAX_PATH]; // 드롭된 파일의 갯수 int nFiles=DragQueryFile(hDropInfo, 0xFFFFFFFF, szPathName, MAX_PATH); if( nFiles != 1) { AfxMessageBox(_T("This application is not support multi-file drag & drop")); return; } for(int index=0 ; index < nFiles ; index++) { DragQueryFile(hDropInfo, index, szPathName, MAX_PATH); // 파일의 경로 얻어옴 std::wstring strExt = light::get_file_ext(szPathName); if( strExt == _T("lnk" )) { IShellLink *link; IPersistFile *pfile; BSTR szLinkPath; CString szPrePath; TCHAR szBuffer[MAX_PATH]; CString fname = szPathName; if(SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&link))) { link->QueryInterface(IID_IPersistFile, (void **)&pfile); szLinkPath = fname.AllocSysString(); pfile->Load(szLinkPath, STGM_READ); SysFreeString(szLinkPath); link->Resolve(NULL, NULL); link->GetPath(szBuffer, MAX_PATH, NULL, 0); // 리스트 박스나 메세지 박스로 해당 경로 값을 불러온다. (szBuffer) _tcsncpy_s(szPathName , szBuffer, _TRUNCATE); pfile->Release(); link->Release(); } } SHORTCUT_INFO ShortcutInfo(GetSafeHwnd()); ShortcutInfo.m_strShortcutName = light::get_file_name_without_ext(szPathName); ShortcutInfo.m_strProgramPath = szPathName; if( true == OnEditShortcutDlg(ShortcutInfo) ) { AddShortCutInfo(ShortcutInfo); RebuildShortcutList(); AutoSave(); } } DragFinish(hDropInfo); CDialog::OnDropFiles(hDropInfo); }
void MainWindow::on_actionNew_triggered() { if (m_isSomethingChanged) { AutoSave(); } NewFile(); ui->actionSave->setEnabled(false); }
void CEzShortcutDlg::OnBnClickedButtonAdd() { SHORTCUT_INFO ShortcutInfo(GetSafeHwnd()); if( true == OnEditShortcutDlg(ShortcutInfo) ) { AddShortCutInfo(ShortcutInfo); RebuildShortcutList(); AutoSave(); } }
/** * Évènement - Ouvre une fenêtre de navigation pour sélectionner un .mp3 (Il sera lu au lancement de Fu(X)) */ void PreferenceDefaut::Defaut_Bouton_Recherche(wxCommandEvent &WXUNUSED(event)) { int ouvert; wxFileDialog navig(this, _("Choisissez une chanson"), wxStandardPaths::Get().GetDocumentsDir(), m_boiteCheminChansonRep->GetValue(), Parametre::Get()->getExtensionValideMusique(), wxFD_OPEN | wxFD_FILE_MUST_EXIST); ouvert = navig.ShowModal(); m_boiteCheminChansonRep->SetValue( (ouvert == wxID_OK) ? navig.GetPath() : _T("") ); AutoSave(); }
/** * Évènement - Ouvre une fenêtre de navigation pour sélectionner le dossier à ouvrir par défaut */ void PreferenceDefaut::Defaut_Bouton_DossierDefaut(wxCommandEvent &WXUNUSED(event)) { int ouvert; wxDirDialog navig(this, _("Choisissez le répertoire par défaut"), m_boiteCheminDefautRech->GetValue(), wxDD_DEFAULT_STYLE|wxDD_DIR_MUST_EXIST); ouvert = navig.ShowModal(); m_boiteCheminDefautRech->SetValue((ouvert == wxID_OK) ? navig.GetPath() : _T("")); AutoSave(); }
void MainWindow::HandleSave() { if (!AutoSave()) { QMessageBox msgBox; msgBox.setText("Failure on saving changes"); msgBox.exec(); } else { ui->actionSave->setEnabled(false); } }
/** * Évènement - Active/Désactive les listes en fonction du type (MP3 ou M3U) choisi. */ void PreferenceDefaut::Defaut_RadioMP3_M3U(wxCommandEvent &event) { //m_listeM3u_mp3 = event.GetSelection(); if (/*m_listeM3u_mp3 */event.GetSelection() == MP3) { m_listeReprise->Enable(false); m_boiteCheminChansonRep->Enable(true); m_boutonRecherche->Enable(true); } else if (/*m_listeM3u_mp3 */event.GetSelection() == M3U) { m_listeReprise->Enable(true); m_boiteCheminChansonRep->Enable(false); m_boutonRecherche->Enable(false); } AutoSave(); }
void CEzShortcutDlg::OnBnClickedButtonRemove() { int nCursel = m_listboxShortCutInfo.GetCurSel(); if(nCursel < 0) { AfxMessageBox(_T("You are not select Shotcut.")); return; } CString strShortCutName; m_listboxShortCutInfo.GetText(nCursel, strShortCutName); if( false == RemoveShortCutInfo( strShortCutName.GetBuffer() ) ) return; RebuildShortcutList(); InitInputDlg(); AutoSave(); }
/** * Met à jour toutes les listes de la page */ void PreferenceDefaut::MAJListe(bool save) { wxString coul = m_listeCouleur->GetStringSelection(), son = m_listeSon->GetStringSelection(), rep = m_listeReprise->GetStringSelection(); if (m_pageCouleur) { m_listeCouleur->Clear(); m_pageCouleur->MajListe(m_listeCouleur); m_listeCouleur->SetStringSelection(coul); } if (m_pageSon) { m_listeSon->Clear(); m_pageSon->MajListe(m_listeSon); m_listeSon->SetStringSelection(son); } m_listeReprise->Clear(); CreerListe(m_listeReprise); m_listeReprise->SetStringSelection(rep); if (save) AutoSave(); }
void MainWindow::on_actionOpen_triggered() { if (m_isSomethingChanged) { QMessageBox::StandardButton reply; reply = QMessageBox::question(this, "Unsaved changes", "Save?", QMessageBox::Yes|QMessageBox::No); if (reply == QMessageBox::Yes) { AutoSave(); } } if (!Open()) { QMessageBox msgBox; msgBox.setText("Failure on saving changes"); msgBox.exec(); } else { ui->actionSave->setEnabled(false); } }
/** * Évènement - Active/Désactive la liste des filtres sons */ void PreferenceDefaut::Defaut_CheckBoxSon(wxCommandEvent &event) { m_listeSon->Enable(event.IsChecked()); AutoSave(); }
/*** zPrint - <print> editor function * * Prints file(s) or designated area * * Input: * NOARG Print current file * TEXTARG List of files to print * STREAMARG Print designated area * BOXARG Print designated area * LINEARG Print designated area * * Output: * Returns TRUE if the printing has been successful, FALSE otherwise * *************************************************************************/ flagType zPrint ( CMDDATA argData, ARG * pArg, flagType fMeta ) { flagType fOK; /* Holds the return value */ PFILE pFile; /* general file pointer */ /* * The following is used only when we scan a list of files (TEXTARG) */ flagType fNewFile; /* Did we open a new file ? */ buffer pNameList; /* Holds the list of file names */ char *pName, *pEndName; /* Begining and end of file names */ flagType fDone = FALSE; /* Did we finish with the list ? */ /* * If we can flush the files, that's the moment */ AutoSave (); switch (pArg->argType) { case NOARG: return (DoPrint (pFileHead, FALSE)); case TEXTARG: /* * Get the list in a buffer */ strcpy ((char *) pNameList, pArg->arg.textarg.pText); /* * Empty list = no work */ if (!*(pName = whiteskip (pNameList))) { return FALSE; } /* * For each name: * - pName points at the begining * - Make pEndName pointing just past its ends * - If it's already the end of the string * then we're done with the list * else put a zero terminator there * - Do the job with the name we've found : * . Get the file handle (if it doen't exist yet, * create one and switch fNewFile on * . Call DoPrint * - Let pName point to the next name */ fOK = TRUE; do { pEndName = whitescan (pName); if (*pEndName) { *pEndName = 0; } else { fDone = TRUE; } if ((pFile = FileNameToHandle (pName, pName)) == NULL) { pFile = AddFile (pName); FileRead (pName, pFile, FALSE); fNewFile = TRUE; } else { fNewFile = FALSE; } fOK &= DoPrint (pFile, FALSE); if (fNewFile) { RemoveFile (pFile); } pName = whiteskip (++pEndName); } while (!fDone && *pName); /* * Just in case we would change the behaviour to stopping all * things at the first error : * * } while (fOK && !fDone && *pName); */ return (fOK); case STREAMARG: case BOXARG: case LINEARG: /* * If we print an area, we'll put the text in a temporary file, * call DoPrint with this file and then destroy it. */ pFile = GetTmpFile (); switch (pArg->argType) { case STREAMARG: CopyStream (pFileHead, pFile, pArg->arg.streamarg.xStart, pArg->arg.streamarg.yStart, pArg->arg.streamarg.xEnd, pArg->arg.streamarg.yEnd, 0L,0L); break; case BOXARG: CopyBox (pFileHead, pFile, pArg->arg.boxarg.xLeft, pArg->arg.boxarg.yTop, pArg->arg.boxarg.xRight, pArg->arg.boxarg.yBottom, 0L,0L); break; case LINEARG: CopyLine (pFileHead, pFile, pArg->arg.linearg.yStart, pArg->arg.linearg.yEnd, 0L); break; } /* * If we have to spawn a print command, then we need to make a real * disk file */ if (pPrintCmd && (!FileWrite (pFile->pName, pFile))) { fOK = FALSE; } else { fOK = DoPrint (pFile, TRUE); } RemoveFile (pFile); return (fOK); } argData; fMeta; }
void PreferenceDefaut::AutoSave(wxCommandEvent &WXUNUSED(event)) { AutoSave(); }
// 창이 닫힐때 데이터를 저장한다 void CRankDlg::OnDestroy() { CDialogEx::OnDestroy(); AutoSave () ; }
void Mapviz::Initialize() { if (!initialized_) { if (is_standalone_) { // If this Mapviz is running as a standalone application, it needs to init // ROS and start spinning. If it's running as an rqt plugin, rqt will // take care of that. ros::init(argc_, argv_, "mapviz", ros::init_options::AnonymousName); spin_timer_.start(30); connect(&spin_timer_, SIGNAL(timeout()), this, SLOT(SpinOnce())); } node_ = new ros::NodeHandle("~"); // Create a sub-menu that lists all available Image Transports image_transport::ImageTransport it(*node_); std::vector<std::string> transports = it.getLoadableTransports(); QActionGroup* group = new QActionGroup(image_transport_menu_); for (std::vector<std::string>::iterator iter = transports.begin(); iter != transports.end(); iter++) { QString transport = QString::fromStdString(*iter).replace( QString::fromStdString(IMAGE_TRANSPORT_PARAM) + "/", ""); QAction* action = image_transport_menu_->addAction(transport); action->setCheckable(true); group->addAction(action); } connect(group, SIGNAL(triggered(QAction*)), this, SLOT(SetImageTransport(QAction*))); tf_ = boost::make_shared<tf::TransformListener>(); tf_manager_ = boost::make_shared<swri_transform_util::TransformManager>(); tf_manager_->Initialize(tf_); loader_ = new pluginlib::ClassLoader<MapvizPlugin>( "mapviz", "mapviz::MapvizPlugin"); std::vector<std::string> plugins = loader_->getDeclaredClasses(); for (unsigned int i = 0; i < plugins.size(); i++) { ROS_INFO("Found mapviz plugin: %s", plugins[i].c_str()); } canvas_->InitializeTf(tf_); canvas_->SetFixedFrame(ui_.fixedframe->currentText().toStdString()); canvas_->SetTargetFrame(ui_.targetframe->currentText().toStdString()); ros::NodeHandle priv("~"); add_display_srv_ = node_->advertiseService("add_mapviz_display", &Mapviz::AddDisplay, this); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QString default_path = QDir::homePath(); if (env.contains(ROS_WORKSPACE_VAR)) { // If the ROS_WORKSPACE environment variable is defined, try to read our // config file out of that. If we can't read it, fall back to trying to // read one from the user's home directory. QString ws_path = env.value(ROS_WORKSPACE_VAR, default_path); if (QFileInfo(ws_path + MAPVIZ_CONFIG_FILE).isReadable()) { default_path = ws_path; } else { ROS_WARN("Could not load config file from ROS_WORKSPACE at %s; trying home directory...", ws_path.toStdString().c_str()); } } default_path += MAPVIZ_CONFIG_FILE; std::string config; priv.param("config", config, default_path.toStdString()); bool auto_save; priv.param("auto_save_backup", auto_save, true); Open(config); UpdateFrames(); frame_timer_.start(1000); connect(&frame_timer_, SIGNAL(timeout()), this, SLOT(UpdateFrames())); if (auto_save) { save_timer_.start(10000); connect(&save_timer_, SIGNAL(timeout()), this, SLOT(AutoSave())); } connect(&record_timer_, SIGNAL(timeout()), this, SLOT(CaptureVideoFrame())); bool print_profile_data; priv.param("print_profile_data", print_profile_data, false); if (print_profile_data) { profile_timer_.start(2000); connect(&profile_timer_, SIGNAL(timeout()), this, SLOT(HandleProfileTimer())); } initialized_ = true; } }
void PDocument::MessageReceived(BMessage* message) { TRACE(); switch(message->what) { case MENU_FILE_SAVE: { if (entryRef == NULL) SavePanel(); else Save(); break; } case MENU_FILE_SAVEAS: { SavePanel(); break; } case MENU_FILE_PRINT: { Print(); break; } case MENU_APP_SETTINGS: ShowSettings(); break; case MENU_MACRO_START_RECORDING: { commandManager->StartMacro(); break; } case MENU_MACRO_STOP_RECORDING: { commandManager->StopMacro(); break; } case P_C_MACRO_TYPE: { commandManager->PlayMacro(message); break; } case B_SAVE_REQUESTED: { message->PrintToStream(); BMessage *saveSettings = new BMessage(); message->FindMessage("saveSettings",saveSettings); entry_ref *ref = new entry_ref; const char* name; message->FindRef("directory",ref); message->FindString("name", &name); SetEntry(ref,name); if (documentSetting->ReplaceMessage("saveSettings",saveSettings) != B_OK) documentSetting->AddMessage("saveSettings",saveSettings); Save(); break; } case B_COPY: { BMessage *copyMessage = new BMessage(P_C_EXECUTE_COMMAND); copyMessage->AddString("Command::Name","Copy"); copyMessage->AddBool("shadow",true); commandManager->Execute(copyMessage); break; } case B_PASTE: { BMessage *pasteMessage = new BMessage(P_C_EXECUTE_COMMAND); pasteMessage->AddString("Command::Name","Paste"); pasteMessage->AddBool("shadow",true); commandManager->Execute(pasteMessage); break; } case B_UNDO: { commandManager->Undo(NULL); break; } case B_REDO: { commandManager->Redo(NULL); break; } case P_C_EXECUTE_COMMAND: { commandManager->Execute(message); break; } case P_C_AUTO_SAVE: { AutoSave(); break; } case P_C_RESTORE_SAVE: { //for the Moment we use autosave ;-) AutoSave(); break; } default: BLooper::MessageReceived(message); break; } }
void MainWindow::on_actionSave_triggered() { AutoSave(); }