[NEW_FEATURE] Add "Remove Unmarked Lines" command.

[NEW] Add "Column Mode Tip" to notice users the usage of column mode in Notepad++.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@737 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2011-02-19 15:06:53 +00:00
parent 211998c115
commit f5fa3cc1dd
5 changed files with 29 additions and 10 deletions

View File

@ -1578,14 +1578,14 @@ void Notepad_plus::cutMarkedLines()
str2Cliboard(globalStr.c_str());
}
void Notepad_plus::deleteMarkedLines()
void Notepad_plus::deleteMarkedLines(bool isMarked)
{
int lastLine = _pEditView->lastZeroBasedLineNumber();
_pEditView->execute(SCI_BEGINUNDOACTION);
for (int i = lastLine ; i >= 0 ; i--)
{
if (bookmarkPresent(i))
if (bookmarkPresent(i) == isMarked)
deleteMarkedline(i);
}
_pEditView->execute(SCI_ENDUNDOACTION);

View File

@ -514,7 +514,7 @@ private:
void copyMarkedLines();
void cutMarkedLines();
void deleteMarkedLines();
void deleteMarkedLines(bool isMarked);
void pasteToMarkedLines();
void deleteMarkedline(int ln);
void inverseMarks();

View File

@ -264,7 +264,8 @@ BEGIN
MENUITEM "Space to TAB", IDM_EDIT_SW2TAB
END
MENUITEM SEPARATOR
MENUITEM "Column Editor...", IDM_EDIT_COLUMNMODE
MENUITEM "Column Mode...", IDM_EDIT_COLUMNMODETIP
MENUITEM "Column Editor...", IDM_EDIT_COLUMNMODE
MENUITEM SEPARATOR
MENUITEM "Set Read-Only", IDM_EDIT_SETREADONLY
MENUITEM "Clear Read-Only Flag", IDM_EDIT_CLEARREADONLY
@ -335,7 +336,8 @@ BEGIN
MENUITEM "Cut Bookmarked Lines", IDM_SEARCH_CUTMARKEDLINES
MENUITEM "Copy Bookmarked Lines", IDM_SEARCH_COPYMARKEDLINES
MENUITEM "Paste to (Replace) Bookmarked Lines", IDM_SEARCH_PASTEMARKEDLINES
MENUITEM "Delete Bookmarked Lines", IDM_SEARCH_DELETEMARKEDLINES
MENUITEM "Remove Bookmarked Lines", IDM_SEARCH_DELETEMARKEDLINES
MENUITEM "Remove Unmarked Lines", IDM_SEARCH_DELETEUNMARKEDLINES
MENUITEM "Inverse Bookmark", IDM_SEARCH_INVERSEMARKS
END
END

View File

@ -457,6 +457,16 @@ void Notepad_plus::command(int id)
break;
}
case IDM_EDIT_COLUMNMODETIP :
{
_nativeLangSpeaker.messageBox("ColumnModeTip",
_pPublicInterface->getHSelf(),
TEXT("Column Mode Tip"),
TEXT("Please use \"ALT+Mouse Selection\" or \"Alt+Shift+Arrow key\" to switch to column mode."),
MB_OK|MB_APPLMODAL);
break;
}
case IDM_EDIT_COLUMNMODE :
{
bool isFirstTime = !_colEditorDlg.isCreated();
@ -701,7 +711,11 @@ void Notepad_plus::command(int id)
break;
case IDM_SEARCH_DELETEMARKEDLINES :
deleteMarkedLines();
deleteMarkedLines(true);
break;
case IDM_SEARCH_DELETEUNMARKEDLINES :
deleteMarkedLines(false);
break;
case IDM_SEARCH_INVERSEMARKS :
@ -2200,9 +2214,10 @@ void Notepad_plus::command(int id)
case IDM_SEARCH_VOLATILE_FINDNEXT:
case IDM_SEARCH_VOLATILE_FINDPREV:
case IDM_SEARCH_CUTMARKEDLINES :
case IDM_SEARCH_COPYMARKEDLINES :
case IDM_SEARCH_PASTEMARKEDLINES :
case IDM_SEARCH_DELETEMARKEDLINES:
case IDM_SEARCH_COPYMARKEDLINES :
case IDM_SEARCH_PASTEMARKEDLINES :
case IDM_SEARCH_DELETEMARKEDLINES :
case IDM_SEARCH_DELETEUNMARKEDLINES :
case IDM_SEARCH_MARKALLEXT1 :
case IDM_SEARCH_UNMARKALLEXT1 :
case IDM_SEARCH_MARKALLEXT2 :

View File

@ -98,6 +98,7 @@
#define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34)
#define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35)
#define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36)
#define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37)
#define IDM_EDIT_AUTOCOMPLETE (50000 + 0)
#define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1)
@ -159,7 +160,8 @@
#define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48)
#define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49)
#define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50)
#define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50)
#define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51)
#define IDM_VIEW (IDM + 4000)
//#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)