// ------------------------------------------------------------------------------------------------------------------------------------------------------- void LogClass::PrepareClass() { GetCurrentDate(&m_Start_SysTime); GetCurrentDate(&m_Prev_SysTime); // ----- m_LogFont.Width = 6; m_LogFont.Height = 15; // ----- sprintf(m_szFolderPath, "LOG\0"); sprintf(m_szFilePath, "LOG_%02d.%02d.%04d[%s].log\0", m_Start_SysTime.wDay, m_Start_SysTime.wMonth, m_Start_SysTime.wYear, SOFT_NAME); // ----- // ----- m_iTextLengthKeep = 0; m_iCurrentLine = 0; m_xPos = 5; // ----- memset(m_LogBuffFile, 0, sizeof(m_LogBuffFile)); memset(m_Log, 0, sizeof(m_Log)); // ----- SetFolderPath("LOG"); // ----- CreateDirectory(m_szFolderPath, NULL); }
BOOL CMainDlg::OnInitDialog() { CDialog::OnInitDialog(); SetFolderPath(); //skin CString sSkinPath; sSkinPath.Format("%s\\skin.bmp",m_sFolderPath); m_hBmp = (HBITMAP)LoadImage(AfxGetInstanceHandle(),sSkinPath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE); m_bFirst = TRUE; //inisialisasi database CString sDBPath; m_pDb = new CADODatabase(); sDBPath.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s\\db\\tts.mdb;Persist Security Info=False",m_sFolderPath); if(m_pDb->Open(sDBPath)) { //inisialiasi backpropagation m_backpro.SetConnDB(m_pDb); //inisialiasi second positioning asymetric windowing m_spaw.SetConnDB(m_pDb); m_spaw.SetBackPro(&m_backpro); m_spaw.Initialize(WINDOWSIZE,CENTERWINDOWPOS,4000,0.01, 0.01,4000); //inisialisasi speech //inisialisai natural language m_NatLang.SetConnDB(m_pDb); m_NatLang.m_sFolderPath = m_sFolderPath; m_NatLang.SetSPAW(&m_spaw); //inisialisasi tiap dialog di memory m_pLearningDlg = new CLearningDlg; m_pLearningDlg->SetSPAW(&m_spaw); m_pLearningDlg->Create( IDD_LEARNING_DIALOG, &m_cMainPanel); m_pLearningDlg->ShowWindow(SW_HIDE); m_pKataDlg = new CKataDlg; m_pKataDlg->SetSPAW(&m_spaw); m_pKataDlg->SetDB(m_pDb); m_pKataDlg->Create( IDD_DATA_KATA, &m_cMainPanel); m_pKataDlg->ShowWindow(SW_HIDE); m_pPengecualianDlg = new CPengecualianDlg; m_pPengecualianDlg->SetDB(m_pDb); m_pPengecualianDlg->Create(IDD_DATA_PENGECUALIAN, &m_cMainPanel); m_pPengecualianDlg->ShowWindow(SW_HIDE); m_pSingkatanDlg = new CSingkatanDlg; m_pSingkatanDlg->SetDB(m_pDb); m_pSingkatanDlg->Create(IDD_DATA_SINGKATAN,&m_cMainPanel); m_pSingkatanDlg->ShowWindow(SW_HIDE); m_pPengucapanDlg = new CNETtalk2Dlg; m_pPengucapanDlg->SetNatLang(&m_NatLang); m_pPengucapanDlg->SetConnDB(m_pDb); m_pPengucapanDlg->Create(IDD_NETTALK2_DIALOG,&m_cMainPanel); m_pPengucapanDlg->ShowWindow(SW_SHOW); m_pPengucapanDlg->m_hLearning = m_pLearningDlg->m_hWnd; m_pPengucapanDlg->m_sFolderpath = m_sFolderPath; SetActiveDialog(m_pPengucapanDlg); SetStyle(); } else { MessageBox("Error dalam membuka database","NETtalk2",MB_OK); EndDialog(0); } SetWindowPos(&CWnd::wndTop,0,0,0,0,SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE); CenterWindow(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
bool FActorFolders::RenameFolderInWorld(UWorld& World, FName OldPath, FName NewPath) { if (OldPath.IsNone() || OldPath == NewPath || PathIsChildOf(NewPath.ToString(), OldPath.ToString())) { return false; } const FScopedTransaction Transaction(LOCTEXT("UndoAction_RenameFolder", "Rename Folder")); const FString OldPathString = OldPath.ToString(); const FString NewPathString = NewPath.ToString(); TSet<FName> RenamedFolders; // Move any folders we currently hold - old ones will be deleted later UEditorActorFolders& FoldersInWorld = GetOrCreateFoldersForWorld(World); FoldersInWorld.Modify(); auto ExistingFoldersCopy = FoldersInWorld.Folders; for (const auto& Pair : ExistingFoldersCopy) { auto Path = Pair.Key; const FString FolderPath = Path.ToString(); if (OldPath == Path || PathIsChildOf(FolderPath, OldPathString)) { const FName NewFolder = OldPathToNewPath(OldPathString, NewPathString, FolderPath); if (!FoldersInWorld.Folders.Contains(NewFolder)) { // Use the existing properties for the folder if we have them if (FActorFolderProps* ExistingProperties = FoldersInWorld.Folders.Find(Path)) { FoldersInWorld.Folders.Add(NewFolder, *ExistingProperties); } else { // Otherwise use default properties FoldersInWorld.Folders.Add(NewFolder); } OnFolderCreate.Broadcast(World, NewFolder); } RenamedFolders.Add(Path); } } // Now that we have folders created, move any actors that ultimately reside in that folder too for (auto ActorIt = FActorIterator(&World); ActorIt; ++ActorIt) { const FName& OldActorPath = ActorIt->GetFolderPath(); AActor* Actor = *ActorIt; if (OldActorPath.IsNone()) { continue; } if (Actor->GetFolderPath() == OldPath || PathIsChildOf(OldActorPath.ToString(), OldPathString)) { RenamedFolders.Add(OldActorPath); ActorIt->SetFolderPath(OldPathToNewPath(OldPathString, NewPathString, OldActorPath.ToString())); } } // Cleanup any old folders for (const auto& Path : RenamedFolders) { FoldersInWorld.Folders.Remove(Path); OnFolderDelete.Broadcast(World, Path); } return RenamedFolders.Num() != 0; }