Add "Search on Internet" for selected words as build-in command
Update translation for French, Chinese and English.pull/2225/head
parent
863c4e90c1
commit
e451efbd29
|
@ -31,6 +31,7 @@
|
|||
<Item subMenuId="edit-eolConversion" name="換行格式"/>
|
||||
<Item subMenuId="edit-blankOperations" name="空格處理"/>
|
||||
<Item subMenuId="edit-pasteSpecial" name="特殊貼上"/>
|
||||
<Item subMenuId="edit-onSelection" name="選取字元"/>
|
||||
<Item subMenuId="search-markAll" name="全部標記"/>
|
||||
<Item subMenuId="search-unmarkAll" name="去除標記"/>
|
||||
<Item subMenuId="search-jumpUp" name="上個標記"/>
|
||||
|
@ -113,6 +114,10 @@
|
|||
<Item id="42070" name="句子第一字母大寫"/>
|
||||
<Item id="42071" name="大小寫互換"/>
|
||||
<Item id="42072" name="隨機大小寫"/>
|
||||
<Item id="42073" name="開啟檔案"/>
|
||||
<Item id="42074" name="開啟此資料夾於檔案總管"/>
|
||||
<Item id="42075" name="上網搜尋"/>
|
||||
<Item id="42076" name="更改搜索引擎..."/>
|
||||
<Item id="42018" name="開始錄製巨集"/>
|
||||
<Item id="42019" name="停止錄製巨集"/>
|
||||
<Item id="42021" name="播放巨集(&P)"/>
|
||||
|
@ -806,6 +811,17 @@
|
|||
<!--Item id="6261" name="Please restart Notepad++ to take effect."/-->
|
||||
</Cloud>
|
||||
|
||||
<SearchEngine title="搜索引擎">
|
||||
<Item id="6271" name="搜索引擎(對於『上網搜尋』選單指令)"/>
|
||||
<Item id="6272" name="DuckDuckGo"/>
|
||||
<Item id="6273" name="Google"/>
|
||||
<Item id="6274" name="Bing"/>
|
||||
<Item id="6275" name="雅虎"/>
|
||||
<Item id="6276" name="設定你的搜索引擎:"/>
|
||||
<!-- Don't change anything after Example: -->
|
||||
<Item id="6278" name="範例: https://www.google.com/search?q=$(CURRENT_WORD)"/>
|
||||
</SearchEngine>
|
||||
|
||||
<MISC title="其他">
|
||||
<Item id="6307" name="啟用"/>
|
||||
<Item id="6308" name="最小化至系統匣"/>
|
||||
|
@ -879,6 +895,7 @@
|
|||
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
|
||||
<NbFileToOpenImportantWarning title="檔案開啟數量過多" message="$INT_REPLACE$ 檔案將開啟。\r確定要開啟它們?"/>
|
||||
<SettingsOnCloudError title="雲端設定" message="雲端路徑似乎設成唯讀磁碟,或是資料夾需要寫入權限。\r您的雲端設定將被取消。\r請在「喜好設定」對話框重設相關設定值。"/>
|
||||
<FilePathNotFoundWarning title="開啟檔案" message="你試圖開啟的文件不存在。"/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="剪貼簿記錄"/>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<Item subMenuId="edit-eolConversion" name="EOL Conversion"/>
|
||||
<Item subMenuId="edit-blankOperations" name="Blank Operations"/>
|
||||
<Item subMenuId="edit-pasteSpecial" name="Paste Special"/>
|
||||
<Item subMenuId="edit-onSelection" name="On Selection"/>
|
||||
<Item subMenuId="search-markAll" name="Mark All"/>
|
||||
<Item subMenuId="search-unmarkAll" name="Unmark All"/>
|
||||
<Item subMenuId="search-jumpUp" name="Jump Up"/>
|
||||
|
@ -120,6 +121,10 @@
|
|||
<Item id="42070" name="Sentence case (blend)"/>
|
||||
<Item id="42071" name="iNVERT cASE"/>
|
||||
<Item id="42072" name="ranDOm CasE"/>
|
||||
<Item id="42073" name="Open File"/>
|
||||
<Item id="42074" name="Open Containing Folder in Explorer"/>
|
||||
<Item id="42075" name="Search on Internet"/>
|
||||
<Item id="42076" name="Change Search Engine..."/>
|
||||
<Item id="42018" name="&Start Recording"/>
|
||||
<Item id="42019" name="&Stop Recording"/>
|
||||
<Item id="42021" name="&Playback"/>
|
||||
|
@ -808,12 +813,22 @@
|
|||
<Item id="6256" name="Allow on several lines"/>
|
||||
</Delimiter>
|
||||
|
||||
<Cloud title="Cloud">
|
||||
<Cloud title="Cloud">
|
||||
<Item id="6262" name="Settings on cloud"/>
|
||||
<Item id="6263" name="No Cloud"/>
|
||||
<Item id="6267" name="Set your cloud location path here:"/>
|
||||
<!--Item id="6261" name="Please restart Notepad++ to take effect."/-->
|
||||
</Cloud>
|
||||
|
||||
<SearchEngine title="Search Engine">
|
||||
<Item id="6271" name="Search Engine (for command "Search on Internet")"/>
|
||||
<Item id="6272" name="DuckDuckGo"/>
|
||||
<Item id="6273" name="Google"/>
|
||||
<Item id="6274" name="Bing"/>
|
||||
<Item id="6275" name="Yahoo!"/>
|
||||
<Item id="6276" name="Set your search engine here:"/>
|
||||
<!-- Don't change anything after Example: -->
|
||||
<Item id="6278" name="Example: https://www.google.com/search?q=$(CURRENT_WORD)"/>
|
||||
</SearchEngine>
|
||||
|
||||
<MISC title="MISC.">
|
||||
<Item id="6307" name="Enable"/>
|
||||
|
@ -888,6 +903,7 @@
|
|||
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
|
||||
<NbFileToOpenImportantWarning title="Amount of files to open is too large" message="$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?"/>
|
||||
<SettingsOnCloudError title="Settings on Cloud" message="It seems the path of settings on cloud is set on a read only drive,\ror on a folder needed privilege right for writting access.\rYour settings on cloud will be canceled. Please reset a coherent value via Preference dialog."/>
|
||||
<FilePathNotFoundWarning title="File Open" message="The file you're trying to open doesn't exist."/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="Clipboard History"/>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<Item subMenuId="edit-eolConversion" name="Convertir les sauts de ligne"/>
|
||||
<Item subMenuId="edit-blankOperations" name="Traitement des espacements"/>
|
||||
<Item subMenuId="edit-pasteSpecial" name="Collage spécial"/>
|
||||
<Item subMenuId="edit-onSelection" name="Sur la Selection"/>
|
||||
<Item subMenuId="search-markAll" name="Marquer tout"/>
|
||||
<Item subMenuId="search-unmarkAll" name="Enlever toutes les marques"/>
|
||||
<Item subMenuId="search-jumpUp" name="Aller vers le haut"/>
|
||||
|
@ -114,6 +115,10 @@
|
|||
<Item id="42070" name="Majuscule en début de phrase (moins strict)"/>
|
||||
<Item id="42071" name="à L'ENVERS"/>
|
||||
<Item id="42072" name="ALÉATOiRe"/>
|
||||
<Item id="42073" name="Ouverture du Fichier"/>
|
||||
<Item id="42074" name="Ouvrir le répertoire dans Explorer"/>
|
||||
<Item id="42075" name="Rechercher sur Internet"/>
|
||||
<Item id="42076" name="Changer le Moteur de Recherche..."/>
|
||||
<Item id="42018" name="Démarrer l’enregistrement"/>
|
||||
<Item id="42019" name="Arrêter l’enregistrement"/>
|
||||
<Item id="42021" name="Rejouer la macro"/>
|
||||
|
@ -794,6 +799,17 @@
|
|||
<!--Item id="6261" name="Please restart Notepad++ to take effect."/-->
|
||||
</Cloud>
|
||||
|
||||
<SearchEngine title="Moteur de Recherche">
|
||||
<Item id="6271" name="Moteur de Recherche (Pour la commande "Rechercher sur Internet")"/>
|
||||
<Item id="6272" name="DuckDuckGo"/>
|
||||
<Item id="6273" name="Google"/>
|
||||
<Item id="6274" name="Bing"/>
|
||||
<Item id="6275" name="Yahoo!"/>
|
||||
<Item id="6276" name="Votre Moteur de Recherche :"/>
|
||||
<!-- Don't change anything after Example: -->
|
||||
<Item id="6278" name="Exemple: https://www.google.com/search?q=$(CURRENT_WORD)"/>
|
||||
</SearchEngine>
|
||||
|
||||
<MISC title="Divers">
|
||||
<Item id="6114" name="Activer"/>
|
||||
<Item id="6115" name="Indentation automatique"/>
|
||||
|
@ -868,6 +884,7 @@
|
|||
<NbFileToOpenImportantWarning title="Quantité de fichiers à ouvrir est trop grande." message="$INT_REPLACE$ fichiers sont sur le point d'être ouverts. Êtes-vous sûr de les ouvrir ?"/>
|
||||
<NppHelpAbsentWarning title="Le fichier n'existe pas" message=" n'existe pas. Veuillez le télécharger sur le site de Notepad++."/>
|
||||
<SaveCurrentModifWarning title="Sauvegarder la modification en cours" message="Vous devez enregistrer la modification en cours. Toutes les modifications enregistrées ne peuvent pas être annulées. Continuer ?"/>
|
||||
<FilePathNotFoundWarning title="Ouvrier" message="Le fichier que vous essayez d'ouvrir n'existe pas."/>
|
||||
</MessageBox>
|
||||
<ClipboardHistory>
|
||||
<PanelTitle name="Historique du presse-papiers"/>
|
||||
|
|
|
@ -202,7 +202,7 @@ Notepad_plus::~Notepad_plus()
|
|||
LRESULT Notepad_plus::init(HWND hwnd)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
|
||||
// Menu
|
||||
_mainMenuHandle = ::GetMenu(hwnd);
|
||||
|
@ -750,7 +750,7 @@ void Notepad_plus::killAllChildren()
|
|||
|
||||
bool Notepad_plus::saveGUIParams()
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)(NppParameters::getInstance())->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
nppGUI._toolbarShow = _rebarTop.getIDVisible(REBAR_BAR_TOOLBAR);
|
||||
nppGUI._toolBarStatus = _toolBar.getState();
|
||||
|
||||
|
@ -818,7 +818,7 @@ bool Notepad_plus::saveFileBrowserParam()
|
|||
|
||||
void Notepad_plus::saveDockingParams()
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)(NppParameters::getInstance())->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
|
||||
// Save the docking information
|
||||
nppGUI._dockingData._leftWidth = _dockingManager.getDockedContSize(CONT_LEFT);
|
||||
|
@ -4360,7 +4360,7 @@ bool Notepad_plus::goToPreviousIndicator(int indicID2Search, bool isWrap) const
|
|||
// found
|
||||
if (_pEditView->execute(SCI_INDICATORVALUEAT, indicID2Search, posStart))
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
nppGUI._disableSmartHiliteTmp = true;
|
||||
|
||||
auto currentline = _pEditView->execute(SCI_LINEFROMPOSITION, posEnd);
|
||||
|
@ -4413,7 +4413,7 @@ bool Notepad_plus::goToNextIndicator(int indicID2Search, bool isWrap) const
|
|||
// found
|
||||
if (_pEditView->execute(SCI_INDICATORVALUEAT, indicID2Search, posStart))
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
nppGUI._disableSmartHiliteTmp = true;
|
||||
|
||||
auto currentline = _pEditView->execute(SCI_LINEFROMPOSITION, posEnd);
|
||||
|
|
|
@ -349,11 +349,11 @@ BEGIN
|
|||
END
|
||||
POPUP "On Selection"
|
||||
BEGIN
|
||||
MENUITEM "Open as file", IDM_EDIT_OPENASFILE
|
||||
MENUITEM "Open in folder", IDM_EDIT_OPENINFOLDER
|
||||
//MENUITEM SEPARATOR
|
||||
//MENUITEM "Search on Internet", IDM_EDIT_SEARCHONINTERNET
|
||||
//MENUITEM "Change Search Engin...", IDM_EDIT_CHANGESEARCHENGIN
|
||||
MENUITEM "Open File", IDM_EDIT_OPENASFILE
|
||||
MENUITEM "Open Containing Folder in Explorer", IDM_EDIT_OPENINFOLDER
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Search on Internet", IDM_EDIT_SEARCHONINTERNET
|
||||
MENUITEM "Change Search Engine...", IDM_EDIT_CHANGESEARCHENGINE
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Column Mode...", IDM_EDIT_COLUMNMODETIP
|
||||
|
|
|
@ -94,7 +94,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
|||
}
|
||||
|
||||
NppParameters *pNppParams = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParams->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParams->getNppGUI());
|
||||
|
||||
if (cmdLineParams->_isNoPlugin)
|
||||
_notepad_plus_plus_core._pluginsManager.disable();
|
||||
|
|
|
@ -1286,7 +1286,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
|
||||
case NPPM_INTERNAL_SETCARETWIDTH:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
|
||||
if (nppGUI._caretWidth < 4)
|
||||
{
|
||||
|
@ -1339,7 +1339,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
|
||||
case NPPM_INTERNAL_SETCARETBLINKRATE:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
_mainEditView.execute(SCI_SETCARETPERIOD, nppGUI._caretBlinkRate);
|
||||
_subEditView.execute(SCI_SETCARETPERIOD, nppGUI._caretBlinkRate);
|
||||
return TRUE;
|
||||
|
|
|
@ -372,6 +372,7 @@ void Notepad_plus::command(int id)
|
|||
::SendMessage(hwnd, NPPM_GETNPPFULLFILEPATH, CURRENTWORD_MAXLENGTH, reinterpret_cast<LPARAM>(cmd2Exec));
|
||||
}
|
||||
|
||||
// Full file path
|
||||
if (::PathFileExists(curentWord))
|
||||
{
|
||||
generic_string fullFilePath = id == IDM_EDIT_OPENINFOLDER ? TEXT("/select,") : TEXT("");
|
||||
|
@ -383,7 +384,7 @@ void Notepad_plus::command(int id)
|
|||
(id == IDM_EDIT_OPENASFILE && not ::PathIsDirectory(curentWord)))
|
||||
::ShellExecute(hwnd, TEXT("open"), cmd2Exec, fullFilePath.c_str(), TEXT("."), SW_SHOW);
|
||||
}
|
||||
else
|
||||
else // Full file path - need concatenate with current full file path
|
||||
{
|
||||
TCHAR currentDir[CURRENTWORD_MAXLENGTH];
|
||||
::SendMessage(hwnd, NPPM_GETCURRENTDIRECTORY, CURRENTWORD_MAXLENGTH, reinterpret_cast<LPARAM>(currentDir));
|
||||
|
@ -393,9 +394,17 @@ void Notepad_plus::command(int id)
|
|||
fullFilePath += currentDir;
|
||||
fullFilePath += TEXT("\\");
|
||||
fullFilePath += curentWord;
|
||||
if ((id == IDM_EDIT_OPENASFILE &&
|
||||
|
||||
if ((id == IDM_EDIT_OPENASFILE &&
|
||||
(not::PathFileExists(fullFilePath.c_str() + 1) || ::PathIsDirectory(fullFilePath.c_str() + 1))))
|
||||
{
|
||||
_nativeLangSpeaker.messageBox("FilePathNotFoundWarning",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("The file you're trying to open doesn't exist."),
|
||||
TEXT("File Open"),
|
||||
MB_OK | MB_APPLMODAL);
|
||||
return;
|
||||
}
|
||||
fullFilePath += TEXT("\"");
|
||||
::ShellExecute(hwnd, TEXT("open"), cmd2Exec, fullFilePath.c_str(), TEXT("."), SW_SHOW);
|
||||
}
|
||||
|
@ -404,13 +413,48 @@ void Notepad_plus::command(int id)
|
|||
|
||||
case IDM_EDIT_SEARCHONINTERNET:
|
||||
{
|
||||
if (_pEditView->execute(SCI_GETSELECTIONS) != 1) // Multi-Selection || Column mode || no selection
|
||||
return;
|
||||
|
||||
const NppGUI & nppGui = (NppParameters::getInstance())->getNppGUI();
|
||||
generic_string url;
|
||||
if (nppGui._searchEngineChoice == nppGui.se_custom)
|
||||
{
|
||||
if (nppGui._searchEngineCustom.empty())
|
||||
{
|
||||
url = TEXT("https://www.google.com/search?q=$(CURRENT_WORD)");
|
||||
}
|
||||
else
|
||||
{
|
||||
url = nppGui._searchEngineCustom.c_str();
|
||||
}
|
||||
}
|
||||
else if (nppGui._searchEngineChoice == nppGui.se_duckDuckGo)
|
||||
{
|
||||
url = TEXT("https://duckduckgo.com/?q=$(CURRENT_WORD)");
|
||||
}
|
||||
else if (nppGui._searchEngineChoice == nppGui.se_google)
|
||||
{
|
||||
url = TEXT("https://www.google.com/search?q=$(CURRENT_WORD)");
|
||||
}
|
||||
else if (nppGui._searchEngineChoice == nppGui.se_bing)
|
||||
{
|
||||
url = TEXT("https://www.bing.com/search?q=$(CURRENT_WORD)");
|
||||
}
|
||||
else if (nppGui._searchEngineChoice == nppGui.se_yahoo)
|
||||
{
|
||||
url = TEXT("https://search.yahoo.com/search?q=$(CURRENT_WORD)");
|
||||
}
|
||||
|
||||
Command cmd(url.c_str());
|
||||
cmd.run(_pPublicInterface->getHSelf());
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_EDIT_CHANGESEARCHENGIN:
|
||||
case IDM_EDIT_CHANGESEARCHENGINE:
|
||||
{
|
||||
|
||||
command(IDM_SETTING_PREFERECE);
|
||||
_preference.showDialogByName(TEXT("SearchEngine"));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2378,15 +2422,13 @@ void Notepad_plus::command(int id)
|
|||
|
||||
case IDM_SETTING_EDITCONTEXTMENU :
|
||||
{
|
||||
//if (contion)
|
||||
{
|
||||
generic_string warning, title;
|
||||
_nativeLangSpeaker.messageBox("ContextMenuXmlEditWarning",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("Editing contextMenu.xml allows you to modify your Notepad++ popup context menu on edit zone.\rYou have to restart your Notepad++ to take effect after modifying contextMenu.xml."),
|
||||
TEXT("Editing contextMenu"),
|
||||
MB_OK|MB_APPLMODAL);
|
||||
}
|
||||
generic_string warning, title;
|
||||
_nativeLangSpeaker.messageBox("ContextMenuXmlEditWarning",
|
||||
_pPublicInterface->getHSelf(),
|
||||
TEXT("Editing contextMenu.xml allows you to modify your Notepad++ popup context menu on edit zone.\rYou have to restart your Notepad++ to take effect after modifying contextMenu.xml."),
|
||||
TEXT("Editing contextMenu"),
|
||||
MB_OK|MB_APPLMODAL);
|
||||
|
||||
NppParameters *pNppParams = NppParameters::getInstance();
|
||||
BufferID bufID = doOpen((pNppParams->getContextMenuPath()));
|
||||
switchToFile(bufID);
|
||||
|
@ -2765,7 +2807,7 @@ void Notepad_plus::command(int id)
|
|||
|
||||
case IDM_SYSTRAYPOPUP_NEWDOC:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
|
||||
fileNew();
|
||||
}
|
||||
|
@ -2773,14 +2815,14 @@ void Notepad_plus::command(int id)
|
|||
|
||||
case IDM_SYSTRAYPOPUP_ACTIVATE :
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_SYSTRAYPOPUP_NEW_AND_PASTE:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
|
||||
BufferID bufferID = _pEditView->getCurrentBufferID();
|
||||
Buffer * buf = MainFileManager->getBufferByID(bufferID);
|
||||
|
@ -2794,7 +2836,7 @@ void Notepad_plus::command(int id)
|
|||
|
||||
case IDM_SYSTRAYPOPUP_OPENFILE:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
::ShowWindow(_pPublicInterface->getHSelf(), nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
|
||||
fileOpen();
|
||||
}
|
||||
|
|
|
@ -1297,13 +1297,13 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
|
|||
|
||||
// Disable file autodetection before opening save dialog to prevent use-after-delete bug.
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
ChangeDetect cdBefore = ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection;
|
||||
((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = cdDisabled;
|
||||
ChangeDetect cdBefore = (const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection;
|
||||
(const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection = cdDisabled;
|
||||
|
||||
TCHAR *pfn = fDlg.doSaveDlg();
|
||||
|
||||
// Enable file autodetection again.
|
||||
((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = cdBefore;
|
||||
(const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection = cdBefore;
|
||||
|
||||
if (pfn)
|
||||
{
|
||||
|
|
|
@ -710,7 +710,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||
|
||||
braceMatch();
|
||||
|
||||
NppGUI & nppGui = (NppGUI &)nppParam->getNppGUI();
|
||||
NppGUI & nppGui = const_cast<NppGUI &>(nppParam->getNppGUI());
|
||||
|
||||
if (nppGui._enableTagsMatchHilite)
|
||||
{
|
||||
|
|
|
@ -146,6 +146,10 @@ static const WinMenuKeyDefinition winKeyDefs[] =
|
|||
{VK_SPACE, IDM_EDIT_AUTOCOMPLETE_PATH, true, true, false, nullptr},
|
||||
{VK_RETURN, IDM_EDIT_AUTOCOMPLETE_CURRENTFILE, true, false, false, nullptr},
|
||||
{VK_SPACE, IDM_EDIT_FUNCCALLTIP, true, false, true, nullptr},
|
||||
{VK_NULL, IDM_EDIT_OPENASFILE, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_EDIT_OPENINFOLDER, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_EDIT_SEARCHONINTERNET, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_EDIT_CHANGESEARCHENGINE, false, false, false, nullptr},
|
||||
{VK_R, IDM_EDIT_RTL, true, true, false, nullptr},
|
||||
{VK_L, IDM_EDIT_LTR, true, true, false, nullptr},
|
||||
{VK_NULL, IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING, false, false, false, nullptr},
|
||||
|
@ -329,11 +333,11 @@ static const WinMenuKeyDefinition winKeyDefs[] =
|
|||
|
||||
{VK_NULL, IDM_HOMESWEETHOME, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_PROJECTPAGE, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_ONLINEHELP, false, false, false, nullptr},
|
||||
//{VK_NULL, IDM_ONLINEHELP, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_FORUM, false, false, false, nullptr},
|
||||
{VK_NULL, IDM_PLUGINSHOME, false, false, false, nullptr},
|
||||
{VK_F1, IDM_ABOUT, false, false, false, nullptr},
|
||||
{VK_F1, IDM_HELP, false, false, true, nullptr},
|
||||
//{VK_F1, IDM_HELP, false, false, true, nullptr},
|
||||
|
||||
{VK_TAB, IDC_PREV_DOC, true, false, true, TEXT("Switch to previous document")},
|
||||
{VK_TAB, IDC_NEXT_DOC, true, false, false, TEXT("Switch to next document")},
|
||||
|
@ -454,42 +458,12 @@ static const ScintillaKeyDefinition scintKeyDefs[] =
|
|||
{TEXT("SCI_DELLINERIGHT"), SCI_DELLINERIGHT, true, false, true, VK_DELETE, 0},
|
||||
{TEXT("SCI_LINEDELETE"), SCI_LINEDELETE, true, false, true, VK_L, 0},
|
||||
{TEXT("SCI_LINECUT"), SCI_LINECUT, true, false, false, VK_L, 0},
|
||||
{TEXT("SCI_LINECOPY"), SCI_LINECOPY, true, false, true, VK_T, 0},
|
||||
{TEXT("SCI_LINECOPY"), SCI_LINECOPY, true, false, true, VK_X, 0},
|
||||
{TEXT("SCI_LINETRANSPOSE"), SCI_LINETRANSPOSE, true, false, false, VK_T, 0},
|
||||
{TEXT("SCI_LINEDUPLICATE"), SCI_LINEDUPLICATE, false, false, false, 0, 0},
|
||||
{TEXT("SCI_CANCEL"), SCI_CANCEL, false, false, false, VK_ESCAPE, 0},
|
||||
{TEXT("SCI_SWAPMAINANCHORCARET"), SCI_SWAPMAINANCHORCARET, false, false, false, 0, 0},
|
||||
{TEXT("SCI_ROTATESELECTION"), SCI_ROTATESELECTION, false, false, false, 0, 0}
|
||||
|
||||
// {TEXT("SCI_EMPTYUNDOBUFFER"), SCI_EMPTYUNDOBUFFER, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_TOGGLECARETSTICKY"), SCI_TOGGLECARETSTICKY, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_CALLTIPCANCEL"), SCI_CALLTIPCANCEL, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_SETSAVEPOINT"), SCI_SETSAVEPOINT, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_CLEARDOCUMENTSTYLE"), SCI_CLEARDOCUMENTSTYLE, false, false, false, 0, 0},
|
||||
//
|
||||
//
|
||||
//{TEXT("SCI_CHOOSECARETX"), SCI_CHOOSECARETX, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_AUTOCCOMPLETE"), SCI_AUTOCCOMPLETE, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_AUTOCCANCEL"), SCI_AUTOCCANCEL, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_CLEARREGISTEREDIMAGES"), SCI_CLEARREGISTEREDIMAGES, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_HOMEDISPLAYEXTEND"), SCI_HOMEDISPLAYEXTEND, false, true, true, VK_HOME, 0},
|
||||
// {TEXT("SCI_LINEENDDISPLAYEXTEND"), SCI_LINEENDDISPLAYEXTEND, false, true, true, VK_END, 0},
|
||||
//
|
||||
// {TEXT("SCI_DELWORDRIGHTEND"), SCI_DELWORDRIGHTEND, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_LOWERCASE"), SCI_LOWERCASE, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_UPPERCASE"), SCI_UPPERCASE, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_LOWERCASE"), SCI_LOWERCASE, true, false, false, VK_U, 0},
|
||||
// {TEXT("SCI_UPPERCASE"), SCI_UPPERCASE, true, false, true, VK_U, 0},
|
||||
//
|
||||
// {TEXT("SCI_FORMFEED"), SCI_FORMFEED, true, false, false, VK_L, 0},
|
||||
// {TEXT("SCI_CLEARALLCMDKEYS"), SCI_CLEARALLCMDKEYS, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_STARTRECORD"), SCI_STARTRECORD, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_STOPRECORD"), SCI_STOPRECORD, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_SEARCHANCHOR"), SCI_SEARCHANCHOR, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_TARGETFROMSELECTION"), SCI_TARGETFROMSELECTION, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_STYLERESETDEFAULT"), SCI_STYLERESETDEFAULT, false, false, false, 0, 0},
|
||||
// {TEXT("SCI_STYLECLEARALL"), SCI_STYLECLEARALL, false, false, false, 0, 0},
|
||||
//
|
||||
};
|
||||
|
||||
|
||||
|
@ -2329,7 +2303,7 @@ void NppParameters::feedUserCmds(TiXmlNode *node)
|
|||
childNode = childNode->NextSibling(TEXT("Command")) )
|
||||
{
|
||||
Shortcut sc;
|
||||
if (getShortcuts(childNode, sc))// && sc.isValid())
|
||||
if (getShortcuts(childNode, sc))
|
||||
{
|
||||
TiXmlNode *aNode = childNode->FirstChild();
|
||||
if (aNode)
|
||||
|
@ -2337,9 +2311,8 @@ void NppParameters::feedUserCmds(TiXmlNode *node)
|
|||
const TCHAR *cmdStr = aNode->Value();
|
||||
if (cmdStr)
|
||||
{
|
||||
int cmdID = ID_USER_CMD + int32_t(_userCommands.size());
|
||||
int cmdID = ID_USER_CMD + static_cast<int32_t>(_userCommands.size());
|
||||
UserCommand uc(sc, cmdStr, cmdID);
|
||||
//if (uc.isValid())
|
||||
_userCommands.push_back(uc);
|
||||
}
|
||||
}
|
||||
|
@ -2904,7 +2877,7 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
|||
if (root)
|
||||
{
|
||||
TiXmlNode *sessionNode = root->InsertEndChild(TiXmlElement(TEXT("Session")));
|
||||
(sessionNode->ToElement())->SetAttribute(TEXT("activeView"), static_cast<int>(session._activeView));
|
||||
(sessionNode->ToElement())->SetAttribute(TEXT("activeView"), static_cast<int32_t>(session._activeView));
|
||||
|
||||
struct ViewElem {
|
||||
TiXmlNode *viewNode;
|
||||
|
@ -2922,7 +2895,7 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
|||
|
||||
for (size_t k = 0; k < nbElem ; ++k)
|
||||
{
|
||||
(viewElems[k].viewNode->ToElement())->SetAttribute(TEXT("activeIndex"), static_cast<int>(viewElems[k].activeIndex));
|
||||
(viewElems[k].viewNode->ToElement())->SetAttribute(TEXT("activeIndex"), static_cast<int32_t>(viewElems[k].activeIndex));
|
||||
vector<sessionFileInfo> & viewSessionFiles = *(viewElems[k].viewFiles);
|
||||
|
||||
for (size_t i = 0, len = viewElems[k].viewFiles->size(); i < len ; ++i)
|
||||
|
@ -2939,20 +2912,20 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
|||
(fileNameNode->ToElement())->SetAttribute(TEXT("encoding"), viewSessionFiles[i]._encoding);
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("filename"), viewSessionFiles[i]._fileName.c_str());
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("backupFilePath"), viewSessionFiles[i]._backupFilePath.c_str());
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestamp"), int(viewSessionFiles[i]._originalFileLastModifTimestamp));
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestamp"), static_cast<int32_t>(viewSessionFiles[i]._originalFileLastModifTimestamp));
|
||||
|
||||
for (size_t j = 0, len = viewSessionFiles[i]._marks.size() ; j < len ; ++j)
|
||||
{
|
||||
size_t markLine = viewSessionFiles[i]._marks[j];
|
||||
TiXmlNode *markNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Mark")));
|
||||
markNode->ToElement()->SetAttribute(TEXT("line"), int(markLine));
|
||||
markNode->ToElement()->SetAttribute(TEXT("line"), static_cast<int32_t>(markLine));
|
||||
}
|
||||
|
||||
for (size_t j = 0, len = viewSessionFiles[i]._foldStates.size() ; j < len ; ++j)
|
||||
{
|
||||
size_t foldLine = viewSessionFiles[i]._foldStates[j];
|
||||
TiXmlNode *foldNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Fold")));
|
||||
foldNode->ToElement()->SetAttribute(TEXT("line"), int(foldLine));
|
||||
foldNode->ToElement()->SetAttribute(TEXT("line"), static_cast<int32_t>(foldLine));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3513,7 +3486,7 @@ TiXmlNode * NppParameters::getChildElementByAttribut(TiXmlNode *pere, const TCHA
|
|||
// 2 restes : L_H, L_USER
|
||||
LangType NppParameters::getLangIDFromStr(const TCHAR *langName)
|
||||
{
|
||||
int lang = static_cast<int>(L_TEXT);
|
||||
int lang = static_cast<int32_t>(L_TEXT);
|
||||
for(; lang < L_EXTERNAL; ++lang)
|
||||
{
|
||||
const TCHAR * name = ScintillaEditView::langNames[lang].lexerName;
|
||||
|
@ -4502,7 +4475,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
|||
{
|
||||
int i;
|
||||
if (element->Attribute(TEXT("autoCAction"), &i))
|
||||
_nppGUI._autocStatus = (NppGUI::AutocStatus)i;
|
||||
_nppGUI._autocStatus = static_cast<NppGUI::AutocStatus>(i);
|
||||
|
||||
if (element->Attribute(TEXT("triggerFromNbChar"), &i))
|
||||
_nppGUI._autocFromLen = i;
|
||||
|
@ -4660,6 +4633,16 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
|||
val = 0;
|
||||
_nppGUI._multiInstSetting = (MultiInstSetting)val;
|
||||
}
|
||||
else if (!lstrcmp(nm, TEXT("searchEngine")))
|
||||
{
|
||||
int i;
|
||||
if (element->Attribute(TEXT("searchEngineChoice"), &i))
|
||||
_nppGUI._searchEngineChoice = static_cast<NppGUI::SearchEngineChoice>(i);
|
||||
|
||||
const TCHAR * searchEngineCustom = element->Attribute(TEXT("searchEngineCustom"));
|
||||
if (searchEngineCustom && searchEngineCustom[0])
|
||||
_nppGUI._searchEngineCustom = searchEngineCustom;
|
||||
}
|
||||
else if (!lstrcmp(nm, TEXT("MISC")))
|
||||
{
|
||||
const TCHAR * optName = element->Attribute(TEXT("fileSwitcherWithoutExtColumn"));
|
||||
|
@ -5049,6 +5032,7 @@ bool NppParameters::writeGUIParams()
|
|||
bool delimiterSelectionExist = false;
|
||||
bool multiInstExist = false;
|
||||
bool miscExist = false;
|
||||
bool searchEngineExist = false;
|
||||
|
||||
TiXmlNode *dockingParamNode = NULL;
|
||||
|
||||
|
@ -5292,7 +5276,7 @@ bool NppParameters::writeGUIParams()
|
|||
}
|
||||
else if (!lstrcmp(nm, TEXT("NewDocDefaultSettings")))
|
||||
{
|
||||
element->SetAttribute(TEXT("format"), static_cast<int>(_nppGUI._newDocDefaultSettings._format));
|
||||
element->SetAttribute(TEXT("format"), static_cast<int32_t>(_nppGUI._newDocDefaultSettings._format));
|
||||
element->SetAttribute(TEXT("encoding"), _nppGUI._newDocDefaultSettings._unicodeMode);
|
||||
element->SetAttribute(TEXT("lang"), _nppGUI._newDocDefaultSettings._lang);
|
||||
element->SetAttribute(TEXT("codepage"), _nppGUI._newDocDefaultSettings._codepage);
|
||||
|
@ -5317,7 +5301,7 @@ bool NppParameters::writeGUIParams()
|
|||
element->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str());
|
||||
|
||||
element->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode && _nppGUI._rememberLastSession?TEXT("yes"):TEXT("no"));
|
||||
element->SetAttribute(TEXT("snapshotBackupTiming"), int32_t(_nppGUI._snapshotBackupTiming));
|
||||
element->SetAttribute(TEXT("snapshotBackupTiming"), static_cast<int32_t>(_nppGUI._snapshotBackupTiming));
|
||||
backExist = true;
|
||||
}
|
||||
else if (!lstrcmp(nm, TEXT("MRU")))
|
||||
|
@ -5378,7 +5362,7 @@ bool NppParameters::writeGUIParams()
|
|||
{
|
||||
autocExist = true;
|
||||
element->SetAttribute(TEXT("autoCAction"), _nppGUI._autocStatus);
|
||||
element->SetAttribute(TEXT("triggerFromNbChar"), int32_t(_nppGUI._autocFromLen));
|
||||
element->SetAttribute(TEXT("triggerFromNbChar"), static_cast<int32_t>(_nppGUI._autocFromLen));
|
||||
const TCHAR * pStr = _nppGUI._funcParams?TEXT("yes"):TEXT("no");
|
||||
element->SetAttribute(TEXT("funcParams"), pStr);
|
||||
}
|
||||
|
@ -5498,8 +5482,8 @@ bool NppParameters::writeGUIParams()
|
|||
}
|
||||
else if (!lstrcmp(nm, TEXT("delimiterSelection")))
|
||||
{
|
||||
element->SetAttribute(TEXT("leftmostDelimiter"), static_cast<int>(_nppGUI._leftmostDelimiter));
|
||||
element->SetAttribute(TEXT("rightmostDelimiter"), static_cast<int>(_nppGUI._rightmostDelimiter));
|
||||
element->SetAttribute(TEXT("leftmostDelimiter"), static_cast<int32_t>(_nppGUI._leftmostDelimiter));
|
||||
element->SetAttribute(TEXT("rightmostDelimiter"), static_cast<int32_t>(_nppGUI._rightmostDelimiter));
|
||||
if(_nppGUI._delimiterSelectionOnEntireDocument)
|
||||
element->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), TEXT("yes"));
|
||||
else
|
||||
|
@ -5511,6 +5495,12 @@ bool NppParameters::writeGUIParams()
|
|||
multiInstExist = true;
|
||||
element->SetAttribute(TEXT("setting"), _nppGUI._multiInstSetting);
|
||||
}
|
||||
else if (!lstrcmp(nm, TEXT("searchEngine")))
|
||||
{
|
||||
searchEngineExist = true;
|
||||
element->SetAttribute(TEXT("searchEngineChoice"), _nppGUI._searchEngineChoice);
|
||||
element->SetAttribute(TEXT("searchEngineCustom"), _nppGUI._searchEngineCustom);
|
||||
}
|
||||
}
|
||||
|
||||
if (!noUpdateExist)
|
||||
|
@ -5580,7 +5570,7 @@ bool NppParameters::writeGUIParams()
|
|||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("NewDocDefaultSettings"));
|
||||
GUIConfigElement->SetAttribute(TEXT("format"), static_cast<int>(_nppGUI._newDocDefaultSettings._format));
|
||||
GUIConfigElement->SetAttribute(TEXT("format"), static_cast<int32_t>(_nppGUI._newDocDefaultSettings._format));
|
||||
GUIConfigElement->SetAttribute(TEXT("encoding"), _nppGUI._newDocDefaultSettings._unicodeMode);
|
||||
GUIConfigElement->SetAttribute(TEXT("lang"), _nppGUI._newDocDefaultSettings._lang);
|
||||
GUIConfigElement->SetAttribute(TEXT("codepage"), _nppGUI._newDocDefaultSettings._codepage);
|
||||
|
@ -5610,7 +5600,7 @@ bool NppParameters::writeGUIParams()
|
|||
GUIConfigElement->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str());
|
||||
|
||||
GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI.isSnapshotMode()?TEXT("yes"):TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("snapshotBackupTiming"), int32_t(_nppGUI._snapshotBackupTiming));
|
||||
GUIConfigElement->SetAttribute(TEXT("snapshotBackupTiming"), static_cast<int32_t>(_nppGUI._snapshotBackupTiming));
|
||||
}
|
||||
|
||||
if (!doTaskListExist)
|
||||
|
@ -5654,7 +5644,7 @@ bool NppParameters::writeGUIParams()
|
|||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("auto-completion"));
|
||||
GUIConfigElement->SetAttribute(TEXT("autoCAction"), _nppGUI._autocStatus);
|
||||
GUIConfigElement->SetAttribute(TEXT("triggerFromNbChar"), int32_t(_nppGUI._autocFromLen));
|
||||
GUIConfigElement->SetAttribute(TEXT("triggerFromNbChar"), static_cast<int32_t>(_nppGUI._autocFromLen));
|
||||
const TCHAR * pStr = _nppGUI._funcParams?TEXT("yes"):TEXT("no");
|
||||
GUIConfigElement->SetAttribute(TEXT("funcParams"), pStr);
|
||||
}
|
||||
|
@ -5741,12 +5731,14 @@ bool NppParameters::writeGUIParams()
|
|||
const TCHAR *pStr = (_nppGUI._shortTitlebar)?TEXT("yes"):TEXT("no");
|
||||
GUIConfigElement->SetAttribute(TEXT("short"), pStr);
|
||||
}
|
||||
|
||||
if (!stylerThemeExist)
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("stylerTheme"));
|
||||
GUIConfigElement->SetAttribute(TEXT("path"), _nppGUI._themeName.c_str());
|
||||
}
|
||||
|
||||
if (!delimiterSelectionExist)
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
|
@ -5755,12 +5747,14 @@ bool NppParameters::writeGUIParams()
|
|||
GUIConfigElement->SetAttribute(TEXT("rightmostDelimiter"), _nppGUI._rightmostDelimiter);
|
||||
GUIConfigElement->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), _nppGUI._delimiterSelectionOnEntireDocument);
|
||||
}
|
||||
|
||||
if (!multiInstExist)
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("multiInst"));
|
||||
GUIConfigElement->SetAttribute(TEXT("setting"), _nppGUI._multiInstSetting);
|
||||
}
|
||||
|
||||
if (!miscExist)
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
|
@ -5770,6 +5764,15 @@ bool NppParameters::writeGUIParams()
|
|||
GUIConfigElement->SetAttribute(TEXT("backSlashIsEscapeCharacterForSql"), _nppGUI._backSlashIsEscapeCharacterForSql?TEXT("yes"):TEXT("no"));
|
||||
GUIConfigElement->SetAttribute(TEXT("newStyleSaveDlg"), _nppGUI._useNewStyleSaveDlg?TEXT("yes"):TEXT("no"));
|
||||
}
|
||||
|
||||
if (!searchEngineExist)
|
||||
{
|
||||
TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
|
||||
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("searchEngine"));
|
||||
GUIConfigElement->SetAttribute(TEXT("searchEngineChoice"), _nppGUI._searchEngineChoice);
|
||||
GUIConfigElement->SetAttribute(TEXT("searchEngineCustom"), _nppGUI._searchEngineCustom);
|
||||
}
|
||||
|
||||
insertDockingParamNode(GUIRoot);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -786,9 +786,6 @@ struct NppGUI final
|
|||
|
||||
generic_string _definedSessionExt;
|
||||
generic_string _definedWorkspaceExt;
|
||||
|
||||
|
||||
|
||||
|
||||
struct AutoUpdateOptions
|
||||
{
|
||||
|
@ -819,6 +816,10 @@ struct NppGUI final
|
|||
generic_string _cloudPath; // this option will never be read/written from/to config.xml
|
||||
unsigned char _availableClouds = '\0'; // this option will never be read/written from/to config.xml
|
||||
bool _useNewStyleSaveDlg = false;
|
||||
|
||||
enum SearchEngineChoice{ se_custom = 0, se_duckDuckGo = 1, se_google = 2, se_bing = 3, se_yahoo = 4 };
|
||||
SearchEngineChoice _searchEngineChoice = se_google;
|
||||
generic_string _searchEngineCustom;
|
||||
};
|
||||
|
||||
struct ScintillaViewParams
|
||||
|
|
|
@ -385,8 +385,21 @@ BEGIN
|
|||
GROUPBOX "Settings on cloud",IDC_SETTINGSONCLOUD_GB_STATIC,89,44,268,102,BS_CENTER
|
||||
CONTROL "No Cloud",IDC_NOCLOUD_RADIO,"Button",BS_AUTORADIOBUTTON,125,57,180,10
|
||||
CONTROL "Set your cloud location path here:",IDC_WITHCLOUD_RADIO,"Button",BS_AUTORADIOBUTTON,125,72,180,10
|
||||
EDITTEXT IDC_CLOUDPATH_EDIT,134,88,179,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_CLOUDPATH_EDIT,134,88,179,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...",IDD_CLOUDPATH_BROWSE_BUTTON,320,87,16,14
|
||||
LTEXT "",IDC_SETTINGSONCLOUD_WARNING_STATIC,131,117,135,20
|
||||
END
|
||||
|
||||
IDD_PREFERENCE_SEARCHENGINE_BOX DIALOGEX 0, 0, 455, 185
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Search Engine (for command ""Search on Internet"")",IDC_SEARCHENGINES_GB_STATIC,89,24,268,130,BS_CENTER
|
||||
CONTROL "DuckDuckGo",IDC_SEARCHENGINE_DUCKDUCKGO_RADIO,"Button",BS_AUTORADIOBUTTON,125,37,180,10
|
||||
CONTROL "Google",IDC_SEARCHENGINE_GOOGLE_RADIO,"Button",BS_AUTORADIOBUTTON,125,52,180,10
|
||||
CONTROL "Bing",IDC_SEARCHENGINE_BING_RADIO,"Button",BS_AUTORADIOBUTTON,125,67,180,10
|
||||
CONTROL "Yahoo!",IDC_SEARCHENGINE_YAHOO_RADIO,"Button",BS_AUTORADIOBUTTON,125,82,180,10
|
||||
CONTROL "Set your search engine here:",IDC_SEARCHENGINE_CUSTOM_RADIO,"Button",BS_AUTORADIOBUTTON,125,97,180,10
|
||||
EDITTEXT IDC_SEARCHENGINE_EDIT,134,112,179,14,ES_AUTOHSCROLL
|
||||
LTEXT "Example: https://www.google.com/search?q=$(CURRENT_WORD)",IDD_SEARCHENGINE_NOTE_STATIC,134,127,220,20
|
||||
END
|
||||
|
|
|
@ -95,9 +95,9 @@ static int encodings[] = {
|
|||
20866
|
||||
};
|
||||
|
||||
INT_PTR CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
INT_PTR CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -147,6 +147,9 @@ INT_PTR CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
|
|||
_settingsOnCloudDlg.init(_hInst, _hSelf);
|
||||
_settingsOnCloudDlg.create(IDD_PREFERENCE_SETTINGSONCLOUD_BOX, false, false);
|
||||
|
||||
_searchEngineDlg.init(_hInst, _hSelf);
|
||||
_searchEngineDlg.create(IDD_PREFERENCE_SEARCHENGINE_BOX, false, false);
|
||||
|
||||
|
||||
_wVector.push_back(DlgInfo(&_barsDlg, TEXT("General"), TEXT("Global")));
|
||||
_wVector.push_back(DlgInfo(&_marginsDlg, TEXT("Editing"), TEXT("Scintillas")));
|
||||
|
@ -162,6 +165,7 @@ INT_PTR CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
|
|||
_wVector.push_back(DlgInfo(&_multiInstDlg, TEXT("Multi-Instance"), TEXT("MultiInstance")));
|
||||
_wVector.push_back(DlgInfo(&_delimiterSettingsDlg, TEXT("Delimiter"), TEXT("Delimiter")));
|
||||
_wVector.push_back(DlgInfo(&_settingsOnCloudDlg, TEXT("Cloud"), TEXT("Cloud")));
|
||||
_wVector.push_back(DlgInfo(&_searchEngineDlg, TEXT("Search Engine"), TEXT("SearchEngine")));
|
||||
_wVector.push_back(DlgInfo(&_settingsDlg, TEXT("MISC."), TEXT("MISC")));
|
||||
|
||||
|
||||
|
@ -188,6 +192,7 @@ INT_PTR CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
|
|||
_multiInstDlg.reSizeTo(rc);
|
||||
_delimiterSettingsDlg.reSizeTo(rc);
|
||||
_settingsOnCloudDlg.reSizeTo(rc);
|
||||
_searchEngineDlg.reSizeTo(rc);
|
||||
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
|
||||
|
@ -238,6 +243,20 @@ void PreferenceDlg::makeCategoryList()
|
|||
setListSelection(0);
|
||||
}
|
||||
|
||||
int32_t PreferenceDlg::getIndexFromName(const TCHAR *name) const
|
||||
{
|
||||
if (not name)
|
||||
return -1;
|
||||
|
||||
int32_t i = 0;
|
||||
for (auto it = _wVector.begin() ; it != _wVector.end(); ++it, ++i)
|
||||
{
|
||||
if (it->_internalName == name)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void PreferenceDlg::setListSelection(size_t currentSel) const
|
||||
{
|
||||
// Stupid LB API doesn't allow LB_SETSEL to be used on single select listbox, so we do it in a hard way
|
||||
|
@ -279,7 +298,18 @@ bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *ne
|
|||
return true;
|
||||
}
|
||||
|
||||
void PreferenceDlg::showDialogByIndex(size_t index)
|
||||
void PreferenceDlg::showDialogByName(const TCHAR *name) const
|
||||
{
|
||||
int32_t i = getIndexFromName(name);
|
||||
if (i >= 0)
|
||||
{
|
||||
showDialogByIndex(i);
|
||||
setListSelection(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PreferenceDlg::showDialogByIndex(size_t index) const
|
||||
{
|
||||
size_t len = _wVector.size();
|
||||
for (size_t i = 0; i < len; ++i)
|
||||
|
@ -307,11 +337,11 @@ void PreferenceDlg::destroy()
|
|||
_delimiterSettingsDlg.destroy();
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -592,11 +622,11 @@ void MarginsDlg::initScintParam()
|
|||
}
|
||||
|
||||
|
||||
INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -820,11 +850,11 @@ INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK SettingsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -1116,13 +1146,13 @@ void RecentFilesHistoryDlg::setCustomLen(int val)
|
|||
::ShowWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), val > 0?SW_SHOW:SW_HIDE);
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
|
||||
NewDocDefaultSettings & ndds = (NewDocDefaultSettings &)nppGUI.getNewDocDefaultSettings();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
|
@ -1314,12 +1344,12 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK DefaultDirectoryDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK DefaultDirectoryDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -1407,12 +1437,12 @@ INT_PTR CALLBACK DefaultDirectoryDlg::run_dlgProc(UINT Message, WPARAM wParam, L
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -1542,12 +1572,12 @@ INT_PTR CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT Message, WPARAM wParam,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -1733,12 +1763,12 @@ INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lP
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/* lParam*/)
|
||||
INT_PTR CALLBACK TabSettings::run_dlgProc(UINT message, WPARAM wParam, LPARAM/* lParam*/)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -1952,12 +1982,12 @@ void trim(generic_string & str)
|
|||
else str.erase(str.begin(), str.end());
|
||||
};
|
||||
|
||||
INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -2255,11 +2285,11 @@ INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
|
|||
}
|
||||
|
||||
|
||||
INT_PTR CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK BackupDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -2449,11 +2479,11 @@ void BackupDlg::updateBackupGUI()
|
|||
}
|
||||
|
||||
|
||||
INT_PTR CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK AutoCompletionDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -2644,7 +2674,6 @@ INT_PTR CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPA
|
|||
const int NB_MAX_CHAR = 9;
|
||||
|
||||
ValueDlg valDlg;
|
||||
//NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
valDlg.init(NULL, _hSelf, static_cast<int32_t>(nppGUI._autocFromLen), TEXT("Nb char : "));
|
||||
valDlg.setNBNumber(1);
|
||||
|
||||
|
@ -2717,10 +2746,10 @@ INT_PTR CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPA
|
|||
}
|
||||
|
||||
|
||||
INT_PTR CALLBACK MultiInstDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK MultiInstDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -2763,10 +2792,10 @@ INT_PTR CALLBACK MultiInstDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
INT_PTR CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
switch (Message)
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>((NppParameters::getInstance())->getNppGUI());
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
|
@ -2879,10 +2908,10 @@ INT_PTR CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters * nppParams = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = (NppGUI &)(nppParams->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(nppParams->getNppGUI());
|
||||
|
||||
if (HIWORD(wParam) == EN_CHANGE)
|
||||
{
|
||||
|
@ -2917,7 +2946,7 @@ INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LP
|
|||
}
|
||||
}
|
||||
|
||||
switch (Message)
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
|
@ -2984,5 +3013,92 @@ INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LP
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK SearchEngineChoiceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters * nppParams = NppParameters::getInstance();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(nppParams->getNppGUI());
|
||||
|
||||
if (HIWORD(wParam) == EN_CHANGE)
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_SEARCHENGINE_EDIT:
|
||||
{
|
||||
TCHAR input[MAX_PATH] = { '\0' };
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_EDIT, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(input));
|
||||
nppGUI._searchEngineCustom = input;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
if (nppGUI._searchEngineChoice == nppGUI.se_custom)
|
||||
{
|
||||
if (nppGUI._searchEngineCustom.empty())
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_google;
|
||||
}
|
||||
}
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_CUSTOM_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_custom ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_DUCKDUCKGO_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_duckDuckGo ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_GOOGLE_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_google ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_BING_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_bing ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_YAHOO_RADIO, BM_SETCHECK, nppGUI._searchEngineChoice == nppGUI.se_yahoo ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_SEARCHENGINE_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(nppGUI._searchEngineCustom.c_str()));
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), nppGUI._searchEngineChoice == nppGUI.se_custom);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
case IDC_SEARCHENGINE_DUCKDUCKGO_RADIO:
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_duckDuckGo;
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SEARCHENGINE_GOOGLE_RADIO:
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_google;
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SEARCHENGINE_BING_RADIO:
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_bing;
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SEARCHENGINE_YAHOO_RADIO:
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_yahoo;
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SEARCHENGINE_CUSTOM_RADIO:
|
||||
{
|
||||
nppGUI._searchEngineChoice = nppGUI.se_custom;
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SEARCHENGINE_EDIT), true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,32 +26,14 @@
|
|||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#ifndef PREFERENCE_DLG_H
|
||||
#define PREFERENCE_DLG_H
|
||||
#pragma once
|
||||
|
||||
#ifndef CONTROLS_TAB_H
|
||||
#include "ControlsTab.h"
|
||||
#endif //CONTROLS_TAB_H
|
||||
|
||||
#ifndef PREFERENCE_RC_H
|
||||
#include "preference_rc.h"
|
||||
#endif //PREFERENCE_RC_H
|
||||
|
||||
#ifndef URLCTRL_INCLUDED
|
||||
#include "URLCtrl.h"
|
||||
#endif //URLCTRL_INCLUDED
|
||||
|
||||
#ifndef PARAMETERS_H
|
||||
#include "Parameters.h"
|
||||
#endif //PARAMETERS_H
|
||||
|
||||
#ifndef REG_EXT_DLG_H
|
||||
#include "regExtDlg.h"
|
||||
#endif //REG_EXT_DLG_H
|
||||
|
||||
#ifndef WORD_STYLE_H
|
||||
#include "WordStyleDlg.h"
|
||||
#endif //WORD_STYLE_H
|
||||
|
||||
class SettingsDlg : public StaticDialog
|
||||
{
|
||||
|
@ -59,7 +41,7 @@ public :
|
|||
SettingsDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class BarsDlg : public StaticDialog
|
||||
|
@ -67,7 +49,7 @@ class BarsDlg : public StaticDialog
|
|||
public :
|
||||
BarsDlg() {};
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class MarginsDlg : public StaticDialog
|
||||
|
@ -80,7 +62,7 @@ public :
|
|||
|
||||
private :
|
||||
URLCtrl _verticalEdgeLineNbColVal;
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
void initScintParam();
|
||||
};
|
||||
|
||||
|
@ -103,7 +85,7 @@ private :
|
|||
::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, BST_UNCHECKED, 0);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), doIt);
|
||||
};
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class DefaultDirectoryDlg : public StaticDialog
|
||||
|
@ -112,7 +94,7 @@ public :
|
|||
DefaultDirectoryDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class RecentFilesHistoryDlg : public StaticDialog
|
||||
|
@ -128,7 +110,7 @@ private :
|
|||
URLCtrl _customLenVal;
|
||||
std::vector<LangID_Name> _langList;
|
||||
void setCustomLen(int val);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class LangMenuDlg : public StaticDialog
|
||||
|
@ -138,7 +120,7 @@ public :
|
|||
|
||||
private :
|
||||
LexerStylerArray _lsArray;
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
std::vector<LangMenuItem> _langList;
|
||||
};
|
||||
|
||||
|
@ -152,7 +134,7 @@ public :
|
|||
|
||||
private :
|
||||
URLCtrl _tabSizeVal;
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
|
||||
|
@ -167,7 +149,7 @@ class PrintSettingsDlg : public StaticDialog
|
|||
public :
|
||||
PrintSettingsDlg():_focusedEditCtrl(0), _selStart(0), _selEnd(0){};
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
std::vector<strCouple> varList;
|
||||
int _focusedEditCtrl;
|
||||
DWORD _selStart;
|
||||
|
@ -180,7 +162,7 @@ public :
|
|||
BackupDlg() {};
|
||||
private :
|
||||
void updateBackupGUI();
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
|
||||
|
@ -190,7 +172,7 @@ public :
|
|||
AutoCompletionDlg() {};
|
||||
private :
|
||||
URLCtrl _nbCharVal;
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class MultiInstDlg : public StaticDialog
|
||||
|
@ -199,7 +181,7 @@ public :
|
|||
MultiInstDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class DelimiterSettingsDlg : public StaticDialog
|
||||
|
@ -208,7 +190,7 @@ public :
|
|||
DelimiterSettingsDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
POINT _singleLineModePoint, _multiLineModePoint;
|
||||
RECT _closerRect, _closerLabelRect;
|
||||
};
|
||||
|
@ -219,7 +201,16 @@ public :
|
|||
SettingsOnCloudDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class SearchEngineChoiceDlg : public StaticDialog
|
||||
{
|
||||
public :
|
||||
SearchEngineChoiceDlg() {};
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
class PreferenceDlg : public StaticDialog
|
||||
|
@ -246,14 +237,17 @@ public :
|
|||
int getListSelectedIndex() const {
|
||||
return static_cast<int32_t>(::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETCURSEL, 0, 0));
|
||||
};
|
||||
|
||||
void showDialogByName(const TCHAR *name) const;
|
||||
void setListSelection(size_t currentSel) const;
|
||||
|
||||
virtual void destroy();
|
||||
|
||||
private :
|
||||
INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
void makeCategoryList();
|
||||
void showDialogByIndex(size_t index);
|
||||
int32_t getIndexFromName(const TCHAR *name) const;
|
||||
void showDialogByIndex(size_t index) const;
|
||||
//ControlsTab _ctrlTab;
|
||||
WindowVector _wVector;
|
||||
BarsDlg _barsDlg;
|
||||
|
@ -271,8 +265,6 @@ private :
|
|||
MultiInstDlg _multiInstDlg;
|
||||
DelimiterSettingsDlg _delimiterSettingsDlg;
|
||||
SettingsOnCloudDlg _settingsOnCloudDlg;
|
||||
SearchEngineChoiceDlg _searchEngineDlg;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //PREFERENCE_DLG_H
|
|
@ -135,6 +135,16 @@
|
|||
#define IDC_WITHCLOUD_RADIO (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 7)
|
||||
#define IDC_CLOUDPATH_EDIT (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 8)
|
||||
#define IDD_CLOUDPATH_BROWSE_BUTTON (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 9)
|
||||
|
||||
#define IDD_PREFERENCE_SEARCHENGINE_BOX 6270 //(IDD_PREFERENCE_BOX + 250)
|
||||
#define IDC_SEARCHENGINES_GB_STATIC (IDD_PREFERENCE_SEARCHENGINE_BOX + 1)
|
||||
#define IDC_SEARCHENGINE_DUCKDUCKGO_RADIO (IDD_PREFERENCE_SEARCHENGINE_BOX + 2)
|
||||
#define IDC_SEARCHENGINE_GOOGLE_RADIO (IDD_PREFERENCE_SEARCHENGINE_BOX + 3)
|
||||
#define IDC_SEARCHENGINE_BING_RADIO (IDD_PREFERENCE_SEARCHENGINE_BOX + 4)
|
||||
#define IDC_SEARCHENGINE_YAHOO_RADIO (IDD_PREFERENCE_SEARCHENGINE_BOX + 5)
|
||||
#define IDC_SEARCHENGINE_CUSTOM_RADIO (IDD_PREFERENCE_SEARCHENGINE_BOX + 6)
|
||||
#define IDC_SEARCHENGINE_EDIT (IDD_PREFERENCE_SEARCHENGINE_BOX + 7)
|
||||
#define IDD_SEARCHENGINE_NOTE_STATIC (IDD_PREFERENCE_SEARCHENGINE_BOX + 8)
|
||||
|
||||
#define IDD_PREFERENCE_SETTING_BOX 6300 //(IDD_PREFERENCE_BOX + 300)
|
||||
#define IDC_TABSETTING_GB_STATIC (IDD_PREFERENCE_SETTING_BOX + 1)
|
||||
|
|
|
@ -61,6 +61,9 @@ http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Context_Menu
|
|||
<Item MenuEntryName="Edit" MenuItemName="UPPERCASE"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="lowercase"/>
|
||||
<Item id="0"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="Open File"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="Search On Internet"/>
|
||||
<Item id="0"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="Toggle Single Line Comment"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="Block Comment"/>
|
||||
<Item MenuEntryName="Edit" MenuItemName="Block Uncomment"/>
|
||||
|
|
|
@ -62,6 +62,7 @@ MenuPosition menuPos[] = {
|
|||
{ 1, 16, -1, "edit-eolConversion" },
|
||||
{ 1, 17, -1, "edit-blankOperations" },
|
||||
{ 1, 18, -1, "edit-pasteSpecial" },
|
||||
{ 1, 19, -1, "edit-onSelection" },
|
||||
|
||||
{ 2, 18, -1, "search-markAll" },
|
||||
{ 2, 19, -1, "search-unmarkAll" },
|
||||
|
@ -830,6 +831,13 @@ void NativeLangSpeaker::changePrefereceDlgLang(PreferenceDlg & preference)
|
|||
preference.renameDialogTitle(TEXT("Cloud"), nameW);
|
||||
}
|
||||
|
||||
changeDlgLang(preference._searchEngineDlg.getHSelf(), "SearchEngine", titre);
|
||||
if (titre[0] != '\0')
|
||||
{
|
||||
const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding);
|
||||
preference.renameDialogTitle(TEXT("SearchEngine"), nameW);
|
||||
}
|
||||
|
||||
preference.setListSelection(currentSel);
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
#define IDM_EDIT_OPENASFILE (IDM_EDIT + 73)
|
||||
#define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74)
|
||||
#define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75)
|
||||
#define IDM_EDIT_CHANGESEARCHENGIN (IDM_EDIT + 76)
|
||||
#define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76)
|
||||
|
||||
// Menu macro
|
||||
#define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18)
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "$(FULL_CURRENT_PATH)"</Command>
|
||||
<Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "$(FULL_CURRENT_PATH)"</Command>
|
||||
<Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "$(FULL_CURRENT_PATH)"</Command>
|
||||
<Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="70">safari "$(FULL_CURRENT_PATH)"</Command>
|
||||
<Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="65">safari "$(FULL_CURRENT_PATH)"</Command>
|
||||
<Command name="Get php help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/$(CURRENT_WORD)</Command>
|
||||
<Command name="Google Search" Ctrl="no" Alt="yes" Shift="no" Key="113">https://www.google.com/search?q=$(CURRENT_WORD)</Command>
|
||||
<Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command>
|
||||
<Command name="Open file in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst</Command>
|
||||
<Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a "$(FULL_CURRENT_PATH)"</Command>
|
||||
|
|
|
@ -413,7 +413,7 @@ DEVOMER*/
|
|||
|
||||
Notepad_plus_Window notepad_plus_plus;
|
||||
|
||||
NppGUI & nppGui = (NppGUI &)pNppParameters->getNppGUI();
|
||||
NppGUI & nppGui = const_cast<NppGUI &>(pNppParameters->getNppGUI());
|
||||
|
||||
generic_string updaterDir = pNppParameters->getNppPath();
|
||||
updaterDir += TEXT("\\updater\\");
|
||||
|
|
Loading…
Reference in New Issue