[NEW_FEATURE] Snapshot feature.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1221 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-04-13 20:56:20 +00:00
parent 4c49b023ca
commit e8b76a28ec
4 changed files with 42 additions and 5 deletions

View File

@ -1050,6 +1050,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return (LRESULT)_scintillaCtrls4Plugins.getScintillaEditViewFrom((HWND)lParam);
}
case NPPM_INTERNAL_ENABLESNAPSHOT:
{
launchDocumentBackupTask();
return TRUE;
}
case NPPM_DESTROYSCINTILLAHANDLE :
{
return _scintillaCtrls4Plugins.destroyScintilla((HWND)lParam);

View File

@ -2732,10 +2732,11 @@ BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
_pFRDlg->processFindNext(str2Search.c_str(), &fo, &findStatus);
setFindStatus(findStatus);
}
return TRUE;
case EN_KILLFOCUS :
case EN_SETFOCUS :
break;
return TRUE;
case EN_KILLFOCUS :
case EN_SETFOCUS :
break;
}
}
return TRUE;

View File

@ -2216,6 +2216,15 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
case IDC_BACKUPDIR_RESTORESESSION_EDIT:
{
const int stringSize = 16;
TCHAR str[stringSize];
::GetDlgItemText(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, str, stringSize);
if (lstrcmp(str, TEXT("")) == 0)
return TRUE;
nppGUI._snapshotBackupTiming = ::GetDlgItemInt(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, NULL, FALSE) * 1000;
if (!nppGUI._snapshotBackupTiming)
{
@ -2226,6 +2235,25 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
}
}
}
else if (HIWORD(wParam) == EN_KILLFOCUS)
{
switch (LOWORD(wParam))
{
case IDC_BACKUPDIR_RESTORESESSION_EDIT:
{
//printStr(TEXT(""));
const int stringSize = 16;
TCHAR str[stringSize];
::GetDlgItemText(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, str, stringSize);
if (lstrcmp(str, TEXT("")) == 0)
{
::SetDlgItemInt(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, nppGUI._snapshotBackupTiming/1000, FALSE);
}
}
}
}
switch (wParam)
{
@ -2237,6 +2265,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
if (nppGUI._isSnapshotMode)
{
// Launch thread
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_ENABLESNAPSHOT, 0, 0);
}
return TRUE;
}

View File

@ -394,7 +394,7 @@
#define NPPM_INTERNAL_RECENTFILELIST_UPDATE (NOTEPADPLUS_USER_INTERNAL + 35)
#define NPPM_INTERNAL_RECENTFILELIST_SWITCH (NOTEPADPLUS_USER_INTERNAL + 36)
#define NPPM_INTERNAL_GETSCINTEDTVIEW (NOTEPADPLUS_USER_INTERNAL + 37)
//#define NPPM_INTERNAL_SETDOCMAPCHECK (NOTEPADPLUS_USER_INTERNAL + 38)
#define NPPM_INTERNAL_ENABLESNAPSHOT (NOTEPADPLUS_USER_INTERNAL + 38)
//wParam: 0
//lParam: document new index