Merge remote-tracking branch 'base/master'

This commit is contained in:
NN 2015-09-24 09:58:25 +03:00
commit 1fd41dbeb6
106 changed files with 9600 additions and 8040 deletions

3
.gitignore vendored
View File

@ -117,4 +117,5 @@ PowerEditor/bin/NppShell_06.dll
PowerEditor/bin/SourceCodePro-Bold.ttf
PowerEditor/bin/SourceCodePro-BoldIt.ttf
PowerEditor/bin/SourceCodePro-It.ttf
PowerEditor/bin/SourceCodePro-Regular.ttf
PowerEditor/bin/SourceCodePro-Regular.ttf
*.zip

View File

@ -54,7 +54,7 @@ In short: The easier the code review is, the better the chance your pull request
* ###### Good:
```cpp
if (10 == a && 42 == b)
if (a == 10 && b == 42)
```
* ###### Bad:

View File

@ -1,10 +1,11 @@
Notepad++ v6.8 new features and bug-fix:
1. Settings on cloud feature allows users to write their settings on whichever cloud.
2. Use Source Code Pro as default font.
3. Make smooth font optional.
4. Fix the context menu disappears problem after find in files operation.
Notepad++ v6.8.3 bug-fixes:
1. Fix a crash issue by using wild card (*) to open files on command line.
2. Fix the problem of display refresh missing on exit.
3. Fix plugin shortcut configuration lost problem by using option -noPlugin.
4. Fix Norwegian localization bad display and wrong encoding.
5. Fix functionList display problem under high DPI.
6. Fix Norwegian localization bad display and wrong encoding.
Included plugins:

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
## Bulgarian localization for Notepad++ ##
Translators:.....: 2007-2012 - Milen Metev (Tragedy); 2014-yyyy - RDD
Last modified:...: 24.07.2015 by RDD
Last modified:...: 27.08.2015 by RDD
Download:........: https://drive.google.com/file/d/0B2sYyYGUvu5dMEJYR2xMcWw2Nms
-->
<NotepadPlus>
@ -352,7 +352,7 @@
<Item id="47010" name="Параметри на командния ред..."/>
<Item id="47001" name="Notepad++ домашна страница"/>
<Item id="47002" name="Notepad++ страница на проекта"/>
<Item id="47004" name="Форум"/>
<Item id="47004" name="Notepad++ общност (Форум)"/>
<Item id="47005" name="Още добавки"/>
<Item id="47003" name="Онлайн документация"/>
<Item id="47006" name="Обновяване на Notepad++"/>
@ -730,11 +730,11 @@
<Item id="6403" name="Unix"/>
<Item id="6405" name="Кодировка"/>
<Item id="6406" name="ANSI"/>
<Item id="6407" name="UTF-8 без BOM"/>
<Item id="6407" name="UTF-8"/>
<Item id="6420" name="Прилагане в отворени ANSI файлове"/>
<Item id="6408" name="UTF-8"/>
<Item id="6409" name="UCS-2 Big Endian"/>
<Item id="6410" name="UCS-2 Little Endian"/>
<Item id="6408" name="UTF-8 с BOM"/>
<Item id="6409" name="UCS-2 Big Endian с BOM"/>
<Item id="6410" name="UCS-2 Little Endian с BOM"/>
<Item id="6411" name="Основен синтаксис:"/>
</NewDoc>
<!-- Път по подразбиране -->

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Catalan translation
for Notepad++ 6.7.1
Updated 23.12.2014
for Notepad++ 6.8
Updated 23.07.2015
By Hiro5 <groccat at gmail>
-->
<NotepadPlus>
<Native-Langue name="Català" filename="catalan.xml" version="6.7.1">
<Native-Langue name="Català" filename="catalan.xml" version="6.8">
<Menu>
<Main>
<Entries>
@ -87,6 +87,7 @@ By Hiro5 <groccat at gmail>
<Item id="41013" name="Desa &amp;Sessió..."/>
<Item id="41010" name="&amp;Imprimeix..."/>
<Item id="1001" name="Im&amp;primeix ara!"/>
<Item id="41021" name="Restaura els fitxers tancats recentment"/>
<Item id="42040" name="Obre tots els ar&amp;xius recents"/>
<Item id="42041" name="Nete&amp;ja llista d'arxius recents"/>
<Item id="41011" name="S&amp;urt"/>
@ -109,7 +110,13 @@ By Hiro5 <groccat at gmail>
<Item id="42012" name="&amp;Talla línies"/>
<Item id="42013" name="&amp;Uneix línies"/>
<Item id="42059" name="Ordena línies ascendentment"/>
<Item id="42061" name="Ordena línies d'enters ascendentment"/>
<Item id="42063" name="Ordena línies de decimals amb coma ascendentment"/>
<Item id="42065" name="Ordena línies de decimals amb punt ascendentment"/>
<Item id="42060" name="Ordena línies descendentment"/>
<Item id="42062" name="Ordena línies d'enters descendentment"/>
<Item id="42064" name="Ordena línies de decimals amb coma descendentment"/>
<Item id="42066" name="Ordena línies de decimals amb punt descendentment"/>
<Item id="42014" name="Mou a&amp;munt aquesta línia"/>
<Item id="42015" name="Mou a&amp;vall aquesta línia"/>
<Item id="42055" name="&amp;Esborra línies buides"/>
@ -284,12 +291,10 @@ By Hiro5 <groccat at gmail>
<Item id="48016" name="&amp;Modifica tecla de drecera/Esborra macro..."/>
<Item id="49000" name="&amp;Executa..."/>
<Item id="48017" name="&amp;Modifica tecla de drecera/Esborra ordre..."/>
<Item id="47008" name="&amp;Ajuda..."/>
<Item id="47010" name="Ús en &amp;línia d'ordres..."/>
<Item id="47001" name="Web de &amp;Notepad++"/>
<Item id="47002" name="Pàgina del &amp;projecte Notepad++"/>
<Item id="47003" name="Np&amp;Wiki++ (Ajuda en línia)"/>
<Item id="47004" name="&amp;Fòrum"/>
<Item id="47011" name="Ajuda en línia"/>
<Item id="47005" name="Aconsegueix més &amp;complements"/>
<Item id="47006" name="Ac&amp;tualitza Notepad++"/>
<Item id="47009" name="Confi&amp;gura l'intermediari d'actualització"/>
@ -644,8 +649,8 @@ By Hiro5 <groccat at gmail>
<Item id="6206" name="Mostra el número de línia al marge"/>
<Item id="6207" name="Mostra les marques de línia al marge"/>
<Item id="6214" name="Activa el realçament de la línia actual"/>
<Item id="6234" name="Desactiva el desplaçament avançat
(si teniu problemes amb un touchpad)"/>
<Item id="6215" name="Activa tipus de lletres suavitzats"/>
<Item id="6234" name="Desactiva el desplaçament avançat&#xD;(si teniu problemes amb un touchpad)"/>
</Scintillas>
<NewDoc title="Document nou">
<Item id="6419" name="Document nou"/>
@ -770,9 +775,7 @@ By Hiro5 <groccat at gmail>
<Cloud title="Núvol">
<Item id="6262" name="Paràmetres al núvol"/>
<Item id="6263" name="Sense núvol"/>
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<Item id="6267" name="Indiqueu el directori del núvol aquí:"/>
<!--Item id="6261" name="Reinicieu Notepad++ perquè faci efecte."-->
</Cloud>
<MISC title="Miscel·lània">
@ -826,6 +829,7 @@ By Hiro5 <groccat at gmail>
<Item id="2033" name="Números a inserir"/>
<Item id="2030" name="Número inicial:"/>
<Item id="2031" name="Incrementat en:"/>
<Item id="2036" name="Repeteix:"/>
<Item id="2035" name="Omple amb zeros"/>
<Item id="2032" name="Format"/>
<Item id="2024" name="Decimal"/>
@ -835,28 +839,18 @@ By Hiro5 <groccat at gmail>
</ColumnEditor>
</Dialog>
<MessageBox>
<ContextMenuXmlEditWarning title="Editant contextMenu" message="Podeu modificar el menú contextual emergent de Notepad++ editant el fitxer contextMenu.xml.
Necessiteu reiniciar Notepad++ després de modificar contextMenu.xml per a què faci efecte."/>
<NppHelpAbsentWarning title="No existeix el fitxer" message="
no existeix. El podeu baixar de la web de Notepad++."/>
<SaveCurrentModifWarning title="Desa la modificació actual" message="Hauríeu de desar la modificació actual.
Totes les modificacions desades no es podran desfer.
Voleu continuar?"/>
<LoseUndoAbilityWarning title="Avís de pèrdua d'habilitat de desfer" message="Hauríeu de desar la modificació actual.
Totes les modificacions desades no es podran desfer.
Voleu continuar?"/>
<ContextMenuXmlEditWarning title="Editant contextMenu" message="Podeu modificar el menú contextual emergent de Notepad++ editant el fitxer contextMenu.xml.&#xD;Reinicieu Notepad++ després de modificar contextMenu.xml perquè faci efecte."/>
<NppHelpAbsentWarning title="No existeix el fitxer" message="&#xD;no existeix. El podeu baixar de la web de Notepad++."/>
<SaveCurrentModifWarning title="Desa la modificació actual" message="Hauríeu de desar la modificació actual.&#xD;Totes les modificacions desades no es podran desfer.&#xD;&#xD;Voleu continuar?"/>
<LoseUndoAbilityWarning title="Avís de pèrdua d'habilitat de desfer" message="Hauríeu de desar la modificació actual.&#xD;Totes les modificacions desades no es podran desfer.&#xD;&#xD;Voleu continuar?"/>
<CannotMoveDoc title="Mou a una nova finestra de Notepad++" message="El document s'ha modificat, l'heu de desar abans i tornar a intentar-ho."/>
<DocReloadWarning title="Recarrega" message="Segur que voleu recarregar el fitxer actual i perdre els canvis fets amb Notepad++?"/>
<FileLockedWarning title="No s'ha pogut desar" message="Comproveu si aquest fitxer està obert amb un altre programa"/>
<FileAlreadyOpenedInNpp title="" message="El fitxer ja està obert amb Notepad++."/>
<DeleteFileFailed title="Esborra fitxer" message="No s'ha pogut esborrar el fitxer"/>
<NbFileToOpenImportantWarning title="La quantitat d'arxius a obrir és massa gran" message="Esteu a punt d'obrir $INT_REPLACE$ fitxers.
Segur que voleu obrir-los?"/>
<ColumnModeTip title="Consell del mode de columna" message="Utilitzeu «Alt+Selecció amb ratolí»
o «Alt+Maj.+Fletxes del teclat»
per canviar al mode de columna." />
<NbFileToOpenImportantWarning title="La quantitat d'arxius a obrir és massa gran" message="Esteu a punt d'obrir $INT_REPLACE$ fitxers.&#xD;Segur que voleu obrir-los?"/>
<ColumnModeTip title="Consell del mode de columna" message="Utilitzeu «Alt+Selecció amb ratolí»&#xD;o «Alt+Maj.+Fletxes del teclat»&#xD;per canviar al mode de columna." />
<SettingsOnCloudError title="Opcions al núvol" message="Sembla que el directori indicat a les opcions del núvol es troba en una unitat de només lectura,&#xD;o en una carpeta que demana drets d'accés d'escriptura.&#xD;Els vostres paràmetres del núvol es cancel·laran. Reinicieu a un valor coherent a través del diàleg de Preferències."/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Historial del porta-retalls"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<NotepadPlus>
<Native-Langue name="中文繁體" filename="chinese.xml" version="6.7.7">
<Native-Langue name="中文繁體" filename="chinese.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -87,8 +87,7 @@
<Item id="41015" name="儲存拷貝至..."/>
<Item id="41016" name="檔案刪除"/>
<Item id="41017" name="檔案重新命名..."/>
<Item id="41021" name="恢復最近關閉檔案"/> <!-- 簡體中文用軟件轉換為繁體中文,用語可能會不妥當 -->
<Item id="41021" name="重新開啟最近關閉檔案"/>
<Item id="42001" name="剪下(&amp;T)"/>
<Item id="42002" name="複製(&amp;C)"/>
<Item id="42003" name="復原(&amp;U)"/>
@ -145,8 +144,14 @@
<Item id="42056" name="移除空行(含空白字元)"/>
<Item id="42057" name="在現行行上加入空行"/>
<Item id="42058" name="在現行行下加入空行"/>
<Item id="42059" name="排序"/>
<Item id="42060" name="反向排序"/>
<Item id="42059" name="字典順序排序"/>
<Item id="42061" name="整數排序"/>
<Item id="42063" name="小數(逗號)排序"/>
<Item id="42065" name="小數(點)排序"/>
<Item id="42060" name="字典順序反向排序"/>
<Item id="42062" name="整數反向排序"/>
<Item id="42064" name="小數(逗號)反向排序"/>
<Item id="42066" name="小數(點)反向排序"/>
<Item id="43001" name="尋找(&amp;F)..."/>
<Item id="43002" name="找下一個(&amp;N)"/>
<Item id="43003" name="取代..."/>
@ -196,6 +201,7 @@
<Item id="43047" name="上一個搜尋結果"/>
<Item id="43048" name="選取並搜尋下一個"/>
<Item id="43049" name="選取並搜尋上一個"/>
<Item id="43054" name="標記..."/>
<Item id="43050" name="反向標記書籤"/>
<Item id="44009" name="便條紙"/>
<Item id="44010" name="折疊所有層次"/>
@ -258,7 +264,7 @@
<Item id="46080" name="使用者自訂"/>
<Item id="47000" name="關於 Notepad++..."/>
<Item id="47001" name="Notepad++ 官方網站"/>
<Item id="47002" name="Notepad++ 在 SourceForge"/>
<Item id="47002" name="Notepad++ 專案頁GitHub"/>
<Item id="47003" name="線上輔助"/>
<Item id="47004" name="網路論壇"/>
<Item id="47005" name="下載更多外掛模組"/>
@ -266,6 +272,7 @@
<Item id="47008" name="全攻略秘籍"/>
<Item id="47009" name="設定更新程式代理伺服器..."/>
<Item id="47010" name="指令列參數..."/>
<Item id="47011" name="技術支援熱線"/>
<Item id="48005" name="匯入外掛模組..."/>
<Item id="48006" name="匯入主題面板..."/>
<Item id="48018" name="編輯彈跳選單"/>
@ -432,8 +439,8 @@
<Item id="25030" name="字型"/>
<Item id="25006" name="前景顏色"/>
<Item id="25007" name="背景顏色"/>
<Item id="25031" name="字型名稱:"/>
<Item id="25032" name="字型大小:"/>
<Item id="25031" name="名稱:"/>
<Item id="25032" name="大小:"/>
<Item id="25001" name="粗體"/>
<Item id="25002" name="斜體"/>
<Item id="25003" name="底線"/>
@ -459,6 +466,8 @@
<Item id="25026" name="運算符號一"/>
<Item id="25027" name="運算符號二"/>
<Item id="25028" name="數字"/>
<Item id="1" name="儲存"/>
<Item id="2" name="取消"/>
</StylerDialog>
<Folder title="層次設定與內定格式">
<Item id="21101" name="內定格式設定"/>
@ -644,7 +653,7 @@
<Item id="6212" name="垂直線模式"/>
<Item id="6213" name="背景色模式"/>
<Item id="6214" name="啟動現行行列背景顏色"/>
<Item id="6215" name="啟用 smooth font"/>
<Item id="6231" name="邊框寬度"/>
</Scintillas>
<NewDoc title="開新文件">
@ -777,9 +786,7 @@
<Cloud title="雲端">
<Item id="6262" name="雲端上儲存讀取設定"/>
<Item id="6263" name="晴朗無雲"/>
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<Item id="6267" name="設置你的雲端的路徑:"/>
<!--Item id="6261" name="Please restart Notepad++ to take effect."/-->
</Cloud>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<NotepadPlus>
<Native-Langue name="简体中文" filename="chineseSimplified.xml" version="6.7.7">
<Native-Langue name="简体中文" filename="chineseSimplified.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -144,8 +144,14 @@
<Item id="42056" name="移除空行(包括空白字符)" />
<Item id="42057" name="在当前行上方插入空行"/>
<Item id="42058" name="在当前行下方插入空行"/>
<Item id="42059" name="升序排列行"/>
<Item id="42060" name="降序排列行"/>
<Item id="42059" name="升序排列文本行"/>
<Item id="42060" name="降序排列文本行"/>
<Item id="42061" name="升序排列整数" />
<Item id="42062" name="降序排列整数" />
<Item id="42063" name="升序排列小数(逗号作为小数点)" />
<Item id="42064" name="降序排列小数(逗号作为小数点)" />
<Item id="42065" name="升序排列小数(句点作为小数点)" />
<Item id="42066" name="降序排列小数(句点作为小数点)" />
<Item id="43001" name="查找(&amp;F)..." />
<Item id="43002" name="查找下一个(&amp;N)" />
<Item id="43003" name="替换..." />
@ -170,6 +176,7 @@
<Item id="43051" name="删除未标记行" />
<Item id="43052" name="查找范围内的字符..." />
<Item id="43053" name="选中所有匹配括号间字符"/>
<Item id="43054" name="标记..." />
<Item id="43022" name="使用格式1" />
<Item id="43023" name="清除格式1" />
<Item id="43024" name="使用格式2" />
@ -260,12 +267,13 @@
<Item id="47001" name="Notepad++ 官方主页" />
<Item id="47002" name="Notepad++ 项目主页" />
<Item id="47003" name="在线帮助" />
<Item id="47004" name="论坛" />
<Item id="47004" name="Notepad++ 社区(论坛" />
<Item id="47005" name="获取插件" />
<Item id="47006" name="升级 Notepad++" />
<Item id="47008" name="帮助" />
<Item id="47009" name="设置更新代理服务器..." />
<Item id="47010" name="指令列参数..."/>
<Item id="47010" name="命令行参数..." />
<Item id="47011" name="在线支持" />
<Item id="48005" name="导入插件..." />
<Item id="48006" name="导入主题..." />
<Item id="48018" name="编辑弹出菜单" />
@ -353,6 +361,19 @@
<Item id="1686" name="透明度" />
<Item id="1703" name="&amp;. 匹配新行" />
</Find>
<FindCharsInRange title="查找范围内的字符...">
<Item id="2" name="关闭"/>
<Item id="2901" name="非 ASCII 字符 (128-255)"/>
<Item id="2902" name="ASCII 字符 (0-127)"/>
<Item id="2903" name="自定义范围:"/>
<Item id="2906" name="向上(&amp;U)"/>
<Item id="2907" name="向下(&amp;D)"/>
<Item id="2908" name="方向"/>
<Item id="2909" name="循环查找(&amp;P)"/>
<Item id="2910" name="查找"/>
</FindCharsInRange>
<GoToLine title="转至">
<Item id="2007" name="行" />
<Item id="2008" name="偏移量" />
@ -454,6 +475,8 @@
<Item id="25026" name="运算符 1" />
<Item id="25027" name="运算符 2" />
<Item id="25028" name="数字" />
<Item id="1" name="确认" />
<Item id="2" name="取消" />
</StylerDialog>
<Folder title="层次设置与默认格式">
<Item id="21101" name="默认格式设置" />
@ -642,6 +665,7 @@
<Item id="6212" name="边界线模式" />
<Item id="6213" name="背景色模式" />
<Item id="6214" name="当前行高亮模式" />
<Item id="6215" name="启用平滑字体" />
<Item id="6231" name="边框宽度" />
</Scintillas>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<NotepadPlus>
<Native-Langue name="English" filename="english.xml" version="6.7.7">
<Native-Langue name="English" filename="english.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -201,6 +201,7 @@
<Item id="43047" name="Previous Search Result"/>
<Item id="43048" name="Select and Find Next"/>
<Item id="43049" name="Select and Find Previous"/>
<Item id="43054" name="Mark..."/>
<Item id="44009" name="Post-It"/>
<Item id="44010" name="Fold All"/>
<Item id="44019" name="Show All Characters"/>
@ -277,6 +278,7 @@
<Item id="47001" name="Notepad++ Home"/>
<Item id="47002" name="Notepad++ Project Page"/>
<Item id="47003" name="Online Documentation"/>
<Item id="47004" name="Notepad++ Community (Forum)"/>
<Item id="47011" name="Live Support"/>
<Item id="47005" name="Get More Plugins"/>
<Item id="47006" name="Update Notepad++"/>
@ -358,7 +360,7 @@
<Item id="1659" name="In hidden folders"/>
<Item id="1624" name="Search mode"/>
<Item id="1625" name="Normal"/>
<Item id="1626" name="Extended (\n, \r, \t, \0, \x...)"/>
<Item id="1626" name="Extended (\r, \n, \t, \x..., \0)"/>
<Item id="1660" name="Replace in Files"/>
<Item id="1661" name="Follow current doc."/>
<Item id="1641" name="Find All in Current Document"/>
@ -470,6 +472,8 @@
<Item id="25026" name="Operator 1"/>
<Item id="25027" name="Operator 2"/>
<Item id="25028" name="Numbers"/>
<Item id="1" name="OK"/>
<Item id="2" name="Cancel"/>
</StylerDialog>
<Folder title="Folder &amp;&amp; Default">
<Item id="21101" name="Default style"/>
@ -655,7 +659,7 @@
<Item id="6212" name="Line mode"/>
<Item id="6213" name="Background mode"/>
<Item id="6214" name="Enable current line highlighting"/>
<Item id="6215" name="Enable smooth font"/>
<Item id="6231" name="Border Width"/>
</Scintillas>
@ -666,10 +670,10 @@
<Item id="6404" name="Mac"/>
<Item id="6405" name="Encoding"/>
<Item id="6406" name="ANSI"/>
<Item id="6407" name="UTF-8 without BOM"/>
<Item id="6408" name="UTF-8"/>
<Item id="6409" name="UCS-2 Big Endian"/>
<Item id="6410" name="UCS-2 Little Endian"/>
<Item id="6407" name="UTF-8"/>
<Item id="6408" name="UTF-8 with BOM"/>
<Item id="6409" name="UCS-2 Big Endian with BOM"/>
<Item id="6410" name="UCS-2 Little Endian with BOM"/>
<Item id="6411" name="Default language:"/>
<Item id="6419" name="New Document"/>
<Item id="6420" name="Apply to opened ANSI files"/>
@ -682,8 +686,8 @@
</DefaultDir>
<FileAssoc title="File Association">
<Item id="4009" name="Supported exts:"/>
<Item id="4010" name="Registered exts:"/>
<Item id="4009" name="Supported extensions:"/>
<Item id="4010" name="Registered extensions:"/>
</FileAssoc>
<LangMenu title="Language Menu">
<Item id="6505" name="Available items"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<NotepadPlus>
<Native-Langue name="English" filename="english_customizable.xml" version="6.5.2">
<Native-Langue name="English" filename="english_customizable.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -19,7 +19,7 @@
</Entries>
<!-- Sub Menu Entries -->
<SubEntries>
<Item subMenuId="file-openFolder" name="Open Containing Folder"/>
<Item subMenuId="file-openFolder" name="Open Containing Folder"/>
<Item subMenuId="file-closeMore" name="Close More"/>
<Item subMenuId="file-recentFiles" name="Recent Files"/>
<Item subMenuId="edit-copyToClipboard" name="Copy to Clipboard"/>
@ -95,7 +95,7 @@
<Item id="42005" name="&amp;Paste"/>
<Item id="42006" name="&amp;Delete"/>
<Item id="42007" name="Select A&amp;ll"/>
<Item id="42020" name="Begin/End Select"/>
<Item id="42020" name="Begin/End Select"/>
<Item id="42008" name="Increase Line Indent"/>
<Item id="42009" name="Decrease Line Indent"/>
<Item id="42010" name="Duplicate Current Line"/>
@ -103,6 +103,14 @@
<Item id="42013" name="Join Lines"/>
<Item id="42014" name="Move Up Current Line"/>
<Item id="42015" name="Move Down Current Line"/>
<Item id="42059" name="Sort Lines Lexicographically Ascending"/>
<Item id="42060" name="Sort Lines Lexicographically Descending"/>
<Item id="42061" name="Sort Lines As Integers Ascending"/>
<Item id="42062" name="Sort Lines As Integers Descending"/>
<Item id="42063" name="Sort Lines As Decimals (Comma) Ascending"/>
<Item id="42064" name="Sort Lines As Decimals (Comma) Descending"/>
<Item id="42065" name="Sort Lines As Decimals (Dot) Ascending"/>
<Item id="42066" name="Sort Lines As Decimals (Dot) Descending"/>
<Item id="42016" name="UPPERCASE"/>
<Item id="42017" name="lowercase"/>
<Item id="42018" name="&amp;Start Recording"/>
@ -142,9 +150,7 @@
<Item id="42055" name="Remove Empty Lines"/>
<Item id="42056" name="Remove Empty Lines (Containing Blank characters)"/>
<Item id="42057" name="Insert Blank Line Above Current"/>
<Item id="42058" name="Insert Blank Line Bellow Current"/>
<Item id="42059" name="Sort Lines in Ascending Order"/>
<Item id="42060" name="Sort Lines in Descending Order"/>
<Item id="42058" name="Insert Blank Line Below Current"/>
<Item id="43001" name="&amp;Find..."/>
<Item id="43002" name="Find &amp;Next"/>
<Item id="43003" name="Replace..."/>
@ -156,10 +162,10 @@
<Item id="43018" name="Cut Bookmarked Lines"/>
<Item id="43019" name="Copy Bookmarked Lines"/>
<Item id="43020" name="Paste to (Replace) Bookmarked Lines"/>
<Item id="43021" name="Remove Bookmarked Lines"/>
<Item id="43051" name="Remove Unmarked Lines"/>
<Item id="43021" name="Remove Bookmarked Lines"/>
<Item id="43051" name="Remove Unmarked Lines"/>
<Item id="43050" name="Inverse Bookmark"/>
<Item id="43052" name="Find characters in range..."/>
<Item id="43052" name="Find characters in range..."/>
<Item id="43053" name="Select All Between Matching Braces"/>
<Item id="43009" name="Go to Matching Brace"/>
<Item id="43010" name="Find Previous"/>
@ -167,8 +173,6 @@
<Item id="43013" name="Find in Files"/>
<Item id="43014" name="Find (Volatile) Next"/>
<Item id="43015" name="Find (Volatile) Previous"/>
<Item id="43016" name="Mark All"/>
<Item id="43017" name="Unmark All"/>
<Item id="43022" name="Using 1st Style"/>
<Item id="43023" name="Clear 1st Style"/>
<Item id="43024" name="Using 2nd Style"/>
@ -197,6 +201,7 @@
<Item id="43047" name="Previous Search Result"/>
<Item id="43048" name="Select and Find Next"/>
<Item id="43049" name="Select and Find Previous"/>
<Item id="43054" name="Mark..."/>
<Item id="44009" name="Post-It"/>
<Item id="44010" name="Fold All"/>
<Item id="44019" name="Show All Characters"/>
@ -252,17 +257,31 @@
<Item id="10003" name="Move to New Instance"/>
<Item id="10004" name="Open in New Instance"/>
<Item id="45060" name="Big5 (Traditional)"/>
<Item id="45061" name="GB2312 (Simplified)"/>
<Item id="45054" name="OEM 861: Icelandic"/>
<Item id="45057" name="OEM 865: Nordic"/>
<Item id="45053" name="OEM 860: Portuguese"/>
<Item id="45056" name="OEM 863: French"/>
<Item id="46033" name="Assembly"/>
<Item id="46019" name="MS INI file"/>
<Item id="46015" name="MS-DOS Style"/>
<Item id="46016" name="Normal Text"/>
<Item id="46017" name="Resource file"/>
<Item id="46001" name="Style Configurator..."/>
<Item id="46150" name="Define your language..."/>
<Item id="46150" name="Define your language..."/>
<Item id="46080" name="User-Defined"/>
<Item id="47000" name="About Notepad++..."/>
<Item id="47010" name="Command Line Arguments..."/>
<Item id="47001" name="Notepad++ Home"/>
<Item id="47002" name="Notepad++ Project Page"/>
<Item id="47003" name="Online Documentation"/>
<Item id="47004" name="Forum"/>
<Item id="47004" name="Notepad++ Community (Forum)"/>
<Item id="47011" name="Live Support"/>
<Item id="47005" name="Get More Plugins"/>
<Item id="47006" name="Update Notepad++"/>
<Item id="47008" name="Help Contents"/>
<Item id="47009" name="Set Updater Proxy..."/>
<Item id="48005" name="Import Plugin(s) ..."/>
<Item id="48006" name="Import Theme(s) ..."/>
@ -302,9 +321,9 @@
<Item CMID="14" name="Move to New Instance"/>
<Item CMID="15" name="Open in New Instance"/>
<Item CMID="16" name="Reload"/>
<Item CMID="17" name="Close All to the Left"/>
<Item CMID="17" name="Close All to the Left"/>
<Item CMID="18" name="Close All to the Right"/>
<Item CMID="19" name="Open Containing Folder in Explorer"/>
<Item CMID="19" name="Open Containing Folder in Explorer"/>
<Item CMID="20" name="Open Containing Folder in cmd"/>
</TabBar>
</Menu>
@ -323,20 +342,17 @@
<Item id="1614" name="Count"/>
<Item id="1615" name="Find All"/>
<Item id="1616" name="Mark line"/>
<Item id="1617" name="Style found token"/>
<Item id="1618" name="Purge for each search"/>
<Item id="1621" name="Direction"/>
<Item id="1611" name="Re&amp;place with:"/>
<Item id="1608" name="&amp;Replace"/>
<Item id="1609" name="Replace &amp;All"/>
<Item id="1623" name="Transparency"/>
<Item id="1687" name="On losing focus"/>
<Item id="1688" name="Always"/>
<Item id="1632" name="In selection"/>
<Item id="1633" name="Clear"/>
<Item id="1635" name="Replace All in All Opened Documents"/>
<Item id="1636" name="Find All in All Opened Documents"/>
<Item id="1637" name="Find in Files"/>
<Item id="1654" name="Filters:"/>
<Item id="1655" name="Directory:"/>
<Item id="1656" name="Find All"/>
@ -344,13 +360,26 @@
<Item id="1659" name="In hidden folders"/>
<Item id="1624" name="Search mode"/>
<Item id="1625" name="Normal"/>
<Item id="1626" name="Extended (\n, \r, \t, \0, \x...)"/>
<Item id="1626" name="Extended (\r, \n, \t, \x..., \0)"/>
<Item id="1660" name="Replace in Files"/>
<Item id="1661" name="Follow current doc."/>
<Item id="1641" name="Find All in Current Document"/>
<Item id="1686" name="Transparency"/>
<Item id="1703" name="&amp;. matches newline"/>
<Item id="1703" name="&amp;. matches newline"/>
</Find>
<FindCharsInRange title="Find Characters in Range...">
<Item id="2" name="Close"/>
<Item id="2901" name="Non-ASCII Characters (128-255)"/>
<Item id="2902" name="ASCII Characters (0-127)"/>
<Item id="2903" name="My range:"/>
<Item id="2906" name="&amp;Up"/>
<Item id="2907" name="&amp;Down"/>
<Item id="2908" name="Direction"/>
<Item id="2909" name="Wra&amp;p around"/>
<Item id="2910" name="Find"/>
</FindCharsInRange>
<GoToLine title="Go to...">
<Item id="2007" name="Line"/>
<Item id="2008" name="Offset"/>
@ -380,7 +409,7 @@
<Item id="2207" name="Background colour"/>
<Item id="2208" name="Font name:"/>
<Item id="2209" name="Font size:"/>
<Item id="2211" name="Style:"/>
<Item id="2211" name="Style:"/>
<Item id="2212" name="Colour Style"/>
<Item id="2213" name="Font Style"/>
<Item id="2214" name="Default ext.:"/>
@ -401,7 +430,7 @@
</StyleConfig>
<UserDefine title="User-Defined">
<Item id="20001" name="Dock"/>
<Item id="20001" name="Dock"/>
<Item id="20002" name="Rename"/>
<Item id="20003" name="Create New..."/>
<Item id="20004" name="Remove"/>
@ -412,37 +441,39 @@
<Item id="20011" name="Transparency"/>
<Item id="20015" name="Import..."/>
<Item id="20016" name="Export..."/>
<StylerDialog title="Styler Dialog">
<StylerDialog title="Styler Dialog">
<Item id="25030" name="Font options:"/>
<Item id="25006" name="Foreground colour"/>
<Item id="25007" name="Background colour"/>
<Item id="25031" name="Name:"/>
<Item id="25032" name="Size:"/>
<Item id="25001" name="Bold"/>
<Item id="25002" name="Italic"/>
<Item id="25003" name="Underline"/>
<Item id="25029" name="Nesting:"/>
<Item id="25008" name="Delimiter 1"/>
<Item id="25009" name="Delimiter 2"/>
<Item id="25010" name="Delimiter 3"/>
<Item id="25011" name="Delimiter 4"/>
<Item id="25012" name="Delimiter 5"/>
<Item id="25013" name="Delimiter 6"/>
<Item id="25014" name="Delimiter 7"/>
<Item id="25015" name="Delimiter 8"/>
<Item id="25018" name="Keyword 1"/>
<Item id="25019" name="Keyword 2"/>
<Item id="25020" name="Keyword 3"/>
<Item id="25021" name="Keyword 4"/>
<Item id="25022" name="Keyword 5"/>
<Item id="25023" name="Keyword 6"/>
<Item id="25024" name="Keyword 7"/>
<Item id="25025" name="Keyword 8"/>
<Item id="25016" name="Comment"/>
<Item id="25017" name="Comment line"/>
<Item id="25026" name="Operator 1"/>
<Item id="25027" name="Operator 2"/>
<Item id="25028" name="Numbers"/>
<Item id="25006" name="Foreground colour"/>
<Item id="25007" name="Background colour"/>
<Item id="25031" name="Name:"/>
<Item id="25032" name="Size:"/>
<Item id="25001" name="Bold"/>
<Item id="25002" name="Italic"/>
<Item id="25003" name="Underline"/>
<Item id="25029" name="Nesting:"/>
<Item id="25008" name="Delimiter 1"/>
<Item id="25009" name="Delimiter 2"/>
<Item id="25010" name="Delimiter 3"/>
<Item id="25011" name="Delimiter 4"/>
<Item id="25012" name="Delimiter 5"/>
<Item id="25013" name="Delimiter 6"/>
<Item id="25014" name="Delimiter 7"/>
<Item id="25015" name="Delimiter 8"/>
<Item id="25018" name="Keyword 1"/>
<Item id="25019" name="Keyword 2"/>
<Item id="25020" name="Keyword 3"/>
<Item id="25021" name="Keyword 4"/>
<Item id="25022" name="Keyword 5"/>
<Item id="25023" name="Keyword 6"/>
<Item id="25024" name="Keyword 7"/>
<Item id="25025" name="Keyword 8"/>
<Item id="25016" name="Comment"/>
<Item id="25017" name="Comment line"/>
<Item id="25026" name="Operator 1"/>
<Item id="25027" name="Operator 2"/>
<Item id="25028" name="Numbers"/>
<Item id="1" name="OK"/>
<Item id="2" name="Cancel"/>
</StylerDialog>
<Folder title="Folder &amp;&amp; Default">
<Item id="21101" name="Default style"/>
@ -450,13 +481,13 @@
<Item id="21105" name="Documentation:"/>
<Item id="21104" name="Temporary doc site:"/>
<Item id="21106" name="Fold compact (fold empty lines too)"/>
<Item id="21220" name="Folding in code 1 style:"/>
<Item id="21224" name="Open:"/>
<Item id="21220" name="Folding in code 1 style:"/>
<Item id="21224" name="Open:"/>
<Item id="21225" name="Middle:"/>
<Item id="21226" name="Close:"/>
<Item id="21227" name="Styler"/>
<Item id="21320" name="Folding in code 2 style (separators needed):"/>
<Item id="21324" name="Open:"/>
<Item id="21320" name="Folding in code 2 style (separators needed):"/>
<Item id="21324" name="Open:"/>
<Item id="21325" name="Middle:"/>
<Item id="21326" name="Close:"/>
<Item id="21327" name="Styler"/>
@ -464,7 +495,7 @@
<Item id="21424" name="Open:"/>
<Item id="21425" name="Middle:"/>
<Item id="21426" name="Close:"/>
<Item id="21127" name="Styler"/>
<Item id="21427" name="Styler"/>
</Folder>
<Keywords title="Keywords Lists">
<Item id="22101" name="1st Group"/>
@ -483,7 +514,7 @@
<Item id="22521" name="Prefix mode"/>
<Item id="22571" name="Prefix mode"/>
<Item id="22621" name="Prefix mode"/>
<Item id="22122" name="Styler"/>
<Item id="22122" name="Styler"/>
<Item id="22222" name="Styler"/>
<Item id="22322" name="Styler"/>
<Item id="22422" name="Styler"/>
@ -523,51 +554,50 @@
</Comment>
<Operator title="Operators &amp;&amp; Delimiter">
<Item id="24101" name="Operators style"/>
<Item id="24113" name="Styler"/>
<Item id="24116" name="Operators 1"/>
<Item id="24117" name="Operators 2 (separators required)"/>
<Item id="24113" name="Styler"/>
<Item id="24116" name="Operators 1"/>
<Item id="24117" name="Operators 2 (separators required)"/>
<Item id="24201" name="Delimiter 1 style"/>
<Item id="24220" name="Open:"/>
<Item id="24220" name="Open:"/>
<Item id="24221" name="Escape:"/>
<Item id="24222" name="Close:"/>
<Item id="24223" name="Styler"/>
<Item id="24301" name="Delimiter 2 style"/>
<Item id="24320" name="Open:"/>
<Item id="24320" name="Open:"/>
<Item id="24321" name="Escape:"/>
<Item id="24322" name="Close:"/>
<Item id="24323" name="Styler"/>
<Item id="24401" name="Delimiter 3 style"/>
<Item id="24420" name="Open:"/>
<Item id="24420" name="Open:"/>
<Item id="24421" name="Escape:"/>
<Item id="24422" name="Close:"/>
<Item id="24423" name="Styler"/>
<Item id="24451" name="Delimiter 4 style"/>
<Item id="24470" name="Open:"/>
<Item id="24470" name="Open:"/>
<Item id="24471" name="Escape:"/>
<Item id="24472" name="Close:"/>
<Item id="24473" name="Styler"/>
<Item id="24501" name="Delimiter 5 style"/>
<Item id="24520" name="Open:"/>
<Item id="24520" name="Open:"/>
<Item id="24521" name="Escape:"/>
<Item id="24522" name="Close:"/>
<Item id="24523" name="Styler"/>
<Item id="24551" name="Delimiter 6 style"/>
<Item id="24570" name="Open:"/>
<Item id="24570" name="Open:"/>
<Item id="24571" name="Escape:"/>
<Item id="24572" name="Close:"/>
<Item id="24573" name="Styler"/>
<Item id="24601" name="Delimiter 7 style"/>
<Item id="24620" name="Open:"/>
<Item id="24620" name="Open:"/>
<Item id="24621" name="Escape:"/>
<Item id="24622" name="Close:"/>
<Item id="24623" name="Styler"/>
<Item id="24651" name="Delimiter 8 style"/>
<Item id="24670" name="Open:"/>
<Item id="24670" name="Open:"/>
<Item id="24671" name="Escape:"/>
<Item id="24672" name="Close:"/>
<Item id="24673" name="Styler"/>
</Operator>
<Item id="24001" name="Enable escape character:"/>
</UserDefine>
<Preference title="Preferences">
<Item id="6001" name="Close"/>
@ -591,12 +621,12 @@
<Item id="6119" name="Multi-line"/>
<Item id="6120" name="Vertical"/>
<Item id="6121" name="Menu Bar"/>
<Item id="6122" name="Hide (use Alt or F10 key to toggle)"/>
<Item id="6123" name="Localization"/>
<Item id="6125" name="Document List Panel"/>
<Item id="6125" name="Document List Panel"/>
<Item id="6126" name="Show"/>
<Item id="6127" name="Disable extension column"/>
</Global>
<Scintillas title="Editing">
<Item id="6216" name="Caret Settings"/>
@ -622,13 +652,15 @@
<Item id="6207" name="Display bookmarks"/>
<Item id="6208" name="Show vertical edge"/>
<Item id="6209" name="Number of columns: "/>
<Item id="6234" name="Disable advanced scrolling feature
(if you have touchpad problem)"/>
<Item id="6211" name="Vertical Edge Settings"/>
<Item id="6212" name="Line mode"/>
<Item id="6213" name="Background mode"/>
<Item id="6214" name="Enable current line highlighting"/>
<Item id="6231" name="Border Width"/>
<Item id="6215" name="Enable smooth font"/>
<Item id="6231" name="Border Width"/>
</Scintillas>
<NewDoc title="New Document">
@ -638,10 +670,10 @@
<Item id="6404" name="Mac"/>
<Item id="6405" name="Encoding"/>
<Item id="6406" name="ANSI"/>
<Item id="6407" name="UTF-8 without BOM"/>
<Item id="6408" name="UTF-8"/>
<Item id="6409" name="UCS-2 Big Endian"/>
<Item id="6410" name="UCS-2 Little Endian"/>
<Item id="6407" name="UTF-8"/>
<Item id="6408" name="UTF-8 with BOM"/>
<Item id="6409" name="UCS-2 Big Endian with BOM"/>
<Item id="6410" name="UCS-2 Little Endian with BOM"/>
<Item id="6411" name="Default language:"/>
<Item id="6419" name="New Document"/>
<Item id="6420" name="Apply to opened ANSI files"/>
@ -654,8 +686,8 @@
</DefaultDir>
<FileAssoc title="File Association">
<Item id="4009" name="Supported exts:"/>
<Item id="4010" name="Registered exts:"/>
<Item id="4009" name="Supported extensions:"/>
<Item id="4010" name="Registered extensions:"/>
</FileAssoc>
<LangMenu title="Language Menu">
<Item id="6505" name="Available items"/>
@ -697,7 +729,7 @@
<Item id="6722" name="Right part"/>
<Item id="6723" name="Add"/>
<Item id="6725" name="Variable:"/>
<Item id="6727" name="Here display your variable settings"/>
<Item id="6727" name="Here display your variable settings"/>
<Item id="6728" name="Header and Footer"/>
</Print>
@ -713,6 +745,12 @@
</RecentFilesHistory>
<Backup title="Backup">
<Item id="6817" name="Session snapshot and periodic backup"/>
<Item id="6818" name="Enable session snapshot and periodic backup"/>
<Item id="6819" name="Backup in every"/>
<Item id="6821" name="seconds"/>
<Item id="6822" name="Backup path:"/>
<Item id="6309" name="Remember current session for next launch"/>
<Item id="6801" name="Backup"/>
<Item id="6315" name="None"/>
<Item id="6316" name="Simple backup"/>
@ -726,6 +764,7 @@
<Item id="6808" name="Enable auto-completion on each input"/>
<Item id="6809" name="Function completion"/>
<Item id="6810" name="Word completion"/>
<Item id="6816" name="Function and word completion"/>
<Item id="6811" name="From"/>
<Item id="6813" name="th character"/>
<Item id="6814" name="Valid value: 1 - 9"/>
@ -754,10 +793,16 @@
<Item id="6256" name="Allow on several lines"/>
</Delimiter>
<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>
<MISC title="MISC.">
<Item id="6307" name="Enable"/>
<Item id="6308" name="Minimize to system tray"/>
<Item id="6309" name="Remember current session for next launch"/>
<Item id="6312" name="File Status Auto-Detection"/>
<Item id="6313" name="Update silently"/>
<Item id="6318" name="Clickable Link Settings"/>
@ -775,7 +820,8 @@
<Item id="6331" name="Show only filename in title bar"/>
<Item id="6332" name="Match case"/>
<Item id="6333" name="Smart Highlighting"/>
<Item id="6334" name="Autodetect character encoding"/>
<Item id="6334" name="Autodetect character encoding"/>
<Item id="6335" name="Treat backslash as escape character for SQL"/>
<Item id="6114" name="Enable"/>
<Item id="6115" name="Auto-indent"/>
<Item id="6117" name="Enable MRU behaviour"/>
@ -824,28 +870,29 @@
<!-- $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."/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Clipboard History"/>
<PanelTitle name="Clipboard History"/>
</ClipboardHistory>
<DocSwitcher>
<PanelTitle name="Doc Switcher"/>
<ColumnName name="Name"/>
<ColumnExt name="Ext."/>
<PanelTitle name="Doc Switcher"/>
<ColumnName name="Name"/>
<ColumnExt name="Ext."/>
</DocSwitcher>
<AsciiInsertion>
<PanelTitle name="ASCII Insertion Panel"/>
<ColumnVal name="Value"/>
<ColumnHex name="Hex"/>
<ColumnChar name="Character"/>
<PanelTitle name="ASCII Insertion Panel"/>
<ColumnVal name="Value"/>
<ColumnHex name="Hex"/>
<ColumnChar name="Character"/>
</AsciiInsertion>
<DocumentMap>
<PanelTitle name="Document Map"/>
<PanelTitle name="Document Map"/>
</DocumentMap>
<FunctionList>
<PanelTitle name="Function List"/>
<SortTip name="Sort" />
<ReloadTip name="Reload" />
<PanelTitle name="Function List"/>
<SortTip name="Sort" />
<ReloadTip name="Reload" />
</FunctionList>
<ProjectManager>
<PanelTitle name="Project"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<NotepadPlus>
<Native-Langue name="Français" filename="french.xml" version="6.7.5">
<Native-Langue name="Français" filename="french.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -90,6 +90,7 @@
<Item id="41015" name="Enregistrer une copie..."/>
<Item id="41016" name="Supprimer"/>
<Item id="41017" name="Renommer..."/>
<Item id="41021" name="Ouvrir le fichier récemment fermé"/>
<Item id="42001" name="Cou&amp;per"/>
<Item id="42002" name="&amp;Copier"/>
<Item id="42003" name="&amp;Annuler"/>
@ -130,8 +131,14 @@
<Item id="42056" name="Enlever les lignes vides (contenant les blancs aussi)"/>
<Item id="42057" name="Insérer une ligne vide devant la ligne courante"/>
<Item id="42058" name="Insérer une ligne vide après la ligne courante"/>
<Item id="42059" name="Trier les lignes dans l'ordre croissant"/>
<Item id="42060" name="Trier les lignes dans l'ordre décroissant"/>
<Item id="42059" name="Trier les lignes dans l'ordre lexicographique croissant"/>
<Item id="42061" name="Trier les lignes dans l'ordre d'entier croissant"/>
<Item id="42063" name="Trier les lignes dans l'ordre décimal (virgule) croissant"/>
<Item id="42065" name="Trier les lignes dans l'ordre décimal (point) croissant"/>
<Item id="42060" name="Trier les lignes dans l'ordre lexicographique décroissant"/>
<Item id="42062" name="Trier les lignes dans l'ordre d'entier décroissant"/>
<Item id="42064" name="Trier les lignes dans l'ordre décimal (virgule) décroissant"/>
<Item id="42066" name="Trier les lignes dans l'ordre décimal (point) décroissant"/>
<Item id="42037" name="Sélection en mode colonne..."/>
<Item id="42040" name="Ouvrir tous les fichiers récents"/>
<Item id="42041" name="Vider la liste des fichiers récents"/>
@ -199,6 +206,7 @@
<Item id="43051" name="Supprimer les lignes non marquées"/>
<Item id="43052" name="Rechercher des caractères dans une plage..."/>
<Item id="43053" name="Sélectionner tout entre les 2 accolades"/>
<Item id="43054" name="Marquer..."/>
<Item id="44009" name="Post-it"/>
<Item id="44010" name="Replier tous les blocs"/>
<Item id="44019" name="Afficher tous les caractères"/>
@ -273,6 +281,7 @@
<Item id="47008" name="Aide"/>
<Item id="47009" name="Paramétrer le Proxy d'Updater..."/>
<Item id="47010" name="Arguments de la Ligne de Commande..."/>
<Item id="47011" name="Support en Direct"/>
<Item id="48005" name="Importer un complément..."/>
<Item id="48006" name="Importer un thème..."/>
<Item id="48009" name="Raccourcis clavier..."/>
@ -477,6 +486,8 @@
<Item id="25030" name="Police:"/>
<Item id="25031" name="Nom:"/>
<Item id="25032" name="Taille:"/>
<Item id="1" name="Enregistrer"/>
<Item id="2" name="Annuler"/>
</StylerDialog>
<Keywords title="Mots-clés">
<Item id="22101" name="1er Groupe"/>
@ -621,6 +632,7 @@
<Item id="6212" name="Afficher un filet vertical"/>
<Item id="6213" name="Colorer larrière-plan"/>
<Item id="6214" name="Surligner la ligne actuelle"/>
<Item id="6215" name="Activer smooth font"/>
<Item id="6216" name="Curseur"/>
<Item id="6217" name="Largeur :"/>
<Item id="6219" name="Clignotement :"/>
@ -764,10 +776,8 @@
<Cloud title="Cloud">
<Item id="6262" name="Sauvegarder les paramètres dans le cloud"/>
<Item id="6263" name="Local"/>
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<Item id="6263" name="Par défaut"/>
<Item id="6267" name="Le chemin d'accèss de votre location de cloud :"/>
<!--Item id="6261" name="Please restart Notepad++ to take effect."/-->
</Cloud>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
German localization for Notepad++ 6.7.9.x,
last modified 2015-07-10 by Jan Schreiber.
German localization for Notepad++ 6.8,
last modified 2015-08-03 by Jan Schreiber.
Please e-mail errors, suggestions etc. to janschreiber(at)users.sf.net.
@ -332,7 +332,7 @@
<!-- Dialog Windows: -->
<Dialog>
<!-- Find and Replace Dialog: -->
<Find title="Suchen &amp; Ersetzen" titleFind="Suchen" titleReplace="Ersetzen" titleFindInFiles="In Dateien suchen" titleMark="Vorkommnisse markieren">
<Find title="Suchen und ersetzen" titleFind="Suchen" titleReplace="Ersetzen" titleFindInFiles="In Dateien suchen" titleMark="Hervorheben">
<Item id="1" name="&amp;Weitersuchen"/>
<Item id="2" name="&amp;Schließen"/>
<Item id="1603" name="Nur &amp;ganze Wörter suchen"/>
@ -341,7 +341,7 @@
<Item id="1606" name="Am Ende von vorn &amp;beginnen"/>
<Item id="1608" name="&amp;Ersetzen"/>
<Item id="1609" name="Alle erse&amp;tzen"/>
<Item id="1611" name="Erset&amp;zen durch"/>
<Item id="1611" name="Erset&amp;zen durch:"/>
<Item id="1612" name="R&amp;ückwärts"/>
<Item id="1613" name="&amp;Vorwärts"/>
<Item id="1614" name="Z&amp;ählen"/>
@ -349,11 +349,11 @@
<Item id="1616" name="&amp;Lesezeichen setzen"/>
<Item id="1617" name="&amp;Treffer markieren"/>
<Item id="1618" name="Für &amp;jede Suche löschen"/>
<Item id="1620" name="Suchen &amp;nach"/>
<Item id="1620" name="Suchen &amp;nach:"/>
<Item id="1621" name="Suchrichtung"/>
<Item id="1624" name="Suchmodus"/>
<Item id="1625" name="Norma&amp;l"/>
<Item id="1626" name="Erwe&amp;itert (\n, \r, \t, \0, \x...)"/>
<Item id="1626" name="Erwe&amp;itert (\r, \n, \t, \x..., \0)"/>
<Item id="1627" name="Unten"/>
<Item id="1632" name="In &amp;Markierung"/>
<Item id="1633" name="Zurücksetzen"/>
@ -362,8 +362,8 @@
<Item id="1637" name="In Dateien suchen"/>
<Item id="1640" name="Umschaltdialog"/>
<Item id="1641" name="Alle in aktiver &amp;Datei suchen"/>
<Item id="1654" name="Filter"/>
<Item id="1655" name="Verzeichnis"/>
<Item id="1654" name="Filter:"/>
<Item id="1655" name="Verzeichnis:"/>
<Item id="1656" name="Alle su&amp;chen"/>
<Item id="1658" name="&amp;Unterverzeichnisse"/>
<Item id="1659" name="&amp;Versteckte Ordner"/>
@ -655,6 +655,7 @@
<Item id="6212" name="vertikale Linie"/>
<Item id="6213" name="farbiger Hintergrund"/>
<Item id="6214" name="Aktuelle Zeile hervorheben"/>
<Item id="6215" name="Kantenglättung der Schriftarten"/>
<Item id="6216" name="Cursoreinstellungen"/>
<Item id="6217" name="Breite"/>
<Item id="6219" name="Geschwindigkeit"/>
@ -798,9 +799,7 @@
<Cloud title="Cloud-Einstellungen">
<Item id="6262" name="Einstellungen in der Cloud speichern"/>
<Item id="6263" name="aus"/>
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<Item id="6267" name="Netzwerkpfad:"/>
</Cloud>
<AutoCompletion title="Autovervollständigung">
<Item id="6807" name="Autovervollständigung"/>

View File

@ -3,9 +3,9 @@
<!-- Email: batagy.ford kukac gmail pont com -->
<!-- Webpage: http://w3.hdsnet.hu/batagy/ -->
<!-- Forum topic: https://notepad-plus-plus.org/community/topic/80/hungarian-translation-->
<!-- For Notepad++ Version 6.8, modified 2015.07.22 -->
<!-- For Notepad++ Version 6.8.2, modified 2015.08.20 -->
<NotepadPlus>
<Native-Langue name="Magyar" filename="hungarian.xml" version="6.8">
<Native-Langue name="Magyar" filename="hungarian.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -290,6 +290,7 @@
<Item id="47001" name="Notepad++ honlapja"/>
<Item id="47002" name="Notepad++ projekt oldal"/>
<Item id="47003" name="Online Súgó"/>
<Item id="47004" name="Notepad++ Fórum"/>
<Item id="47011" name="Élő üzenőfal támogatás"/>
<Item id="47005" name="További bővítmények"/>
<Item id="47006" name="Notepad++ frissítése"/>
@ -371,7 +372,7 @@
<Item id="1659" name="Rejtett mappákban is"/>
<Item id="1624" name="Keresési mód"/>
<Item id="1625" name="Normál"/>
<Item id="1626" name="Bővített (\n, \r, \t, \0, \x... Lásd Súgó)"/>
<Item id="1626" name="Bővített (\r, \n, \t, \x..., \0)"/>
<Item id="1660" name="Csere a fájlokban"/>
<Item id="1661" name="Jelenlegi mappában"/>
<Item id="1641" name="Keresés a jelenlegi dokumentumban"/>
@ -483,8 +484,8 @@
<Item id="25026" name="Operátor 1"/>
<Item id="25027" name="Operátor2"/>
<Item id="25028" name="Számok"/>
<Item id="1" name="&amp;OK"/>
<Item id="2" name="&amp;Mégse"/>
<Item id="1" name="OK"/>
<Item id="2" name="Mégse"/>
</StylerDialog>
<Folder title="Alapstílus és Blokk">
<Item id="21101" name="Alapértelmezett stílus"/>
@ -639,7 +640,6 @@
<Item id="6127" name="Kiterjesztés oszlop tiltása"/>
</Global>
<Scintillas title="Megjelenítés beállításai">
<Item id="6215" name="Betűtípusok simítása"/>
<Item id="6216" name="Kurzor beállításai"/>
<Item id="6217" name="Szélesség:"/>
<Item id="6219" name="Villogás:"/>
@ -670,7 +670,7 @@
<Item id="6212" name="Megjelenítés vonallal"/>
<Item id="6213" name="Megjelenítés kiemeléssel"/>
<Item id="6214" name="Aktuális sor kiemelése"/>
<Item id="6215" name="Betűtípusok simítása"/>
<Item id="6231" name="Ablakkeret szélessége"/>
</Scintillas>
@ -681,10 +681,10 @@
<Item id="6404" name="Mac"/>
<Item id="6405" name="Kódolás"/>
<Item id="6406" name="ANSI"/>
<Item id="6407" name="UTF-8 BOM nélkül"/>
<Item id="6408" name="UTF-8"/>
<Item id="6409" name="UCS-2 Big Endian"/>
<Item id="6410" name="UCS-2 Little Endian"/>
<Item id="6407" name="UTF-8"/>
<Item id="6408" name="UTF-8 BOM-mal"/>
<Item id="6409" name="UCS-2 Big Endian BOM-mal"/>
<Item id="6410" name="UCS-2 Little Endian BOM-mal"/>
<Item id="6411" name="Alapértelmezett nyelv:"/>
<Item id="6418" name="..."/>
<Item id="6419" name="Új dokumentum"/>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
<?xml version = "1.0" encoding = "Windows-1252" ?>
<?xml version = "1.0" encoding = "utf-8" ?>
<NotepadPlus>
<Native-Langue name = "Norsk" filename="norwegian.xml" >
<!-- Endret av Tor Ole Grønvoll 2015-08
torole@gmail.com -->
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -234,6 +236,7 @@
<Item id = "1633" name = "Fjern"/>
<Item id = "1635" name = "Erstatt alle i alle åpne dokument"/>
<Item id = "1636" name = "Finn alle i alle åpne dokument"/>
<Item id = "1641" name = "Finn alle i dette dokumentet"/>
<Item id = "1637" name = "Finn i filer"/>
<Item id = "1654" name = "Filter:"/>
<Item id = "1655" name = "Katalog:"/>
@ -524,7 +527,7 @@
<Item id = "2023" name = "Sett inn tekst "/>
<Item id = "2033" name = "Sett inn tall "/>
<Item id = "2030" name = "Start med:"/>
<Item id = "2031" name = k med:"/>
<Item id = "2031" name = ˜k med:"/>
<Item id = "2035" name = "Bruk null foran"/>
<Item id = "2032" name = " Format "/>
<Item id = "2024" name = "Dec"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<NotepadPlus>
<Native-Langue name="Norsk-nynorsk" filename="no-nn.xml" >
<Native-Langue name="Norsk-nynorsk" filename="nynorsk.xml" >
<!-- Omsett av Thomas Bernes 2008-12
thomas.bernes@gmail.com -->

View File

@ -7,15 +7,15 @@
<Entries>
<Item menuId="file" name="&amp;Ficheiro"/>
<Item menuId="edit" name="&amp;Editar"/>
<Item menuId="search" name="&amp;Procurar"/>
<Item menuId="search" name="P&amp;rocurar"/>
<Item menuId="view" name="&amp;Visualização"/>
<Item menuId="encoding" name="C&amp;odificação"/>
<Item menuId="encoding" name="&amp;Codificação"/>
<Item menuId="language" name="&amp;Linguagem"/>
<Item menuId="settings" name="Confi&amp;guração"/>
<Item menuId="settings" name="C&amp;onfiguração"/>
<Item menuId="macro" name="&amp;Macro"/>
<Item menuId="run" name="E&amp;xecutar"/>
<Item idName="Plugins" name="Plug-ins"/>
<Item idName="Window" name="Janela"/>
<Item idName="Plugins" name="P&amp;lugins"/>
<Item idName="Window" name="J&amp;anela"/>
</Entries>
<!-- Sub Menu Entries -->
<SubEntries>
@ -26,7 +26,7 @@
<Item subMenuId="edit-indent" name="Indentação"/>
<Item subMenuId="edit-convertCaseTo" name="Converter Letra para"/>
<Item subMenuId="edit-blankOperations" name="Operações de Linha"/>
<Item subMenuId="edit-comment" name="Comentar/Descomentar"/>
<Item subMenuId="edit-comment" name="Comentario"/>
<Item subMenuId="edit-autoCompletion" name="Conclusão Automática"/>
<Item subMenuId="edit-eolConversion" name="Conversão EOL (fim da linha)"/>
<Item subMenuId="edit-lineOperations" name="Operações de Linha"/>
@ -76,23 +76,23 @@
<Item id="41018" name="Fechar TUDO à Direita"/>
<Item id="41006" name="&amp;Guardar"/>
<Item id="41007" name="Guardar Tudo"/>
<Item id="41008" name="Guardar &amp;Como ..."/>
<Item id="41010" name="Imprimir ..."/>
<Item id="41008" name="Guardar &amp;Como..."/>
<Item id="41010" name="Imprimir..."/>
<Item id="1001" name="Imprimir Agora"/>
<Item id="41011" name="&amp;Sair"/>
<Item id="41012" name="Carregar Sessão ..."/>
<Item id="41013" name="Guardar Sessão ..."/>
<Item id="41012" name="Carregar Sessão..."/>
<Item id="41013" name="Guardar Sessão..."/>
<Item id="41014" name="Recarregar do Disco"/>
<Item id="41015" name="Guardar uma Cópia Como ..."/>
<Item id="41015" name="Guardar uma Cópia Como..."/>
<Item id="41016" name="Apagar do Disco"/>
<Item id="41017" name="Renomear ..."/>
<Item id="41017" name="Renomear..."/>
<Item id="42001" name="Cor&amp;tar"/>
<Item id="42002" name="&amp;Copiar"/>
<Item id="42003" name="&amp;Anular"/>
<Item id="42002" name="C&amp;opiar"/>
<Item id="42003" name="A&amp;nular"/>
<Item id="42004" name="&amp;Refazer"/>
<Item id="42005" name="Co&amp;lar"/>
<Item id="42006" name="&amp;Apagar"/>
<Item id="42006" name="A&amp;pagar"/>
<Item id="42007" name="Selecionar T&amp;udo"/>
<Item id="42020" name="Selecionar Início/Fim"/>
<Item id="42008" name="Aumentar Indentação da Linha"/>
@ -108,12 +108,12 @@
<Item id="42019" name="&amp;Parar Gravação"/>
<Item id="42021" name="&amp;Reproduzir"/>
<Item id="42022" name="Alternar Comentário de Linha"/>
<Item id="42023" name="Bloquear Comentar"/>
<Item id="42023" name="Bloquear Comentário"/>
<Item id="42047" name="Bloquear Descomentar"/>
<Item id="42024" name="Remover o Espaço do Fim da Linha"/>
<Item id="42042" name="Remover Espaço no Início da Linha"/>
<Item id="42043" name="Remover o Espaço no Início e no Fim da Linha"/>
<Item id="42044" name="Fim da Linha para Espaço"/>
<Item id="42044" name="Fim da Linha do Espaço"/>
<Item id="42045" name="Remover o Espaço em Branco e do Fim da Linha"/>
<Item id="42046" name="TAB para Espaço"/>
<Item id="42054" name="Espaço para TAB (Tudo)"/>
@ -123,9 +123,9 @@
<Item id="42048" name="Copiar Conteúdo Binário"/>
<Item id="42049" name="Cortar Conteúdo Binário"/>
<Item id="42050" name="Colar Conteúdo Binário"/>
<Item id="42037" name="Modo de Coluna ..."/>
<Item id="42034" name="Editor de Coluna ..."/>
<Item id="42051" name="Painel Caráter"/>
<Item id="42037" name="Modo de Coluna..."/>
<Item id="42034" name="Editor de Coluna..."/>
<Item id="42051" name="Painel Carateres"/>
<Item id="42052" name="Hístórico da Área de Transferência"/>
<Item id="42025" name="Guardar a Macro Atualmente Gravada"/>
<Item id="42026" name="Direção do Texto - Direita para a Esquerda"/>
@ -134,7 +134,7 @@
<Item id="42029" name="Caminho do Ficheiro Atual para a Área de Transferência"/>
<Item id="42030" name="Nome do Ficheiro Atual para a Área de Transferência"/>
<Item id="42031" name="Caminho Dir. Atual para a Área de Transferência"/>
<Item id="42032" name="Executar Macro Múltiplas Vezes ..."/>
<Item id="42032" name="Executar Macro Múltiplas Vezes..."/>
<Item id="42033" name="Limpar Símbolo Só de Leitura"/>
<Item id="42035" name="Comentar Bloco"/>
<Item id="42036" name="Descomentar Bloco"/>
@ -144,10 +144,10 @@
<Item id="42058" name="Inserir Linha em Branco por Baixo da Atual"/>
<Item id="42059" name="Ordenar Linhas pela Ordem Ascendente"/>
<Item id="42060" name="Ordenar Linhas pela Ordem Descendente"/>
<Item id="43001" name="&amp;Encontrar ..."/>
<Item id="43002" name="Encontrar &amp;Seguinte"/>
<Item id="43003" name="Substituir ..."/>
<Item id="43004" name="Ir para ..."/>
<Item id="43001" name="&amp;Encontrar..."/>
<Item id="43002" name="&amp;Encontrar Seguinte"/>
<Item id="43003" name="Substituir..."/>
<Item id="43004" name="Ir para..."/>
<Item id="43005" name="Alternar Marcador"/>
<Item id="43006" name="Marcador Seguinte"/>
<Item id="43007" name="Marcador Anterior"/>
@ -158,7 +158,7 @@
<Item id="43021" name="Remover Linhas Marcadas"/>
<Item id="43051" name="Remover Linhas Desmarcadas"/>
<Item id="43050" name="Inverter Marcador"/>
<Item id="43052" name="Encontrar carateres ..."/>
<Item id="43052" name="Encontrar carateres..."/>
<Item id="43053" name="Selecionar Tudo Entre as Chavetas Correspondidas"/>
<Item id="43009" name="Ir para a Chaveta Correspondida"/>
<Item id="43010" name="Encontrar Anterior"/>
@ -201,14 +201,14 @@
<Item id="44019" name="Mostrar Todos os Carateres"/>
<Item id="44020" name="Mostrar Guia de Indentação"/>
<Item id="44022" name="Procura Contínua"/>
<Item id="44023" name="Zoom &amp;+ Ctrl+Roda do Rato p/ Cima"/>
<Item id="44024" name="Zoom &amp;- Ctrl+Roda do Rato p/ Baixo"/>
<Item id="44023" name="Zoom &amp;+ Ctrl+Roda do Rato p/ Cima"/>
<Item id="44024" name="Zoom &amp;- Ctrl+Roda do Rato p/ Baixo"/>
<Item id="44025" name="Mostrar Espaços e Tabulações"/>
<Item id="44026" name="Mostrar Fim da Linha"/>
<Item id="44029" name="Expandir Tudo"/>
<Item id="44030" name="Ocultar Nível Atual"/>
<Item id="44031" name="Expandir Nível Atual"/>
<Item id="44049" name="Resumo ..."/>
<Item id="44049" name="Resumo..."/>
<Item id="44080" name="Mapa Documento"/>
<Item id="44084" name="Lista Função"/>
<Item id="44086" name="1º Separador"/>
@ -251,11 +251,11 @@
<Item id="10003" name="Mover para a Nova Instância"/>
<Item id="10004" name="Abrir numa Nova Instância"/>
<Item id="46001" name="Configurador do Estilo ..."/>
<Item id="46150" name="Defina o seu idioma ..."/>
<Item id="46001" name="Configurador do Estilo..."/>
<Item id="46150" name="Defina o seu idioma..."/>
<Item id="46080" name="Definida pelo Utilizador"/>
<Item id="47000" name="Sobre o Notepad++ ..."/>
<Item id="47010" name="Argumentos da Linha de Comando ..."/>
<Item id="47000" name="Sobre o Notepad++..."/>
<Item id="47010" name="Argumentos da Linha de Comando..."/>
<Item id="47001" name="Página da Notepad++"/>
<Item id="47002" name="Página do Projeto Notepad++"/>
<Item id="47003" name="Documentação na Internet"/>
@ -263,13 +263,13 @@
<Item id="47005" name="Obter Mais Plugins"/>
<Item id="47006" name="Atualizar o Notepad++"/>
<Item id="47008" name="Conteúdos da Ajuda"/>
<Item id="47009" name="Definir Proxy Atualizador ..."/>
<Item id="48005" name="Importar Plugin(s) ..."/>
<Item id="48006" name="Importar Tema(s) ..."/>
<Item id="47009" name="Definir Proxy Atualizador..."/>
<Item id="48005" name="Importar Plugin(s)..."/>
<Item id="48006" name="Importar Tema(s)..."/>
<Item id="48018" name="Editar Janela do Menu de Contexto"/>
<Item id="48009" name="Configurador de Atalho(s) ..."/>
<Item id="48011" name="Preferências ..."/>
<Item id="49000" name="&amp;Executar ..."/>
<Item id="48009" name="Configurador de Atalho(s)..."/>
<Item id="48011" name="Preferências..."/>
<Item id="49000" name="&amp;Executar..."/>
<Item id="50000" name="Conclusão da Função"/>
<Item id="50001" name="Conclusão da Palavra"/>
@ -278,17 +278,17 @@
<Item id="44042" name="Ocultar Linhas"/>
<Item id="42040" name="Abrir Todos os Ficheiros Recentes"/>
<Item id="42041" name="Limpar a Lista dos Ficheiros Recentes"/>
<Item id="48016" name="Modificar Atalho / Apagar Macro ..."/>
<Item id="48017" name="Modificar Atalho / Apagar Comando ..."/>
<Item id="48016" name="Modificar Atalho / Apagar Macro..."/>
<Item id="48017" name="Modificar Atalho / Apagar Comando..."/>
</Commands>
</Main>
<Splitter>
</Splitter>
<TabBar>
<Item CMID="0" name="Fechar"/>
<Item CMID="1" name="Fechar TUDO EXCETO Este"/>
<Item CMID="1" name="Fechar tudo EXCETO Este"/>
<Item CMID="2" name="Guardar"/>
<Item CMID="3" name="Guardar Como ..."/>
<Item CMID="3" name="Guardar Como..."/>
<Item CMID="4" name="Imprimir"/>
<Item CMID="5" name="Mostrar/Fechar Separador Lado a Lado"/>
<Item CMID="6" name="Clonar para Outro Separador"/>
@ -305,7 +305,7 @@
<Item CMID="17" name="Fechar Tudo para a Esquerda"/>
<Item CMID="18" name="Fechar Tudo para a Direita"/>
<Item CMID="19" name="Abrir Pasta Recipiente no Explorador"/>
<Item CMID="20" name="Abrir Pasta Recipiente na Janela do Cmd"/>
<Item CMID="20" name="Abrir Pasta Recipiente na Janela do CMD"/>
</TabBar>
</Menu>
@ -313,7 +313,7 @@
<Find title="" titleFind="Encontrar" titleReplace="Substituir" titleFindInFiles="Encontrar nos Ficheiros" titleMark="Marca">
<Item id="1" name="Encontrar Seguinte"/>
<Item id="2" name="Fechar"/>
<Item id="1620" name="Encontrar o quê?:"/>
<Item id="1620" name="Encontrar o quê?"/>
<Item id="1603" name="Corresponder à &amp;Palavra Completa"/>
<Item id="1604" name="Corresponder &amp;MAI/MIN"/>
<Item id="1605" name="&amp;Expressão Regular "/>
@ -344,14 +344,14 @@
<Item id="1659" name="Nas pastas ocultas"/>
<Item id="1624" name="Modo de procura"/>
<Item id="1625" name="Normal"/>
<Item id="1626" name="Estendido (\n, \r, \t, \0, \x ...)"/>
<Item id="1626" name="Estendido (\n, \r, \t, \0, \x...)"/>
<Item id="1660" name="Substituir nos Ficheiros"/>
<Item id="1661" name="Seguir Documento Atual"/>
<Item id="1641" name="Encontrar Tudo no Documento Atual"/>
<Item id="1686" name="Transparência"/>
<Item id="1703" name="&amp;. corresponde com a nova linha"/>
<Item id="1703" name="&amp;. Corresponde com a nova linha"/>
</Find>
<GoToLine title="Ir para ...">
<GoToLine title="Ir para...">
<Item id="2007" name="Linha"/>
<Item id="2008" name="Posição"/>
<Item id="1" name="&amp;Ir"/>
@ -361,11 +361,11 @@
<Item id="2006" name="Não pode ir além de:"/>
</GoToLine>
<Run title="Executar ...">
<Run title="Executar...">
<Item id="1903" name="Programa a Executar"/>
<Item id="1" name="Executar"/>
<Item id="2" name="Cancelar"/>
<Item id="1904" name="Guardar ..."/>
<Item id="1904" name="Guardar..."/>
</Run>
<StyleConfig title="Configurador de Estilos">
@ -401,17 +401,17 @@
</StyleConfig>
<UserDefine title="Configurações do Utilizador">
<Item id="20001" name="Doca"/>
<Item id="20001" name="Inic. Rápida"/>
<Item id="20002" name="Renomear"/>
<Item id="20003" name="Criar Novo ..."/>
<Item id="20003" name="Criar Novo..."/>
<Item id="20004" name="Remover"/>
<Item id="20005" name="Guardar Como ..."/>
<Item id="20005" name="Guardar Como..."/>
<Item id="20007" name="Idioma do Utilizador: "/>
<Item id="20009" name="Ext.:"/>
<Item id="20012" name="Ignorar MAI/MIN"/>
<Item id="20011" name="Transparência"/>
<Item id="20015" name="Importar ..."/>
<Item id="20016" name="Exportar ..."/>
<Item id="20015" name="Importar..."/>
<Item id="20016" name="Exportar..."/>
<StylerDialog title="Janela do Estilo">
<Item id="25030" name="Opções do Tipo de Letra:"/>
<Item id="25006" name="Cor do Primeiro Plano"/>
@ -421,7 +421,7 @@
<Item id="25001" name="Negrito"/>
<Item id="25002" name="Itálico"/>
<Item id="25003" name="Sublinhar"/>
<Item id="25029" name="Nesting:"/>
<Item id="25029" name="Distribuição:"/>
<Item id="25008" name="Delimitador 1"/>
<Item id="25009" name="Delimitador 2"/>
<Item id="25010" name="Delimitador 3"/>
@ -444,23 +444,23 @@
<Item id="25027" name="Operador 2"/>
<Item id="25028" name="Números"/>
</StylerDialog>
<Folder title="Pasta &amp;&amp; Predefinida">
<Folder title="Pasta &amp;Predefinida">
<Item id="21101" name="Estilo Predefinido"/>
<Item id="21102" name="Estilizar"/>
<Item id="21105" name="Documentação:"/>
<Item id="21104" name="Site do doc. temporário:"/>
<Item id="21106" name="Fold compact (também fold linhas sem dados)"/>
<Item id="21220" name="Folding no código estilo 1:"/>
<Item id="21106" name="Fold compact (Também dobrar linhas sem dados)"/>
<Item id="21220" name="Dobrar no código estilo 1:"/>
<Item id="21224" name="Abrir:"/>
<Item id="21225" name="Meio:"/>
<Item id="21226" name="Fechar:"/>
<Item id="21227" name="Estilizar"/>
<Item id="21320" name="Folding no código estilo 2 (necessário separadores):"/>
<Item id="21320" name="Dobrar no código estilo 2 (necessário separadores):"/>
<Item id="21324" name="Abrir:"/>
<Item id="21325" name="Meio:"/>
<Item id="21326" name="Fechar:"/>
<Item id="21327" name="Estilizar"/>
<Item id="21420" name="Folding in comment style:"/>
<Item id="21420" name="Dobrar em estilo comentário:"/>
<Item id="21424" name="Abrir:"/>
<Item id="21425" name="Meio:"/>
<Item id="21426" name="Fechar:"/>
@ -492,12 +492,12 @@
<Item id="22572" name="Estilizar"/>
<Item id="22622" name="Estilizar"/>
</Keywords>
<Comment title="Comentário &amp;&amp; Número">
<Comment title="Comentário & Número">
<Item id="23003" name="Posição linha comentário"/>
<Item id="23004" name="Permitir em qualquer parte"/>
<Item id="23005" name="Forçar no início da linha"/>
<Item id="23006" name="Permitir espaço em branco precedente"/>
<Item id="23001" name="Permitir folding dos comentários"/>
<Item id="23001" name="Permitir Dobrar os comentários"/>
<Item id="23326" name="Estilizar"/>
<Item id="23323" name="Abrir"/>
<Item id="23324" name="Continuar caráter"/>
@ -528,42 +528,42 @@
<Item id="24117" name="Operadores 2 (necessário separadores)"/>
<Item id="24201" name="Delimitador 1"/>
<Item id="24220" name="Abrir:"/>
<Item id="24221" name="Escape:"/>
<Item id="24221" name="Esc:"/>
<Item id="24222" name="Fechar:"/>
<Item id="24223" name="Estilizar"/>
<Item id="24301" name="Delimitador 2"/>
<Item id="24320" name="Abrir:"/>
<Item id="24321" name="Escape:"/>
<Item id="24321" name="Esc:"/>
<Item id="24322" name="Fechar:"/>
<Item id="24323" name="Estilizar"/>
<Item id="24401" name="Delimitador - Estilo 3"/>
<Item id="24420" name="Abrir:"/>
<Item id="24421" name="Escape:"/>
<Item id="24421" name="Esc:"/>
<Item id="24422" name="Fechar:"/>
<Item id="24423" name="Estilizar"/>
<Item id="24451" name="Delimitador - Estilo 4"/>
<Item id="24470" name="Abrir:"/>
<Item id="24471" name="Escape:"/>
<Item id="24471" name="Esc:"/>
<Item id="24472" name="Fechar:"/>
<Item id="24473" name="Estilizar"/>
<Item id="24501" name="Delimitador - Estilo 5"/>
<Item id="24520" name="Abrir:"/>
<Item id="24521" name="Escape:"/>
<Item id="24521" name="Esc:"/>
<Item id="24522" name="Fechar:"/>
<Item id="24523" name="Estilizar"/>
<Item id="24551" name="Delimitador - Estilo 6"/>
<Item id="24570" name="Abrir:"/>
<Item id="24571" name="Escape:"/>
<Item id="24571" name="Esc:"/>
<Item id="24572" name="Fechar:"/>
<Item id="24573" name="Estilizar"/>
<Item id="24601" name="Delimitador - Estilo 7"/>
<Item id="24620" name="Abrir:"/>
<Item id="24621" name="Escape:"/>
<Item id="24621" name="Esc:"/>
<Item id="24622" name="Fechar:"/>
<Item id="24623" name="Estilizar"/>
<Item id="24651" name="Delimitador - Estilo 8"/>
<Item id="24670" name="Abrir:"/>
<Item id="24671" name="Escape:"/>
<Item id="24671" name="Esc:"/>
<Item id="24672" name="Fechar:"/>
<Item id="24673" name="Estilizar"/>
</Operator>
@ -576,7 +576,7 @@
<Item id="6102" name="Ocultar"/>
<Item id="6103" name="Ícones Pequenos"/>
<Item id="6104" name="Ícones Grandes"/>
<Item id="6105" name="Ícones Standard"/>
<Item id="6105" name="Ícones Normais"/>
<Item id="6106" name=" Barra do Separador "/>
<Item id="6107" name="Diminuir Tamanho"/>
@ -631,7 +631,7 @@
<Item id="6213" name="Modo de fundo"/>
<Item id="6214" name="Ativar o realce da linha atual"/>
<Item id="6231" name="Largura Margem"/>
<Item id="6231" name="Largura da Margem"/>
</Scintillas>
<NewDoc title="Novo Documento">
@ -700,7 +700,7 @@
<Item id="6722" name="Parte Direita"/>
<Item id="6723" name="Adicionar"/>
<Item id="6725" name="Variável:"/>
<Item id="6727" name="Aqui, exibe as definições da sua variável"/>
<Item id="6727" name="Aqui exibe as definições da sua variável"/>
<Item id="6728" name=" Cabeçalho e Rodapé "/>
</Print>
@ -741,7 +741,7 @@
<Item id="6814" name="Valor válido: 1 - 9"/>
<Item id="6815" name="Sugerir dicas da função ao escrever"/>
<Item id="6851" name="Inserir Automático"/>
<Item id="6857" name=" etiqueta fechar html/xml"/>
<Item id="6857" name=" Etiqueta Fechar html/xml"/>
<Item id="6858" name="Abrir"/>
<Item id="6859" name="Fechar"/>
<Item id="6860" name="Par 1 Correspondido:"/>
@ -770,7 +770,9 @@
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<!--Item id="6261" name="Por favor, reinicie o Notepad++ para aplicar."/-->
<!--
Item id="6261" name="Por favor reinicie o Notepad++ para aplicar."/
-->
</Cloud>
<MISC title="Diversos">
@ -832,9 +834,9 @@
</Dialog>
<MessageBox>
<ContextMenuXmlEditWarning title="Editar contextMenu" message="Editar o contextMenu.xml permite-lhe modificar o menu de contexto do seu Notepad++.\r Tem de reiniciar o seu Notepad++ para que as alterações do contextMenu.xml tenham efeito."/>
<NppHelpAbsentWarning title="O ficheiro não existe" message="\rnão existe. Por favor, transfira-o a partir do site do Notepad++."/>
<SaveCurrentModifWarning title="Guardar alterações actuais" message="Deve guardar as alterações actuais.\rTodas as alterações guardadas não poderão ser desfeitas.\r\rContinuar?"/>
<LoseUndoAbilityWarning title="Aviso de impossibilidade de anular" message="Deve guardar as alterações atuais.\nTodas as alterações guardadas não poderão ser desfeitas.\n\nContinuar?"/>
<NppHelpAbsentWarning title="O ficheiro não existe" message="\r não existe. Por favor, transfira-o a partir do site do Notepad++."/>
<SaveCurrentModifWarning title="Guardar alterações actuais" message="Deve guardar as alterações actuais.\r Todas as alterações guardadas não poderão ser desfeitas.\r \r Continuar?"/>
<LoseUndoAbilityWarning title="Aviso de impossibilidade de anular" message="Deve guardar as alterações atuais.\n Todas as alterações guardadas não poderão ser desfeitas.\n \n Continuar?"/>
<CannotMoveDoc title="Mover para nova instância do Notepad++" message="Documento modificado, guarde-o e tente novamente."/>
<DocReloadWarning title="Recarregar" message="Tem a certeza que pretende recarregar o ficheiro atual e perder as alterações efetuadas no Notepad++?"/>
<FileLockedWarning title="Falha ao Guardar" message="Por favor, verifique se o ficheiro está aberto noutro programa."/>
@ -881,15 +883,15 @@
<Item id="3123" name="Abrir Área de Trabalho"/>
<Item id="3124" name="Recarregar Área de Trabalho"/>
<Item id="3125" name="Guardar"/>
<Item id="3126" name="Guardar Como ..."/>
<Item id="3127" name="Guardar uma Cópia Como ..."/>
<Item id="3126" name="Guardar Como..."/>
<Item id="3127" name="Guardar uma Cópia Como..."/>
<Item id="3121" name="Adicionar Novo Projeto"/>
</WorkspaceMenu>
<ProjectMenu>
<Item id="3111" name="Renomear"/>
<Item id="3112" name="Adicionar Pasta"/>
<Item id="3113" name="Adicionar Ficheiros ..."/>
<Item id="3117" name="Adicionar Ficheiros da Pasta ..."/>
<Item id="3113" name="Adicionar Ficheiros..."/>
<Item id="3117" name="Adicionar Ficheiros da Pasta..."/>
<Item id="3114" name="Remover"/>
<Item id="3118" name="Mover para Cima"/>
<Item id="3119" name="Mover Para Baixo"/>
@ -897,9 +899,9 @@
<FolderMenu>
<Item id="3111" name="Renomear"/>
<Item id="3112" name="Adicionar Pasta"/>
<Item id="3113" name="Adicionar Ficheiros ..."/>
<Item id="3113" name="Adicionar Ficheiros..."/>
<Item id="3114" name="Remover"/>
<Item id="3117" name="Adicionar Ficheiros da Pasta ..."/>
<Item id="3117" name="Adicionar Ficheiros da Pasta..."/>
<Item id="3118" name="Mover para Cima"/>
<Item id="3119" name="Mover Para Baixo"/>
</FolderMenu>
@ -919,12 +921,17 @@
Updated by:
André Silva <andreluis.g.silva@gmail.com>
29/05/2011
New update by:
New updates by:
David Cunha <ling.fude@gmail.com>
10/09/2012
Luis Neves <luis.a.neves@sapo.pt>
27/09/2013 (versão 6.4.5)
20/09/2014 (versão 6.6.9) Updated and revised by Manuela Silva (Interpreter/Translator) <manuela.silva@sky.com>
Tradução de Acordo com o Novo Acordo Ortográfico
P.F., NÃO ALTEREM A ORDEM PORQUE TORNA-SE MAIS DIFÍCIL A COMPARAÇÃO ENTRE OS FICHEIROS PT E EN
-->
João Pereira <joaopereira@openmailbox.org>
changelog:
PT- Corrigidos erros de tradução e palavras por interpretar
EN - Corrected translation errors and missing translations for some words
29/07/2015
TRADUÇÃO DE ACORDO COM O NOVO ACORDO ORTOGRÁFICO
POR FAVOR, NÃO ALTEREM A ORDEM PORQUE TORNA-SE MAIS DIFÍCIL A COMPARAÇÃO ENTRE OS FICHEIROS PT E EN
-->

View File

@ -5,39 +5,39 @@
<Main>
<!-- Main Menu Entries -->
<Entries>
<Item menuId="file" name="Файл"/>
<Item menuId="edit" name="Правка"/>
<Item menuId="search" name="Поиск"/>
<Item menuId="view" name="Вид"/>
<Item menuId="encoding" name="Кодировки"/>
<Item menuId="language" name="Синтаксисы"/>
<Item menuId="settings" name="Опции"/>
<Item menuId="macro" name="Макросы"/>
<Item menuId="run" name="Запуск"/>
<Item idName="Plugins" name="Плагины"/>
<Item idName="Window" name="Окна"/>
<Item menuId="file" name="&amp;Файл"/>
<Item menuId="edit" name="&amp;Правка"/>
<Item menuId="search" name="По&amp;иск"/>
<Item menuId="view" name="&amp;Вид"/>
<Item menuId="encoding" name="&amp;Кодировки"/>
<Item menuId="language" name="&amp;Синтаксисы"/>
<Item menuId="settings" name="&amp;Опции"/>
<Item menuId="macro" name="&amp;Макросы"/>
<Item menuId="run" name="&amp;Запуск"/>
<Item idName="Plugins" name="Плаги&amp;ны"/>
<Item idName="Window" name="Окн&amp;а"/>
</Entries>
<!-- Sub Menu Entries -->
<SubEntries>
<Item subMenuId="file-openFolder" name="Открыть папку документа"/>
<Item subMenuId="file-openFolder" name="&amp;Открыть папку документа"/>
<Item subMenuId="file-closeMore" name="Управление вкладками..."/>
<Item subMenuId="file-recentFiles" name="Последние файлы"/>
<Item subMenuId="edit-copyToClipboard" name="Копировать в Буфер..."/>
<Item subMenuId="edit-copyToClipboard" name="Копировать в &amp;Буфер..."/>
<Item subMenuId="edit-indent" name="Отступы (табуляция)"/>
<Item subMenuId="edit-convertCaseTo" name="Преобразовать Регистр"/>
<Item subMenuId="edit-lineOperations" name="Строки"/>
<Item subMenuId="edit-comment" name="Комментарии"/>
<Item subMenuId="edit-convertCaseTo" name="Преобразование Регистра"/>
<Item subMenuId="edit-lineOperations" name="Операции со Строками"/>
<Item subMenuId="edit-comment" name="Комментирование"/>
<Item subMenuId="edit-autoCompletion" name="Автозавершение Ввода"/>
<Item subMenuId="edit-eolConversion" name="Формат Конца Строк"/>
<Item subMenuId="edit-blankOperations" name="Пробелы"/>
<Item subMenuId="edit-blankOperations" name="Операции с Пробелами"/>
<Item subMenuId="edit-pasteSpecial" name="Специальная Вставка"/>
<Item subMenuId="search-markAll" name="Пометить выделенное"/>
<Item subMenuId="search-unmarkAll" name="Убрать Пометки"/>
<Item subMenuId="search-jumpUp" name="Перейти вверх"/>
<Item subMenuId="search-jumpDown" name="Перейти вниз"/>
<Item subMenuId="search-bookmark" name="Закладки"/>
<Item subMenuId="search-bookmark" name="&amp;Закладки"/>
<Item subMenuId="view-showSymbol" name="Отображение символов"/>
<Item subMenuId="view-zoom" name="Масштаб"/>
<Item subMenuId="view-zoom" name="Масштаб текста"/>
<Item subMenuId="view-moveCloneDocument" name="Операции с документом"/>
<Item subMenuId="view-tab" name="Выбор Вкладки..."/>
<Item subMenuId="view-collapseLevel" name="Свернуть уровень"/>
@ -65,25 +65,25 @@
<!-- all menu item -->
<Commands>
<Item id="1001" name="Распечатать!"/>
<Item id="1001" name="&amp;Распечатать!"/>
<Item id="41001" name="Новый"/>
<Item id="41002" name="Открыть"/>
<Item id="41019" name="Открыть папку документа"/>
<Item id="41019" name="&amp;Открыть папку документа"/>
<Item id="41003" name="Закрыть"/>
<Item id="41004" name="Закрыть все"/>
<Item id="41004" name="Закрыть вс&amp;е"/>
<Item id="41005" name="Закрыть все, кроме активной"/>
<Item id="41006" name="Сохранить"/>
<Item id="41007" name="Сохранить все"/>
<Item id="41008" name="Сохранить как..."/>
<Item id="41010" name="Печать..."/>
<Item id="41010" name="Пе&amp;чать..."/>
<Item id="41011" name="Выход"/>
<Item id="41012" name="Загрузить сессию..."/>
<Item id="41013" name="Сохранить сессию..."/>
<Item id="41014" name="Перезагрузить с диска"/>
<Item id="41012" name="&amp;Загрузить сессию..."/>
<Item id="41013" name="&amp;Сохранить сессию..."/>
<Item id="41014" name="&amp;Перезагрузить с диска"/>
<Item id="41015" name="Сохранить копию как..."/>
<Item id="41016" name="Удалить файл (в корзину)"/>
<Item id="41016" name="&amp;Удалить файл (в корзину)"/>
<Item id="41017" name="Переименовать..."/>
<Item id="41020" name="Открыть в консоли cmd"/>
<Item id="41020" name="Открыть папку в &amp;консоли cmd"/>
<Item id="41021" name="Открыть последний закрытый файл"/>
<Item id="41009" name="Закрыть все Слева"/>
<Item id="41018" name="Закрыть все Справа"/>
@ -93,7 +93,7 @@
<Item id="42004" name="Повтор"/>
<Item id="42005" name="Вставить"/>
<Item id="42006" name="Удалить"/>
<Item id="42007" name="Выделить всё"/>
<Item id="42007" name="Выделить все"/>
<Item id="42008" name="Вставить Табуляцию"/>
<Item id="42009" name="Удалить Табуляцию"/>
<Item id="42010" name="Дублировать текущую строку"/>
@ -113,12 +113,12 @@
<Item id="42025" name="Сохранить запись в макрос..."/>
<Item id="42026" name="Текст справа Налево"/>
<Item id="42027" name="Текст слева Направо"/>
<Item id="42028" name="Задать &quot;Только чтение&quot;"/>
<Item id="42029" name="Путь и Имя файла в буфер"/>
<Item id="42030" name="Имя файла в буфер"/>
<Item id="42031" name="Путь к файлу в буфер"/>
<Item id="42028" name="&quot;&amp;Только чтение&quot;"/>
<Item id="42029" name="&amp;Путь и Имя файла"/>
<Item id="42030" name="&amp;Имя файла"/>
<Item id="42031" name="Пу&amp;ть к файлу"/>
<Item id="42032" name="Многократный запуск..."/>
<Item id="42033" name="Снять атрибут &quot;Только чтение&quot;"/>
<Item id="42033" name="&amp;Снять &quot;Только чтение&quot;"/>
<Item id="42034" name="Генератор столбца..."/>
<Item id="42035" name="Закомментировать строку"/>
<Item id="42036" name="Раскомментировать строку"/>
@ -130,18 +130,18 @@
<Item id="42042" name="Убрать Начальные Пробелы"/>
<Item id="42043" name="Убрать Начальные и Замыкающие Пробелы"/>
<Item id="42044" name="Символ Конца Строки в Пробел"/>
<Item id="42045" name="Убрать лишние Пробелы а Концы Строк в Пробел"/>
<Item id="42045" name="Убрать лишние Пробелы / Концы Строк в Пробел"/>
<Item id="42046" name="Табуляцию в Пробел"/>
<Item id="42047" name="Раскомментировать выделенное"/>
<Item id="42048" name="Копировать как Двоичный код"/>
<Item id="42049" name="Вырезать как Двоичный код"/>
<Item id="42050" name="Вставить как Двоичный код"/>
<Item id="42051" name="Таблица символов"/>
<Item id="42052" name="Панель истории буфера обмена"/>
<Item id="42051" name="Табл&amp;ица символов"/>
<Item id="42052" name="&amp;Панель истории буфера обмена"/>
<Item id="42053" name="Пробел в Табуляцию (в начале строки)"/>
<Item id="42054" name="Пробел в Табуляцию (все)"/>
<Item id="42055" name="Удалить Пустые Строки"/>
<Item id="42056" name="Удалить Пустые Строки (Содер. символы Пробел)"/>
<Item id="42056" name="Удалить Пустые Строки (Содер. символы Пробела)"/>
<Item id="42057" name="Вставить пустую строку Перед Текущей"/>
<Item id="42058" name="Вставить пустую строку После Текущей"/>
<Item id="42059" name="Сортировка по Возрастанию (По первой цифре)"/>
@ -159,7 +159,7 @@
<Item id="43005" name="Закладка (поставить /снять)"/>
<Item id="43006" name="К следующей Закладке"/>
<Item id="43007" name="К предыдущей Закладке"/>
<Item id="43008" name="Убрать все Закладки"/>
<Item id="43008" name="&amp;Убрать все Закладки"/>
<Item id="43009" name="Перейти к парной скобке"/>
<Item id="43010" name="Искать ранее"/>
<Item id="43011" name="Поиск по мере набора..."/>
@ -203,7 +203,7 @@
<Item id="43050" name="Инвертировать закладки (все строки)"/>
<Item id="43051" name="Удалить все строки Без Закладки"/>
<Item id="43052" name="Найти символы в диапазоне..."/>
<Item id="43053" name="Выделить всё между Парных Скобок"/>
<Item id="43053" name="Выделить все между Парных Скобок"/>
<Item id="43054" name="Пометки..."/>
<Item id="44009" name="Только текст (во всё окно)"/>
<Item id="44010" name="Свернуть все блоки"/>
@ -216,13 +216,13 @@
<Item id="44023" name="Крупнее (Ctrl+Кол. Вверх)"/>
<Item id="44024" name="Мельче (Ctrl+Кол. Вниз)"/>
<Item id="44025" name="Отображать Пробелы и Табуляции"/>
<Item id="44026" name="Отображать символ Конеца Строки"/>
<Item id="44026" name="Отображать символ Конца Строки"/>
<Item id="44029" name="Развернуть все блоки"/>
<Item id="44030" name="Свернуть текущий блок"/>
<Item id="44031" name="Развернуть текущий блок"/>
<Item id="44032" name="Текст во весь Экран"/>
<Item id="44033" name="Восстановить масштаб..."/>
<Item id="44034" name="Поверх всех окон"/>
<Item id="44034" name="&amp;Поверх всех окон"/>
<Item id="44035" name="Синхрониз. вертикальную прокрутку"/>
<Item id="44036" name="Синхрониз. горизонтальную прокрутку"/>
<Item id="44041" name="Отображать знак Переноса Строк"/>
@ -281,7 +281,7 @@
<Item id="48005" name="Импортировать Плагин(ы)"/>
<Item id="48006" name="Импортировать Тему(ы)"/>
<Item id="48009" name="Горячие клавиши..."/>
<Item id="48011" name="Настройки..."/>
<Item id="48011" name="&amp;Настройки..."/>
<Item id="48016" name="Измен. гор. клав./Удалить макро..."/>
<Item id="48017" name="Измен. гор. клав./Удалить команду..."/>
<Item id="48018" name="Редакт. Контекстное Меню"/>
@ -306,18 +306,18 @@
<Item CMID="4" name="Печать"/>
<Item CMID="5" name="Переместить в Другую Область"/>
<Item CMID="6" name="Дублировать в Другой Области"/>
<Item CMID="7" name="Полный путь к файлу в буфер"/>
<Item CMID="8" name="Имя файла в буфер"/>
<Item CMID="9" name="Путь к директории файла в буфер"/>
<Item CMID="7" name="Полный путь к файлу (в буфер)"/>
<Item CMID="8" name="Имя файла (в буфер)"/>
<Item CMID="9" name="Путь к директории файла (в буфер)"/>
<Item CMID="10" name="Переименовать"/>
<Item CMID="11" name="Удалить файл (в корзину)"/>
<Item CMID="12" name="Задать &quot;Только чтение&quot;"/>
<Item CMID="13" name="Снять атрибут &quot;Только чтение&quot;"/>
<Item CMID="12" name="&quot;Только чтение&quot;"/>
<Item CMID="13" name="Снять &quot;Только чтение&quot;"/>
<Item CMID="14" name="Переместить в Новый Экземпляр"/>
<Item CMID="15" name="Открыть в Новом Экземпляре"/>
<Item CMID="16" name="Перезагрузить с диска"/>
<Item CMID="17" name="Закрыть Вкладки Слева"/>
<Item CMID="18" name="Закрыть Вкладки Справа"/>
<Item CMID="17" name="Закрыть все Вкладки Слева"/>
<Item CMID="18" name="Закрыть все Вкладки Справа"/>
<Item CMID="19" name="Открыть папку документа"/>
<Item CMID="20" name="Открыть папку документа в cmd"/>
</TabBar>
@ -325,33 +325,33 @@
<Dialog>
<Find title = "" titleFind = "Найти" titleReplace = "Заменить" titleFindInFiles = "Найти в файлах" titleMark="Пометки">
<Item id="1" name="Искать далее"/>
<Item id="1" name="&amp;Искать далее"/>
<Item id="2" name="Закрыть"/>
<Item id="1603" name="Только целые слова"/>
<Item id="1604" name="Учитывать регистр"/>
<Item id="1604" name="Учитывать &amp;регистр"/>
<Item id="1605" name="Регуляр. выражен."/>
<Item id="1606" name="Зациклить поиск"/>
<Item id="1606" name="За&amp;циклить поиск"/>
<Item id="1608" name="Заменить"/>
<Item id="1609" name="Заменить всё"/>
<Item id="1609" name="&amp;Заменить все"/>
<Item id="1611" name="Заменить на:"/>
<Item id="1612" name="Вверх"/>
<Item id="1613" name="Вниз"/>
<Item id="1614" name="Подсчитать"/>
<Item id="1615" name="Пометить все"/>
<Item id="1616" name="Помечать Закладкой"/>
<Item id="1615" name="&amp;Пометить все"/>
<Item id="1616" name="Помечат&amp;ь Закладкой"/>
<Item id="1617" name="Помечать найденное"/>
<Item id="1618" name="Убирать предыдущие пометки"/>
<Item id="1620" name="Найти:"/>
<Item id="1621" name="Направление"/>
<Item id="1624" name="Режим поиска"/>
<Item id="1625" name="Обычный"/>
<Item id="1626" name="Расширенный (\n, \r, \t, \0, \x...)"/>
<Item id="1626" name="Расширенный (\r, \n, \t, \x..., \0)"/>
<Item id="1632" name="В выделенном"/>
<Item id="1633" name="Убрать все Пометки"/>
<Item id="1635" name="Заменить всё во всех Открытых Документах"/>
<Item id="1636" name="Найти всё во всех Открытых Документах"/>
<Item id="1633" name="&amp;Убрать все Пометки"/>
<Item id="1635" name="Заменить все во всех Открытых &amp;Документах"/>
<Item id="1636" name="Найти все во всех &amp;Открытых Документах"/>
<Item id="1637" name="Искать в файлах"/>
<Item id="1641" name="Найти все в&#x0A;Текущем Документе"/>
<Item id="1641" name="Найти все в&#x0A;&amp;Текущем Документе"/>
<Item id="1654" name="Фильтры:"/>
<Item id="1655" name="Папка:"/>
<Item id="1656" name="Найти все"/>
@ -366,10 +366,10 @@
</Find>
<GoToLine title= "К строке...">
<Item id="2007" name="Строка"/>
<Item id="2008" name="Положение символа"/>
<Item id="2008" name="Символ"/>
<Item id="1" name="Вперед!"/>
<Item id="2" name="Отмена"/>
<Item id="2004" name="Сейчас вы здесь:"/>
<Item id="2004" name="Вы сейчас здесь:"/>
<Item id="2005" name="Хотите пройти к:"/>
<Item id="2006" name="Максимальное значение:"/>
</GoToLine>
@ -511,7 +511,7 @@
<Item id="22413" name="Префикс режим"/>
</Keywords>
<Comment title="Комментарии и Числа">
<Item id="23003" name="Положение линии комментариев"/>
<Item id="23003" name="Положение комментария строки"/>
<Item id="23004" name="Разрешить где угодно"/>
<Item id="23005" name="Разместить в начале строки"/>
<Item id="23006" name="Предшествующий пробел"/>
@ -600,7 +600,7 @@
<Item id="6107" name="Уменьшенный размер"/>
<Item id="6108" name="Запретить перетаскивание"/>
<Item id="6109" name="Неактивные вкладки серого цвета"/>
<Item id="6110" name="Оранжевая линия над вкладкой"/>
<Item id="6110" name="Оранжевая линия над активной"/>
<Item id="6111" name="Отображать Строку Состояния"/>
<Item id="6112" name="Кнопка закрытия на вкладке"/>
<Item id="6113" name="Закрывать двойным щелчком"/>
@ -841,7 +841,7 @@
<Item id="2" name="Закрыть"/>
<Item id="2901" name="Не-ASCII символы (128-255)"/>
<Item id="2902" name="ASCII символы (0 - 127)"/>
<Item id="2903" name="Мой диапазон:"/>
<Item id="2903" name="Свой диапазон:"/>
<Item id="2906" name="Вверх"/>
<Item id="2907" name="Вниз"/>
<Item id="2908" name="Направление"/>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Slovenian localization for Notepad++ v.6.7.2
Last modified 28. 12. 2014 by Vinko Kastelic
Slovenian localization for Notepad++ v6.8.1
Last modified 20. 08. 2015 by Vinko Kastelic
-->
<NotepadPlus>
<Native-Langue name="Slovenski jezik" filename="slovenian.xml" version="6.7.2" >
<Native-Langue name="Slovenski jezik" filename="slovenian.xml" version="6.8.1" >
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -21,7 +21,7 @@
<Item menuId="run" name="Poženi"/>
<Item idName="Plugins" name="Vtičniki"/>
<Item idName="Window" name="Okno"/>
</Entries>
</Entries>
<!-- Sub Menu Entries -->
<SubEntries>
<Item subMenuId="file-openFolder" name="Odpri vsebino mape"/>
@ -40,11 +40,11 @@
<Item subMenuId="search-unmarkAll" name="Odznači vse"/>
<Item subMenuId="search-jumpUp" name="Skoči navzgor"/>
<Item subMenuId="search-jumpDown" name="Skoči navzdol"/>
<Item subMenuId="search-bookmark" name="Zaznamek"/>
<Item subMenuId="search-bookmark" name="Zaznamek"/>
<Item subMenuId="view-showSymbol" name="Pokaži simbol"/>
<Item subMenuId="view-zoom" name="Povečava"/>
<Item subMenuId="view-moveCloneDocument" name="Premakni/Kloniraj trenutni dokument"/>
<Item subMenuId="view-tab" name="Tabulator"/>
<Item subMenuId="view-tab" name="Tabulator"/>
<Item subMenuId="view-collapseLevel" name="Strni raven"/>
<Item subMenuId="view-uncollapseLevel" name="Razprostri raven"/>
<Item subMenuId="view-project" name="Projekt"/>
@ -67,7 +67,7 @@
<Item subMenuId="encoding-vietnamese" name="vietnamski"/>
<Item subMenuId="settings-import" name="Uvozi"/>
</SubEntries>
<!-- all menu item -->
<Commands>
<Item id="41001" name="&amp;Nov"/>
@ -78,7 +78,7 @@
<Item id="41004" name="&amp;Zapri vse"/>
<Item id="41005" name="Zapri vse razen trenutnega"/>
<Item id="41009" name="Zapri vse na levi"/>
<Item id="41018" name="Zapri vse na desni"/>
<Item id="41018" name="Zapri vse na desni"/>
<Item id="41006" name="&amp;Shrani"/>
<Item id="41007" name="Shrani &amp;vse"/>
<Item id="41008" name="Shrani &amp;kot..."/>
@ -91,7 +91,8 @@
<Item id="41015" name="Shrani kopijo kot..."/>
<Item id="41016" name="Izbriši z diska"/>
<Item id="41017" name="Preimenuj..."/>
<Item id="41021" name="Obnovi nedavno zaprto datoteko"/>
<Item id="42001" name="Iz&amp;reži"/>
<Item id="42002" name="&amp;Kopiraj"/>
<Item id="42003" name="&amp;Razveljavi"/>
@ -105,8 +106,16 @@
<Item id="42010" name="Podvoji trenutno vrstico"/>
<Item id="42012" name="Razdeli vrstice"/>
<Item id="42013" name="Združi vrstice"/>
<Item id="42014" name="Pomakni trenutno vrstico navzgor"/>
<Item id="42015" name="Pomakni trenutno vrstico navzdol"/>
<Item id="42014" name="Pomakni trenutno vrstico navzgor"/>
<Item id="42015" name="Pomakni trenutno vrstico navzdol"/>
<Item id="42059" name="Razvrsti vrstice leksikografsko Naraščajoče"/>
<Item id="42060" name="Razvrsti vrstice leksikografsko Padajoče"/>
<Item id="42061" name="Razvrsti vrstice kot cela števila Naraščujoče"/>
<Item id="42062" name="Razvrsti vrstice kot cela števila Padajoče"/>
<Item id="42063" name="Razvrsti vrstice kot decimalke (z vejico) Naraščujoče"/>
<Item id="42064" name="Razvrsti vrstice kot decimalke (z vejico) Padajoče"/>
<Item id="42065" name="Razvrsti vrstice kot decimalke (s piko) Naraščujoče"/>
<Item id="42066" name="Razvrsti vrstice kot decimalke (s piko) Padajoče"/>
<Item id="42016" name="V VELIKE ČRKE"/>
<Item id="42017" name="v male črke"/>
<Item id="42018" name="&amp;Začni snemanje"/>
@ -131,7 +140,7 @@
<Item id="42037" name="Način stolpca..."/>
<Item id="42034" name="Urejevalnik stolpca..."/>
<Item id="42051" name="Panel znakov"/>
<Item id="42052" name="Zgodovina odložišča"/>
<Item id="42052" name="Zgodovina odložišča"/>
<Item id="42025" name="Shrani trenutno posneti makro"/>
<Item id="42026" name="Smer besedila D->L"/>
<Item id="42027" name="Smer besedila L->D"/>
@ -145,10 +154,8 @@
<Item id="42036" name="Odkomentiraj enovrstični komentar"/>
<Item id="42055" name="Odstrani prazne vrstice"/>
<Item id="42056" name="Odstrani prazne vrstice (Vsebujejo prazne znake)"/>
<Item id="42057" name="Vstavi prazno vrstico nad trenutno"/>
<Item id="42058" name="Vstavi prazno vrstico pod trenutno"/>
<Item id="42059" name="Razvrsti vrstice po naraščajočem vrstnem redu"/>
<Item id="42060" name="Razvrsti vrstice po padajočem vrstnem redu"/>
<Item id="42057" name="Vstavi prazno vrstico nad trenutno"/>
<Item id="42058" name="Vstavi prazno vrstico pod trenutno"/>
<Item id="43001" name="&amp;Najdi..."/>
<Item id="43002" name="Najdi n&amp;aslednjega"/>
<Item id="43003" name="Zamenjaj..."/>
@ -156,7 +163,7 @@
<Item id="43005" name="Preklopi zaznamek"/>
<Item id="43006" name="Naslednji zaznamek"/>
<Item id="43007" name="Prejšnji zaznamek"/>
<Item id="43008" name="Počisti vse zaznamke"/>
<Item id="43008" name="Počisti vse zaznamke"/>
<Item id="43018" name="Izreži zaznamovane vrstice"/>
<Item id="43019" name="Kopiraj zaznamovane vrstice"/>
<Item id="43020" name="Prilepi v (zamenjaj) zaznamovane vrstice"/>
@ -164,15 +171,13 @@
<Item id="43051" name="Odstrani neoznačene vrstice"/>
<Item id="43050" name="Inverzni zaznamek"/>
<Item id="43052" name="Najdi znake v območju..."/>
<Item id="43053" name="Izberi vse ujemanje med oklepaji"/>
<Item id="43053" name="Izberi vse ujemanje med oklepaji"/>
<Item id="43009" name="Pojdi na ujemanja"/>
<Item id="43010" name="Najdi prejšnje"/>
<Item id="43011" name="&amp;Inkrementalno iskanje"/>
<Item id="43013" name="Najdi v datotekah"/>
<Item id="43014" name="Najdi (začasno) Naprej"/>
<Item id="43015" name="Najdi (začasno) Nazaj"/>
<Item id="43016" name="Označi vse"/>
<Item id="43017" name="Odznači vse"/>
<Item id="43022" name="Uporaba 1. sloga"/>
<Item id="43023" name="Počisti 1. slog"/>
<Item id="43024" name="Uporaba 2. sloga"/>
@ -200,9 +205,9 @@
<Item id="43046" name="Naslednji rezultat iskanja"/>
<Item id="43047" name="Prejšnji rezultat iskanja"/>
<Item id="43048" name="Izberi in najdi naslednje"/>
<Item id="43049" name="Izberi in najdi prejšnje"/>
<Item id="43049" name="Izberi in najdi prejšnje"/>
<Item id="44009" name="Lepljivček"/>
<Item id="44010" name="Strni vse"/>
<Item id="44010" name="Strni vse"/>
<Item id="44019" name="Pokaži vse znake"/>
<Item id="44020" name="Pokaži vodilo zamika"/>
<Item id="44022" name="Prelomi besedilo"/>
@ -212,7 +217,7 @@
<Item id="44026" name="Pokaži konce vrstic"/>
<Item id="44029" name="Razprostri vse"/>
<Item id="44030" name="Strni trenutno raven"/>
<Item id="44031" name="Razprostri trenutno raven"/>
<Item id="44031" name="Razprostri trenutno raven"/>
<Item id="44049" name="Povzetek..."/>
<Item id="44080" name="Mapa dokumenta"/>
<Item id="44084" name="Seznam funkcij"/>
@ -226,7 +231,7 @@
<Item id="44093" name="8. tabulator"/>
<Item id="44094" name="9. tabulator"/>
<Item id="44095" name="Naslednji tabulator"/>
<Item id="44096" name="Predhodni tabulator"/>
<Item id="44096" name="Predhodni tabulator"/>
<Item id="44032" name="Preklopi celozaslonski način"/>
<Item id="44033" name="Povrni privzeto povečavo"/>
<Item id="44034" name="Vedno na vrhu"/>
@ -255,7 +260,20 @@
<Item id="10002" name="Kloniraj v drugi pogled"/>
<Item id="10003" name="Premakni v novo pojavitev"/>
<Item id="10004" name="Odpri v novi pojavitvi"/>
<Item id="45060" name="Big5 (Traditional)"/>
<Item id="45061" name="GB2312 (Simplified)"/>
<Item id="45054" name="OEM 861: Islandic"/>
<Item id="45057" name="OEM 865: Nordic"/>
<Item id="45053" name="OEM 860: Portuguese"/>
<Item id="45056" name="OEM 863: French"/>
<Item id="46033" name="Sklop"/>
<Item id="46019" name="MS INI datoteka"/>
<Item id="46015" name="MS-DOS slog"/>
<Item id="46016" name="Običajno besedilo"/>
<Item id="46017" name="Izvorna datoteka"/>
<Item id="46001" name="Nastavljanje sloga..."/>
<Item id="46150" name="Določite svoj jezik..."/>
<Item id="46080" name="Uporabniško določeno"/>
@ -264,10 +282,9 @@
<Item id="47001" name="Domača stran Notepad++"/>
<Item id="47002" name="Stran projekta Notepad++"/>
<Item id="47003" name="Spletna dokumentacija"/>
<Item id="47004" name="Forum"/>
<Item id="47011" name="Podpora v živo"/>
<Item id="47005" name="Dodatni vtičniki"/>
<Item id="47006" name="Posodobi Notepad++"/>
<Item id="47008" name="Vsebina pomoči"/>
<Item id="47009" name="Nastavite Updater Proxy..."/>
<Item id="48005" name="Uvozi vtičnike..."/>
<Item id="48006" name="Uvozi temo..."/>
@ -275,7 +292,7 @@
<Item id="48009" name="Bližnjice..."/>
<Item id="48011" name="Nastavitve..."/>
<Item id="49000" name="&amp;Poženi ..."/>
<Item id="50000" name="Dopolnjevanje funkcij"/>
<Item id="50001" name="Dopolnjevanje besed"/>
<Item id="50002" name="Namig za parametre funkcij"/>
@ -284,7 +301,7 @@
<Item id="42040" name="Odpri vse nedavne datoteke"/>
<Item id="42041" name="Počisti seznam nedavno odprtih datotek"/>
<Item id="48016" name="Spremeni bližnjico/Izbriši makro..."/>
<Item id="48017" name="Spremeni bližnjico/Izbriši ukaz..."/>
<Item id="48017" name="Spremeni bližnjico/Izbriši ukaz..."/>
</Commands>
</Main>
<Splitter>
@ -313,7 +330,7 @@
<Item CMID="20" name="Odpri vsebino mape v cmd.exe oknu"/>
</TabBar>
</Menu>
<Dialog>
<Find title="" titleFind="Najdi" titleReplace="Zamenjaj" titleFindInFiles="Najdi v datotekah" titleMark="Označi">
<Item id="1" name="Najdi naslednjega"/>
@ -328,20 +345,17 @@
<Item id="1614" name="Preštej"/>
<Item id="1615" name="Najdi vse"/>
<Item id="1616" name="Označi vrstico"/>
<Item id="1617" name="Označi najdeni slog"/>
<Item id="1618" name="Počisti ob vsakem iskanju"/>
<Item id="1621" name="Smer"/>
<Item id="1611" name="Z&amp;amenjaj z:"/>
<Item id="1608" name="&amp;Zamenjaj"/>
<Item id="1609" name="Zamenjaj &amp;vse"/>
<Item id="1623" name="Prosojnost"/>
<Item id="1687" name="Ob izgubljeni pozornosti"/>
<Item id="1688" name="Vedno"/>
<Item id="1632" name="V izboru"/>
<Item id="1633" name="Počisti"/>
<Item id="1635" name="Zamenjaj vse v vseh odprtih dokumentih"/>
<Item id="1636" name="Najdi vse v vseh odprtih dokumentih"/>
<Item id="1637" name="Najdi v datotekah"/>
<Item id="1654" name="Filtri:"/>
<Item id="1655" name="Mapa:"/>
<Item id="1656" name="Najdi vse"/>
@ -356,6 +370,19 @@
<Item id="1686" name="Prosojnost"/>
<Item id="1703" name="&amp;. se ujema z novo vrstico"/>
</Find>
<FindCharsInRange title="Najdi znake v razpou...">
<Item id="2" name="Zapri"/>
<Item id="2901" name="Niso-ASCII znaki (128-255)"/>
<Item id="2902" name="ASCII znaki (0-127)"/>
<Item id="2903" name="Moj razpon:"/>
<Item id="2906" name="&amp;Navzgor"/>
<Item id="2907" name="&amp;Navzdol"/>
<Item id="2908" name="Smer"/>
<Item id="2909" name="Oklepaj&amp;oče"/>
<Item id="2910" name="Najdi"/>
</FindCharsInRange>
<GoToLine title="Pojdi v vrstico ...">
<Item id="2007" name="Vrstica"/>
<Item id="2008" name="Zamik"/>
@ -365,7 +392,7 @@
<Item id="2005" name="Želite v:"/>
<Item id="2006" name="Ne morete iti dlje od:"/>
</GoToLine>
<Run title="Poženi...">
<Item id="1903" name="Vnesite program za zagon"/>
<Item id="1" name="Poženi"/>
@ -376,7 +403,7 @@
<StyleConfig title="Prilagoditev sloga">
<Item id="2" name="Prekliči"/>
<Item id="2301" name="Shrani in zapri"/>
<Item id="2303" name="Prosojnost"/>
<Item id="2303" name="Prosojnost"/>
<Item id="2306" name="Izberite temo: "/>
<SubDialog>
<Item id="2204" name="Krepko"/>
@ -402,9 +429,9 @@
<Item id="2231" name="Omogoči splošni ležeči slog pisave"/>
<Item id="2232" name="Omogoči splošni podčrtani slog pisave"/>
</SubDialog>
</StyleConfig>
<UserDefine title="Uporabniško določen">
<Item id="20001" name="Zasidraj"/>
<Item id="20002" name="Preimenuj"/>
@ -469,7 +496,7 @@
<Item id="21424" name="Odpri:"/>
<Item id="21425" name="Sredina:"/>
<Item id="21426" name="Zapri:"/>
<Item id="21127" name="Slogovnik"/>
<Item id="21127" name="Slogovnik"/>
</Folder>
<Keywords title="Seznam ključnih besed">
<Item id="22101" name="1. skupina"/>
@ -495,9 +522,9 @@
<Item id="22472" name="Slogovnik"/>
<Item id="22522" name="Slogovnik"/>
<Item id="22572" name="Slogovnik"/>
<Item id="22622" name="Slogovnik"/>
<Item id="22622" name="Slogovnik"/>
</Keywords>
<Comment title="Komentarji in števila">
<Comment title="Komentarji &amp;&amp; števila">
<Item id="23003" name="Pozicija vrstice komentarja"/>
<Item id="23004" name="Dovoli kjerkoli"/>
<Item id="23005" name="Prisili na začetek vrstice"/>
@ -572,7 +599,6 @@
<Item id="24672" name="Zapri:"/>
<Item id="24673" name="Slogovnik"/>
</Operator>
<Item id="24001" name="Omogoči ubežni znak:"/>
</UserDefine>
<Preference title="Nastavitve">
<Item id="6001" name="Zapri"/>
@ -582,24 +608,23 @@
<Item id="6103" name="Majhne ikone"/>
<Item id="6104" name="Velike ikone"/>
<Item id="6105" name="Majhne standardne ikone"/>
<Item id="6106" name="Vrstica zavihkov"/>
<Item id="6107" name="Zmanjšaj"/>
<Item id="6108" name="Zakleni (brez povleci-in-spusti)"/>
<Item id="6109" name="Potemni neaktivne zavihke"/>
<Item id="6110" name="Nariši obarvano vrstico na aktivnem zavihku"/>
<Item id="6111" name="Pokaži vrstico stanja"/>
<Item id="6112" name="Prikaži gumb za zapiranje na vsakem zavihku"/>
<Item id="6113" name="Dvokliknite za zaprtje dokumenta"/>
<Item id="6118" name="Skrij"/>
<Item id="6119" name="Večvrstično"/>
<Item id="6120" name="Navpično"/>
<Item id="6121" name="Menijska vrstica"/>
<Item id="6122" name="Skrij (uporabite tipko Alt ali F10 za preklop)"/>
<Item id="6123" name="Lokalizacija"/>
<Item id="6125" name="Panel seznama dokumenta"/>
<Item id="6126" name="Prikaži"/>
<Item id="6127" name="Onemogoči stolpec podaljška"/>
@ -618,12 +643,12 @@
<Item id="6204" name="Drevo s krogi"/>
<Item id="6205" name="Drevo s kvadrati"/>
<Item id="6226" name="Brez"/>
<Item id="6227" name="Prelom vrstice"/>
<Item id="6228" name="Privzeto"/>
<Item id="6229" name="Poravnano"/>
<Item id="6230" name="Alineja"/>
<Item id="6206" name="Prikaži številke vrstic"/>
<Item id="6207" name="Prikaži zaznamke"/>
<Item id="6208" name="Prikaži navpični rob"/>
@ -635,10 +660,10 @@
<Item id="6212" name="Vrstični način"/>
<Item id="6213" name="Način ozadja"/>
<Item id="6214" name="Omogoči poudarjanje trenutne vrstice"/>
<Item id="6231" name="Širina obrobe"/>
</Scintillas>
</Scintillas>
<NewDoc title="Nov dokument">
<Item id="6401" name="Format"/>
<Item id="6402" name="Windows"/>
@ -650,35 +675,35 @@
<Item id="6408" name="UTF-8"/>
<Item id="6409" name="UCS-2 Big Endian"/>
<Item id="6410" name="UCS-2 small Endian"/>
<Item id="6411" name="Privzeti jezik:"/>
<Item id="6411" name="Privzeti jezik:"/>
<Item id="6419" name="Nov dokument"/>
<Item id="6420" name="Uporabi za odprte ANSI datoteke"/>
</NewDoc>
<DefaultDir title="Privzeti imenik">
<Item id="6413" name="Privzeti imenik (Odpri/Shrani)"/>
<Item id="6414" name="Sledi trenutnemu dokumentu"/>
<Item id="6415" name="Zapomni si zadnjo uporabljen imenik"/>
</DefaultDir>
</DefaultDir>
<FileAssoc title="Povezave datotek">
<Item id="4009" name="Podprte končnice:"/>
<Item id="4010" name="Registrirane končnice:"/>
</FileAssoc>
<LangMenu title="Jezikovni meni">
<LangMenu title="Jezikovni meni">
<Item id="6505" name="Razpoložljive postavke"/>
<Item id="6506" name="Onemogočene postavke"/>
<Item id="6507" name="Strni jezikovni meni"/>
<Item id="6508" name="Jezikovni meni"/>
<Item id="6508" name="Jezikovni meni"/>
</LangMenu>
<TabSettings title="Nastavitve zavihka">
<Item id="6301" name="Nastavitve zavihka"/>
<Item id="6302" name="Zamenjaj s presledki"/>
<Item id="6303" name="Velikost zavihka: "/>
<Item id="6510" name="Uporabi privzeto vrednost"/>
</TabSettings>
<Print title="Tiskanje">
<Item id="6601" name="Natisni številko vrstice"/>
<Item id="6602" name="Barvne možnosti"/>
@ -708,7 +733,7 @@
<Item id="6727" name="Tukaj so prikazane vaše variabilne nastavitve"/>
<Item id="6728" name="Glava in noga"/>
</Print>
<RecentFilesHistory title="Nastavitev zgodovine datotek">
<Item id="6304" name="Nastavitev zgodovine datotek"/>
<Item id="6305" name="Ne preverjaj ob zagonu"/>
@ -719,14 +744,14 @@
<Item id="6426" name="Celotno ime poti datoteke"/>
<Item id="6427" name="Prilagodi največjo dolžino:"/>
</RecentFilesHistory>
<Backup title="Varnostno kopiranje">
<Item id="6817" name="Posnetek seje in periodično varnostno kopiranje"/>
<Item id="6818" name="Omogoči posnetek seje in periodično varnostno kopiranje"/>
<Item id="6819" name="Varnostno kopiranje vsakih"/>
<Item id="6821" name="sekund"/>
<Item id="6822" name="Pot varnostne kopije:"/>
<Item id="6309" name="Zapomni si trenutno sejo za naslednji zagon"/>
<Item id="6309" name="Zapomni si trenutno sejo za naslednji zagon"/>
<Item id="6801" name="Varnostno kopiranje"/>
<Item id="6315" name="Brez"/>
<Item id="6316" name="Enostavno varnostno kopiranje"/>
@ -734,7 +759,7 @@
<Item id="6804" name="Imenik varnostnega kopiranja po meri"/>
<Item id="6803" name="Imenik:"/>
</Backup>
<AutoCompletion title="Samodejno dopolnjevanje">
<Item id="6807" name="Samodejno dopolnjevanje"/>
<Item id="6808" name="Omogoči samodejno dopolnjevanje ob vsakem vnosu"/>
@ -753,7 +778,7 @@
<Item id="6863" name="Usklajen par 2:"/>
<Item id="6866" name="Usklajen par 3:"/>
</AutoCompletion>
<MultiInstance title="Večpojavnost">
<Item id="6151" name="Nastavitve večpojavnosti"/>
<Item id="6152" name="Odpri sejo v novem primerku Notepad++"/>
@ -761,24 +786,22 @@
<Item id="6154" name="Privzeto (enopojavnost)"/>
<Item id="6155" name="* Sprememba te nastavitve zahteva ponovni zagon Notepad++"/>
</MultiInstance>
<Delimiter title="Razmejilnik">
<Item id="6251" name="Nastavitve izbora razmejilnika (Ctrl + dvoklik miške)"/>
<Item id="6252" name="Odpri"/>
<Item id="6255" name="Zapri"/>
<Item id="6256" name="Dovoli na več vrsticah"/>
</Delimiter>
<Cloud title="Cloud">
</Delimiter>
<Cloud title="Oblak">
<Item id="6262" name="Nastavitve na oblaku"/>
<Item id="6263" name="Brez oblaka"/>
<Item id="6264" name="Dropbox"/>
<Item id="6265" name="OneDrive"/>
<Item id="6266" name="Google Drive"/>
<Item id="6267" name="Nastavite pot do lokacije oblaka tukaj:"/>
<!--Item id="6261" name="Začne veljati po ponovnem zagonu Notepad++."/-->
</Cloud>
<MISC title="Razno">
</Cloud>
<MISC title="Razno">
<Item id="6307" name="Omogoči"/>
<Item id="6308" name="Minimiraj v sistemsko vrstico"/>
<Item id="6312" name="Samozaznava stanja datoteke"/>
@ -794,7 +817,7 @@
<Item id="6329" name="Poudari ujemajoče oznake"/>
<Item id="6327" name="Omogoči"/>
<Item id="6328" name="Poudari atribute oznake"/>
<Item id="6330" name="Poudari komentar/php/asp območja"/>
<Item id="6330" name="Poudari komentar/php/asp območja"/>
<Item id="6331" name="V naslovni vrstici pokaži le ime datoteke"/>
<Item id="6332" name="Razlikuj male/VELIKE črke"/>
<Item id="6333" name="Pametno poudarjanje"/>
@ -802,7 +825,7 @@
<Item id="6335" name="Uporabite poševnico kot ubežni znak za SQL"/>
<Item id="6114" name="Omogoči"/>
<Item id="6115" name="Samodejno zamikaj"/>
<Item id="6117" name="Omogoči MRU obnašanje"/>
<Item id="6117" name="Omogoči MRU obnašanje"/>
</MISC>
</Preference>
<MultiMacro title="Večkratni zagon makra">
@ -845,10 +868,11 @@
<FileLockedWarning title="Shranjevanje ni uspelo" message="Prosimo, preverite, ali je ta datoteka odprta v drugem programu"/>
<FileAlreadyOpenedInNpp title="" message="Datoteka je že odprta v Notepad++."/>
<DeleteFileFailed title="Brisanje datoteke" message="Brisanje datoteke ni uspelo"/>
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
<NbFileToOpenImportantWarning title="Število datotek za odpiranje je preveliko" message="$INT_REPLACE$ datoteke so na tem, da se odprejo.\rJih Želite res odpreti?"/>
</MessageBox>
<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."/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Zgodovina odložišča"/>
</ClipboardHistory>
@ -916,6 +940,6 @@
<Item id="3119" name="Premakni dol"/>
</FileMenu>
</Menus>
</ProjectManager>
</ProjectManager>
</Native-Langue>
</NotepadPlus>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<NotepadPlus>
<Native-Langue name="Español" filename="spanish.xml" version="6.7.7">
<Native-Langue name="Español" filename="spanish.xml" version="6.8.2">
<Menu>
<Main>
<!-- Main Menu Entries -->
@ -86,7 +86,7 @@
<Item id="41016" name="Borrar del disco"/>
<Item id="41017" name="Renombrar..."/>
<Item id="41021" name="Restaurar archivo cerrado recientemente"/>
<Item id="42001" name="C&amp;ortar"/>
<Item id="42001" name="C&amp;ortar"/>
<Item id="42002" name="&amp;Copiar"/>
<Item id="42003" name="&amp;Deshacer"/>
<Item id="42004" name="&amp;Rehacer"/>
@ -101,6 +101,14 @@
<Item id="42013" name="Unir líneas"/>
<Item id="42014" name="Subir línea actual"/>
<Item id="42015" name="Bajar línea actual"/>
<Item id="42059" name="Ordenar líneas en sentido ascendente"/>
<Item id="42060" name="Ordenar líneas en sentido descendente"/>
<Item id="42061" name="Orden de líneas numérico ascendiente"/>
<Item id="42062" name="Orden de líneas numérico descendiente"/>
<Item id="42063" name="Ordenar líneas como decimales (coma) ascendiente"/>
<Item id="42064" name="Ordenar líneas como decimales (coma) descendiente"/>
<Item id="42065" name="Ordenar líneas como decimales (punto) ascendiente"/>
<Item id="42066" name="Ordenar líneas como decimales (punto) descendiente"/>
<Item id="42016" name="Convertir a MAYÚSCULAS"/>
<Item id="42017" name="Convertir a minúsculas"/>
<Item id="42018" name="&amp;Inicio de grabación"/>
@ -141,8 +149,6 @@
<Item id="42056" name="Eliminar líneas vacías (y contenido en blanco)"/>
<Item id="42057" name="Insert línea en blanco encima de la actual"/>
<Item id="42058" name="Insertar línea en blanco bajo la actual"/>
<Item id="42059" name="Ordenar líneas en sentido ascendente"/>
<Item id="42060" name="Ordenar líneas en sentido descendente"/>
<Item id="43001" name="&amp;Buscar..."/>
<Item id="43002" name="Buscar &amp;siguiente"/>
<Item id="43003" name="Reemplazar..."/>
@ -193,6 +199,7 @@
<Item id="43047" name="Resultados de búsqueda anterior"/>
<Item id="43048" name="Seleccionar y encontrar siguiente"/>
<Item id="43049" name="Seleccionar y encontrar anterior"/>
<Item id="43054" name="Marcar..."/>
<Item id="44009" name="Post-It"/>
<Item id="44010" name="Contraer todo"/>
<Item id="44019" name="Mostrar todos los caracteres"/>
@ -451,6 +458,8 @@
<Item id="25026" name="Operador 1"/>
<Item id="25027" name="Operador 2"/>
<Item id="25028" name="Numeros"/>
<Item id="1" name="OK"/>
<Item id="2" name="Cancelar"/>
</StylerDialog>
<Folder title="Carpeta &amp;&amp; por defecto">
<Item id="21101" name="Estilo por defecto"/>
@ -575,7 +584,6 @@
<Item id="24672" name="Cerrar:"/>
<Item id="24673" name="Estilo"/>
</Operator>
<Item id="24001" name="Habilitar carácter de escape:"/>
</UserDefine>
<Preference title="Preferencias">
<Item id="6001" name="Cerrar"/>
@ -595,8 +603,7 @@
<Item id="6113" name="Doble clic para cerrar pestaña"/>
<Item id="6118" name="Ocultar"/>
<Item id="6119" name="Multi-línea"/>
<Item id="6120" name="Vertical"/>
<Item id="6121" name="Barra de menú"/>
<Item id="6120" name="Vertical"/>
<Item id="6122" name="Ocultar (Alt o F10 para des/activar)"/>
<Item id="6123" name="Localización"/>
<Item id="6125" name="Panel lista de documentos"/>
@ -631,6 +638,8 @@
<Item id="6213" name="Modo de fondo"/>
<Item id="6214" name="Resaltar la línea activa"/>
<Item id="6231" name="Ancho de borde"/>
<Item id="6215" name="Suavizar la fuente"/>
<Item id="6231" name="Ancho del borde"/>
</Scintillas>
<NewDoc title="Archivo nuevo/Carpeta predeterminada">
<Item id="6401" name="Formato"/>
@ -829,6 +838,7 @@
<DeleteFileFailed title="Borrar archivo" message="Imposible borrar"/>
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
<NbFileToOpenImportantWarning title="Demasiados archivos" message="$INT_REPLACE$ archivos serán abiertos.\rConfirme si desea hacerlo"/>
<SettingsOnCloudError title="Ajustes en la nube" message="Ha usado una unidad de solo lectura para ajustes en la nube,\ro una carpeta que necesita privilegios para escritura.\rSus ajustes en la nube se cancelarán. Por favor ajuste de nuevo desde Preferencias."/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Historial"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<NotepadPlus><!-- Çeviri: Emrah Güzeltaş | emrahguzeltas@gmail.com -->
<Native-Langue name="Turkish" filename="turkish.xml" version="6.7.7">
<NotepadPlus><!-- Çeviri:.....: ?-2015 - Emrah Güzeltaş; 2015-? - Tmp341 -->
<Native-Langue name="Turkish" filename="turkish.xml" version="6.8.2">
<Menu>
<Main>
<!-- Ana Menü Yazıları -->
@ -86,7 +86,7 @@
<Item id="41015" name="Kopya Olarak Kaydet" />
<Item id="41016" name="Diskten Sil" />
<Item id="41017" name="Yeniden Adlandır" />
<Item id="41021" name="En Son Kapanmış Dosyaları Geri Yükle"/>
<Item id="41021" name="Son Kapatılan Dosyaları Geri Yükle"/>
<Item id="42001" name="K&amp;es" />
<Item id="42002" name="&amp;Kopyala" />
@ -201,6 +201,7 @@
<Item id="43047" name="Önceki Arama Sonucu" />
<Item id="43048" name="Seç ve Sonrakini Bul" />
<Item id="43049" name="Seç ve Öncekini Bul" />
<Item id="43054" name="İşaretle..."/>
<Item id="44009" name="Pencereyi Ekrana Tuttur" />
<Item id="44010" name="Tümünü Katla" />
<Item id="44019" name="Tüm Karakterleri Göster" />
@ -263,11 +264,11 @@
<Item id="45053" name="OEM 860: Portekizce"/>
<Item id="45056" name="OEM 863: Fransızca"/>
<Item id="46033" name="Çevirme (Assembly)"/>
<Item id="46019" name="MS INI Dosyası"/>
<Item id="46015" name="MS-DOS Stili"/>
<Item id="46016" name="Normal Metin"/>
<Item id="46017" name="Kaynak Dosyası"/>
<Item id="46033" name="Assembly"/>
<Item id="46019" name="MS INI dosyası"/>
<Item id="46015" name="MS-DOS stili"/>
<Item id="46016" name="Normal metin"/>
<Item id="46017" name="Kaynak dosyası"/>
<Item id="46001" name="&amp;Stil Yapılandırıcı" />
<Item id="46150" name="Dil &amp;Tanımla" />
@ -277,6 +278,7 @@
<Item id="47001" name="Notepad++ &amp;Ana Sayfası" />
<Item id="47002" name="Notepad++ Proje Sayfası" />
<Item id="47003" name="Çevrimiçi Belgelendirme" />
<Item id="47004" name="Notepad++ Topluluğu (Forum)"/>
<Item id="47011" name="Canlı Destek"/>
<Item id="47005" name="Eklenti Merkezi" />
<Item id="47006" name="&amp;Güncellemeleri Denetle" />
@ -470,6 +472,8 @@
<Item id="25026" name="İşleç 1" />
<Item id="25027" name="İşleç 2" />
<Item id="25028" name="Sayılar" />
<Item id="1" name="Tamam"/>
<Item id="2" name="İptal"/>
</StylerDialog>
<Folder title="Klasör &amp;&amp; Varsayılanlar">
<Item id="21101" name="Varsayılan Stil" />
@ -655,7 +659,7 @@
<Item id="6212" name="Çizgi modu" />
<Item id="6213" name="Arka plan modu" />
<Item id="6214" name="Geçerli satırı vurgula" />
<Item id="6215" name="Yumuşak fontu etkinleştir"/>
<Item id="6231" name="Kenarlık Boyutu" />
</Scintillas>
@ -666,10 +670,10 @@
<Item id="6404" name="Mac OS" />
<Item id="6405" name="Kodlama" />
<Item id="6406" name="ANSI" />
<Item id="6407" name="BOM olmadan UTF-8" />
<Item id="6408" name="UTF-8" />
<Item id="6409" name="UCS-2 Big-Endian" />
<Item id="6410" name="UCS-2 Small-Endian" />
<Item id="6407" name="UTF-8" />
<Item id="6408" name="UTF-8 BOM ile" />
<Item id="6409" name="UCS-2 Big-Endian BOM ile" />
<Item id="6410" name="UCS-2 Small-Endian BOM ile" />
<Item id="6411" name="Varsayılan dil:" />
<Item id="6419" name="Yeni Belge" />
<Item id="6420" name="Açılmış ANSI dosyalarına uygula" />
@ -731,13 +735,13 @@
<RecentFilesHistory title="Son Kull. Dosya Geçmişi">
<Item id="6304" name="Son Kullanılan Dosya Geçmişi" />
<Item id="6306" name="En fazla girdi sayısı:" />
<Item id="6306" name="Maksimum girdi sayısı:" />
<Item id="6305" name="Başlatıldığı zaman denetleme" />
<Item id="6429" name="Göster" />
<Item id="6424" name="Alt menüde göster" />
<Item id="6425" name="Sadece dosya adı" />
<Item id="6426" name="Tam dosya adı yolu" />
<Item id="6427" name="En fazla uzunluğu özelleştir:" />
<Item id="6427" name="Maksimum uzunluğu özelleştir:" />
</RecentFilesHistory>
<Backup title="Yedekleme">
@ -866,6 +870,7 @@
<!-- $INT_REPLACE$ bir yer tutucudur, çevirmeyin -->
<NbFileToOpenImportantWarning title="Açılmak istenen dosya sayısı çok fazla" message="$INT_REPLACE$ dosyasıılmak üzere. Devam etmek istiyor musunuz?" />
<SettingsOnCloudError title="Bulut Ayarları" 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."/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Pano Geçmişi" />

View File

@ -5,13 +5,13 @@
<Main>
<!-- Main Menu Entries -->
<Entries>
<Item menuId="file" name="&amp;Файл"/>
<Item menuId="edit" name="&amp;Змінити"/>
<Item menuId="search" name="&amp;Пошук"/>
<Item menuId="view" name="&amp;Вигляд"/>
<Item menuId="encoding" name="&amp;Кодування"/>
<Item menuId="language" name="&amp;Мова"/>
<Item menuId="settings" name="&amp;Налаштування"/>
<Item menuId="file" name="Файл"/>
<Item menuId="edit" name="Змінити"/>
<Item menuId="search" name="Пошук"/>
<Item menuId="view" name="Вигляд"/>
<Item menuId="encoding" name="Кодування"/>
<Item menuId="language" name="Мова"/>
<Item menuId="settings" name="Налаштування"/>
<Item menuId="macro" name="Макрос"/>
<Item menuId="run" name="Запустити"/>
<Item idName="Plugins" name="Плагіни"/>
@ -22,7 +22,7 @@
<Item subMenuId="file-openFolder" name="Відкрити теку розташування"/>
<Item subMenuId="file-closeMore" name="Закрити ще"/>
<Item subMenuId="file-recentFiles" name="Недавні файли"/>
<Item subMenuId="edit-copyToClipboard" name="Копіювати в буфер"/>
<Item subMenuId="edit-copyToClipboard" name="Копіювати в буфер..."/>
<Item subMenuId="edit-indent" name="Абзац"/>
<Item subMenuId="edit-convertCaseTo" name="Змінити регістр"/>
<Item subMenuId="edit-lineOperations" name="Дії над рядком"/>
@ -65,36 +65,36 @@
<!-- all menu item -->
<Commands>
<Item id="41001" name="&amp;Створити"/>
<Item id="41002" name="&amp;Відкрити"/>
<Item id="41001" name="Створити"/>
<Item id="41002" name="Відкрити"/>
<Item id="41019" name="Explorer"/>
<Item id="41020" name="cmd"/>
<Item id="41003" name="Закрити"/>
<Item id="41004" name="За&amp;крити все"/>
<Item id="41004" name="Закрити все"/>
<Item id="41005" name="Закрити все, окрім активного"/>
<Item id="41009" name="Закрити все зліва"/>
<Item id="41018" name="Закрити все справа"/>
<Item id="41006" name="&amp;Зберегти"/>
<Item id="41007" name="З&amp;берегти все"/>
<Item id="41008" name="Зберегти &amp;як..."/>
<Item id="41006" name="Зберегти"/>
<Item id="41007" name="Зберегти все"/>
<Item id="41008" name="Зберегти як..."/>
<Item id="41010" name="Друк..."/>
<Item id="1001" name="Друкувати негайно!"/>
<Item id="41011" name="Ви&amp;йти"/>
<Item id="41011" name="Вийти"/>
<Item id="41012" name="Завантажити сеанс..."/>
<Item id="41013" name="Зберегти сеанс..."/>
<Item id="41014" name="Перезавантажити з диска"/>
<Item id="41015" name="Зберегти копію як..."/>
<Item id="41016" name="Вилучити з диска"/>
<Item id="41017" name="Перейменувати..."/>
<Item id="41021" name="Restore Recent Closed File"/>
<Item id="41021" name="Відкрити останній закритий файл"/>
<Item id="42001" name="Ви&amp;різати"/>
<Item id="42002" name="&amp;Копіювати"/>
<Item id="42003" name="&amp;Скасувати"/>
<Item id="42004" name="&amp;Повторити"/>
<Item id="42005" name="&amp;Вставити"/>
<Item id="42006" name="Ви&amp;лучити"/>
<Item id="42007" name="Ви&amp;брати все"/>
<Item id="42001" name="Вирізати"/>
<Item id="42002" name="Копіювати"/>
<Item id="42003" name="Скасувати"/>
<Item id="42004" name="Повторити"/>
<Item id="42005" name="Вставити"/>
<Item id="42006" name="Вилучити"/>
<Item id="42007" name="Вибрати все"/>
<Item id="42020" name="Вибрати Початок/Кінець"/>
<Item id="42008" name="Вставити Tab (Відступ)"/>
<Item id="42009" name="Вилучити Tab (Втяжка)"/>
@ -105,20 +105,20 @@
<Item id="42015" name="Опустити поточний рядок"/>
<Item id="42016" name="ВЕЛИКИМИ"/>
<Item id="42017" name="маленькими"/>
<Item id="42018" name="&amp;Почати запис"/>
<Item id="42019" name="&amp;Зупинити запис"/>
<Item id="42021" name="Прокрутити &amp;запис"/>
<Item id="42018" name="Почати запис"/>
<Item id="42019" name="Зупинити запис"/>
<Item id="42021" name="Прокрутити запис"/>
<Item id="42022" name="Перемкнути в коментар одного рядка"/>
<Item id="42023" name="Коментувати блок"/>
<Item id="42047" name="Розкоментувати блок"/>
<Item id="42024" name="Прибрати пропуски"/>
<Item id="42042" name="Прибрати пропуск на початку"/>
<Item id="42043" name="Прибрати пропуск на початку і в кінці"/>
<Item id="42044" name="EOL для пропуску"/>
<Item id="42045" name="Remove Unnecessary Blank and EOL"/>
<Item id="42046" name="TAB для пропуску"/>
<Item id="42054" name="Пробіл для TAB (Все)"/>
<Item id="42053" name="Пробіл для TAB (На початку)"/>
<Item id="42024" name="Прибрати Пробіли"/>
<Item id="42042" name="Прибрати Пробіл на початку"/>
<Item id="42043" name="Прибрати Пробіл на початку і в кінці"/>
<Item id="42044" name="Символ Кінця Рядка в Пробіл"/>
<Item id="42045" name="Прибрати зайві Пробіли а Закінчення Рядків в Пробіл"/>
<Item id="42046" name="TAB в Пробіл"/>
<Item id="42054" name="Пробіл в TAB (Все)"/>
<Item id="42053" name="Пробіл в TAB (На початку)"/>
<Item id="42038" name="Вставити вміст HTML"/>
<Item id="42039" name="Вставити вміст RTF"/>
<Item id="42048" name="Копіювати бінарний вміст"/>
@ -132,11 +132,11 @@
<Item id="42026" name="Текст справа наліво"/>
<Item id="42027" name="Текст зліва направо"/>
<Item id="42028" name="Лише читання"/>
<Item id="42029" name="Копіювати шлях та ім'я файлу до буфера обміну"/>
<Item id="42030" name="Копіювати ім'я файлу до буфера обміну"/>
<Item id="42031" name="Копіювати шлях до файлу до буфера обміну"/>
<Item id="42032" name="Запустити багато разів..."/>
<Item id="42033" name="Зняти галочку &quot;Лише читання&quot;"/>
<Item id="42029" name="Шлях та ім'я файла в буфер обміну"/>
<Item id="42030" name="Ім'я файла в буфер обміну"/>
<Item id="42031" name="Шлях до файла в буфер обміну"/>
<Item id="42032" name="Багаторазовий запуск..."/>
<Item id="42033" name="Прибрати атрибут &quot;Лише читання&quot;"/>
<Item id="42035" name="Закоментувати блок"/>
<Item id="42036" name="Розкоментувати блок"/>
<Item id="42055" name="Прибрати пусті рядки"/>
@ -145,8 +145,8 @@
<Item id="42058" name="Додати пустий рядок під поточним"/>
<Item id="42059" name="Сортувати рядки за зростанням"/>
<Item id="42060" name="Сортувати рядки за спаданням"/>
<Item id="43001" name="&amp;Пошук..."/>
<Item id="43002" name="Виконати пошук &amp;далі"/>
<Item id="43001" name="Пошук..."/>
<Item id="43002" name="Виконати пошук далі"/>
<Item id="43003" name="Замінити..."/>
<Item id="43004" name="Перехід до..."/>
<Item id="43005" name="Закладки"/>
@ -163,32 +163,32 @@
<Item id="43053" name="Вибрати все у відповідному діапазоні"/>
<Item id="43009" name="Зіставити дужку"/>
<Item id="43010" name="Виконати пошук раніше"/>
<Item id="43011" name="По&amp;кроковий пошук"/>
<Item id="43011" name="Покроковий пошук"/>
<Item id="43013" name="Знайти у файлах"/>
<Item id="43014" name="Знайти таке ж далі"/>
<Item id="43015" name="Знайти таке ж попереднє"/>
<Item id="43022" name="Використовувати 1-й стиль"/>
<Item id="43023" name="Очистити 1-й стиль"/>
<Item id="43024" name="Використовувати 2-й стиль"/>
<Item id="43025" name="Очистити 2-й стиль"/>
<Item id="43026" name="Використовувати 3-й стиль"/>
<Item id="43027" name="Очистити 3-й стиль"/>
<Item id="43028" name="Використовувати 4-й стиль"/>
<Item id="43029" name="Очистити 4-й стиль"/>
<Item id="43030" name="Використовувати 5-й стиль"/>
<Item id="43031" name="Очистити 5-й стиль"/>
<Item id="43022" name="Використовувати стиль 1"/>
<Item id="43023" name="Очистити стиль 1"/>
<Item id="43024" name="Використовувати стиль 2"/>
<Item id="43025" name="Очистити стиль 2"/>
<Item id="43026" name="Використовувати стиль 3"/>
<Item id="43027" name="Очистити стиль 3"/>
<Item id="43028" name="Використовувати стиль 4"/>
<Item id="43029" name="Очистити стиль 4"/>
<Item id="43030" name="Використовувати стиль 5"/>
<Item id="43031" name="Очистити стиль 5"/>
<Item id="43032" name="Очистити всі стилі"/>
<Item id="43033" name="1й стиль"/>
<Item id="43034" name="2й стиль"/>
<Item id="43035" name="3й стиль"/>
<Item id="43036" name="4й стиль"/>
<Item id="43037" name="5й стиль"/>
<Item id="43033" name="Стиль 1"/>
<Item id="43034" name="Стиль 2"/>
<Item id="43035" name="Стиль 3"/>
<Item id="43036" name="Стиль 4"/>
<Item id="43037" name="Стиль 5"/>
<Item id="43038" name="Знайти стиль"/>
<Item id="43039" name="1й стиль"/>
<Item id="43040" name="2й стиль"/>
<Item id="43041" name="3й стиль"/>
<Item id="43042" name="4й стиль"/>
<Item id="43043" name="5й стиль"/>
<Item id="43039" name="Стиль 1"/>
<Item id="43040" name="Стиль 2"/>
<Item id="43041" name="Стиль 3"/>
<Item id="43042" name="Стиль 4"/>
<Item id="43043" name="Стиль 5"/>
<Item id="43044" name="Знайти стиль"/>
<Item id="43045" name="Вікно результатів пошуку"/>
<Item id="43046" name="Наступні результати пошуку"/>
@ -200,25 +200,25 @@
<Item id="44019" name="Всі символи"/>
<Item id="44020" name="Значення відступів"/>
<Item id="44022" name="Перенесення рядків"/>
<Item id="44023" name="&amp;Більше"/>
<Item id="44024" name="&amp;Дрібніше"/>
<Item id="44025" name="Порожні пропуски і Tab"/>
<Item id="44026" name="Символ закінчення рядка"/>
<Item id="44023" name="Більше"/>
<Item id="44024" name="Дрібніше"/>
<Item id="44025" name="Відображати Пробіли і Tab"/>
<Item id="44026" name="Відображати Символ Закінчення Рядка"/>
<Item id="44029" name="Розгорнути все"/>
<Item id="44030" name="Згорнути поточний фрагмент"/>
<Item id="44031" name="Розгорнути поточний фрагмент"/>
<Item id="44049" name="Summary..."/>
<Item id="44049" name="Сумарно..."/>
<Item id="44080" name="Карта документа"/>
<Item id="44084" name="Список функцій"/>
<Item id="44086" name="1st Tab"/>
<Item id="44087" name="2nd Tab"/>
<Item id="44088" name="3rd Tab"/>
<Item id="44089" name="4th Tab"/>
<Item id="44090" name="5th Tab"/>
<Item id="44091" name="6th Tab"/>
<Item id="44092" name="7th Tab"/>
<Item id="44093" name="8th Tab"/>
<Item id="44094" name="9th Tab"/>
<Item id="44086" name="Вкладка 1"/>
<Item id="44087" name="Вкладка 2"/>
<Item id="44088" name="Вкладка 3"/>
<Item id="44089" name="Вкладка 4"/>
<Item id="44090" name="Вкладка 5"/>
<Item id="44091" name="Вкладка 6"/>
<Item id="44092" name="Вкладка 7"/>
<Item id="44093" name="Вкладка 8"/>
<Item id="44094" name="Вкладка 9"/>
<Item id="44095" name="Наступна вкладка"/>
<Item id="44096" name="Попередня вкладка"/>
<Item id="44032" name="На весь екран"/>
@ -275,21 +275,21 @@
<Item id="47005" name="Більше доповнень"/>
<Item id="47006" name="Оновити Notepad++"/>
<Item id="47008" name="Довідка Notepad++"/>
<Item id="47009" name="Set Updater Proxy..."/>
<Item id="47009" name="Встановити проксі для оновлення..."/>
<Item id="48005" name="Імпорт доповнень ..."/>
<Item id="48006" name="Імпорт тем..."/>
<Item id="48018" name="Змінити контекстне меню"/>
<Item id="48009" name="Гарячі клавіші..."/>
<Item id="48011" name="Налаштування..."/>
<Item id="49000" name="&amp;Запуск..."/>
<Item id="49000" name="Запуск..."/>
<Item id="50000" name="Закінчення функцій"/>
<Item id="50001" name="Закінчення слів"/>
<Item id="50002" name="Підказка по функціях"/>
<Item id="50006" name="Path Completion"/>
<Item id="50006" name="Завершення шляху"/>
<Item id="44042" name="Сховати рядки"/>
<Item id="42040" name="Відкрити всі нещодавні файли"/>
<Item id="42041" name="Очистити список нещодавніх файлів"/>
<Item id="42040" name="Відкрити всі недавні файли"/>
<Item id="42041" name="Очистити список недавніх файлів"/>
<Item id="48016" name="Модиф. гаряч. клавіш/Видалити макро..."/>
<Item id="48017" name="Модиф. гаряч. клавіш/Видалити команду..."/>
</Commands>
@ -326,20 +326,20 @@
<Item id="1" name="Виконати пошук далі"/>
<Item id="2" name="Закрити"/>
<Item id="1620" name="Що шукати:"/>
<Item id="1603" name="Лише &amp;цілі слова"/>
<Item id="1604" name="Враховувати &amp;регістр"/>
<Item id="1605" name="Регулярний &amp;вираз"/>
<Item id="1606" name="Перенесення &amp;слів"/>
<Item id="1612" name="В&amp;гору"/>
<Item id="1613" name="В&amp;низ"/>
<Item id="1603" name="Лише цілі слова"/>
<Item id="1604" name="Враховувати регістр"/>
<Item id="1605" name="Регулярний вираз"/>
<Item id="1606" name="Перенесення слів"/>
<Item id="1612" name="Вгору"/>
<Item id="1613" name="Вниз"/>
<Item id="1614" name="Підрахунок"/>
<Item id="1615" name="Шукати все"/>
<Item id="1616" name="Позначки рядка"/>
<Item id="1618" name="Очищати для кожного пошуку"/>
<Item id="1621" name="Напрямок"/>
<Item id="1611" name="&amp;Замінити на:"/>
<Item id="1608" name="За&amp;мінити"/>
<Item id="1609" name="Замінити &amp;все"/>
<Item id="1611" name="Замінити на:"/>
<Item id="1608" name="Замінити"/>
<Item id="1609" name="Замінити все"/>
<Item id="1687" name="Вимкнути"/>
<Item id="1688" name="Завжди"/>
<Item id="1632" name="У вибраному"/>
@ -358,7 +358,7 @@
<Item id="1661" name="У теці поточного файлу"/>
<Item id="1641" name="Виконати пошук всього в поточному документі"/>
<Item id="1686" name="Прозорість"/>
<Item id="1703" name="&amp;. matches newline"/>
<Item id="1703" name=". matches newline"/>
</Find>
<FindCharsInRange title="Знайти символи на сторінці...">
@ -366,20 +366,20 @@
<Item id="2901" name="Не ASCII символи (128-255)"/>
<Item id="2902" name="ASCII символи (0-127)"/>
<Item id="2903" name="Мій діапазон:"/>
<Item id="2906" name="&amp;Вгору"/>
<Item id="2907" name="&amp;Вниз"/>
<Item id="2906" name="Вгору"/>
<Item id="2907" name="Вниз"/>
<Item id="2908" name="Напрямок"/>
<Item id="2909" name="Wra&amp;p around"/>
<Item id="2909" name="Циклічний пошук"/>
<Item id="2910" name="Знайти"/>
</FindCharsInRange>
<GoToLine title="До рядка #">
<Item id="2007" name="Рядок"/>
<Item id="2008" name="Стовпець"/>
<Item id="2008" name="Стовпчик"/>
<Item id="1" name="Вперед!"/>
<Item id="2" name="Не хочу нікуди"/>
<Item id="2004" name="Ми тут:"/>
<Item id="2005" name="&amp;Йдемо туди:"/>
<Item id="2005" name="Йдемо туди:"/>
<Item id="2006" name="Далі не пройти:"/>
</GoToLine>
@ -392,7 +392,7 @@
<StyleConfig title="Визначення стилів">
<Item id="2" name="Скасувати"/>
<Item id="2301" name="&amp;Гаразд"/>
<Item id="2301" name="Гаразд"/>
<Item id="2303" name="Прозорість"/>
<Item id="2306" name="Вибрати тему: "/>
<SubDialog>
@ -432,71 +432,71 @@
<Item id="20009" name="Розширення:"/>
<Item id="20012" name="Будь-який регістр"/>
<Item id="20011" name="Прозорість"/>
<Item id="20015" name="Import..."/>
<Item id="20016" name="Export..."/>
<Item id="20015" name="Імпорт..."/>
<Item id="20016" name="Експорт..."/>
<StylerDialog title="Styler Dialog">
<Item id="25030" name="Font options:"/>
<Item id="25006" name="Foreground colour"/>
<Item id="25007" name="Background colour"/>
<Item id="25031" name="Name:"/>
<Item id="25032" name="Size:"/>
<Item id="25001" name="Bold"/>
<Item id="25002" name="Italic"/>
<Item id="25003" name="Underline"/>
<Item id="25029" name="Nesting:"/>
<Item id="25008" name="Delimiter 1"/>
<Item id="25009" name="Delimiter 2"/>
<Item id="25010" name="Delimiter 3"/>
<Item id="25011" name="Delimiter 4"/>
<Item id="25012" name="Delimiter 5"/>
<Item id="25013" name="Delimiter 6"/>
<Item id="25014" name="Delimiter 7"/>
<Item id="25015" name="Delimiter 8"/>
<Item id="25018" name="Keyword 1"/>
<Item id="25019" name="Keyword 2"/>
<Item id="25020" name="Keyword 3"/>
<Item id="25021" name="Keyword 4"/>
<Item id="25022" name="Keyword 5"/>
<Item id="25023" name="Keyword 6"/>
<Item id="25024" name="Keyword 7"/>
<Item id="25025" name="Keyword 8"/>
<Item id="25016" name="Comment"/>
<Item id="25017" name="Comment line"/>
<Item id="25026" name="Operator 1"/>
<Item id="25027" name="Operator 2"/>
<Item id="25028" name="Numbers"/>
<Item id="25030" name="Налаштування шрифту:"/>
<Item id="25006" name="Колір переднього плану"/>
<Item id="25007" name="Колір тла"/>
<Item id="25031" name="Назва:"/>
<Item id="25032" name="Розмір:"/>
<Item id="25001" name="Жирний"/>
<Item id="25002" name="Курсив"/>
<Item id="25003" name="Підкреслення"/>
<Item id="25029" name="Вкладення:"/>
<Item id="25008" name="Розділювач 1"/>
<Item id="25009" name="Розділювач 2"/>
<Item id="25010" name="Розділювач 3"/>
<Item id="25011" name="Розділювач 4"/>
<Item id="25012" name="Розділювач 5"/>
<Item id="25013" name="Розділювач 6"/>
<Item id="25014" name="Розділювач 7"/>
<Item id="25015" name="Розділювач 8"/>
<Item id="25018" name="Ключове слово 1"/>
<Item id="25019" name="Ключове слово 2"/>
<Item id="25020" name="Ключове слово 3"/>
<Item id="25021" name="Ключове слово 4"/>
<Item id="25022" name="Ключове слово 5"/>
<Item id="25023" name="Ключове слово 6"/>
<Item id="25024" name="Ключове слово 7"/>
<Item id="25025" name="Ключове слово 8"/>
<Item id="25016" name="Коментар"/>
<Item id="25017" name="Рядок коментаря"/>
<Item id="25026" name="Оператор 1"/>
<Item id="25027" name="Оператор 2"/>
<Item id="25028" name="Числа"/>
</StylerDialog>
<Folder title="Folder &amp;&amp; Default">
<Item id="21101" name="Default style"/>
<Item id="21102" name="Styler"/>
<Item id="21105" name="Documentation:"/>
<Item id="21104" name="Temporary doc site:"/>
<Item id="21106" name="Fold compact (fold empty lines too)"/>
<Item id="21220" name="Folding in code 1 style:"/>
<Item id="21224" name="Open:"/>
<Item id="21225" name="Middle:"/>
<Item id="21226" name="Close:"/>
<Item id="21227" name="Styler"/>
<Item id="21320" name="Folding in code 2 style (separators needed):"/>
<Item id="21324" name="Open:"/>
<Item id="21325" name="Middle:"/>
<Item id="21326" name="Close:"/>
<Item id="21327" name="Styler"/>
<Item id="21420" name="Folding in comment style:"/>
<Item id="21424" name="Open:"/>
<Item id="21425" name="Middle:"/>
<Item id="21426" name="Close:"/>
<Item id="21427" name="Styler"/>
<Folder title="Стандартний">
<Item id="21101" name="Типовий стиль"/>
<Item id="21102" name="Налаштувати"/>
<Item id="21105" name="Документація:"/>
<Item id="21104" name="Тимчасовий сайт документації:"/>
<Item id="21106" name="Компактне згорт. (пусті лінії також)"/>
<Item id="21220" name="Згортання в коді стилю 1:"/>
<Item id="21224" name="Відкриття:"/>
<Item id="21225" name="Середина:"/>
<Item id="21226" name="Закриття:"/>
<Item id="21227" name="Стиль"/>
<Item id="21320" name="Згортання в коді стилю 2 (потрібні розділювачі):"/>
<Item id="21324" name="Відкриття:"/>
<Item id="21325" name="Середина:"/>
<Item id="21326" name="Закриття:"/>
<Item id="21327" name="Стиль"/>
<Item id="21420" name="Згортання в стилі коментаря:"/>
<Item id="21424" name="Відкриття:"/>
<Item id="21425" name="Середина:"/>
<Item id="21426" name="Закриття:"/>
<Item id="21427" name="Стиль"/>
</Folder>
<Keywords title="Списки ключових слів">
<Item id="22101" name="1-а група"/>
<Item id="22201" name="2-а група"/>
<Item id="22301" name="3-я група"/>
<Item id="22401" name="4-а група"/>
<Item id="22451" name="5-а група"/>
<Item id="22501" name="6-а група"/>
<Item id="22551" name="7-а група"/>
<Item id="22601" name="8-а група"/>
<Item id="22101" name="Група 1"/>
<Item id="22201" name="Група 2"/>
<Item id="22301" name="Група 3"/>
<Item id="22401" name="Група 4"/>
<Item id="22451" name="Група 5"/>
<Item id="22501" name="Група 6"/>
<Item id="22551" name="Група 7"/>
<Item id="22601" name="Група 8"/>
<Item id="22121" name="Режим префіксу"/>
<Item id="22221" name="Режим префіксу"/>
<Item id="22321" name="Режим префіксу"/>
@ -505,16 +505,16 @@
<Item id="22521" name="Режим префіксу"/>
<Item id="22571" name="Режим префіксу"/>
<Item id="22621" name="Режим префіксу"/>
<Item id="22122" name="Стайлер"/>
<Item id="22222" name="Стайлер"/>
<Item id="22322" name="Стайлер"/>
<Item id="22422" name="Стайлер"/>
<Item id="22472" name="Стайлер"/>
<Item id="22522" name="Стайлер"/>
<Item id="22572" name="Стайлер"/>
<Item id="22622" name="Стайлер"/>
<Item id="22122" name="Стиль"/>
<Item id="22222" name="Стиль"/>
<Item id="22322" name="Стиль"/>
<Item id="22422" name="Стиль"/>
<Item id="22472" name="Стиль"/>
<Item id="22522" name="Стиль"/>
<Item id="22572" name="Стиль"/>
<Item id="22622" name="Стиль"/>
</Keywords>
<Comment title="Comment &amp;&amp; Number">
<Comment title="Comment Number">
<Item id="23003" name="Line comment position"/>
<Item id="23004" name="Allow anywhere"/>
<Item id="23005" name="Force at beginning of line"/>
@ -706,13 +706,13 @@
<Item id="6613" name="Згори"/>
<Item id="6614" name="Справа"/>
<Item id="6615" name="Знизу"/>
<Item id="6706" name="Грубий"/>
<Item id="6706" name="Жирний"/>
<Item id="6707" name="Курсив"/>
<Item id="6708" name="Верхній колонтитул"/>
<Item id="6709" name="Ліва частина"/>
<Item id="6710" name="Середня частина"/>
<Item id="6711" name="Права частина"/>
<Item id="6717" name="Грубий"/>
<Item id="6717" name="Жирний"/>
<Item id="6718" name="Курсив"/>
<Item id="6719" name="Нижній колонтитул"/>
<Item id="6720" name="Ліва частина"/>
@ -854,7 +854,7 @@
<ContextMenuXmlEditWarning title="Зміна contextMenu" message="Зміна contextMenu.xml дозволяє вам змінювати випадаюче меню Notepad++.\rДля застосування змін необхідно перезапустити Notepad++."/>
<NppHelpAbsentWarning title="Файл не існує" message="\rне існує. Завантажте його на сайті Notepad++."/>
<SaveCurrentModifWarning title="Зберегти поточну модифікацію" message="Ви повинні зберегти поточну модифікацію.\rВсі збережені модифікації не можуть бути відновлені.\r\rПродовжити?"/>
<LoseUndoAbilityWarning title="Lose Undo Ability Warning" message="You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"/>
<LoseUndoAbilityWarning title="Втрата можливості відміни" message="Ви повинні зберегти поточні зміни.\rВсі збережені зміни неможливо відмінити.\r\rПродовжити?"/>
<CannotMoveDoc title="Перемістити в новий зразок Notepad++" message="Документ змінений. Збережіть його і спробуйте знову."/>
<DocReloadWarning title="Перезавантажити" message="Ви дійсно хочете перезавантажити поточний файл і втратити зміни, зроблені в Notepad++?"/>
<FileLockedWarning title="Збереження невдале" message="Перевірте, чи цей файл не відкритий в іншій програмі"/>

View File

@ -36,10 +36,10 @@
; Define the application name
!define APPNAME "Notepad++"
!define APPVERSION "6.8"
!define APPVERSION "6.8.3"
!define APPNAMEANDVERSION "${APPNAME} v${APPVERSION}"
!define VERSION_MAJOR 6
!define VERSION_MINOR 8
!define VERSION_MINOR 83
!define APPWEBSITE "http://notepad-plus-plus.org/"
@ -489,10 +489,7 @@ Section -"Notepad++" mainSection
SetOverwrite off
File "..\bin\shortcuts.xml"
File "..\bin\SourceCodePro-Regular.ttf"
File "..\bin\SourceCodePro-Bold.ttf"
File "..\bin\SourceCodePro-It.ttf"
File "..\bin\SourceCodePro-BoldIt.ttf"
; Set Section Files and Shortcuts
SetOverwrite on
@ -807,19 +804,6 @@ SectionGroupEnd
SectionGroup "Plugins" Plugins
SetOverwrite on
${MementoSection} "Npp FTP" NppFTP
Delete "$INSTDIR\plugins\NppFTP.dll"
SetOutPath "$INSTDIR\plugins"
File "..\bin\plugins\NppFTP.dll"
SetOutPath "$INSTDIR\plugins\doc\NppFTP"
File "..\bin\plugins\doc\NppFTP\license_NppFTP.txt"
File "..\bin\plugins\doc\NppFTP\license_libssh.txt"
File "..\bin\plugins\doc\NppFTP\license_OpenSSL.txt"
File "..\bin\plugins\doc\NppFTP\license_TiXML.txt"
File "..\bin\plugins\doc\NppFTP\license_ZLIB.txt"
File "..\bin\plugins\doc\NppFTP\license_UTCP.htm"
File "..\bin\plugins\doc\NppFTP\Readme.txt"
${MementoSectionEnd}
${MementoSection} "NppExport" NppExport
Delete "$INSTDIR\plugins\NppExport.dll"

View File

@ -47,14 +47,7 @@ copy /Y ..\bin\"notepad++.exe" .\minimalist\
If ErrorLevel 1 PAUSE
copy /Y ..\bin\SciLexer.dll .\minimalist\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-Regular.ttf .\minimalist\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-Bold.ttf .\minimalist\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-It.ttf .\minimalist\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-BoldIt.ttf .\minimalist\
If ErrorLevel 1 PAUSE
rem Notepad++ Unicode package
@ -95,18 +88,9 @@ copy /Y ..\bin\"notepad++.exe" .\zipped.package.release\
If ErrorLevel 1 PAUSE
copy /Y ..\bin\SciLexer.dll .\zipped.package.release\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-Regular.ttf .\zipped.package.release\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-Bold.ttf .\zipped.package.release\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-It.ttf .\zipped.package.release\
If ErrorLevel 1 PAUSE
copy /Y ..\src\fonts\sourceCodePro\SourceCodePro-BoldIt.ttf .\zipped.package.release\
If ErrorLevel 1 PAUSE
rem Plugins
copy /Y "..\bin\plugins\NppFTP.dll" .\zipped.package.release\plugins\
If ErrorLevel 1 PAUSE
copy /Y "..\bin\plugins\NppExport.dll" .\zipped.package.release\plugins\
If ErrorLevel 1 PAUSE
copy /Y "..\bin\plugins\mimeTools.dll" .\zipped.package.release\plugins\

View File

@ -223,9 +223,9 @@ Notepad++ Custom Style
<WordsStyle name="COMMENT" styleID="1" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMAND" styleID="2" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="1" fontSize="" />
<WordsStyle name="HEADER" styleID="3" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="POSITION" styleID="4" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="DELETED" styleID="5" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="ADDED" styleID="6" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="POSITION" styleID="4" fgColor="0080C0" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="DELETED" styleID="5" fgColor="FF8080" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="ADDED" styleID="6" fgColor="00FF40" bgColor="293134" fontName="" fontStyle="0" fontSize="" />
</LexerType>
<LexerType name="nfo" desc="Dos Style" ext="">
<WordsStyle name="DEFAULT" styleID="32" fgColor="E0E2E4" bgColor="293134" fontSize="" fontStyle="0" />

View File

@ -24,20 +24,20 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <algorithm>
#include <shlwapi.h>
#include <Shlobj.h>
#include <uxtheme.h>
#include "StaticDialog.h"
#include "Common.h"
#include "../Utf8.h"
WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
WcharMbcsConvertor* WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
void printInt(int int2print)
{
@ -96,7 +96,7 @@ char getDriveLetter()
generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath)
{
generic_string fullFilePathName = TEXT("");
generic_string fullFilePathName;
TCHAR fullFileName[MAX_PATH];
BOOL isRelative = ::PathIsRelative(relativeFilePath);
@ -112,6 +112,7 @@ generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath)
fullFilePathName += getDriveLetter();
fullFilePathName += ':';
}
fullFilePathName += relativeFilePath;
}
@ -202,8 +203,9 @@ void folderBrowser(HWND parent, int outputCtrlID, const TCHAR *defaultStr)
generic_string getFolderName(HWND parent, const TCHAR *defaultDir)
{
generic_string folderName(TEXT(""));
generic_string folderName;
LPMALLOC pShellMalloc = 0;
if (::SHGetMalloc(&pShellMalloc) == NO_ERROR)
{
BROWSEINFO info;
@ -301,7 +303,6 @@ int filter(unsigned int code, struct _EXCEPTION_POINTERS *)
{
if (code == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
@ -310,9 +311,11 @@ bool isInList(const TCHAR *token, const TCHAR *list)
{
if ((!token) || (!list))
return false;
TCHAR word[64];
size_t i = 0;
size_t j = 0;
for (size_t len = lstrlen(list); i <= len; ++i)
{
if ((list[i] == ' ')||(list[i] == '\0'))
@ -341,24 +344,26 @@ generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand
TCHAR cleanedName[64] = TEXT("");
size_t j = 0;
size_t menuNameLen = lstrlen(menuItemStr);
for(size_t k = 0 ; k < menuNameLen ; ++k)
for (size_t k = 0 ; k < menuNameLen ; ++k)
{
if (menuItemStr[k] == '\t')
{
cleanedName[k] = 0;
break;
}
else if (menuItemStr[k] == '&')
{
if (keepAmpersand)
cleanedName[j++] = menuItemStr[k];
//else skip
}
else
{
cleanedName[j++] = menuItemStr[k];
if (menuItemStr[k] == '&')
{
if (keepAmpersand)
cleanedName[j++] = menuItemStr[k];
//else skip
}
else
cleanedName[j++] = menuItemStr[k];
}
}
cleanedName[j] = 0;
return cleanedName;
}
@ -367,10 +372,15 @@ generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand
const wchar_t * WcharMbcsConvertor::char2wchar(const char * mbcs2Convert, UINT codepage, int lenMbcs, int *pLenWc, int *pBytesNotProcessed)
{
// Do not process NULL pointer
if (!mbcs2Convert) return NULL;
if (!mbcs2Convert)
return nullptr;
// Do not process empty strings
if (lenMbcs == 0 || lenMbcs == -1 && mbcs2Convert[0] == 0) { _wideCharStr.empty(); return _wideCharStr; }
if (lenMbcs == 0 || lenMbcs == -1 && mbcs2Convert[0] == 0)
{
_wideCharStr.empty();
return _wideCharStr;
}
int bytesNotProcessed = 0;
int lenWc = 0;
@ -419,8 +429,11 @@ const wchar_t * WcharMbcsConvertor::char2wchar(const char * mbcs2Convert, UINT c
else
_wideCharStr.empty();
if (pLenWc) *pLenWc = lenWc;
if (pBytesNotProcessed) *pBytesNotProcessed = bytesNotProcessed;
if (pLenWc)
*pLenWc = lenWc;
if (pBytesNotProcessed)
*pBytesNotProcessed = bytesNotProcessed;
return _wideCharStr;
}
@ -459,10 +472,10 @@ const wchar_t * WcharMbcsConvertor::char2wchar(const char * mbcs2Convert, UINT c
}
const char * WcharMbcsConvertor::wchar2char(const wchar_t * wcharStr2Convert, UINT codepage, int lenWc, int *pLenMbcs)
const char* WcharMbcsConvertor::wchar2char(const wchar_t * wcharStr2Convert, UINT codepage, int lenWc, int *pLenMbcs)
{
// Do not process NULL pointer
if (!wcharStr2Convert) return NULL;
if (nullptr == wcharStr2Convert)
return nullptr;
int lenMbcs = WideCharToMultiByte(codepage, 0, wcharStr2Convert, lenWc, NULL, 0, NULL, NULL);
if (lenMbcs > 0)
@ -481,8 +494,8 @@ const char * WcharMbcsConvertor::wchar2char(const wchar_t * wcharStr2Convert, UI
const char * WcharMbcsConvertor::wchar2char(const wchar_t * wcharStr2Convert, UINT codepage, long *mstart, long *mend)
{
// Do not process NULL pointer
if (!wcharStr2Convert) return NULL;
if (nullptr == wcharStr2Convert)
return nullptr;
int len = WideCharToMultiByte(codepage, 0, wcharStr2Convert, -1, NULL, 0, NULL, NULL);
if (len > 0)
@ -517,10 +530,10 @@ std::wstring string2wstring(const std::string & rString, UINT codepage)
MultiByteToWideChar(codepage, 0, rString.c_str(), -1, &vw[0], len);
return &vw[0];
}
else
return L"";
return std::wstring();
}
std::string wstring2string(const std::wstring & rwString, UINT codepage)
{
int len = WideCharToMultiByte(codepage, 0, rwString.c_str(), -1, NULL, 0, NULL, NULL);
@ -530,10 +543,10 @@ std::string wstring2string(const std::wstring & rwString, UINT codepage)
WideCharToMultiByte(codepage, 0, rwString.c_str(), -1, &vw[0], len, NULL, NULL);
return &vw[0];
}
else
return "";
return std::string();
}
// Escapes ampersands in file name to use it in menu
template <typename T>
generic_string convertFileName(T beg, T end)
@ -549,6 +562,7 @@ generic_string convertFileName(T beg, T end)
return strTmp;
}
generic_string intToString(int val)
{
std::vector<TCHAR> vt;
@ -558,7 +572,8 @@ generic_string intToString(int val)
vt.push_back('0' + (TCHAR)(std::abs(val % 10)));
val /= 10;
while (val != 0) {
while (val != 0)
{
vt.push_back('0' + (TCHAR)(std::abs(val % 10)));
val /= 10;
}
@ -569,13 +584,15 @@ generic_string intToString(int val)
return generic_string(vt.rbegin(), vt.rend());
}
generic_string uintToString(unsigned int val)
{
std::vector<TCHAR> vt;
vt.push_back('0' + (TCHAR)(val % 10));
val /= 10;
while (val != 0) {
while (val != 0)
{
vt.push_back('0' + (TCHAR)(val % 10));
val /= 10;
}
@ -635,7 +652,7 @@ generic_string BuildMenuFileName(int filenameLen, unsigned int pos, const generi
}
generic_string PathRemoveFileSpec(generic_string & path)
generic_string PathRemoveFileSpec(generic_string& path)
{
generic_string::size_type lastBackslash = path.find_last_of(TEXT('\\'));
if (lastBackslash == generic_string::npos)
@ -649,7 +666,7 @@ generic_string PathRemoveFileSpec(generic_string & path)
{
if (lastBackslash == 2 && path[1] == TEXT(':') && path.size() >= 3) // "C:\foo.exe" becomes "C:\"
path.erase(3);
else if (lastBackslash == 0 && path.size() > 1) // "\foo.exe" becomes "\"
else if (lastBackslash == 0 && path.size() > 1) // "\foo.exe" becomes "\"
path.erase(1);
else
path.erase(lastBackslash);
@ -658,29 +675,29 @@ generic_string PathRemoveFileSpec(generic_string & path)
}
generic_string PathAppend(generic_string &strDest, const generic_string & str2append)
generic_string PathAppend(generic_string& strDest, const generic_string& str2append)
{
if (strDest == TEXT("") && str2append == TEXT("")) // "" + ""
if (strDest.empty() && str2append.empty()) // "" + ""
{
strDest = TEXT("\\");
return strDest;
}
if (strDest == TEXT("") && str2append != TEXT("")) // "" + titi
if (strDest.empty() && not str2append.empty()) // "" + titi
{
strDest = str2append;
return strDest;
}
if (strDest[strDest.length() - 1] == '\\' && (str2append != TEXT("") && str2append[0] == '\\')) // toto\ + \titi
if (strDest[strDest.length() - 1] == '\\' && (not str2append.empty() && str2append[0] == '\\')) // toto\ + \titi
{
strDest.erase(strDest.length() - 1, 1);
strDest += str2append;
return strDest;
}
if ((strDest[strDest.length() - 1] == '\\' && (str2append != TEXT("") && str2append[0] != '\\')) // toto\ + titi
|| (strDest[strDest.length() - 1] != '\\' && (str2append != TEXT("") && str2append[0] == '\\'))) // toto + \titi
if ((strDest[strDest.length() - 1] == '\\' && (not str2append.empty() && str2append[0] != '\\')) // toto\ + titi
|| (strDest[strDest.length() - 1] != '\\' && (not str2append.empty() && str2append[0] == '\\'))) // toto + \titi
{
strDest += str2append;
return strDest;

View File

@ -24,15 +24,13 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef M30_IDE_COMMUN_H
#define M30_IDE_COMMUN_H
#pragma once
#include <vector>
#include <string>
#include <windows.h>
#include <iso646.h>
#include <cstdint>
const bool dirUp = true;
const bool dirDown = false;
@ -117,59 +115,64 @@ std::string getFileContent(const TCHAR *file2read);
generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath);
void writeFileContent(const TCHAR *file2write, const char *content2write);
class WcharMbcsConvertor {
class WcharMbcsConvertor final
{
public:
static WcharMbcsConvertor * getInstance() {return _pSelf;};
static void destroyInstance() {delete _pSelf;};
static WcharMbcsConvertor * getInstance() {return _pSelf;}
static void destroyInstance() {delete _pSelf;}
const wchar_t * char2wchar(const char *mbStr, UINT codepage, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL);
const wchar_t * char2wchar(const char *mbcs2Convert, UINT codepage, int *mstart, int *mend);
const char * wchar2char(const wchar_t *wcStr, UINT codepage, int lenIn=-1, int *pLenOut=NULL);
const char * wchar2char(const wchar_t *wcStr, UINT codepage, long *mstart, long *mend);
const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL) {
const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL)
{
int lenWc = 0;
const wchar_t * strW = char2wchar(txt2Encode, fromCodepage, lenIn, &lenWc, pBytesNotProcessed);
return wchar2char(strW, toCodepage, lenWc, pLenOut);
};
}
protected:
WcharMbcsConvertor() {}
~WcharMbcsConvertor() {}
static WcharMbcsConvertor * _pSelf;
static WcharMbcsConvertor* _pSelf;
template <class T>
class StringBuffer
class StringBuffer final
{
public:
StringBuffer() : _str(0), _allocLen(0) { }
~StringBuffer() { if(_allocLen) delete [] _str; }
~StringBuffer() { if(_allocLen) delete[] _str; }
void sizeTo(size_t size)
{
if(_allocLen < size)
if (_allocLen < size)
{
if(_allocLen) delete[] _str;
if (_allocLen)
delete[] _str;
_allocLen = max(size, initSize);
_str = new T[_allocLen];
}
}
void empty()
{
static T nullStr = 0; // routines may return an empty string, with null terminator, without allocating memory; a pointer to this null character will be returned in that case
if(_allocLen == 0)
if (_allocLen == 0)
_str = &nullStr;
else
_str[0] = 0;
}
operator T*() { return _str; }
operator T* () { return _str; }
operator const T* () const { return _str; }
protected:
static const int initSize = 1024;
size_t _allocLen;
T* _str;
size_t _allocLen = 0;
T* _str = nullptr;
};
StringBuffer<char> _multiByteStr;
@ -202,5 +205,3 @@ generic_string stringTakeWhileAdmissable(const generic_string& input, const gene
double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL);
bool str2Clipboard(const generic_string &str2cpy, HWND hwnd);
#endif //M30_IDE_COMMUN_H

View File

@ -39,7 +39,7 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\
L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\
L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\
L_COFFEESCRIPT,\
L_COFFEESCRIPT, L_JSON,\
// The end of enumated language type, so it should be always at the end
L_EXTERNAL};
enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81};

View File

@ -34,14 +34,14 @@ IDD_REGEXT_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL
FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x1
BEGIN
LTEXT "Supported exts :",IDC_SUPPORTEDEXTS_STATIC,100,18,77,8
LISTBOX IDC_REGEXT_LANG_LIST,100,31,63,122,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
LISTBOX IDC_REGEXT_LANGEXT_LIST,168,31,42,122,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
EDITTEXT IDC_CUSTOMEXT_EDIT,181,75,30,14,ES_AUTOHSCROLL | NOT WS_VISIBLE
PUSHBUTTON "->",IDC_ADDFROMLANGEXT_BUTTON,218,75,26,14
PUSHBUTTON "<-",IDC_REMOVEEXT_BUTTON,218,98,26,14
LTEXT "Registered exts :",IDC_REGISTEREDEXTS_STATIC,252,18,72,8
LISTBOX IDC_REGEXT_REGISTEREDEXTS_LIST,251,30,48,123,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
LTEXT "Supported extensions:",IDC_SUPPORTEDEXTS_STATIC,70,18,80,8
LISTBOX IDC_REGEXT_LANG_LIST,70,30,100,125,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
LISTBOX IDC_REGEXT_LANGEXT_LIST,175,30,80,125,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
EDITTEXT IDC_CUSTOMEXT_EDIT,175,75,80,14,ES_AUTOHSCROLL | NOT WS_VISIBLE
PUSHBUTTON "->",IDC_ADDFROMLANGEXT_BUTTON,265,76,25,14
PUSHBUTTON "<-",IDC_REMOVEEXT_BUTTON,265,96,25,14
LTEXT "Registered extensions:",IDC_REGISTEREDEXTS_STATIC,300,18,80,8
LISTBOX IDC_REGEXT_REGISTEREDEXTS_LIST,300,30,80,125,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
//CONTROL "",IDC_POUPELLE_STATIC,"Static",SS_OWNERDRAW,301,82,20,20
END

View File

@ -56,11 +56,6 @@ enum tb_stat {tb_saved, tb_unsaved, tb_ro};
#define NPP_INTERNAL_FUCTION_STR TEXT("Notepad++::InternalFunction")
#define SOURCECODEPRO_FONT TEXT("SourceCodePro-Regular.ttf")
#define SOURCECODEPRO_I_FONT TEXT("SourceCodePro-It.ttf")
#define SOURCECODEPRO_B_FONT TEXT("SourceCodePro-Bold.ttf")
#define SOURCECODEPRO_IB_FONT TEXT("SourceCodePro-BoldIt.ttf")
int docTabIconIDs[] = {IDI_SAVED_ICON, IDI_UNSAVED_ICON, IDI_READONLY_ICON};
ToolBarButtonUnit toolBarIcons[] = {
@ -126,14 +121,13 @@ ToolBarButtonUnit toolBarIcons[] = {
{IDM_MACRO_SAVECURRENTMACRO, IDI_SAVERECORD_OFF_ICON, IDI_SAVERECORD_ON_ICON, IDI_SAVERECORD_DISABLE_ICON, IDR_SAVERECORD}
};
Notepad_plus::Notepad_plus(): _mainWindowStatus(0), _pDocTab(NULL), _pEditView(NULL),
_pMainSplitter(NULL),
_recordingMacro(false), _pTrayIco(NULL), _isUDDocked(false), _pFileSwitcherPanel(NULL),
_pProjectPanel_1(NULL), _pProjectPanel_2(NULL), _pProjectPanel_3(NULL), _pDocMap(NULL), _pFuncList(NULL),
_linkTriggered(true), _isHotspotDblClicked(false), _isFolding(false),
_sysMenuEntering(false),
_autoCompleteMain(&_mainEditView), _autoCompleteSub(&_subEditView), _smartHighlighter(&_findReplaceDlg),
_isFileOpening(false), _pAnsiCharPanel(NULL), _pClipboardHistoryPanel(NULL)
Notepad_plus::Notepad_plus()
: _autoCompleteMain(&_mainEditView)
, _autoCompleteSub(&_subEditView)
, _smartHighlighter(&_findReplaceDlg)
{
ZeroMemory(&_prevSelectedRange, sizeof(_prevSelectedRange));
@ -198,10 +192,6 @@ Notepad_plus::~Notepad_plus()
delete _pProjectPanel_3;
delete _pDocMap;
delete _pFuncList;
::RemoveFontResourceEx(SOURCECODEPRO_FONT, FR_PRIVATE, 0);
::RemoveFontResourceEx(SOURCECODEPRO_I_FONT, FR_PRIVATE, 0);
::RemoveFontResourceEx(SOURCECODEPRO_B_FONT, FR_PRIVATE, 0);
::RemoveFontResourceEx(SOURCECODEPRO_IB_FONT, FR_PRIVATE, 0);
}
LRESULT Notepad_plus::init(HWND hwnd)
@ -209,12 +199,6 @@ LRESULT Notepad_plus::init(HWND hwnd)
NppParameters *pNppParam = NppParameters::getInstance();
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
// Add Main font
::AddFontResourceEx(SOURCECODEPRO_FONT, FR_PRIVATE, 0);
::AddFontResourceEx(SOURCECODEPRO_I_FONT, FR_PRIVATE, 0);
::AddFontResourceEx(SOURCECODEPRO_B_FONT, FR_PRIVATE, 0);
::AddFontResourceEx(SOURCECODEPRO_IB_FONT, FR_PRIVATE, 0);
// Menu
_mainMenuHandle = ::GetMenu(hwnd);
int langPos2BeRemoved = MENUINDEX_LANGUAGE+1;
@ -343,7 +327,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
::SendMessage(_mainDocTab.getHSelf(), WM_SETFONT, (WPARAM)hf, MAKELPARAM(TRUE, 0));
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, (WPARAM)hf, MAKELPARAM(TRUE, 0));
}
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(20);
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(22);
int tabDpiDynamicalWidth = NppParameters::getInstance()->_dpiManager.scaleX(45);
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
@ -363,16 +347,16 @@ LRESULT Notepad_plus::init(HWND hwnd)
bool isVertical = (nppGUI._splitterPos == POS_VERTICAL);
_subSplitter.init(_pPublicInterface->getHinst(), hwnd);
_subSplitter.create(&_mainDocTab, &_subDocTab, 8, DYNAMIC, 50, isVertical);
_subSplitter.create(&_mainDocTab, &_subDocTab, 8, SplitterMode::DYNAMIC, 50, isVertical);
//--Status Bar Section--//
bool willBeShown = nppGUI._statusBarShow;
_statusBar.init(_pPublicInterface->getHinst(), hwnd, 6);
_statusBar.setPartWidth(STATUSBAR_DOC_SIZE, 200);
_statusBar.setPartWidth(STATUSBAR_CUR_POS, 260);
_statusBar.setPartWidth(STATUSBAR_EOF_FORMAT, 110);
_statusBar.setPartWidth(STATUSBAR_DOC_SIZE, 200);
_statusBar.setPartWidth(STATUSBAR_CUR_POS, 260);
_statusBar.setPartWidth(STATUSBAR_EOF_FORMAT, 110);
_statusBar.setPartWidth(STATUSBAR_UNICODE_TYPE, 120);
_statusBar.setPartWidth(STATUSBAR_TYPING_MODE, 30);
_statusBar.setPartWidth(STATUSBAR_TYPING_MODE, 30);
_statusBar.display(willBeShown);
_pMainWindow = &_mainDocTab;
@ -380,7 +364,10 @@ LRESULT Notepad_plus::init(HWND hwnd)
_dockingManager.init(_pPublicInterface->getHinst(), hwnd, &_pMainWindow);
if (nppGUI._isMinimizedToTray && _pTrayIco == NULL)
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));
{
HICON icon = ::LoadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_M30ICON));
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, IDC_MINIMIZED_TRAY, icon, TEXT(""));
}
checkSyncState();
@ -422,9 +409,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
::InsertMenu(hMacroMenu, posBase - 1, MF_BYPOSITION, (unsigned int)-1, 0);
for (size_t i = 0 ; i < nbMacro ; ++i)
{
::InsertMenu(hMacroMenu, posBase + i, MF_BYPOSITION, ID_MACRO + i, macros[i].toMenuItemString().c_str());
}
if (nbMacro >= 1)
{
@ -554,7 +539,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
TCHAR menuName[64];
for (size_t i = 0 ; i < len ; ++i)
{
if (tmp[i]._itemName == TEXT(""))
if (tmp[i]._itemName.empty())
{
::GetMenuString(_mainMenuHandle, tmp[i]._cmdID, menuName, 64, MF_BYCOMMAND);
tmp[i]._itemName = purgeMenuItemString(menuName);
@ -617,7 +602,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
_toolBar.addToRebar(&_rebarTop);
_rebarTop.setIDVisible(REBAR_BAR_TOOLBAR, willBeShown);
checkMacroState();
checkMacroState();
//--Init dialogs--//
_findReplaceDlg.init(_pPublicInterface->getHinst(), hwnd, &_pEditView);
@ -636,23 +621,29 @@ LRESULT Notepad_plus::init(HWND hwnd)
bool uddShow = false;
switch (uddStatus)
{
case UDD_SHOW : // show & undocked
{
case UDD_SHOW: // show & undocked
{
udd->doDialog(true, _nativeLangSpeaker.isRTL());
_nativeLangSpeaker.changeUserDefineLang(udd);
uddShow = true;
break;
case UDD_DOCKED : { // hide & docked
break;
}
case UDD_DOCKED: // hide & docked
{
_isUDDocked = true;
break;}
case (UDD_SHOW | UDD_DOCKED) : // show & docked
udd->doDialog(true, _nativeLangSpeaker.isRTL());
_nativeLangSpeaker.changeUserDefineLang(udd);
::SendMessage(udd->getHSelf(), WM_COMMAND, IDC_DOCK_BUTTON, 0);
uddShow = true;
break;
}
case (UDD_SHOW | UDD_DOCKED) : // show & docked
{
udd->doDialog(true, _nativeLangSpeaker.isRTL());
_nativeLangSpeaker.changeUserDefineLang(udd);
::SendMessage(udd->getHSelf(), WM_COMMAND, IDC_DOCK_BUTTON, 0);
uddShow = true;
break;
}
default : // hide & undocked
default: // hide & undocked
break;
}
@ -665,19 +656,21 @@ LRESULT Notepad_plus::init(HWND hwnd)
//
// Initialize the default foreground & background color
//
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
int i = globalStyles.getStylerIndexByID(STYLE_DEFAULT);
if (i != -1)
{
Style & style = globalStyles.getStyler(i);
(NppParameters::getInstance())->setCurrentDefaultFgColor(style._fgColor);
(NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor);
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
int i = globalStyles.getStylerIndexByID(STYLE_DEFAULT);
if (i != -1)
{
Style & style = globalStyles.getStyler(i);
(NppParameters::getInstance())->setCurrentDefaultFgColor(style._fgColor);
(NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor);
}
}
//
// launch the plugin dlg memorized at the last session
//
DockingManagerData &dmd = nppGUI._dockingData;
DockingManagerData& dmd = nppGUI._dockingData;
_dockingManager.setDockedContSize(CONT_LEFT , nppGUI._dockingData._leftWidth);
_dockingManager.setDockedContSize(CONT_RIGHT , nppGUI._dockingData._rightWidth);
@ -686,17 +679,13 @@ LRESULT Notepad_plus::init(HWND hwnd)
for (size_t i = 0, len = dmd._pluginDockInfo.size(); i < len ; ++i)
{
PluginDlgDockingInfo & pdi = dmd._pluginDockInfo[i];
PluginDlgDockingInfo& pdi = dmd._pluginDockInfo[i];
if (pdi._isVisible)
{
if (pdi._name == NPP_INTERNAL_FUCTION_STR)
{
_internalFuncIDs.push_back(pdi._internalID);
}
else
{
_pluginsManager.runPluginCommand(pdi._name.c_str(), pdi._internalID);
}
}
}
@ -705,6 +694,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
ContainerTabInfo & cti = dmd._containerTabInfo[i];
_dockingManager.setActiveTab(cti._cont, cti._activeTab);
}
//Load initial docs into doctab
loadBufferIntoView(_mainEditView.getCurrentBufferID(), MAIN_VIEW);
loadBufferIntoView(_subEditView.getCurrentBufferID(), SUB_VIEW);
@ -902,6 +892,26 @@ void Notepad_plus::saveDockingParams()
}
void Notepad_plus::saveUserDefineLangs()
{
if (ScintillaEditView::getUserDefineDlg()->isDirty())
(NppParameters::getInstance())->writeUserDefinedLang();
}
void Notepad_plus::saveShortcuts()
{
NppParameters::getInstance()->writeShortcuts();
}
void Notepad_plus::saveFindHistory()
{
_findReplaceDlg.saveFindHistory();
(NppParameters::getInstance())->writeFindHistory();
}
int Notepad_plus::getHtmlXmlEncoding(const TCHAR *fileName) const
{
// Get Language type
@ -1806,6 +1816,7 @@ void Notepad_plus::checkDocState()
bool isUserReadOnly = curBuf->getUserReadOnly();
::CheckMenuItem(_mainMenuHandle, IDM_EDIT_SETREADONLY, MF_BYCOMMAND | (isUserReadOnly?MF_CHECKED:MF_UNCHECKED));
}
enableCommand(IDM_FILE_DELETE, isFileExisting, MENU);
enableCommand(IDM_FILE_RENAME, isFileExisting, MENU);
@ -2100,23 +2111,26 @@ bool Notepad_plus::braceMatch()
}
void Notepad_plus::setDisplayFormat(formatType f)
void Notepad_plus::setLangStatus(LangType langType)
{
generic_string str;
switch (f)
{
case MAC_FORMAT :
str = TEXT("Macintosh");
break;
case UNIX_FORMAT :
str = TEXT("UNIX");
break;
default :
str = TEXT("Dos\\Windows");
}
_statusBar.setText(str.c_str(), STATUSBAR_EOF_FORMAT);
_statusBar.setText(getLangDesc(langType).c_str(), STATUSBAR_DOC_TYPE);
}
void Notepad_plus::setDisplayFormat(FormatType format)
{
const TCHAR* str = TEXT("??");
switch (format)
{
case FormatType::windows: str = TEXT("Dos\\Windows"); break;
case FormatType::macos: str = TEXT("Macintosh"); break;
case FormatType::unix: str = TEXT("UNIX"); break;
case FormatType::unknown: str = TEXT("Unknown"); assert(false); break;
}
_statusBar.setText(str, STATUSBAR_EOF_FORMAT);
}
void Notepad_plus::setUniModeText()
{
Buffer *buf = _pEditView->getCurrentBuffer();
@ -2559,6 +2573,8 @@ enum LangType Notepad_plus::menuID2LangType(int cmdID)
return L_XML;
case IDM_LANG_JS :
return L_JS;
case IDM_LANG_JSON:
return L_JSON;
case IDM_LANG_PHP :
return L_PHP;
case IDM_LANG_ASP :
@ -2892,7 +2908,7 @@ size_t Notepad_plus::getSelectedBytes()
int Notepad_plus::wordCount()
{
FindOption env;
env._str2Search = TEXT("[^ \\\\.,;:!?()+\\-\\*/=\\]\\[{}&~\"'`|@$%<>\\^]+");
env._str2Search = TEXT("[^ \\\\.,;:!?()+\\r\\n\\-\\*/=\\]\\[{}&~\"'`|@$%<>\\^]+");
env._searchType = FindRegex;
return _findReplaceDlg.processAll(ProcessCountAll, &env, true);
}
@ -2981,7 +2997,8 @@ void Notepad_plus::getMainClientRect(RECT &rc) const
rc.bottom -= rc.top + _rebarBottom.getHeight() + _statusBar.getHeight();
}
void Notepad_plus::showView(int whichOne) {
void Notepad_plus::showView(int whichOne)
{
if (viewVisible(whichOne)) //no use making visible view visible
return;
@ -3027,8 +3044,11 @@ void Notepad_plus::hideView(int whichOne)
{
_pMainSplitter->setWin0(windowToSet);
}
else // otherwise the main window is the spltter container that we just created
else
{
// otherwise the main window is the spltter container that we just created
_pMainWindow = windowToSet;
}
_subSplitter.display(false); //hide splitter
//hide scintilla and doctab
@ -3210,7 +3230,7 @@ void Notepad_plus::dockUserDlg()
else
pWindow = _pDocTab;
_pMainSplitter->create(pWindow, ScintillaEditView::getUserDefineDlg(), 8, RIGHT_FIX, 45);
_pMainSplitter->create(pWindow, ScintillaEditView::getUserDefineDlg(), 8, SplitterMode::RIGHT_FIX, 45);
}
if (bothActive())
@ -3254,15 +3274,27 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode, int x, int y)
generic_string command = TEXT("\"");
command += nppName;
command += TEXT("\"");
command += TEXT(" \"$(FULL_CURRENT_PATH)\" -multiInst -nosession");
command += TEXT(" \"$(FULL_CURRENT_PATH)\" -multiInst -nosession -x");
TCHAR pX[10], pY[10];
generic_itoa(x, pX, 10);
generic_itoa(y, pY, 10);
if (x) {
TCHAR pX[10];
generic_itoa(x, pX, 10);
command += TEXT(" -x");
command += pX;
}
if (y) {
TCHAR pY[10];
generic_itoa(y, pY, 10);
command += TEXT(" -y");
command += pY;
}
command += pX;
command += TEXT(" -y");
command += pY;
command += TEXT(" -l");
command += ScintillaEditView::langNames[buf->getLangType()].lexerName;
command += TEXT(" -n");
command += to_wstring(_pEditView->getCurrentLineNumber() + 1);
command += TEXT(" -c");
command += to_wstring(_pEditView->getCurrentColumnNumber() + 1);
Command cmd(command);
cmd.run(_pPublicInterface->getHSelf());
@ -3460,6 +3492,7 @@ void Notepad_plus::staticCheckMenuAndTB() const
checkMenuItem(IDM_VIEW_WRAP_SYMBOL, _pEditView->isWrapSymbolVisible());
}
void Notepad_plus::dynamicCheckMenuAndTB() const
{
//Format conversion
@ -3467,13 +3500,15 @@ void Notepad_plus::dynamicCheckMenuAndTB() const
checkUnicodeMenuItems();
}
void Notepad_plus::enableConvertMenuItems(formatType f) const
void Notepad_plus::enableConvertMenuItems(FormatType format) const
{
enableCommand(IDM_FORMAT_TODOS, (f != WIN_FORMAT), MENU);
enableCommand(IDM_FORMAT_TOUNIX, (f != UNIX_FORMAT), MENU);
enableCommand(IDM_FORMAT_TOMAC, (f != MAC_FORMAT), MENU);
enableCommand(IDM_FORMAT_TODOS, (format != FormatType::windows), MENU);
enableCommand(IDM_FORMAT_TOUNIX, (format != FormatType::unix), MENU);
enableCommand(IDM_FORMAT_TOMAC, (format != FormatType::macos), MENU);
}
void Notepad_plus::checkUnicodeMenuItems() const
{
Buffer *buf = _pEditView->getCurrentBuffer();
@ -3845,7 +3880,8 @@ bool Notepad_plus::saveScintillaParams()
bool Notepad_plus::addCurrentMacro()
{
vector<MacroShortcut> & theMacros = (NppParameters::getInstance())->getMacroList();
NppParameters* nppParams = NppParameters::getInstance();
vector<MacroShortcut> & theMacros = nppParams->getMacroList();
int nbMacro = theMacros.size();
@ -3864,7 +3900,7 @@ bool Notepad_plus::addCurrentMacro()
// Insert the separator and modify/delete command
::InsertMenu(hMacroMenu, posBase + nbMacro + 1, MF_BYPOSITION, (unsigned int)-1, 0);
NativeLangSpeaker *pNativeLangSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
NativeLangSpeaker *pNativeLangSpeaker = nppParams->getNativeLangSpeaker();
generic_string nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO);
if (nativeLangShortcutMapperMacro == TEXT(""))
nativeLangShortcutMapperMacro = TEXT("Modify Shortcut/Delete Macro...");
@ -3874,6 +3910,7 @@ bool Notepad_plus::addCurrentMacro()
theMacros.push_back(ms);
::InsertMenu(hMacroMenu, posBase + nbMacro, MF_BYPOSITION, cmdID, ms.toMenuItemString().c_str());
_accelerator.updateShortcuts();
nppParams->setShortcutDirty();
return true;
}
return false;

View File

@ -161,29 +161,29 @@ enum spaceTab {
struct TaskListInfo;
struct VisibleGUIConf {
bool isPostIt;
bool isFullScreen;
struct VisibleGUIConf final
{
bool isPostIt = false;
bool isFullScreen = false;
//Used by both views
bool isMenuShown;
bool isMenuShown = true;
//bool isToolbarShown; //toolbar forcefully hidden by hiding rebar
DWORD_PTR preStyle;
DWORD_PTR preStyle = (WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN);
//used by postit only
bool isTabbarShown;
bool isAlwaysOnTop;
bool isStatusbarShown;
bool isTabbarShown = true;
bool isAlwaysOnTop = false;
bool isStatusbarShown = true;
//used by fullscreen only
WINDOWPLACEMENT _winPlace;
VisibleGUIConf() : isPostIt(false), isFullScreen(false),
isAlwaysOnTop(false), isMenuShown(true), isTabbarShown(true),
isStatusbarShown(true), preStyle(WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN)
VisibleGUIConf()
{
_winPlace.length = 0;
};
memset(&_winPlace, 0x0, sizeof(_winPlace));
}
};
@ -196,14 +196,19 @@ class ProjectPanel;
class DocumentMap;
class FunctionListPanel;
class Notepad_plus
class Notepad_plus final
{
friend class Notepad_plus_Window;
friend class FileManager;
public:
Notepad_plus();
virtual ~Notepad_plus();
~Notepad_plus();
LRESULT init(HWND hwnd);
LRESULT process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
void killAllChildren();
@ -215,9 +220,10 @@ public:
// For filtering the modeless Dialog message
// fileOperations
//! \name File Operations
//@{
//The doXXX functions apply to a single buffer and dont need to worry about views, with the excpetion of doClose, since closing one view doesnt have to mean the document is gone
BufferID doOpen(const TCHAR *fileName, bool isRecursive = false, bool isReadOnly = false, int encoding = -1, const TCHAR *backupFileName = NULL, time_t fileNameTimestamp = 0);
BufferID doOpen(const generic_string& fileName, bool isRecursive = false, bool isReadOnly = false, int encoding = -1, const TCHAR *backupFileName = NULL, time_t fileNameTimestamp = 0);
bool doReload(BufferID id, bool alert = true);
bool doSave(BufferID, const TCHAR * filename, bool isSaveCopy = false);
void doClose(BufferID, int whichOne, bool doDeleteBackup = false);
@ -225,16 +231,11 @@ public:
void fileOpen();
void fileNew();
bool fileReload() {
BufferID buf = _pEditView->getCurrentBufferID();
return doReload(buf, buf->isDirty());
}
bool fileReload();
bool fileClose(BufferID id = BUFFER_INVALID, int curView = -1); //use curView to override view to close from
bool fileCloseAll(bool doDeleteBackup, bool isSnapshotMode = false);
bool fileCloseAllButCurrent();
bool fileCloseAllGiven(const std::vector<int> &krvecBufferIndexes);
bool fileCloseAllGiven(const std::vector<int>& krvecBufferIndexes);
bool fileCloseAllToLeft();
bool fileCloseAllToRight();
bool fileSave(BufferID id = BUFFER_INVALID);
@ -246,7 +247,7 @@ public:
bool addBufferToView(BufferID id, int whichOne);
bool moveBuffer(BufferID id, int whereTo); //assumes whereFrom is otherView(whereTo)
bool switchToFile(BufferID buffer); //find buffer in active view then in other view.
// end fileOperations
//@}
bool isFileSession(const TCHAR * filename);
void filePrint(bool showDialog);
@ -255,26 +256,17 @@ public:
bool saveGUIParams();
bool saveProjectPanelsParams();
void saveDockingParams();
void saveUserDefineLangs() {
if (ScintillaEditView::getUserDefineDlg()->isDirty())
(NppParameters::getInstance())->writeUserDefinedLang();
}
void saveShortcuts(){
NppParameters::getInstance()->writeShortcuts();
}
void saveUserDefineLangs();
void saveShortcuts();
void saveSession(const Session & session);
void saveCurrentSession();
void saveFindHistory();
void saveFindHistory(){
_findReplaceDlg.saveFindHistory();
(NppParameters::getInstance())->writeFindHistory();
}
void getCurrentOpenedFiles(Session& session, bool includUntitledDoc = false);
void getCurrentOpenedFiles(Session & session, bool includUntitledDoc = false);
bool fileLoadSession(const TCHAR *fn = NULL);
bool fileLoadSession(const TCHAR* fn = nullptr);
const TCHAR * fileSaveSession(size_t nbFile, TCHAR ** fileNames, const TCHAR *sessionFile2save);
const TCHAR * fileSaveSession(size_t nbFile = 0, TCHAR ** fileNames = NULL);
const TCHAR * fileSaveSession(size_t nbFile = 0, TCHAR** fileNames = nullptr);
void changeToolBarIcons();
bool doBlockComment(comment_mode currCommentMode);
@ -298,7 +290,7 @@ public:
return _accelerator.getAccTable();
}
bool emergency(generic_string emergencySavedDir);
Buffer * getCurrentBuffer() {
Buffer* getCurrentBuffer() {
return _pEditView->getCurrentBuffer();
}
void launchDocumentBackupTask();
@ -306,39 +298,42 @@ public:
void showQuoteFromIndex(int index) const;
void showQuote(const char *quote, const char *quoter, bool doTrolling) const;
private:
Notepad_plus_Window *_pPublicInterface;
Window *_pMainWindow;
Notepad_plus_Window *_pPublicInterface = nullptr;
Window *_pMainWindow = nullptr;
DockingManager _dockingManager;
std::vector<int> _internalFuncIDs;
AutoCompletion _autoCompleteMain;
AutoCompletion _autoCompleteSub; //each Scintilla has its own autoComplete
AutoCompletion _autoCompleteSub; // each Scintilla has its own autoComplete
SmartHighlighter _smartHighlighter;
NativeLangSpeaker _nativeLangSpeaker;
DocTabView _mainDocTab;
DocTabView _subDocTab;
DocTabView *_pDocTab;
DocTabView *_pNonDocTab;
DocTabView* _pDocTab = nullptr;
DocTabView* _pNonDocTab = nullptr;
ScintillaEditView _subEditView;
ScintillaEditView _mainEditView;
ScintillaEditView _invisibleEditView; //for searches
ScintillaEditView _fileEditView; //for FileManager
ScintillaEditView *_pEditView;
ScintillaEditView *_pNonEditView;
ScintillaEditView _invisibleEditView; // for searches
ScintillaEditView _fileEditView; // for FileManager
ScintillaEditView* _pEditView = nullptr;
ScintillaEditView* _pNonEditView = nullptr;
SplitterContainer *_pMainSplitter;
SplitterContainer* _pMainSplitter = nullptr;
SplitterContainer _subSplitter;
ContextMenu _tabPopupMenu, _tabPopupDropMenu, _fileSwitcherMultiFilePopupMenu;
ContextMenu _tabPopupMenu;
ContextMenu _tabPopupDropMenu;
ContextMenu _fileSwitcherMultiFilePopupMenu;
ToolBar _toolBar;
IconList _docTabIconList;
StatusBar _statusBar;
bool _toReduceTabBar;
bool _toReduceTabBar = false;
ReBar _rebarTop;
ReBar _rebarBottom;
@ -361,9 +356,9 @@ private:
//vector<iconLocator> _customIconVect;
WindowsMenu _windowsMenu;
HMENU _mainMenuHandle;
HMENU _mainMenuHandle = NULL;
bool _sysMenuEntering;
bool _sysMenuEntering = false;
// For FullScreen/PostIt features
@ -373,43 +368,42 @@ private:
// Keystroke macro recording and playback
Macro _macro;
bool _recordingMacro;
bool _recordingMacro = false;
RunMacroDlg _runMacroDlg;
// For hotspot
bool _linkTriggered;
bool _isHotspotDblClicked;
bool _isFolding;
bool _linkTriggered = true;
bool _isHotspotDblClicked = false;
bool _isFolding = false;
//For Dynamic selection highlight
CharacterRange _prevSelectedRange;
struct ActivateAppInfo
struct ActivateAppInfo final
{
bool _isActivated;
int _x;
int _y;
ActivateAppInfo() : _isActivated(false), _x(0), _y(0){};
bool _isActivated = false;
int _x = 0;
int _y = 0;
}
_activeAppInf;
//Synchronized Scolling
struct SyncInfo
struct SyncInfo final
{
int _line;
int _column;
bool _isSynScollV;
bool _isSynScollH;
SyncInfo():_line(0), _column(0), _isSynScollV(false), _isSynScollH(false){};
bool doSync() const {return (_isSynScollV || _isSynScollH); };
int _line = 0;
int _column = 0;
bool _isSynScollV = false;
bool _isSynScollH = false;
bool doSync() const {return (_isSynScollV || _isSynScollH); }
}
_syncInfo;
bool _isUDDocked;
bool _isUDDocked = false;
trayIconControler *_pTrayIco;
int _zoomOriginalValue;
trayIconControler* _pTrayIco = nullptr;
int _zoomOriginalValue = 0;
Accelerator _accelerator;
ScintillaAccelerator _scintaccelerator;
@ -417,30 +411,30 @@ private:
PluginsManager _pluginsManager;
ButtonDlg _restoreButton;
bool _isFileOpening;
bool _isAdministrator;
bool _isFileOpening = false;
bool _isAdministrator = false;
ScintillaCtrls _scintillaCtrls4Plugins;
std::vector<std::pair<int, int> > _hideLinesMarks;
StyleArray _hotspotStyles;
AnsiCharPanel *_pAnsiCharPanel;
ClipboardHistoryPanel *_pClipboardHistoryPanel;
VerticalFileSwitcher *_pFileSwitcherPanel;
ProjectPanel *_pProjectPanel_1;
ProjectPanel *_pProjectPanel_2;
ProjectPanel *_pProjectPanel_3;
AnsiCharPanel* _pAnsiCharPanel = nullptr;
ClipboardHistoryPanel* _pClipboardHistoryPanel = nullptr;
VerticalFileSwitcher* _pFileSwitcherPanel = nullptr;
ProjectPanel* _pProjectPanel_1 = nullptr;
ProjectPanel* _pProjectPanel_2 = nullptr;
ProjectPanel* _pProjectPanel_3 = nullptr;
DocumentMap *_pDocMap;
FunctionListPanel *_pFuncList;
DocumentMap* _pDocMap = nullptr;
FunctionListPanel* _pFuncList = nullptr;
BOOL notify(SCNotification *notification);
void command(int id);
//Document management
UCHAR _mainWindowStatus; //For 2 views and user dialog if docked
int _activeView;
UCHAR _mainWindowStatus = 0; //For 2 views and user dialog if docked
int _activeView = MAIN_VIEW;
//User dialog docking
void dockUserDlg();
@ -501,16 +495,14 @@ private:
void getMainClientRect(RECT & rc) const;
void staticCheckMenuAndTB() const;
void dynamicCheckMenuAndTB() const;
void enableConvertMenuItems(formatType f) const;
void enableConvertMenuItems(FormatType f) const;
void checkUnicodeMenuItems() const;
generic_string getLangDesc(LangType langType, bool getName = false);
void setLangStatus(LangType langType){
_statusBar.setText(getLangDesc(langType).c_str(), STATUSBAR_DOC_TYPE);
}
void setLangStatus(LangType langType);
void setDisplayFormat(formatType f);
void setDisplayFormat(FormatType f);
int getCmdIDFromEncoding(int encoding) const;
void setUniModeText();
void checkLangsMenu(int id) const ;

View File

@ -51,7 +51,7 @@ BEGIN
VALUE "FileDescription", "Notepad++ : a free (GNU) source code editor\0"
VALUE "FileVersion", VERSION_VALUE
VALUE "InternalName", "npp.exe\0"
VALUE "LegalCopyright", "Copyleft 1998-2013 by Don HO\0"
VALUE "LegalCopyright", "Copyleft 1998-2015 by Don HO\0"
VALUE "OriginalFilename", "Notepad++.exe\0"
VALUE "ProductName", "Notepad++\0"
VALUE "ProductVersion", VERSION_VALUE
@ -668,6 +668,7 @@ BEGIN
MENUITEM "INNO", IDM_LANG_INNO
MENUITEM "Java", IDM_LANG_JAVA
MENUITEM "Javascript", IDM_LANG_JS
MENUITEM "JSON", IDM_LANG_JSON
MENUITEM "JSP", IDM_LANG_JSP
MENUITEM "KIXtart", IDM_LANG_KIX
MENUITEM "LISP", IDM_LANG_LISP
@ -747,6 +748,7 @@ BEGIN
BEGIN
MENUITEM "Java", IDM_LANG_JAVA
MENUITEM "Javascript", IDM_LANG_JS
MENUITEM "JSON", IDM_LANG_JSON
MENUITEM "JSP", IDM_LANG_JSP
END
MENUITEM "KIXtart", IDM_LANG_KIX
@ -846,7 +848,7 @@ BEGIN
MENUITEM "Notepad++ Home", IDM_HOMESWEETHOME
MENUITEM "Notepad++ Project Page", IDM_PROJECTPAGE
//MENUITEM "Online Documentation", IDM_ONLINEHELP
//MENUITEM "Forum", IDM_FORUM
MENUITEM "Notepad++ Community (Forum)", IDM_FORUM
MENUITEM "Live Support", IDM_ONLINESUPPORT
MENUITEM "Get More Plugins", IDM_PLUGINSHOME
MENUITEM SEPARATOR

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -33,6 +33,39 @@
const TCHAR Notepad_plus_Window::_className[32] = TEXT("Notepad++");
HWND Notepad_plus_Window::gNppHWND = NULL;
namespace // anonymous
{
struct PaintLocker final
{
PaintLocker(HWND handle)
: handle(handle)
{
// disallow drawing on the window
LockWindowUpdate(handle);
}
~PaintLocker()
{
// re-allow drawing for the window
LockWindowUpdate(NULL);
// force re-draw
InvalidateRect(handle, nullptr, TRUE);
RedrawWindow(handle, nullptr, NULL, RDW_ERASE | RDW_ALLCHILDREN | RDW_FRAME | RDW_INVALIDATE);
}
HWND handle;
};
} // anonymous namespace
void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLine, CmdLineParams *cmdLineParams)
{
time_t timestampBegin = 0;
@ -65,42 +98,43 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
if (cmdLineParams->_isNoPlugin)
_notepad_plus_plus_core._pluginsManager.disable();
_hSelf = ::CreateWindowEx(
WS_EX_ACCEPTFILES | (_notepad_plus_plus_core._nativeLangSpeaker.isRTL()?WS_EX_LAYOUTRTL:0),\
_className,\
TEXT("Notepad++"),\
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,\
// CreateWindowEx bug : set all 0 to walk around the pb
0, 0, 0, 0,\
_hParent,\
NULL,\
_hInst,\
(LPVOID)this); // pass the ptr of this instantiated object
// for retrieve it in Notepad_plus_Proc from
// the CREATESTRUCT.lpCreateParams afterward.
if (!_hSelf)
{
_hSelf = ::CreateWindowEx(
WS_EX_ACCEPTFILES | (_notepad_plus_plus_core._nativeLangSpeaker.isRTL()?WS_EX_LAYOUTRTL:0),
_className,
TEXT("Notepad++"),
(WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN),
// CreateWindowEx bug : set all 0 to walk around the pb
0, 0, 0, 0,
_hParent, nullptr, _hInst,
(LPVOID) this); // pass the ptr of this instantiated object
// for retrieve it in Notepad_plus_Proc from
// the CREATESTRUCT.lpCreateParams afterward.
if (NULL == _hSelf)
throw std::runtime_error("Notepad_plus_Window::init : CreateWindowEx() function return null");
}
PaintLocker paintLocker{_hSelf};
_notepad_plus_plus_core.staticCheckMenuAndTB();
gNppHWND = _hSelf;
if (cmdLineParams->isPointValid())
{
::MoveWindow(_hSelf, cmdLineParams->_point.x, cmdLineParams->_point.y, nppGUI._appPos.right, nppGUI._appPos.bottom, TRUE);
}
else
{
WINDOWPLACEMENT posInfo;
posInfo.length = sizeof(WINDOWPLACEMENT);
posInfo.flags = 0;
if(_isPrelaunch)
posInfo.showCmd = SW_HIDE;
else
posInfo.showCmd = nppGUI._isMaximized?SW_SHOWMAXIMIZED:SW_SHOWNORMAL;
posInfo.showCmd = nppGUI._isMaximized ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL;
posInfo.ptMinPosition.x = (LONG)-1;
posInfo.ptMinPosition.y = (LONG)-1;
posInfo.ptMaxPosition.x = (LONG)-1;
@ -113,13 +147,17 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
//SetWindowPlacement will take care of situations, where saved position was in no longer available monitor
::SetWindowPlacement(_hSelf,&posInfo);
}
if (nppGUI._tabStatus & TAB_MULTILINE)
// avoid useless drawing
//PaintLocker paintLocker(_hSelf);
if (0 != (nppGUI._tabStatus & TAB_MULTILINE))
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0);
if (!nppGUI._menuBarShow)
::SetMenu(_hSelf, NULL);
if (cmdLineParams->_isNoTab || (nppGUI._tabStatus & TAB_HIDE))
{
const int tabStatusOld = nppGUI._tabStatus;
@ -132,22 +170,18 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
}
if (cmdLineParams->_alwaysOnTop)
{
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_ALWAYSONTOP, 0);
}
nppGUI._isCmdlineNosessionActivated = cmdLineParams->_isNoSession;
if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession)
{
_notepad_plus_plus_core.loadLastSession();
}
if (!cmdLineParams->_isPreLaunch)
if (not cmdLineParams->_isPreLaunch)
{
if (cmdLineParams->isPointValid())
::ShowWindow(_hSelf, SW_SHOW);
else
::ShowWindow(_hSelf, nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
::ShowWindow(_hSelf, nppGUI._isMaximized ? SW_MAXIMIZE : SW_SHOW);
}
else
{
@ -155,15 +189,13 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
_notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD);
}
if (cmdLine)
{
if (cmdLine)
_notepad_plus_plus_core.loadCommandlineParams(cmdLine, cmdLineParams);
}
std::vector<generic_string> fileNames;
std::vector<generic_string> patterns;
patterns.push_back(TEXT("*.xml"));
generic_string nppDir = pNppParams->getNppPath();
LocalizationSwitcher & localizationSwitcher = pNppParams->getLocalizationSwitcher();
@ -171,14 +203,12 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
PathAppend(localizationDir, TEXT("localization\\"));
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len ; ++i)
{
for (size_t i = 0, len = fileNames.size(); i < len; ++i)
localizationSwitcher.addLanguageFromXml(fileNames[i].c_str());
}
fileNames.clear();
ThemeSwitcher & themeSwitcher = pNppParams->getThemeSwitcher();
// Get themes from both npp install themes dir and app data themes dir with the per user
// overriding default themes of the same name.
@ -193,6 +223,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
}
fileNames.clear();
themeDir.clear();
themeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
@ -201,7 +232,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
for (size_t i = 0, len = fileNames.size(); i < len ; ++i)
{
generic_string themeName( themeSwitcher.getThemeFromXmlFileName(fileNames[i].c_str()) );
if (! themeSwitcher.themeNameExists(themeName.c_str()) )
if (! themeSwitcher.themeNameExists(themeName.c_str()) )
{
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
@ -217,7 +248,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
scnN.nmhdr.idFrom = 0;
_notepad_plus_plus_core._pluginsManager.notify(&scnN);
if (cmdLineParams->_easterEggName != TEXT(""))
if (not cmdLineParams->_easterEggName.empty())
{
char dest[MAX_PATH];
wcstombs(dest, (cmdLineParams->_easterEggName).c_str(), sizeof(dest));
@ -269,7 +300,8 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
}
}
bool Notepad_plus_Window::isDlgsMsg(MSG *msg) const
bool Notepad_plus_Window::isDlgsMsg(MSG *msg) const
{
for (size_t i = 0, len = _notepad_plus_plus_core._hModelessDlgs.size(); i < len; ++i)
{

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,13 +24,11 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef NOTEPAD_PLUS_WINDOW_H
#define NOTEPAD_PLUS_WINDOW_H
#pragma once
#include "Notepad_plus.h"
const TCHAR COMMAND_ARG_HELP[] = TEXT("Usage :\r\
\r\
notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-LlangCode] [-nLineNumber] [-cColumnNumber] [-xLeftPos] [-yTopPos] [-nosession] [-notabbar] [-ro] [-systemtray] [-loadingTime] [-alwaysOnTop] [-openSession] [-r] [-qnEsterEggName | -qtText | -qfCntentFileName] [filePath]\r\
@ -59,47 +57,57 @@ notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-LlangCode] [-nLineNum
filePath : file or folder name to open (absolute or relative path name)\r\
");
class Notepad_plus_Window : public Window {
class Notepad_plus_Window : public Window
{
public:
Notepad_plus_Window() : _isPrelaunch(false), _disablePluginsManager(false) {};
void init(HINSTANCE, HWND, const TCHAR *cmdLine, CmdLineParams *cmdLineParams);
bool isDlgsMsg(MSG *msg) const;
HACCEL getAccTable() const {
HACCEL getAccTable() const
{
return _notepad_plus_plus_core.getAccTable();
};
bool emergency(generic_string emergencySavedDir) {
}
bool emergency(generic_string emergencySavedDir)
{
return _notepad_plus_plus_core.emergency(emergencySavedDir);
};
}
bool isPrelaunch() const {
bool isPrelaunch() const
{
return _isPrelaunch;
};
}
void setIsPrelaunch(bool val) {
void setIsPrelaunch(bool val)
{
_isPrelaunch = val;
};
}
virtual void destroy(){
::DestroyWindow(_hSelf);
};
virtual void destroy()
{
::DestroyWindow(_hSelf);
}
static const TCHAR * getClassName() {
static const TCHAR * getClassName()
{
return _className;
};
}
static HWND gNppHWND; //static handle to Notepad++ window, NULL if non-existant
private:
Notepad_plus _notepad_plus_plus_core;
static LRESULT CALLBACK Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static const TCHAR _className[32];
bool _isPrelaunch;
bool _disablePluginsManager;
std::string _userQuote; // keep the availability of this string for thread using
bool _isPrelaunch = false;
bool _disablePluginsManager = false;
std::string _userQuote; // keep the availability of this string for thread using
};
#endif //NOTEPAD_PLUS_WINDOW_H

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -55,7 +55,7 @@ void Notepad_plus::macroPlayback(Macro macro)
_pEditView->execute(SCI_ENDUNDOACTION);
}
void Notepad_plus::command(int id)
void Notepad_plus::command(int id)
{
switch (id)
{
@ -127,7 +127,7 @@ void Notepad_plus::command(int id)
checkDocState();
break;
}
case IDM_FILE_CLOSEALL_BUT_CURRENT :
fileCloseAllButCurrent();
checkDocState();
@ -234,12 +234,12 @@ void Notepad_plus::command(int id)
unsigned char *lpucharCopy = (unsigned char *)GlobalLock(hglbCopy);
memcpy(lpucharCopy, pBinText, textLen * sizeof(unsigned char));
lpucharCopy[textLen] = 0; // null character
GlobalUnlock(hglbCopy);
// Place the handle on the clipboard.
SetClipboardData(CF_TEXT, hglbCopy);
// Allocate a global memory object for the text length.
HGLOBAL hglbLenCopy = GlobalAlloc(GMEM_MOVEABLE, sizeof(unsigned long));
@ -248,13 +248,13 @@ void Notepad_plus::command(int id)
CloseClipboard();
return;
}
// Lock the handle and copy the text to the buffer.
unsigned long *lpLenCopy = (unsigned long *)GlobalLock(hglbLenCopy);
// Lock the handle and copy the text to the buffer.
unsigned long *lpLenCopy = (unsigned long *)GlobalLock(hglbLenCopy);
*lpLenCopy = textLen;
GlobalUnlock(hglbLenCopy);
GlobalUnlock(hglbLenCopy);
// Place the handle on the clipboard.
UINT f = RegisterClipboardFormat(CF_NPPTEXTLEN);
SetClipboardData(f, hglbLenCopy);
@ -276,33 +276,33 @@ void Notepad_plus::command(int id)
break;
case IDM_EDIT_PASTE_BINARY:
{
{
LongRunningOperation op;
if (!IsClipboardFormatAvailable(CF_TEXT))
return;
if (!OpenClipboard(NULL))
return;
HGLOBAL hglb = GetClipboardData(CF_TEXT);
if (hglb != NULL)
{
char *lpchar = (char *)GlobalLock(hglb);
if (lpchar != NULL)
return;
HGLOBAL hglb = GetClipboardData(CF_TEXT);
if (hglb != NULL)
{
char *lpchar = (char *)GlobalLock(hglb);
if (lpchar != NULL)
{
UINT cf_nppTextLen = RegisterClipboardFormat(CF_NPPTEXTLEN);
if (IsClipboardFormatAvailable(cf_nppTextLen))
{
HGLOBAL hglbLen = GetClipboardData(cf_nppTextLen);
if (hglbLen != NULL)
{
unsigned long *lpLen = (unsigned long *)GlobalLock(hglbLen);
if (lpLen != NULL)
HGLOBAL hglbLen = GetClipboardData(cf_nppTextLen);
if (hglbLen != NULL)
{
unsigned long *lpLen = (unsigned long *)GlobalLock(hglbLen);
if (lpLen != NULL)
{
_pEditView->execute(SCI_REPLACESEL, 0, (LPARAM)"");
_pEditView->execute(SCI_ADDTEXT, *lpLen, (LPARAM)lpchar);
GlobalUnlock(hglb);
GlobalUnlock(hglb);
}
}
}
@ -311,7 +311,7 @@ void Notepad_plus::command(int id)
_pEditView->execute(SCI_REPLACESEL, 0, (LPARAM)lpchar);
}
GlobalUnlock(hglb);
GlobalUnlock(hglb);
}
}
CloseClipboard();
@ -325,27 +325,27 @@ void Notepad_plus::command(int id)
LongRunningOperation op;
UINT f = RegisterClipboardFormat(id==IDM_EDIT_PASTE_AS_HTML?CF_HTML:CF_RTF);
if (!IsClipboardFormatAvailable(f))
if (!IsClipboardFormatAvailable(f))
return;
if (!OpenClipboard(NULL))
return;
HGLOBAL hglb = GetClipboardData(f);
if (hglb != NULL)
{
LPSTR lptstr = (LPSTR)GlobalLock(hglb);
if (lptstr != NULL)
{
// Call the application-defined ReplaceSelection
// function to insert the text and repaint the
// window.
return;
HGLOBAL hglb = GetClipboardData(f);
if (hglb != NULL)
{
LPSTR lptstr = (LPSTR)GlobalLock(hglb);
if (lptstr != NULL)
{
// Call the application-defined ReplaceSelection
// function to insert the text and repaint the
// window.
_pEditView->execute(SCI_REPLACESEL, 0, (LPARAM)lptstr);
GlobalUnlock(hglb);
GlobalUnlock(hglb);
}
}
CloseClipboard();
CloseClipboard();
}
break;
@ -551,7 +551,7 @@ void Notepad_plus::command(int id)
}
}
break;
case IDM_VIEW_TAB1:
case IDM_VIEW_TAB2:
case IDM_VIEW_TAB3:
@ -613,10 +613,10 @@ void Notepad_plus::command(int id)
// STOP !!!
_mainEditView.execute(SCI_STOPRECORD);
_subEditView.execute(SCI_STOPRECORD);
_mainEditView.execute(SCI_SETCURSOR, (WPARAM)SC_CURSORNORMAL);
_subEditView.execute(SCI_SETCURSOR, (WPARAM)SC_CURSORNORMAL);
_recordingMacro = false;
_runMacroDlg.initMacroList();
}
@ -646,13 +646,13 @@ void Notepad_plus::command(int id)
{
bool isFirstTime = !_runMacroDlg.isCreated();
_runMacroDlg.doDialog(_nativeLangSpeaker.isRTL());
if (isFirstTime)
{
_nativeLangSpeaker.changeDlgLang(_runMacroDlg.getHSelf(), "MultiMacro");
}
break;
}
}
break;
@ -693,7 +693,7 @@ void Notepad_plus::command(int id)
TCHAR str[strSize];
bool isFirstTime = !_findReplaceDlg.isCreated();
DIALOG_TYPE dlgID = FIND_DLG;
if (id == IDM_SEARCH_REPLACE)
dlgID = REPLACE_DLG;
@ -898,7 +898,7 @@ void Notepad_plus::command(int id)
break;
}
case IDM_SEARCH_GOPREVMARKER1 :
case IDM_SEARCH_GOPREVMARKER2 :
case IDM_SEARCH_GOPREVMARKER3 :
@ -1004,11 +1004,11 @@ void Notepad_plus::command(int id)
case IDM_SEARCH_CLEAR_BOOKMARKS:
bookmarkClearAll();
break;
case IDM_LANG_USER_DLG :
{
bool isUDDlgVisible = false;
UserDefineDialog *udd = _pEditView->getUserDefineDlg();
if (!udd->isCreated())
@ -1034,7 +1034,7 @@ void Notepad_plus::command(int id)
_pMainWindow = _pDocTab;
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
udd->display(false);
_mainWindowStatus &= ~WindowUserActive;
}
@ -1051,7 +1051,7 @@ void Notepad_plus::command(int id)
else
pWindow = _pDocTab;
_pMainSplitter->create(pWindow, ScintillaEditView::getUserDefineDlg(), 8, RIGHT_FIX, 45);
_pMainSplitter->create(pWindow, ScintillaEditView::getUserDefineDlg(), 8, SplitterMode::RIGHT_FIX, 45);
}
_pMainWindow = _pMainSplitter;
@ -1137,7 +1137,7 @@ void Notepad_plus::command(int id)
case IDM_EDIT_BLOCK_COMMENT:
doBlockComment(cm_toggle);
break;
case IDM_EDIT_BLOCK_COMMENT_SET:
doBlockComment(cm_comment);
break;
@ -1213,11 +1213,11 @@ void Notepad_plus::command(int id)
case IDM_EDIT_CLEARREADONLY:
{
Buffer * buf = _pEditView->getCurrentBuffer();
DWORD dwFileAttribs = ::GetFileAttributes(buf->getFullPathName());
dwFileAttribs ^= FILE_ATTRIBUTE_READONLY;
::SetFileAttributes(buf->getFullPathName(), dwFileAttribs);
DWORD dwFileAttribs = ::GetFileAttributes(buf->getFullPathName());
dwFileAttribs ^= FILE_ATTRIBUTE_READONLY;
::SetFileAttributes(buf->getFullPathName(), dwFileAttribs);
buf->setFileReadOnly(false);
}
break;
@ -1349,7 +1349,7 @@ void Notepad_plus::command(int id)
//Resize the tab height
int tabDpiDynamicalWidth = NppParameters::getInstance()->_dpiManager.scaleX(45);
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(_toReduceTabBar?20:25);
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(_toReduceTabBar?22:25);
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
_docTabIconList.setIconSize(iconDpiDynamicalSize);
@ -1367,7 +1367,7 @@ void Notepad_plus::command(int id)
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
break;
}
case IDM_VIEW_REFRESHTABAR :
{
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
@ -1397,8 +1397,8 @@ void Notepad_plus::command(int id)
TabBarPlus::setDrawTabCloseButton(!TabBarPlus::drawTabCloseButton());
// This part is just for updating (redraw) the tabs
{
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(TabBarPlus::drawTabCloseButton()?21:20);
{
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(TabBarPlus::drawTabCloseButton()?22:22);
int tabDpiDynamicalWidth = NppParameters::getInstance()->_dpiManager.scaleX(TabBarPlus::drawTabCloseButton() ? 60:45);
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight);
@ -1412,18 +1412,18 @@ void Notepad_plus::command(int id)
TabBarPlus::setDbClk2Close(!TabBarPlus::isDbClk2Close());
break;
}
case IDM_VIEW_DRAWTABBAR_VERTICAL :
{
TabBarPlus::setVertical(!TabBarPlus::isVertical());
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
break;
}
case IDM_VIEW_DRAWTABBAR_MULTILINE :
{
TabBarPlus::setMultiLine(!TabBarPlus::isMultiLine());
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
break;
}
@ -1555,7 +1555,7 @@ void Notepad_plus::command(int id)
case IDM_VIEW_SYNSCROLLV:
{
bool isSynScollV = !_syncInfo._isSynScollV;
checkMenuItem(IDM_VIEW_SYNSCROLLV, isSynScollV);
_toolBar.setCheck(IDM_VIEW_SYNSCROLLV, isSynScollV);
@ -1566,7 +1566,7 @@ void Notepad_plus::command(int id)
int subCurrentLine = _subEditView.execute(SCI_GETFIRSTVISIBLELINE);
_syncInfo._line = mainCurrentLine - subCurrentLine;
}
}
break;
@ -1694,21 +1694,22 @@ void Notepad_plus::command(int id)
break;
}
case IDM_FORMAT_TODOS :
case IDM_FORMAT_TOUNIX :
case IDM_FORMAT_TOMAC :
case IDM_FORMAT_TODOS:
case IDM_FORMAT_TOUNIX:
case IDM_FORMAT_TOMAC:
{
Buffer * buf = _pEditView->getCurrentBuffer();
int f = int((id == IDM_FORMAT_TODOS)?SC_EOL_CRLF:(id == IDM_FORMAT_TOUNIX)?SC_EOL_LF:SC_EOL_CR);
FormatType newFormat = (id == IDM_FORMAT_TODOS)
? FormatType::windows
: (id == IDM_FORMAT_TOUNIX) ? FormatType::unix : FormatType::macos;
buf->setFormat((formatType)f);
_pEditView->execute(SCI_CONVERTEOLS, buf->getFormat());
Buffer* buf = _pEditView->getCurrentBuffer();
buf->setFormat(newFormat);
_pEditView->execute(SCI_CONVERTEOLS, static_cast<int>(buf->getFormat()));
break;
}
case IDM_FORMAT_ANSI :
case IDM_FORMAT_UTF_8 :
case IDM_FORMAT_UTF_8 :
case IDM_FORMAT_UCS_2BE :
case IDM_FORMAT_UCS_2LE :
case IDM_FORMAT_AS_UTF_8 :
@ -1723,7 +1724,7 @@ void Notepad_plus::command(int id)
shoulBeDirty = buf->getUnicodeMode() != uni8Bit;
um = uniCookie;
break;
case IDM_FORMAT_UTF_8:
um = uniUTF8;
break;
@ -1842,7 +1843,7 @@ void Notepad_plus::command(int id)
case IDM_FORMAT_KOREAN_WIN :
case IDM_FORMAT_EUC_KR :
case IDM_FORMAT_TIS_620 :
case IDM_FORMAT_MAC_CYRILLIC :
case IDM_FORMAT_MAC_CYRILLIC :
case IDM_FORMAT_KOI8U_CYRILLIC :
case IDM_FORMAT_KOI8R_CYRILLIC :
{
@ -1856,7 +1857,7 @@ void Notepad_plus::command(int id)
return;
}
Buffer * buf = _pEditView->getCurrentBuffer();
Buffer* buf = _pEditView->getCurrentBuffer();
if (buf->isDirty())
{
generic_string warning, title;
@ -1883,18 +1884,13 @@ void Notepad_plus::command(int id)
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Lose Undo Ability Waning"),
MB_YESNO);
if (answer == IDYES)
{
// Do nothing
}
else
if (answer != IDYES)
return;
}
if (!buf->isDirty())
if (not buf->isDirty())
{
Buffer *buf = _pEditView->getCurrentBuffer();
buf->setEncoding(encoding);
buf->setUnicodeMode(uniCookie);
fileReload();
@ -1906,7 +1902,7 @@ void Notepad_plus::command(int id)
case IDM_FORMAT_CONV2_ANSI:
case IDM_FORMAT_CONV2_AS_UTF_8:
case IDM_FORMAT_CONV2_UTF_8:
case IDM_FORMAT_CONV2_UCS_2BE:
case IDM_FORMAT_CONV2_UCS_2BE:
case IDM_FORMAT_CONV2_UCS_2LE:
{
int idEncoding = -1;
@ -1927,7 +1923,7 @@ void Notepad_plus::command(int id)
{
if (um == uni8Bit)
return;
// set scintilla to ANSI
idEncoding = IDM_FORMAT_ANSI;
}
@ -1978,7 +1974,7 @@ void Notepad_plus::command(int id)
}
break;
}
case IDM_FORMAT_CONV2_UCS_2BE:
{
if (encoding != -1)
@ -2001,7 +1997,7 @@ void Notepad_plus::command(int id)
}
break;
}
case IDM_FORMAT_CONV2_UCS_2LE:
{
if (encoding != -1)
@ -2037,8 +2033,8 @@ void Notepad_plus::command(int id)
LPVOID clipboardData2 = ::GlobalLock(allocClipboardData);
::memcpy(clipboardData2, clipboardDataPtr, len);
::GlobalUnlock(clipboardData);
::GlobalUnlock(allocClipboardData);
::GlobalUnlock(clipboardData);
::GlobalUnlock(allocClipboardData);
::CloseClipboard();
_pEditView->saveCurrentPos();
@ -2049,7 +2045,7 @@ void Notepad_plus::command(int id)
_pEditView->execute(SCI_CLEARALL);
// Change to the proper buffer, save buffer status
::SendMessage(_pPublicInterface->getHSelf(), WM_COMMAND, idEncoding, 0);
// Paste the texte, restore buffer status
@ -2058,7 +2054,7 @@ void Notepad_plus::command(int id)
// Restore the previous clipboard data
::OpenClipboard(_pPublicInterface->getHSelf());
::EmptyClipboard();
::EmptyClipboard();
::SetClipboardData(CF_TEXT, clipboardData2);
::CloseClipboard();
@ -2106,7 +2102,7 @@ void Notepad_plus::command(int id)
for (size_t i = 0, len = copiedFiles.size(); i < len ; ++i)
{
generic_string themeName(themeSwitcher.getThemeFromXmlFileName(copiedFiles[i].c_str()));
if (!themeSwitcher.themeNameExists(themeName.c_str()))
if (!themeSwitcher.themeNameExists(themeName.c_str()))
{
themeSwitcher.addThemeFromXml(copiedFiles[i].c_str());
if (_configStyleDlg.isCreated())
@ -2134,7 +2130,7 @@ void Notepad_plus::command(int id)
{
bool isFirstTime = !_preference.isCreated();
_preference.doDialog(_nativeLangSpeaker.isRTL());
if (isFirstTime)
{
_nativeLangSpeaker.changePrefereceDlgLang(_preference);
@ -2154,7 +2150,7 @@ void Notepad_plus::command(int id)
MB_OK|MB_APPLMODAL);
}
NppParameters *pNppParams = NppParameters::getInstance();
BufferID bufID = doOpen((pNppParams->getContextMenuPath()).c_str());
BufferID bufID = doOpen((pNppParams->getContextMenuPath()));
switchToFile(bufID);
break;
}
@ -2209,7 +2205,7 @@ void Notepad_plus::command(int id)
char author[maxSelLen+1] = "";
_pEditView->getSelectedText(author, maxSelLen + 1);
int iQuote = getQuoteIndexFrom(author);
if (iQuote == -1)
{
doAboutDlg = true;
@ -2229,7 +2225,7 @@ void Notepad_plus::command(int id)
if (!::PathFileExists(noEasterEggsPath.c_str()))
showQuoteFromIndex(iQuote);
return;
}
}
}
if (doAboutDlg)
{
@ -2296,13 +2292,13 @@ void Notepad_plus::command(int id)
::MessageBox(NULL, COMMAND_ARG_HELP, TEXT("Notepad++ Command Argument Help"), MB_OK);
break;
}
/*
case IDM_FORUM:
{
::ShellExecute(NULL, TEXT("open"), TEXT(""), NULL, NULL, SW_SHOWNORMAL);
::ShellExecute(NULL, TEXT("open"), TEXT("https://notepad-plus-plus.org/community/"), NULL, NULL, SW_SHOWNORMAL);
break;
}
*/
case IDM_ONLINESUPPORT:
{
::ShellExecute(NULL, TEXT("open"), TEXT("https://gitter.im/notepad-plus-plus/notepad-plus-plus"), NULL, NULL, SW_SHOWNORMAL);
@ -2381,6 +2377,7 @@ void Notepad_plus::command(int id)
case IDM_LANG_HTML :
case IDM_LANG_XML :
case IDM_LANG_JS :
case IDM_LANG_JSON :
case IDM_LANG_PHP :
case IDM_LANG_ASP :
case IDM_LANG_CSS :
@ -2444,7 +2441,7 @@ void Notepad_plus::command(int id)
{
int nbDoc = viewVisible(MAIN_VIEW)?_mainDocTab.nbItem():0;
nbDoc += viewVisible(SUB_VIEW)?_subDocTab.nbItem():0;
bool doTaskList = ((NppParameters::getInstance())->getNppGUI())._doTaskList;
if (nbDoc > 1)
{
@ -2455,7 +2452,7 @@ void Notepad_plus::command(int id)
activateNextDoc(direction);
}
else
{
{
TaskListDlg tld;
HIMAGELIST hImgLst = _docTabIconList.getHandle();
tld.init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), hImgLst, direction);
@ -2472,7 +2469,7 @@ void Notepad_plus::command(int id)
int size = _lastRecentFileList.getSize();
for (int i = size - 1; i >= 0; i--)
{
BufferID test = doOpen(_lastRecentFileList.getIndex(i).c_str());
BufferID test = doOpen(_lastRecentFileList.getIndex(i));
if (test != BUFFER_INVALID)
lastOne = test;
}
@ -2507,7 +2504,7 @@ void Notepad_plus::command(int id)
{
WindowsDlg _windowsDlg;
_windowsDlg.init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), _pDocTab);
const TiXmlNodeA *nativeLangA = _nativeLangSpeaker.getNativeLangA();
TiXmlNodeA *dlgNode = NULL;
if (nativeLangA)
@ -2545,11 +2542,11 @@ void Notepad_plus::command(int id)
if (!buf->isUntitled() || buf->docLength() != 0)
{
fileNew();
}
}
command(IDM_EDIT_PASTE);
}
break;
case IDM_SYSTRAYPOPUP_OPENFILE:
{
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
@ -2570,13 +2567,11 @@ void Notepad_plus::command(int id)
case IDM_FILE_RESTORELASTCLOSEDFILE:
{
generic_string lastOpenedFullPath = _lastRecentFileList.getFirstItem();
if (lastOpenedFullPath != TEXT(""))
if (not lastOpenedFullPath.empty())
{
BufferID lastOpened = doOpen(lastOpenedFullPath.c_str());
BufferID lastOpened = doOpen(lastOpenedFullPath);
if (lastOpened != BUFFER_INVALID)
{
switchToFile(lastOpened);
}
}
}
break;
@ -2667,7 +2662,7 @@ void Notepad_plus::command(int id)
default :
if (id > IDM_FILEMENU_LASTONE && id < (IDM_FILEMENU_LASTONE + _lastRecentFileList.getMaxNbLRF() + 1))
{
BufferID lastOpened = doOpen(_lastRecentFileList.getItem(id).c_str());
BufferID lastOpened = doOpen(_lastRecentFileList.getItem(id));
if (lastOpened != BUFFER_INVALID)
{
switchToFile(lastOpened);
@ -2687,7 +2682,7 @@ void Notepad_plus::command(int id)
{
int i = id - ID_MACRO;
vector<MacroShortcut> & theMacros = (NppParameters::getInstance())->getMacroList();
macroPlayback(theMacros[i].getMacro());
macroPlayback(theMacros[i].getMacro());
}
else if ((id >= ID_USER_CMD) && (id < ID_USER_CMD_LIMIT))
{
@ -2707,7 +2702,7 @@ void Notepad_plus::command(int id)
{
_pluginsManager.relayNppMessages(WM_COMMAND, id, 0);
}
/*UNLOAD
/*UNLOAD
else if ((id >= ID_PLUGINS_REMOVING) && (id < ID_PLUGINS_REMOVING_END))
{
int i = id - ID_PLUGINS_REMOVING;
@ -2716,11 +2711,11 @@ void Notepad_plus::command(int id)
*/
else if ((id >= IDM_WINDOW_MRU_FIRST) && (id <= IDM_WINDOW_MRU_LIMIT))
{
activateDoc(id-IDM_WINDOW_MRU_FIRST);
activateDoc(id-IDM_WINDOW_MRU_FIRST);
}
}
if (_recordingMacro)
if (_recordingMacro)
switch (id)
{
case IDM_FILE_NEW :
@ -2817,15 +2812,15 @@ void Notepad_plus::command(int id)
case IDM_VIEW_GOTO_ANOTHER_VIEW:
case IDM_VIEW_SYNSCROLLV:
case IDM_VIEW_SYNSCROLLH:
case IDM_VIEW_TAB1:
case IDM_VIEW_TAB2:
case IDM_VIEW_TAB3:
case IDM_VIEW_TAB4:
case IDM_VIEW_TAB5:
case IDM_VIEW_TAB6:
case IDM_VIEW_TAB7:
case IDM_VIEW_TAB8:
case IDM_VIEW_TAB9:
case IDM_VIEW_TAB1:
case IDM_VIEW_TAB2:
case IDM_VIEW_TAB3:
case IDM_VIEW_TAB4:
case IDM_VIEW_TAB5:
case IDM_VIEW_TAB6:
case IDM_VIEW_TAB7:
case IDM_VIEW_TAB8:
case IDM_VIEW_TAB9:
case IDM_VIEW_TAB_NEXT:
case IDM_VIEW_TAB_PREV:
case IDC_PREV_DOC :

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -37,10 +37,14 @@
using namespace std;
BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isReadOnly, int encoding, const TCHAR *backupFileName, time_t fileNameTimestamp)
BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, bool isReadOnly, int encoding, const TCHAR *backupFileName, time_t fileNameTimestamp)
{
const rsize_t longFileNameBufferSize = MAX_PATH;
const rsize_t longFileNameBufferSize = MAX_PATH; // TODO stop using fixed-size buffer
if (fileName.size() >= longFileNameBufferSize - 1) // issue with all other sub-routines
return BUFFER_INVALID;
//If [GetFullPathName] succeeds, the return value is the length, in TCHARs, of the string copied to lpBuffer, not including the terminating null character.
//If the lpBuffer buffer is too small to contain the path, the return value [of GetFullPathName] is the size, in TCHARs, of the buffer that is required to hold the path and the terminating null character.
@ -49,7 +53,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
NppParameters *pNppParam = NppParameters::getInstance();
TCHAR longFileName[longFileNameBufferSize];
const DWORD getFullPathNameResult = ::GetFullPathName(fileName, longFileNameBufferSize, longFileName, NULL);
const DWORD getFullPathNameResult = ::GetFullPathName(fileName.c_str(), longFileNameBufferSize, longFileName, NULL);
if ( getFullPathNameResult == 0 )
{
return BUFFER_INVALID;
@ -59,23 +63,23 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
return BUFFER_INVALID;
}
assert( _tcslen( longFileName ) == getFullPathNameResult );
// ignore the returned value of function due to win64 redirection system
::GetLongPathName(longFileName, longFileName, longFileNameBufferSize);
bool isSnapshotMode = backupFileName != NULL && PathFileExists(backupFileName);
if (isSnapshotMode && !PathFileExists(longFileName)) // UNTITLED
{
lstrcpy(longFileName, fileName);
lstrcpy(longFileName, fileName.c_str());
}
_lastRecentFileList.remove(longFileName);
const TCHAR * fileName2Find;
generic_string gs_fileName = fileName;
generic_string fileName2Find;
generic_string gs_fileName{fileName};
size_t res = gs_fileName.find_first_of(UNTITLED_STR);
if (res != string::npos && res == 0)
{
fileName2Find = fileName;
@ -85,7 +89,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
fileName2Find = longFileName;
}
BufferID test = MainFileManager->getBufferFromName(fileName2Find);
BufferID test = MainFileManager->getBufferFromName(fileName2Find.c_str());
if (test != BUFFER_INVALID && !isSnapshotMode)
{
//switchToFile(test);
@ -171,7 +175,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
{
encoding = getHtmlXmlEncoding(longFileName);
}
BufferID buffer;
if (isSnapshotMode)
{
@ -179,7 +183,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
if (buffer != BUFFER_INVALID)
{
bool isSnapshotMode = backupFileName != NULL && PathFileExists(backupFileName);
bool isSnapshotMode = (backupFileName != NULL and PathFileExists(backupFileName));
if (isSnapshotMode)
{
// To notify plugins that a snapshot dirty file is loaded on startup
@ -222,7 +226,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
scnN.nmhdr.code = NPPN_FILEBEFOREOPEN;
scnN.nmhdr.idFrom = (uptr_t)buffer;
_pluginsManager.notify(&scnN);
loadBufferIntoView(buffer, currentView());
@ -248,48 +252,50 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
}
else
{
if (globbing || ::PathIsDirectory(fileName))
if (globbing || ::PathIsDirectory(fileName.c_str()))
{
vector<generic_string> fileNames;
vector<generic_string> patterns;
if (globbing)
{
const TCHAR * substring = wcsrchr(fileName, TCHAR('\\'));
size_t pos = substring - fileName;
const TCHAR * substring = wcsrchr(fileName.c_str(), TCHAR('\\'));
size_t pos = substring - fileName.c_str();
patterns.push_back(substring + 1);
generic_string dir(fileName, pos + 1);
generic_string dir(fileName.c_str(), pos + 1); // use char * to evoke:
// string (const char* s, size_t n);
// and avoid to call (if pass string) :
// string (const string& str, size_t pos, size_t len = npos);
getMatchedFileNames(dir.c_str(), patterns, fileNames, isRecursive, false);
}
else
{
generic_string fileNameStr = fileName;
if (fileName[lstrlen(fileName) - 1] != '\\')
if (fileName[fileName.size() - 1] != '\\')
fileNameStr += TEXT("\\");
patterns.push_back(TEXT("*"));
getMatchedFileNames(fileNameStr.c_str(), patterns, fileNames, true, false);
}
bool ok2Open = true;
size_t nbFiles2Open = fileNames.size();
if (nbFiles2Open > 200)
{
ok2Open = IDYES == _nativeLangSpeaker.messageBox("NbFileToOpenImportantWarning",
_pPublicInterface->getHSelf(),
TEXT("$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?"),
TEXT("Amount of files to open is too large"),
MB_YESNO|MB_APPLMODAL,
nbFiles2Open);
_pPublicInterface->getHSelf(),
TEXT("$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?"),
TEXT("Amount of files to open is too large"),
MB_YESNO|MB_APPLMODAL,
nbFiles2Open);
}
if (ok2Open)
{
for (size_t i = 0 ; i < nbFiles2Open ; ++i)
{
doOpen(fileNames[i].c_str());
}
doOpen(fileNames[i]);
}
}
else
@ -313,6 +319,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
return buffer;
}
bool Notepad_plus::doReload(BufferID id, bool alert)
{
if (alert)
@ -320,7 +327,7 @@ bool Notepad_plus::doReload(BufferID id, bool alert)
int answer = _nativeLangSpeaker.messageBox("DocReloadWarning",
_pPublicInterface->getHSelf(),
TEXT("Are you sure you want to reload the current file and lose the changes made in Notepad++?"),
TEXT("Reload"),
TEXT("Reload"),
MB_YESNO | MB_ICONEXCLAMATION | MB_APPLMODAL);
if (answer != IDYES)
return false;
@ -362,7 +369,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy)
// Notify plugins that current file is about to be saved
if (!isCopy)
{
scnN.nmhdr.code = NPPN_FILEBEFORESAVE;
scnN.nmhdr.hwndFrom = _pPublicInterface->getHSelf();
scnN.nmhdr.idFrom = (uptr_t)id;
@ -538,7 +545,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
{ //close the view if both visible
hideView(whichOne);
// if the current activated buffer is in this view,
// if the current activated buffer is in this view,
// then get buffer ID to remove the entry from File Switcher Pannel
hiddenBufferID = reinterpret_cast<BufferID>(::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETBUFFERIDFROMPOS, 0, whichOne));
}
@ -554,7 +561,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
if (_pFileSwitcherPanel)
{
//int posInfo = ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETPOSFROMBUFFERID, (WPARAM)id ,0);
_pFileSwitcherPanel->closeItem(id, whichOne);
if (hiddenBufferID != BUFFER_INVALID)
@ -630,7 +637,7 @@ int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType)
LangType lid = l->getLangID();
bool inExcludedList = false;
for (size_t j = 0, len = nppGUI._excludedLangList.size() ; j < len ; ++j)
{
if (lid == nppGUI._excludedLangList[j]._langType)
@ -648,7 +655,7 @@ int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType)
LexerStylerArray &lsa = (NppParameters::getInstance())->getLStylerArray();
const TCHAR *lName = l->getLangName();
LexerStyler *pLS = lsa.getLexerStylerByName(lName);
if (pLS)
userList = pLS->getLexerUserExt();
@ -660,7 +667,7 @@ int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType)
list += TEXT(" ");
list += userList;
}
generic_string stringFilters = exts2Filters(list);
const TCHAR *filters = stringFilters.c_str();
if (filters[0])
@ -708,7 +715,7 @@ bool Notepad_plus::fileClose(BufferID id, int curView)
}
else if (buf->isDirty())
{
res = doSaveOrNot(fileNamePath);
if (res == IDYES)
{
@ -748,7 +755,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
{
// Do nothing
}
else if (buf->isDirty())
else if (buf->isDirty())
{
if (isSnapshotMode)
{
@ -758,18 +765,18 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
activateBuffer(id, MAIN_VIEW);
if(!activateBuffer(id, SUB_VIEW))
switchEditViewTo(MAIN_VIEW);
TCHAR pattern[140] = TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"%s\" ?");
TCHAR phrase[512];
wsprintf(phrase, pattern, buf->getFullPathName());
int res = doActionOrNot(TEXT("Save"), phrase, MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL);
//int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; //abort entire procedure
}
else if (res == IDCANCEL)
}
else if (res == IDCANCEL)
{
return false;
}
@ -782,19 +789,19 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
switchEditViewTo(MAIN_VIEW);
int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; //abort entire procedure
}
else if (res == IDCANCEL)
}
else if (res == IDCANCEL)
{
return false;
}
}
}
}
for(int i = 0; i < _subDocTab.nbItem(); ++i)
for(int i = 0; i < _subDocTab.nbItem(); ++i)
{
BufferID id = _subDocTab.getBufferByIndex(i);
Buffer * buf = MainFileManager->getBufferByID(id);
@ -811,18 +818,18 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
// warning user and save it if user want it.
activateBuffer(id, SUB_VIEW);
switchEditViewTo(SUB_VIEW);
TCHAR pattern[140] = TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"%s\" ?");
TCHAR phrase[512];
wsprintf(phrase, pattern, buf->getFullPathName());
int res = doActionOrNot(TEXT("Save"), phrase, MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL);
//int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; //abort entire procedure
}
else if (res == IDCANCEL)
}
else if (res == IDCANCEL)
{
return false;
}
@ -839,7 +846,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
if (!fileSave(id))
return false; //abort entire procedure
}
else if (res == IDCANCEL)
else if (res == IDCANCEL)
{
return false;
//otherwise continue (IDNO)
@ -879,7 +886,7 @@ bool Notepad_plus::fileCloseAllGiven(const std::vector<int> &krvecBufferIndexes)
{
// Do nothing.
}
else if (buf->isDirty())
else if (buf->isDirty())
{
if(_activeView == MAIN_VIEW)
{
@ -894,11 +901,11 @@ bool Notepad_plus::fileCloseAllGiven(const std::vector<int> &krvecBufferIndexes)
}
int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; // Abort entire procedure.
}
}
else if (res == IDCANCEL)
{
return false;
@ -954,25 +961,25 @@ bool Notepad_plus::fileCloseAllButCurrent()
{
// Do nothing
}
else if (buf->isDirty())
else if (buf->isDirty())
{
activateBuffer(id, MAIN_VIEW);
if(!activateBuffer(id, SUB_VIEW))
switchEditViewTo(MAIN_VIEW);
int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; //abort entire procedure
}
}
else if (res == IDCANCEL)
{
return false;
}
}
}
for(int i = 0; i < _subDocTab.nbItem(); ++i)
for(int i = 0; i < _subDocTab.nbItem(); ++i)
{
BufferID id = _subDocTab.getBufferByIndex(i);
Buffer * buf = MainFileManager->getBufferByID(id);
@ -982,18 +989,18 @@ bool Notepad_plus::fileCloseAllButCurrent()
{
// Do nothing
}
else if (buf->isDirty())
else if (buf->isDirty())
{
activateBuffer(id, SUB_VIEW);
switchEditViewTo(SUB_VIEW);
int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
if (res == IDYES)
{
if (!fileSave(id))
return false; //abort entire procedure
}
else if (res == IDCANCEL)
}
else if (res == IDCANCEL)
{
return false;
}
@ -1006,7 +1013,7 @@ bool Notepad_plus::fileCloseAllButCurrent()
{ //first close all docs in non-current view, which gets closed automatically
//Set active tab to the last one closed.
activateBuffer(_pNonDocTab->getBufferByIndex(0), otherView());
for(int i = _pNonDocTab->nbItem() - 1; i >= 0; i--) { //close all from right to left
doClose(_pNonDocTab->getBufferByIndex(i), otherView(), isSnapshotMode);
}
@ -1063,7 +1070,7 @@ bool Notepad_plus::fileSave(BufferID id)
else if (backup == bak_verbose)
{
generic_string fn_dateTime_bak(TEXT(""));
if ((nppgui._useDir) && (nppgui._backupDir != TEXT("")))
{
fn_dateTime_bak = nppgui._backupDir;
@ -1073,11 +1080,11 @@ bool Notepad_plus::fileSave(BufferID id)
{
const TCHAR *bakDir = TEXT("nppBackup");
// std::string path should be a temp throwable variable
// std::string path should be a temp throwable variable
generic_string path = fn;
::PathRemoveFileSpec(path);
fn_dateTime_bak = path.c_str();
fn_dateTime_bak += TEXT("\\");
fn_dateTime_bak += bakDir;
@ -1141,7 +1148,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
int langTypeIndex = setFileOpenSaveDlgFilters(fDlg, buf->getLangType());
fDlg.setDefFileName(buf->getFileName());
fDlg.setExtIndex(langTypeIndex+1); // +1 for "All types"
// Disable file autodetection before opening save dialog to prevent use-after-delete bug.
@ -1199,7 +1206,7 @@ bool Notepad_plus::fileRename(BufferID id)
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
setFileOpenSaveDlgFilters(fDlg);
fDlg.setDefFileName(buf->getFileName());
TCHAR *pfn = fDlg.doSaveDlg();
@ -1219,7 +1226,7 @@ bool Notepad_plus::fileDelete(BufferID id)
BufferID bufferID = id;
if (id == BUFFER_INVALID)
bufferID = _pEditView->getCurrentBufferID();
Buffer * buf = MainFileManager->getBufferByID(bufferID);
const TCHAR *fileNamePath = buf->getFullPathName();
@ -1246,7 +1253,7 @@ bool Notepad_plus::fileDelete(BufferID id)
TEXT("Delete File failed"),
TEXT("Delete File"),
MB_OK);
scnN.nmhdr.code = NPPN_FILEDELETEFAILED;
_pluginsManager.notify(&scnN);
@ -1269,7 +1276,7 @@ void Notepad_plus::fileOpen()
{
FileDialog fDlg(_pPublicInterface->getHSelf(), _pPublicInterface->getHinst());
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
setFileOpenSaveDlgFilters(fDlg);
BufferID lastOpened = BUFFER_INVALID;
@ -1287,14 +1294,24 @@ void Notepad_plus::fileOpen()
}
}
void Notepad_plus::fileNew()
{
BufferID newBufID = MainFileManager->newEmptyDocument();
loadBufferIntoView(newBufID, currentView(), true); //true, because we want multiple new files if possible
activateBuffer(newBufID, currentView());
}
bool Notepad_plus::fileReload()
{
assert(_pEditView != nullptr);
BufferID buf = _pEditView->getCurrentBufferID();
return doReload(buf, buf->isDirty());
}
bool Notepad_plus::isFileSession(const TCHAR * filename) {
// if file2open matches the ext of user defined session file ext, then it'll be opened as a session
const TCHAR *definedSessionExt = NppParameters::getInstance()->getNppGUI()._definedSessionExt.c_str();
@ -1355,7 +1372,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
isWow64Off = true;
}
if (PathFileExists(pFn))
if (PathFileExists(pFn))
{
if (isSnapshotMode && session._mainViewFiles[i]._backupFilePath != TEXT(""))
lastOpened = doOpen(pFn, false, false, session._mainViewFiles[i]._encoding, session._mainViewFiles[i]._backupFilePath.c_str(), session._mainViewFiles[i]._originalFileLastModifTimestamp);
@ -1411,7 +1428,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
//Don't use default methods because of performance
Document prevDoc = _mainEditView.execute(SCI_GETDOCPOINTER);
_mainEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
for (size_t j = 0, len = session._mainViewFiles[i]._marks.size(); j < len ; ++j)
for (size_t j = 0, len = session._mainViewFiles[i]._marks.size(); j < len ; ++j)
{
_mainEditView.execute(SCI_MARKERADD, session._mainViewFiles[i]._marks[j], MARK_BOOKMARK);
}
@ -1449,7 +1466,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
pNppParam->safeWow64EnableWow64FsRedirection(FALSE);
isWow64Off = true;
}
if (PathFileExists(pFn))
if (PathFileExists(pFn))
{
if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT(""))
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp);
@ -1465,7 +1482,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
{
lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp);
}
else
else
{
lastOpened = BUFFER_INVALID;
}
@ -1483,7 +1500,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
const TCHAR *pLn = session._subViewFiles[k]._langName.c_str();
int id = getLangFromMenuName(pLn);
LangType typeToSet = L_TEXT;
if (id != 0)
typeToSet = menuID2LangType(id);
if (typeToSet == L_EXTERNAL )
@ -1513,12 +1530,12 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)
if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT("") && PathFileExists(session._subViewFiles[k]._backupFilePath.c_str()))
buf->setDirty(true);
//Force in the document so we can add the markers
//Don't use default methods because of performance
Document prevDoc = _subEditView.execute(SCI_GETDOCPOINTER);
_subEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
for (size_t j = 0, len = session._subViewFiles[k]._marks.size(); j < len ; ++j)
for (size_t j = 0, len = session._subViewFiles[k]._marks.size(); j < len ; ++j)
{
_subEditView.execute(SCI_MARKERADD, session._subViewFiles[k]._marks[j], MARK_BOOKMARK);
}
@ -1573,7 +1590,7 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn)
generic_string sessionExt = TEXT("");
if (*ext != '\0')
{
if (*ext != '.')
if (*ext != '.')
sessionExt += TEXT(".");
sessionExt += ext;
fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str(), NULL);
@ -1585,7 +1602,7 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn)
if (PathFileExists(fn))
sessionFileName = fn;
}
NppParameters *pNppParam = NppParameters::getInstance();
const NppGUI & nppGUI = pNppParam->getNppGUI();
@ -1603,7 +1620,7 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn)
TCHAR nppFullPath[MAX_PATH];
::GetModuleFileName(NULL, nppFullPath, MAX_PATH);
generic_string args = TEXT("-multiInst -nosession -openSession ");
args += TEXT("\"");
args += sessionFileName;
@ -1652,7 +1669,7 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, c
const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames)
{
const TCHAR *sessionFileName = NULL;
FileDialog fDlg(_pPublicInterface->getHSelf(), _pPublicInterface->getHinst());
const TCHAR *ext = NppParameters::getInstance()->getNppGUI()._definedSessionExt.c_str();
@ -1660,7 +1677,7 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames)
generic_string sessionExt = TEXT("");
if (*ext != '\0')
{
if (*ext != '.')
if (*ext != '.')
sessionExt += TEXT(".");
sessionExt += ext;
fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str(), NULL);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -75,7 +75,7 @@ bool AutoCompletion::showApiAndWordComplete()
const size_t bufSize = 256;
TCHAR beginChars[bufSize];
size_t len = (curPos > startPos)?(curPos - startPos):(startPos - curPos);
if (len >= bufSize)
return false;
@ -99,7 +99,7 @@ bool AutoCompletion::showApiAndWordComplete()
sort(wordArray.begin(), wordArray.end());
// Get word list
generic_string words(TEXT(""));
generic_string words;
for (size_t i = 0, len = wordArray.size(); i < len; ++i)
{
@ -111,10 +111,10 @@ bool AutoCompletion::showApiAndWordComplete()
_pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' '));
_pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase);
_pEditView->showAutoComletion(curPos - startPos, words.c_str());
return true;
}
void AutoCompletion::getWordArray(vector<generic_string> & wordArray, TCHAR *beginChars)
{
const size_t bufSize = 256;
@ -314,7 +314,7 @@ bool AutoCompletion::showWordComplete(bool autoInsert)
const size_t bufSize = 256;
TCHAR beginChars[bufSize];
size_t len = (curPos > startPos)?(curPos - startPos):(startPos - curPos);
if (len >= bufSize)
return false;
@ -327,7 +327,7 @@ bool AutoCompletion::showWordComplete(bool autoInsert)
if (wordArray.size() == 0) return false;
if (wordArray.size() == 1 && autoInsert)
if (wordArray.size() == 1 && autoInsert)
{
_pEditView->replaceTargetRegExMode(wordArray[0].c_str(), startPos, curPos);
_pEditView->execute(SCI_GOTOPOS, startPos + wordArray[0].length());
@ -370,7 +370,7 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car
_pEditView->execute(SCI_SETSEARCHFLAGS, flags);
TCHAR tag2find[] = TEXT("<[^\\s>]*");
int targetStart = _pEditView->searchInTarget(tag2find, lstrlen(tag2find), caretPos, 0);
if (targetStart == -1 || targetStart == -2)
return;
@ -398,7 +398,7 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car
closeTag[1] = '/';
_pEditView->getText(closeTag + 2, targetStart + 1, targetEnd);
closeTag[foundTextLen+1] = '>';
closeTag[foundTextLen+2] = '\0';
closeTag[foundTextLen+2] = '\0';
}
void InsertedMatchedChars::removeInvalidElements(MatchedCharInserted mci)
@ -443,7 +443,7 @@ int InsertedMatchedChars::search(char startChar, char endChar, int posToDetect)
if (isEmpty())
return -1;
int posToDetectLine = _pEditView->execute(SCI_LINEFROMPOSITION, posToDetect);
for (int i = _insertedMatchedChars.size() - 1; i >= 0; --i)
{
if (_insertedMatchedChars[i]._c == startChar)
@ -508,7 +508,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
}
// if there's no user defined matched pair found, continue to check notepad++'s one
const size_t closeTagLen = 256;
char closeTag[closeTagLen];
closeTag[0] = '\0';
@ -652,7 +652,7 @@ void AutoCompletion::update(int character)
const int wordSize = 64;
TCHAR s[wordSize];
_pEditView->getWordToCurrentPos(s, wordSize);
if (lstrlen(s) >= int(nppGUI._autocFromLen))
{
if (nppGUI._autocStatus == nppGUI.autoc_word)
@ -721,11 +721,11 @@ bool AutoCompletion::setLanguage(LangType language) {
_funcCalltip._param = ',';
_funcCalltip._terminal = ';';
_funcCalltip._ignoreCase = true;
_funcCalltip._additionalWordChar = TEXT("");
_funcCalltip._additionalWordChar.clear();
TiXmlElement * pElem = pAutoNode->FirstChildElement(TEXT("Environment"));
if (pElem)
{
if (pElem)
{
const TCHAR * val = 0;
val = pElem->Attribute(TEXT("ignoreCase"));
if (val && !lstrcmp(val, TEXT("no"))) {
@ -756,7 +756,7 @@ bool AutoCompletion::setLanguage(LangType language) {
_funcCalltip.setLanguageXML(NULL);
}
_keyWords = TEXT("");
_keyWords.clear();
_keyWordArray.clear();
if (_funcCompletionActive)

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,49 +24,52 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef BUFFER_H
#define BUFFER_H
#pragma once
#include "Utf8_16.h"
class Buffer;
typedef Buffer * BufferID; //each buffer has unique ID by which it can be retrieved
typedef Buffer* BufferID; //each buffer has unique ID by which it can be retrieved
#define BUFFER_INVALID (BufferID)0
typedef sptr_t Document;
enum DocFileStatus{
DOC_REGULAR = 0x01, //should not be combined with anything
DOC_UNNAMED = 0x02, //not saved (new ##)
DOC_DELETED = 0x04, //doesn't exist in environment anymore, but not DOC_UNNAMED
DOC_MODIFIED = 0x08 //File in environment has changed
enum DocFileStatus
{
DOC_REGULAR = 0x01, // should not be combined with anything
DOC_UNNAMED = 0x02, // not saved (new ##)
DOC_DELETED = 0x04, // doesn't exist in environment anymore, but not DOC_UNNAMED
DOC_MODIFIED = 0x08 // File in environment has changed
};
enum BufferStatusInfo {
BufferChangeLanguage = 0x001, //Language was altered
BufferChangeDirty = 0x002, //Buffer has changed dirty state
BufferChangeFormat = 0x004, //EOL type was changed
BufferChangeUnicode = 0x008, //Unicode type was changed
BufferChangeReadonly = 0x010, //Readonly state was changed, can be both file and user
BufferChangeStatus = 0x020, //Filesystem Status has changed
BufferChangeTimestamp = 0x040, //Timestamp was changed
BufferChangeFilename = 0x080, //Filename was changed
BufferChangeRecentTag = 0x100, //Recent tag has changed
BufferChangeLexing = 0x200, //Document needs lexing
BufferChangeMask = 0x3FF //Mask: covers all changes
enum BufferStatusInfo
{
BufferChangeLanguage = 0x001, // Language was altered
BufferChangeDirty = 0x002, // Buffer has changed dirty state
BufferChangeFormat = 0x004, // EOL type was changed
BufferChangeUnicode = 0x008, // Unicode type was changed
BufferChangeReadonly = 0x010, // Readonly state was changed, can be both file and user
BufferChangeStatus = 0x020, // Filesystem Status has changed
BufferChangeTimestamp = 0x040, // Timestamp was changed
BufferChangeFilename = 0x080, // Filename was changed
BufferChangeRecentTag = 0x100, // Recent tag has changed
BufferChangeLexing = 0x200, // Document needs lexing
BufferChangeMask = 0x3FF // Mask: covers all changes
};
//const int userLangNameMax = 16;
const TCHAR UNTITLED_STR[] = TEXT("new ");
//File manager class maintains all buffers
class FileManager {
public:
void init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratchTilla);
//void activateBuffer(int index);
//File manager class maintains all buffers
class FileManager final
{
public:
void init(Notepad_plus* pNotepadPlus, ScintillaEditView* pscratchTilla);
//void activateBuffer(int index);
void checkFilesystemChanges();
int getNrBuffers() { return _nrBufs; };
@ -92,7 +95,7 @@ public:
bool reloadBuffer(BufferID id);
bool reloadBufferDeferred(BufferID id);
bool saveBuffer(BufferID id, const TCHAR * filename, bool isCopy = false, generic_string * error_msg = NULL);
bool saveBuffer(BufferID id, const TCHAR* filename, bool isCopy = false, generic_string * error_msg = NULL);
bool backupCurrentBuffer();
bool deleteCurrentBufferBackup();
bool deleteFile(BufferID id);
@ -102,32 +105,37 @@ public:
void destroyInstance() { delete _pSelf; };
int getFileNameFromBuffer(BufferID id, TCHAR * fn2copy);
int docLength(Buffer * buffer) const;
int getEOLFormatForm(const char* const data, size_t length) const;
size_t nextUntitledNewNumber() const;
private:
FileManager() : _nextBufferID(0), _pNotepadPlus(NULL), _nrBufs(0), _pscratchTilla(NULL){};
~FileManager();
int detectCodepage(char* buf, size_t len);
bool loadFileData(Document doc, const TCHAR* filename, char* buffer, Utf8_16_Read* UnicodeConvertor, LangType & language, int& encoding, FormatType* pFormat = nullptr);
LangType detectLanguageFromTextBegining(const unsigned char *data, unsigned int dataLen);
private:
static FileManager *_pSelf;
Notepad_plus * _pNotepadPlus;
ScintillaEditView * _pscratchTilla;
Notepad_plus* _pNotepadPlus = nullptr;
ScintillaEditView* _pscratchTilla = nullptr;
Document _scratchDocDefault;
std::vector<Buffer *> _buffers;
BufferID _nextBufferID;
size_t _nrBufs;
int detectCodepage(char* buf, size_t len);
bool loadFileData(Document doc, const TCHAR * filename, char* buffer, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat = NULL);
std::vector<Buffer*> _buffers;
BufferID _nextBufferID = 0;
size_t _nrBufs = 0;
};
#define MainFileManager FileManager::getInstance()
class Buffer
class Buffer final
{
friend class FileManager;
public :
//Loading a document:
public:
//Loading a document:
//constructor with ID.
//Set a reference (pointer to a container mostly, like DocTabView or ScintillaEditView)
//Set the position manually if needed
@ -143,28 +151,24 @@ public :
const TCHAR * getFullPathName() const {
return _fullPathName.c_str();
};
}
const TCHAR * getFileName() const { return _fileName; };
const TCHAR * getFileName() const { return _fileName; }
BufferID getID() const {
return _id;
};
BufferID getID() const { return _id; }
void increaseRecentTag() {
_recentTag = ++_recentTagCtr;
doNotify(BufferChangeRecentTag);
};
}
long getRecentTag() const {
return _recentTag;
};
long getRecentTag() const { return _recentTag; }
bool checkFileState();
bool isDirty() const {
return _isDirty;
};
}
bool isReadOnly() const {
return (_isUserReadOnly || _isFileReadOnly);
@ -172,71 +176,62 @@ public :
bool isUntitled() const {
return (_currentStatus == DOC_UNNAMED);
};
}
bool getFileReadOnly() const {
return _isFileReadOnly;
};
}
void setFileReadOnly(bool ro) {
_isFileReadOnly = ro;
doNotify(BufferChangeReadonly);
};
}
bool getUserReadOnly() const {
return _isUserReadOnly;
};
}
void setUserReadOnly(bool ro) {
_isUserReadOnly = ro;
doNotify(BufferChangeReadonly);
};
}
formatType getFormat() const {
FormatType getFormat() const {
return _format;
};
}
void setFormat(formatType format) {
void setFormat(FormatType format) {
_format = format;
doNotify(BufferChangeFormat);
};
}
LangType getLangType() const {
return _lang;
};
}
void setLangType(LangType lang, const TCHAR * userLangName = TEXT(""));
UniMode getUnicodeMode() const {
return _unicodeMode;
};
}
void setUnicodeMode(UniMode mode) {
_unicodeMode = mode;
doNotify(BufferChangeUnicode | BufferChangeDirty);
};
void setUnicodeMode(UniMode mode);
int getEncoding() const {
return _encoding;
};
}
void setEncoding(int encoding) {
_encoding = encoding;
doNotify(BufferChangeUnicode | BufferChangeDirty);
};
void setEncoding(int encoding);
DocFileStatus getStatus() const {
return _currentStatus;
};
}
Document getDocument() {
return _doc;
};
}
void setDirty(bool dirty) {
_isDirty = dirty;
doNotify(BufferChangeDirty);
};
void setDirty(bool dirty);
void setPosition(const Position & pos, ScintillaEditView * identifier);
Position & getPosition(ScintillaEditView * identifier);
@ -244,44 +239,50 @@ public :
void setHeaderLineState(const std::vector<size_t> & folds, ScintillaEditView * identifier);
const std::vector<size_t> & getHeaderLineState(const ScintillaEditView * identifier) const;
bool isUserDefineLangExt() const {
bool isUserDefineLangExt() const
{
return (_userLangExt[0] != '\0');
};
}
const TCHAR * getUserDefineLangName() const {
const TCHAR * getUserDefineLangName() const
{
return _userLangExt.c_str();
};
}
const TCHAR * getCommentLineSymbol() const {
const TCHAR * getCommentLineSymbol() const
{
Lang *l = getCurrentLang();
if (!l)
return NULL;
return l->_pCommentLineSymbol;
}
};
const TCHAR * getCommentStart() const {
const TCHAR * getCommentStart() const
{
Lang *l = getCurrentLang();
if (!l)
return NULL;
return l->_pCommentStart;
};
}
const TCHAR * getCommentEnd() const {
const TCHAR * getCommentEnd() const
{
Lang *l = getCurrentLang();
if (!l)
return NULL;
return l->_pCommentEnd;
};
}
bool getNeedsLexing() const {
bool getNeedsLexing() const
{
return _needLexer;
};
}
void setNeedsLexing(bool lex) {
void setNeedsLexing(bool lex)
{
_needLexer = lex;
doNotify(BufferChangeLexing);
};
}
//these two return reference count after operation
int addReference(ScintillaEditView * identifier); //if ID not registered, creates a new Position for that ID and new foldstate
@ -291,11 +292,13 @@ public :
void setDeferredReload();
bool getNeedReload() {
bool getNeedReload()
{
return _needReloading;
}
void setNeedReload(bool reload) {
void setNeedReload(bool reload)
{
_needReloading = reload;
}
@ -304,87 +307,91 @@ public :
void setLineUndoState(size_t currentLine, size_t undoLevel, bool isSaved = false);
*/
int docLength() const {
int docLength() const
{
assert(_pManager != nullptr);
return _pManager->docLength(_id);
};
}
int getFileLength(); // return file length. -1 if file is not existing.
int getFileLength() const; // return file length. -1 if file is not existing.
enum fileTimeType {ft_created, ft_modified, ft_accessed};
generic_string getFileTime(fileTimeType ftt);
generic_string getFileTime(fileTimeType ftt) const;
Lang * getCurrentLang() const;
bool isModified() const {return _isModified;};
void setModifiedStatus(bool isModified) {_isModified = isModified;};
generic_string getBackupFileName() const {return _backupFileName;};
void setBackupFileName(generic_string fileName) {_backupFileName = fileName;};
time_t getLastModifiedTimestamp() const {return _timeStamp;};
bool isLoadedDirty() const {
bool isModified() const {return _isModified;}
void setModifiedStatus(bool isModified) {_isModified = isModified;}
generic_string getBackupFileName() const {return _backupFileName;}
void setBackupFileName(generic_string fileName) {_backupFileName = fileName;}
time_t getLastModifiedTimestamp() const {return _timeStamp;}
bool isLoadedDirty() const
{
return _isLoadedDirty;
};
}
void setLoadedDirty(bool val) {
void setLoadedDirty(bool val)
{
_isLoadedDirty = val;
};
}
private :
FileManager * _pManager;
bool _canNotify;
int _references; //if no references file inaccessible, can be closed
BufferID _id;
private:
void updateTimeStamp();
int indexOfReference(const ScintillaEditView * identifier) const;
void setStatus(DocFileStatus status)
{
_currentStatus = status;
doNotify(BufferChangeStatus);
}
void doNotify(int mask);
Buffer(const Buffer&) = delete;
Buffer& operator = (const Buffer&) = delete;
private:
FileManager * _pManager = nullptr;
bool _canNotify = false;
int _references = 0; // if no references file inaccessible, can be closed
BufferID _id = nullptr;
//document properties
Document _doc; //invariable
LangType _lang;
generic_string _userLangExt; // it's useful if only (_lang == L_USER)
bool _isDirty;
formatType _format;
bool _isDirty = false;
FormatType _format = FormatType::osdefault;
UniMode _unicodeMode;
int _encoding;
bool _isUserReadOnly;
bool _needLexer; //initially true
int _encoding = -1;
bool _isUserReadOnly = false;
bool _needLexer = false; // new buffers do not need lexing, Scintilla takes care of that
//these properties have to be duplicated because of multiple references
//All the vectors must have the same size at all times
std::vector< ScintillaEditView * > _referees;
std::vector< Position > _positions;
std::vector< std::vector<size_t> > _foldStates;
std::vector<ScintillaEditView *> _referees; // Instances of ScintillaEditView which contain this buffer
std::vector<Position> _positions;
std::vector<std::vector<size_t>> _foldStates;
//vector< pair<size_t, pair<size_t, bool> > > _linesUndoState;
//Environment properties
DocFileStatus _currentStatus;
time_t _timeStamp; // 0 if it's a new doc
bool _isFileReadOnly;
generic_string _fullPathName;
TCHAR * _fileName; //points to filename part in _fullPathName
bool _needReloading; //True if Buffer needs to be reloaded on activation
time_t _timeStamp = 0; // 0 if it's a new doc
long _recentTag;
bool _isFileReadOnly = false;
generic_string _fullPathName;
TCHAR * _fileName = nullptr; // points to filename part in _fullPathName
bool _needReloading = false; // True if Buffer needs to be reloaded on activation
long _recentTag = -1;
static long _recentTagCtr;
// For backup system
generic_string _backupFileName; // default: ""
bool _isModified; // default: false
bool _isLoadedDirty; // default: false
void updateTimeStamp();
int indexOfReference(const ScintillaEditView * identifier) const;
void setStatus(DocFileStatus status) {
_currentStatus = status;
doNotify(BufferChangeStatus);
}
void doNotify(int mask) {
if (_canNotify)
_pManager->beNotifiedOfBufferChange(this, mask);
};
Buffer(const Buffer&) { assert(false); }
Buffer& operator = (const Buffer&) { assert(false); return *this; }
};
#endif //BUFFER_H
generic_string _backupFileName;
bool _isModified = false;
bool _isLoadedDirty = false;
};

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -44,13 +44,13 @@ void DocTabView::addBuffer(BufferID buffer)
if (this->getIndexByBuffer(buffer) != -1) //no duplicates
return;
Buffer * buf = MainFileManager->getBufferByID(buffer);
TCITEM tie;
TCITEM tie;
tie.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
int index = -1;
if (_hasImgLst)
index = 0;
tie.iImage = index;
tie.iImage = index;
tie.pszText = (TCHAR *)buf->getFileName();
tie.lParam = (LPARAM)buffer;
::SendMessage(_hSelf, TCM_INSERTITEM, _nbItem++, reinterpret_cast<LPARAM>(&tie));
@ -59,27 +59,35 @@ void DocTabView::addBuffer(BufferID buffer)
::SendMessage(_hParent, WM_SIZE, 0, 0);
}
void DocTabView::closeBuffer(BufferID buffer) {
void DocTabView::closeBuffer(BufferID buffer)
{
int indexToClose = getIndexByBuffer(buffer);
deletItemAt((size_t)indexToClose);
::SendMessage(_hParent, WM_SIZE, 0, 0);
}
bool DocTabView::activateBuffer(BufferID buffer) {
bool DocTabView::activateBuffer(BufferID buffer)
{
int indexToActivate = getIndexByBuffer(buffer);
if (indexToActivate == -1)
return false; //cannot activate
activateAt(indexToActivate);
return true;
}
BufferID DocTabView::activeBuffer() {
BufferID DocTabView::activeBuffer()
{
int index = getCurrentTabIndex();
return (BufferID)getBufferByIndex(index);
}
BufferID DocTabView::findBufferByName(const TCHAR * fullfilename) { //-1 if not found, something else otherwise
BufferID DocTabView::findBufferByName(const TCHAR * fullfilename) //-1 if not found, something else otherwise
{
TCITEM tie;
tie.lParam = -1;
tie.mask = TCIF_PARAM;
@ -96,7 +104,9 @@ BufferID DocTabView::findBufferByName(const TCHAR * fullfilename) { //-1 if not
return BUFFER_INVALID;
}
int DocTabView::getIndexByBuffer(BufferID id) {
int DocTabView::getIndexByBuffer(BufferID id)
{
TCITEM tie;
tie.lParam = -1;
tie.mask = TCIF_PARAM;
@ -109,7 +119,9 @@ int DocTabView::getIndexByBuffer(BufferID id) {
return -1;
}
BufferID DocTabView::getBufferByIndex(int index) {
BufferID DocTabView::getBufferByIndex(int index)
{
TCITEM tie;
tie.lParam = -1;
tie.mask = TCIF_PARAM;
@ -118,6 +130,7 @@ BufferID DocTabView::getBufferByIndex(int index) {
return (BufferID)tie.lParam;
}
void DocTabView::bufferUpdated(Buffer * buffer, int mask)
{
int index = getIndexByBuffer(buffer->getID());
@ -127,7 +140,7 @@ void DocTabView::bufferUpdated(Buffer * buffer, int mask)
TCITEM tie;
tie.lParam = -1;
tie.mask = 0;
if (mask & BufferChangeReadonly || mask & BufferChangeDirty)
{
tie.mask |= TCIF_IMAGE;
@ -176,6 +189,7 @@ void DocTabView::bufferUpdated(Buffer * buffer, int mask)
::SendMessage(_hParent, WM_SIZE, 0, 0);
}
void DocTabView::setBuffer(int index, BufferID id)
{
if (index < 0 || index >= (int)_nbItem)
@ -191,7 +205,8 @@ void DocTabView::setBuffer(int index, BufferID id)
::SendMessage(_hParent, WM_SIZE, 0, 0);
}
void DocTabView::reSizeTo(RECT & rc)
void DocTabView::reSizeTo(RECT & rc)
{
int borderWidth = ((NppParameters::getInstance())->getSVP())._borderWidth;
if (_hideTabBarStatus)
@ -204,9 +219,9 @@ void DocTabView::reSizeTo(RECT & rc)
{
TabBar::reSizeTo(rc);
rc.left += borderWidth;
rc.right -= borderWidth * 2;
rc.right -= borderWidth * 2;
rc.top += borderWidth;
rc.bottom -= (borderWidth * 2);
rc.bottom -= (borderWidth * 2);
_pView->reSizeTo(rc);
}
}

View File

@ -699,12 +699,12 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
//Single actions
case IDCANCEL:
(*_ppEditView)->execute(SCI_CALLTIPCANCEL);
setStatusbarMessage(TEXT(""), FSNoMessage);
setStatusbarMessage(generic_string(), FSNoMessage);
display(false);
break;
case IDOK : // Find Next : only for FIND_DLG and REPLACE_DLG
{
setStatusbarMessage(TEXT(""), FSNoMessage);
setStatusbarMessage(generic_string(), FSNoMessage);
bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit;
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
@ -2141,7 +2141,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
(*_ppEditView)->execute(SCI_ENDUNDOACTION);
nppParamInst->_isFindReplacing = false;
generic_string result = TEXT("");
generic_string result;
if (nbReplaced < 0)
result = TEXT("Replace All: The regular expression is malformed.");
@ -2161,7 +2161,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
case IDCCOUNTALL :
{
int nbCounted = processAll(ProcessCountAll, _env);
generic_string result = TEXT("");
generic_string result;
if (nbCounted < 0)
result = TEXT("Count: The regular expression to search is malformed.");
@ -2182,9 +2182,12 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
nppParamInst->_isFindReplacing = true;
int nbMarked = processAll(ProcessMarkAll, _env);
nppParamInst->_isFindReplacing = false;
generic_string result = TEXT("");
generic_string result;
if (nbMarked < 0)
{
result = TEXT("Mark: The regular expression to search is malformed.");
}
else
{
TCHAR moreInfo[128];
@ -2194,6 +2197,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
wsprintf(moreInfo, TEXT("%d matches."), nbMarked);
result = moreInfo;
}
setStatusbarMessage(result, FSMessage);
break;
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -57,15 +57,15 @@ const int ScintillaEditView::_SC_MARGE_FOLDER = 2;
WNDPROC ScintillaEditView::_scintillaDefaultProc = NULL;
/*
SC_MARKNUM_* | Arrow Plus/minus Circle tree Box tree
SC_MARKNUM_* | Arrow Plus/minus Circle tree Box tree
-------------------------------------------------------------------------------------------------------------
FOLDEROPEN | SC_MARK_ARROWDOWN SC_MARK_MINUS SC_MARK_CIRCLEMINUS SC_MARK_BOXMINUS
FOLDER | SC_MARK_ARROW SC_MARK_PLUS SC_MARK_CIRCLEPLUS SC_MARK_BOXPLUS
FOLDERSUB | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_VLINE SC_MARK_VLINE
FOLDERTAIL | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_LCORNERCURVE SC_MARK_LCORNER
FOLDEREND | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_CIRCLEPLUSCONNECTED SC_MARK_BOXPLUSCONNECTED
FOLDEROPENMID | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_CIRCLEMINUSCONNECTED SC_MARK_BOXMINUSCONNECTED
FOLDERMIDTAIL | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_TCORNERCURVE SC_MARK_TCORNER
FOLDEROPEN | SC_MARK_ARROWDOWN SC_MARK_MINUS SC_MARK_CIRCLEMINUS SC_MARK_BOXMINUS
FOLDER | SC_MARK_ARROW SC_MARK_PLUS SC_MARK_CIRCLEPLUS SC_MARK_BOXPLUS
FOLDERSUB | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_VLINE SC_MARK_VLINE
FOLDERTAIL | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_LCORNERCURVE SC_MARK_LCORNER
FOLDEREND | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_CIRCLEPLUSCONNECTED SC_MARK_BOXPLUSCONNECTED
FOLDEROPENMID | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_CIRCLEMINUSCONNECTED SC_MARK_BOXMINUSCONNECTED
FOLDERMIDTAIL | SC_MARK_EMPTY SC_MARK_EMPTY SC_MARK_TCORNERCURVE SC_MARK_TCORNER
*/
const int ScintillaEditView::_markersArray[][NB_FOLDER_STATE] = {
@ -76,14 +76,15 @@ const int ScintillaEditView::_markersArray[][NB_FOLDER_STATE] = {
{SC_MARK_BOXMINUS, SC_MARK_BOXPLUS, SC_MARK_VLINE, SC_MARK_LCORNER, SC_MARK_BOXPLUSCONNECTED, SC_MARK_BOXMINUSCONNECTED, SC_MARK_TCORNER}
};
//Array with all the names of all languages
// Array with all the names of all languages
// The order of lang type (enum LangType) must be respected
LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = {
{TEXT("normal"), TEXT("Normal text"), TEXT("Normal text file"), L_TEXT, SCLEX_NULL},
{TEXT("php"), TEXT("PHP"), TEXT("PHP Hypertext Preprocessor file"), L_PHP, SCLEX_HTML},
{TEXT("c"), TEXT("C"), TEXT("C source file"), L_C, SCLEX_CPP},
{TEXT("cpp"), TEXT("C++"), TEXT("C++ source file"), L_CPP, SCLEX_CPP},
{TEXT("cs"), TEXT("C#"), TEXT("C# source file"), L_CS, SCLEX_CPP},
{TEXT("objc"), TEXT("Objective-C"), TEXT("Objective-C source file"), L_OBJC, SCLEX_CPP},
{TEXT("objc"), TEXT("Objective-C"), TEXT("Objective-C source file"), L_OBJC, SCLEX_CPP},
{TEXT("java"), TEXT("Java"), TEXT("Java source file"), L_JAVA, SCLEX_CPP},
{TEXT("rc"), TEXT("RC"), TEXT("Windows Resource file"), L_RC, SCLEX_CPP},
{TEXT("html"), TEXT("HTML"), TEXT("Hyper Text Markup Language file"), L_HTML, SCLEX_HTML},
@ -135,6 +136,7 @@ LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = {
{TEXT("r"), TEXT("R"), TEXT("R programming language"), L_R, SCLEX_R},
{TEXT("jsp"), TEXT("JSP"), TEXT("JavaServer Pages script file"), L_JSP, SCLEX_HTML},
{TEXT("coffeescript"), TEXT("CoffeeScript"), TEXT("CoffeeScript file"), L_COFFEESCRIPT, SCLEX_COFFEESCRIPT},
{ TEXT("json"), TEXT("json"), TEXT("JSON file"), L_JSON, SCLEX_CPP },
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, SCLEX_NULL}
};
@ -146,7 +148,7 @@ int getNbDigits(int aNum, int base)
{
int nbChiffre = 1;
int diviseur = base;
for (;;)
{
int result = aNum / diviseur;
@ -230,7 +232,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT2, INDIC_ROUNDBOX);
execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT3, INDIC_ROUNDBOX);
execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT4, INDIC_ROUNDBOX);
execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT5, INDIC_ROUNDBOX);
execute(SCI_INDICSETSTYLE, SCE_UNIVERSAL_FOUND_STYLE_EXT5, INDIC_ROUNDBOX);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_SMART, 100);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE, 100);
@ -241,7 +243,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_EXT2, 100);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_EXT3, 100);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_EXT4, 100);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_EXT5, 100);
execute(SCI_INDICSETALPHA, SCE_UNIVERSAL_FOUND_STYLE_EXT5, 100);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_SMART, true);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE, true);
@ -252,9 +254,9 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT2, true);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT3, true);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT4, true);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT5, true);
execute(SCI_INDICSETUNDER, SCE_UNIVERSAL_FOUND_STYLE_EXT5, true);
_pParameter = NppParameters::getInstance();
_codepage = ::GetACP();
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
@ -270,7 +272,7 @@ LRESULT CALLBACK ScintillaEditView::scintillaStatic_Proc(HWND hwnd, UINT Message
ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL)
{
{
POINT pt;
POINTS pts = MAKEPOINTS(lParam);
POINTSTOPOINT(pt, pts);
@ -295,7 +297,7 @@ LRESULT CALLBACK ScintillaEditView::scintillaStatic_Proc(HWND hwnd, UINT Message
return ::DefWindowProc(hwnd, Message, wParam, lParam);
}
LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message)
{
@ -321,7 +323,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
case WM_IME_REQUEST:
{
if (wParam == IMR_RECONVERTSTRING)
{
int textLength;
@ -416,7 +418,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
notification.nmhdr.idFrom = ::GetDlgCtrlID(_hSelf);
::SendMessage(_hParent, WM_NOTIFY, (WPARAM)LINKTRIGGERED, (LPARAM)&notification);
}
}
break;
}
@ -428,6 +430,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
return _callWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam);
}
#define DEFAULT_FONT_NAME "Courier New"
void ScintillaEditView::setSpecialStyle(const Style & styleToSet)
{
@ -437,12 +440,20 @@ void ScintillaEditView::setSpecialStyle(const Style & styleToSet)
if ( styleToSet._colorStyle & COLORSTYLE_BACKGROUND )
execute(SCI_STYLESETBACK, styleID, styleToSet._bgColor);
if (styleToSet._fontName && lstrcmp(styleToSet._fontName, TEXT("")) != 0)
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char * fontNameA = wmc->wchar2char(styleToSet._fontName, CP_UTF8);
execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)fontNameA);
if (not _pParameter->isInFontList(styleToSet._fontName))
{
execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)DEFAULT_FONT_NAME);
}
else
{
const char * fontNameA = wmc->wchar2char(styleToSet._fontName, CP_UTF8);
execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)fontNameA);
}
}
int fontStyle = styleToSet._fontStyle;
if (fontStyle != STYLE_NOT_USED)
@ -465,7 +476,7 @@ void ScintillaEditView::setHotspotStyle(Style& styleToSet)
}
styleMap = _hotspotStyles[_currentBuffer];
(*styleMap)[styleToSet._styleID] = styleToSet;
setStyle(styleToSet);
}
@ -481,28 +492,35 @@ void ScintillaEditView::setStyle(Style styleToSet)
{
Style & style = stylers.getStyler(i);
if (go.enableFg) {
if (style._colorStyle & COLORSTYLE_FOREGROUND) {
if (go.enableFg)
{
if (style._colorStyle & COLORSTYLE_FOREGROUND)
{
styleToSet._colorStyle |= COLORSTYLE_FOREGROUND;
styleToSet._fgColor = style._fgColor;
} else {
if (styleToSet._styleID == STYLE_DEFAULT) { //if global is set to transparent, use default style color
}
else
{
if (styleToSet._styleID == STYLE_DEFAULT) //if global is set to transparent, use default style color
styleToSet._colorStyle |= COLORSTYLE_FOREGROUND;
} else {
else
styleToSet._colorStyle &= ~COLORSTYLE_FOREGROUND;
}
}
}
if (go.enableBg) {
if (style._colorStyle & COLORSTYLE_BACKGROUND) {
if (go.enableBg)
{
if (style._colorStyle & COLORSTYLE_BACKGROUND)
{
styleToSet._colorStyle |= COLORSTYLE_BACKGROUND;
styleToSet._bgColor = style._bgColor;
} else {
if (styleToSet._styleID == STYLE_DEFAULT) { //if global is set to transparent, use default style color
}
else
{
if (styleToSet._styleID == STYLE_DEFAULT) //if global is set to transparent, use default style color
styleToSet._colorStyle |= COLORSTYLE_BACKGROUND;
} else {
else
styleToSet._colorStyle &= ~COLORSTYLE_BACKGROUND;
}
}
}
if (go.enableFont && style._fontName && style._fontName[0])
@ -511,7 +529,7 @@ void ScintillaEditView::setStyle(Style styleToSet)
styleToSet._fontSize = style._fontSize;
if (style._fontStyle != STYLE_NOT_USED)
{
{
if (go.enableBold)
{
if (style._fontStyle & FONTSTYLE_BOLD)
@ -523,7 +541,7 @@ void ScintillaEditView::setStyle(Style styleToSet)
{
if (style._fontStyle & FONTSTYLE_ITALIC)
styleToSet._fontStyle |= FONTSTYLE_ITALIC;
else
else
styleToSet._fontStyle &= ~FONTSTYLE_ITALIC;
}
if (go.enableUnderLine)
@ -559,7 +577,7 @@ void ScintillaEditView::setXmlLexer(LangType type)
const char *htmlKeyWords = wmc->wchar2char(htmlKeyWords_generic, CP_ACP);
execute(SCI_SETKEYWORDS, 0, reinterpret_cast<LPARAM>(htmlKeyWords?htmlKeyWords:""));
makeStyle(L_HTML);
setEmbeddedJSLexer();
setEmbeddedPhpLexer();
setEmbeddedAspLexer();
@ -589,6 +607,21 @@ void ScintillaEditView::setEmbeddedJSLexer()
execute(SCI_STYLESETEOLFILLED, SCE_HJ_COMMENTDOC, true);
}
void ScintillaEditView::setJsonLexer()
{
execute(SCI_SETLEXER, SCLEX_CPP);
const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
makeStyle(L_JSON, pKwArray);
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold"), reinterpret_cast<LPARAM>("1"));
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.compact"), reinterpret_cast<LPARAM>("0"));
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.comment"), reinterpret_cast<LPARAM>("1"));
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
}
void ScintillaEditView::setEmbeddedPhpLexer()
{
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
@ -644,7 +677,7 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
}
else
{
codepage = CP_OEMCP; // system OEM code page might not match user selection for character set,
codepage = CP_OEMCP; // system OEM code page might not match user selection for character set,
// but this is the best match WideCharToMultiByte offers
}
@ -655,7 +688,7 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
char name[] = "userDefine.prefixKeywords0";
for (int i=0 ; i<SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i)
{
{
itoa(i+1, (name+25), 10);
execute(SCI_SETPROPERTY, (WPARAM)name, (LPARAM)(userLangContainer->_isPrefix[i]?"1":"0"));
}
@ -738,7 +771,7 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
itoa((int)_currentBufferID, intBuffer, 10); // use numeric value of BufferID pointer
execute(SCI_SETPROPERTY, (WPARAM)"userDefine.currentBufferID", reinterpret_cast<LPARAM>(intBuffer));
for (int i = 0 ; i < SCE_USER_STYLE_TOTAL_STYLES ; ++i)
{
Style & style = userLangContainer->_styleArray.getStyler(i);
@ -758,13 +791,13 @@ void ScintillaEditView::setExternalLexer(LangType typeDoc)
{
int id = typeDoc - L_EXTERNAL;
TCHAR * name = _pParameter->getELCFromIndex(id)._name;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char *pName = wmc->wchar2char(name, CP_ACP);
execute(SCI_SETLEXERLANGUAGE, 0, (LPARAM)pName);
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(name);
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(name);
if (pStyler)
{
for (int i = 0 ; i < pStyler->getNbStyler() ; ++i)
@ -774,7 +807,7 @@ void ScintillaEditView::setExternalLexer(LangType typeDoc)
setStyle(style);
if (style._keywordClass >= 0 && style._keywordClass <= KEYWORDSET_MAX)
{
{
basic_string<char> keywordList("");
if (style._keywords)
{
@ -808,13 +841,13 @@ void ScintillaEditView::setCppLexer(LangType langType)
if (langType == L_JS)
{
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(lexerName);
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(lexerName);
if (pStyler)
{
for (int i = 0, nb = pStyler->getNbStyler() ; i < nb ; ++i)
{
Style style = pStyler->getStyler(i); //not by reference, but copy
int cppID = style._styleID;
int cppID = style._styleID;
switch (style._styleID)
{
case SCE_HJ_DEFAULT : cppID = SCE_C_DEFAULT; break;
@ -878,7 +911,7 @@ void ScintillaEditView::setTclLexer()
const char *tclTypes;
execute(SCI_SETLEXER, SCLEX_TCL);
execute(SCI_SETLEXER, SCLEX_TCL);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_TCL, pKwArray);
@ -904,21 +937,21 @@ void ScintillaEditView::setTclLexer()
}
//used by Objective-C and Actionscript
void ScintillaEditView::setObjCLexer(LangType langType)
void ScintillaEditView::setObjCLexer(LangType langType)
{
execute(SCI_SETLEXER, SCLEX_OBJC);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(langType, pKwArray);
basic_string<char> objcInstr1Kwl("");
if (pKwArray[LANG_INDEX_INSTR])
{
objcInstr1Kwl = wstring2string(pKwArray[LANG_INDEX_INSTR], CP_ACP);
}
const char *objcInstrs = getCompleteKeywordList(objcInstr1Kwl, langType, LANG_INDEX_INSTR);
basic_string<char> objcInstr2Kwl("");
if (pKwArray[LANG_INDEX_INSTR2])
{
@ -932,7 +965,7 @@ void ScintillaEditView::setObjCLexer(LangType langType)
objcTypeKwl = wstring2string(pKwArray[LANG_INDEX_TYPE], CP_ACP);
}
const char *objcTypes = getCompleteKeywordList(objcTypeKwl, langType, LANG_INDEX_TYPE);
basic_string<char> objcType2Kwl("");
if (pKwArray[LANG_INDEX_TYPE2])
@ -940,9 +973,9 @@ void ScintillaEditView::setObjCLexer(LangType langType)
objcType2Kwl = wstring2string(pKwArray[LANG_INDEX_TYPE2], CP_ACP);
}
const char *objCQualifier = getCompleteKeywordList(objcType2Kwl, langType, LANG_INDEX_TYPE2);
basic_string<char> doxygenKeyWordsString("");
const TCHAR *doxygenKeyWordsW = _pParameter->getWordList(L_CPP, LANG_INDEX_TYPE2);
if (doxygenKeyWordsW)
@ -976,7 +1009,7 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList)
execute(SCI_SETLEXER, lexerID);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(langType, pKwArray);
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
@ -985,7 +1018,7 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList)
{
const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_INSTR], CP_ACP);
setKeywords(langType, keyWords_char, LANG_INDEX_INSTR);
}
}
if (whichList & LIST_1)
{
@ -1069,7 +1102,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
int iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE);
if (iFind != -1)
{
pStyle = &(stylers.getStyler(iFind));
pStyle = &(stylers.getStyler(iFind));
}
setSpecialIndicator(*pStyle);
@ -1163,7 +1196,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
pStyle = &(stylers.getStyler(iFind));
}
setSpecialIndicator(*pStyle);
// Il faut surtout faire un test ici avant d'exécuter SCI_SETCODEPAGE
// Sinon y'aura un soucis de performance!
if (isCJK())
@ -1195,10 +1228,10 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_TCL :
setTclLexer(); break;
case L_OBJC :
setObjCLexer(typeDoc); break;
case L_PHP :
case L_ASP :
case L_JSP :
@ -1206,6 +1239,9 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_XML :
setXmlLexer(typeDoc); break;
case L_JSON:
setJsonLexer(); break;
case L_CSS :
setCssLexer(); break;
@ -1217,11 +1253,11 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_INI :
setIniLexer(); break;
case L_USER : {
const TCHAR * langExt = _currentBuffer->getUserDefineLangName();
if (langExt[0])
setUserLexer(langExt);
setUserLexer(langExt);
else
setUserLexer();
break; }
@ -1277,7 +1313,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_BATCH :
setBatchLexer(); break;
case L_TEX :
case L_TEX :
setTeXLexer(); break;
case L_NSIS :
@ -1286,7 +1322,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_BASH :
setBashLexer(); break;
case L_FORTRAN :
case L_FORTRAN :
setFortranLexer(); break;
case L_LISP :
@ -1490,13 +1526,13 @@ void ScintillaEditView::activateBuffer(BufferID buffer)
// get foldStateInfo of current doc
std::vector<size_t> lineStateVector;
getCurrentFoldStates(lineStateVector);
// put the state into the future ex buffer
_currentBuffer->setHeaderLineState(lineStateVector, this);
_currentBufferID = buffer; //the magical switch happens here
_currentBuffer = newBuf;
// change the doc, this operation will decrease
// change the doc, this operation will decrease
// the ref count of old current doc and increase the one of the new doc. FileManager should manage the rest
// Note that the actual reference in the Buffer itself is NOT decreased, Notepad_plus does that if neccessary
execute(SCI_SETDOCPOINTER, 0, _currentBuffer->getDocument());
@ -1536,7 +1572,7 @@ void ScintillaEditView::getCurrentFoldStates(std::vector<size_t> & lineStateVect
do {
contractedFoldHeaderLine = execute(SCI_CONTRACTEDFOLDNEXT, contractedFoldHeaderLine);
if (contractedFoldHeaderLine != -1)
if (contractedFoldHeaderLine != -1)
{
//-- Store contracted line
lineStateVector.push_back(contractedFoldHeaderLine);
@ -1559,9 +1595,9 @@ void ScintillaEditView::syncFoldStateWith(const std::vector<size_t> & lineStateV
void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask)
{
//actually only care about language and lexing etc
if (buffer == _currentBuffer)
if (buffer == _currentBuffer)
{
if (mask & BufferChangeLanguage)
if (mask & BufferChangeLanguage)
{
defineDocType(buffer->getLangType());
foldAll(fold_uncollapse);
@ -1575,30 +1611,30 @@ void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask)
} //else nothing, otherwise infinite loop
}
if (mask & BufferChangeFormat)
if (mask & BufferChangeFormat)
{
execute(SCI_SETEOLMODE, _currentBuffer->getFormat());
execute(SCI_SETEOLMODE, static_cast<int>(_currentBuffer->getFormat()));
}
if (mask & BufferChangeReadonly)
if (mask & BufferChangeReadonly)
{
execute(SCI_SETREADONLY, _currentBuffer->isReadOnly());
}
if (mask & BufferChangeUnicode)
if (mask & BufferChangeUnicode)
{
int enc = CP_ACP;
if (buffer->getUnicodeMode() == uni8Bit)
if (buffer->getUnicodeMode() == uni8Bit)
{ //either 0 or CJK codepage
LangType typeDoc = buffer->getLangType();
if (isCJK())
{
if (typeDoc == L_CSS || typeDoc == L_CAML || typeDoc == L_ASM || typeDoc == L_MATLAB)
enc = CP_ACP; //you may also want to set charsets here, not yet implemented
else
else
enc = _codepage;
}
else
enc = CP_ACP;
}
}
else //CP UTF8 for all unicode
enc = SC_CP_UTF8;
execute(SCI_SETCODEPAGE, enc);
@ -1612,10 +1648,10 @@ void ScintillaEditView::collapse(int level2Collapse, bool mode)
int maxLine = execute(SCI_GETLINECOUNT);
for (int line = 0; line < maxLine; ++line)
for (int line = 0; line < maxLine; ++line)
{
int level = execute(SCI_GETFOLDLEVEL, line);
if (level & SC_FOLDLEVELHEADERFLAG)
if (level & SC_FOLDLEVELHEADERFLAG)
{
level -= SC_FOLDLEVELBASE;
if (level2Collapse == (level & SC_FOLDLEVELNUMBERMASK))
@ -1645,7 +1681,7 @@ void ScintillaEditView::fold(int line, bool mode)
int headerLine;
int level = execute(SCI_GETFOLDLEVEL, line);
if (level & SC_FOLDLEVELHEADERFLAG)
headerLine = line;
else
@ -1674,10 +1710,10 @@ void ScintillaEditView::foldAll(bool mode)
{
int maxLine = execute(SCI_GETLINECOUNT);
for (int line = 0; line < maxLine; ++line)
for (int line = 0; line < maxLine; ++line)
{
int level = execute(SCI_GETFOLDLEVEL, line);
if (level & SC_FOLDLEVELHEADERFLAG)
if (level & SC_FOLDLEVELHEADERFLAG)
if (isFolded(line) != mode)
fold(line, mode);
}
@ -1708,7 +1744,7 @@ void ScintillaEditView::getGenericText(TCHAR *dest, size_t destlen, int start, i
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
char *destA = new char[end - start + 1];
getText(destA, start, end);
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const TCHAR *destW = wmc->char2wchar(destA, cp);
_tcsncpy_s(dest, destlen, destW, _TRUNCATE);
delete [] destA;
@ -1722,7 +1758,7 @@ void ScintillaEditView::getGenericText(TCHAR *dest, size_t destlen, int start, i
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
char *destA = new char[end - start + 1];
getText(destA, start, end);
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const TCHAR *destW = wmc->char2wchar(destA, cp, mstart, mend);
_tcsncpy_s(dest, destlen, destW, _TRUNCATE);
delete [] destA;
@ -1786,7 +1822,7 @@ TCHAR * ScintillaEditView::getGenericWordOnCaretPos(TCHAR * txt, int size)
unsigned int cp = execute(SCI_GETCODEPAGE);
char *txtA = new char[size + 1];
getWordOnCaretPos(txtA, size);
const TCHAR * txtW = wmc->char2wchar(txtA, cp);
lstrcpy(txt, txtW);
delete [] txtA;
@ -1817,7 +1853,7 @@ TCHAR * ScintillaEditView::getGenericSelectedText(TCHAR * txt, int size, bool ex
unsigned int cp = execute(SCI_GETCODEPAGE);
char *txtA = new char[size + 1];
getSelectedText(txtA, size, expand);
const TCHAR * txtW = wmc->char2wchar(txtA, cp);
lstrcpy(txt, txtW);
delete [] txtA;
@ -1830,7 +1866,7 @@ int ScintillaEditView::searchInTarget(const TCHAR * text2Find, int lenOfText2Fin
execute(SCI_SETTARGETEND, toPos);
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *text2FindA = wmc->wchar2char(text2Find, cp);
size_t text2FindALen = strlen(text2FindA);
int len = (lenOfText2Find > (int)text2FindALen)?lenOfText2Find:text2FindALen;
@ -1841,7 +1877,7 @@ int ScintillaEditView::searchInTarget(const TCHAR * text2Find, int lenOfText2Fin
void ScintillaEditView::appandGenericText(const TCHAR * text2Append) const
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *text2AppendA =wmc->wchar2char(text2Append, cp);
execute(SCI_APPENDTEXT, strlen(text2AppendA), (LPARAM)text2AppendA);
}
@ -1849,7 +1885,7 @@ void ScintillaEditView::appandGenericText(const TCHAR * text2Append) const
void ScintillaEditView::addGenericText(const TCHAR * text2Append) const
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *text2AppendA =wmc->wchar2char(text2Append, cp);
execute(SCI_ADDTEXT, strlen(text2AppendA), (LPARAM)text2AppendA);
}
@ -1857,7 +1893,7 @@ void ScintillaEditView::addGenericText(const TCHAR * text2Append) const
void ScintillaEditView::addGenericText(const TCHAR * text2Append, long *mstart, long *mend) const
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *text2AppendA =wmc->wchar2char(text2Append, cp, mstart, mend);
execute(SCI_ADDTEXT, strlen(text2AppendA), (LPARAM)text2AppendA);
}
@ -1870,7 +1906,7 @@ int ScintillaEditView::replaceTarget(const TCHAR * str2replace, int fromTargetPo
execute(SCI_SETTARGETEND, toTargetPos);
}
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *str2replaceA = wmc->wchar2char(str2replace, cp);
return execute(SCI_REPLACETARGET, (WPARAM)-1, (LPARAM)str2replaceA);
}
@ -1888,10 +1924,10 @@ int ScintillaEditView::replaceTargetRegExMode(const TCHAR * re, int fromTargetPo
return execute(SCI_REPLACETARGETRE, (WPARAM)-1, (LPARAM)reA);
}
void ScintillaEditView::showAutoComletion(int lenEntered, const TCHAR * list)
void ScintillaEditView::showAutoComletion(int lenEntered, const TCHAR* list)
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *listA = wmc->wchar2char(list, cp);
execute(SCI_AUTOCSHOW, lenEntered, WPARAM(listA));
}
@ -1899,7 +1935,7 @@ void ScintillaEditView::showAutoComletion(int lenEntered, const TCHAR * list)
void ScintillaEditView::showCallTip(int startPos, const TCHAR * def)
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
unsigned int cp = execute(SCI_GETCODEPAGE);
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *defA = wmc->wchar2char(def, cp);
execute(SCI_CALLTIPSHOW, startPos, LPARAM(defA));
}
@ -1919,7 +1955,7 @@ void ScintillaEditView::getLine(int lineNumber, TCHAR * line, int lineBufferLen)
unsigned int cp = execute(SCI_GETCODEPAGE);
char *lineA = new char[lineBufferLen];
// From Scintilla documentation for SCI_GETLINE: "The buffer is not terminated by a 0 character."
memset(lineA, '\0', sizeof(char) * lineBufferLen);
memset(lineA, 0x0, sizeof(char) * lineBufferLen);
execute(SCI_GETLINE, lineNumber, (LPARAM)lineA);
const TCHAR *lineW = wmc->char2wchar(lineA, cp);
lstrcpyn(line, lineW, lineBufferLen);
@ -1969,22 +2005,22 @@ void ScintillaEditView::marginClick(int position, int modifiers)
execute(SCI_SETFOLDEXPANDED, lineClick, 1);
expand(lineClick, true, true, 100, levelClick);
}
else if (modifiers & SCMOD_CTRL)
else if (modifiers & SCMOD_CTRL)
{
if (isFolded(lineClick))
if (isFolded(lineClick))
{
// Contract this line and all children
execute(SCI_SETFOLDEXPANDED, lineClick, 0);
expand(lineClick, false, true, 0, levelClick);
}
else
}
else
{
// Expand this line and all children
execute(SCI_SETFOLDEXPANDED, lineClick, 1);
expand(lineClick, true, true, 100, levelClick);
}
}
else
}
else
{
// Toggle this line
bool mode = isFolded(lineClick);
@ -2000,31 +2036,30 @@ void ScintillaEditView::expand(int &line, bool doExpand, bool force, int visLeve
++line;
while (line <= lineMaxSubord)
{
if (force)
if (force)
{
if (visLevels > 0)
execute(SCI_SHOWLINES, line, line);
else
execute(SCI_HIDELINES, line, line);
}
else
execute(((visLevels > 0) ? SCI_SHOWLINES : SCI_HIDELINES), line, line);
}
else
{
if (doExpand)
execute(SCI_SHOWLINES, line, line);
}
int levelLine = level;
if (levelLine == -1)
levelLine = int(execute(SCI_GETFOLDLEVEL, line, 0));
if (levelLine & SC_FOLDLEVELHEADERFLAG)
{
if (force)
if (force)
{
if (visLevels > 1)
execute(SCI_SETFOLDEXPANDED, line, 1);
else
execute(SCI_SETFOLDEXPANDED, line, 0);
expand(line, doExpand, force, visLevels - 1);
}
}
else
{
if (doExpand)
@ -2033,23 +2068,20 @@ void ScintillaEditView::expand(int &line, bool doExpand, bool force, int visLeve
execute(SCI_SETFOLDEXPANDED, line, 1);
expand(line, true, force, visLevels - 1);
}
else
{
expand(line, false, force, visLevels - 1);
}
else
expand(line, false, force, visLevels - 1);
}
}
else
{
++line;
}
}
runMarkers(true, 0, true, false);
}
void ScintillaEditView::performGlobalStyles()
void ScintillaEditView::performGlobalStyles()
{
StyleArray & stylers = _pParameter->getMiscStylerArray();
@ -2168,7 +2200,7 @@ void ScintillaEditView::setLineIndent(int line, int indent) const {
execute(SCI_SETSEL, crange.cpMin, crange.cpMax);
}
void ScintillaEditView::updateLineNumberWidth()
void ScintillaEditView::updateLineNumberWidth()
{
if (_lineNumbersShown)
{
@ -2213,7 +2245,7 @@ const char * ScintillaEditView::getCompleteKeywordList(std::basic_string<char> &
{
kwl += " ";
const TCHAR *defKwl_generic = _pParameter->getWordList(langType, keywordIndex);
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char * defKwl = wmc->wchar2char(defKwl_generic, CP_ACP);
kwl += defKwl?defKwl:"";
@ -2242,7 +2274,7 @@ void ScintillaEditView::setMultiSelections(const ColumnModeInfos & cmi)
}
}
void ScintillaEditView::currentLineUp() const
void ScintillaEditView::currentLineUp() const
{
int currentLine = getCurrentLineNumber();
if (currentLine != 0)
@ -2255,7 +2287,7 @@ void ScintillaEditView::currentLineUp() const
}
}
void ScintillaEditView::currentLineDown() const
void ScintillaEditView::currentLineDown() const
{
int currentLine = getCurrentLineNumber();
if (currentLine != (execute(SCI_GETLINECOUNT) - 1))
@ -2268,7 +2300,7 @@ void ScintillaEditView::currentLineDown() const
}
}
// Get selection range : (fromLine, toLine)
// Get selection range : (fromLine, toLine)
// return (-1, -1) if multi-selection
pair<int, int> ScintillaEditView::getSelectionLinesRange() const
{
@ -2289,7 +2321,7 @@ pair<int, int> ScintillaEditView::getSelectionLinesRange() const
return range;
}
void ScintillaEditView::currentLinesUp() const
void ScintillaEditView::currentLinesUp() const
{
pair<int, int> lineRange = getSelectionLinesRange();
if ((lineRange.first == -1 || lineRange.first == 0))
@ -2317,10 +2349,10 @@ void ScintillaEditView::currentLinesUp() const
execute(SCI_SETSELECTIONEND, noSel?posStart - nbChar:posEnd - nbChar);
}
void ScintillaEditView::currentLinesDown() const
void ScintillaEditView::currentLinesDown() const
{
pair<int, int> lineRange = getSelectionLinesRange();
if ((lineRange.first == -1 || lineRange.second >= execute(SCI_LINEFROMPOSITION, getCurrentDocLen())))
return;
@ -2360,7 +2392,7 @@ void ScintillaEditView::convertSelectedTextTo(bool Case)
if (execute(SCI_GETSELECTIONS) > 1) // Multi-Selection || Column mode
{
execute(SCI_BEGINUNDOACTION);
ColumnModeInfos cmi = getColumnModeSelectInfo();
for (size_t i = 0, cmiLen = cmi.size(); i < cmiLen ; ++i)
@ -2403,7 +2435,7 @@ void ScintillaEditView::convertSelectedTextTo(bool Case)
size_t selectionStart = execute(SCI_GETSELECTIONSTART);
size_t selectionEnd = execute(SCI_GETSELECTIONEND);
int strSize = ((selectionEnd > selectionStart)?(selectionEnd - selectionStart):(selectionStart - selectionEnd))+1;
if (strSize)
{
@ -2454,7 +2486,7 @@ bool ScintillaEditView::expandWordSelection()
return false;
}
TCHAR * int2str(TCHAR *str, int strLen, int number, int base, int nbChiffre, bool isZeroLeading)
TCHAR * int2str(TCHAR *str, int strLen, int number, int base, int nbChiffre, bool isZeroLeading)
{
if (nbChiffre >= strLen) return NULL;
TCHAR f[64];
@ -2469,7 +2501,7 @@ TCHAR * int2str(TCHAR *str, int strLen, int number, int base, int nbChiffre, boo
int nbBits = sizeof(unsigned int) * 8;
int nbBit2Shift = (nbChiffre >= nbBits)?nbBits:(nbBits - nbChiffre);
unsigned long mask = MASK_ULONG_BITFORT >> nbBit2Shift;
int i = 0;
int i = 0;
for (; mask > 0 ; ++i)
{
str[i] = (mask & number)?'1':'0';
@ -2527,7 +2559,7 @@ ColumnModeInfos ScintillaEditView::getColumnModeSelectInfo()
int absPosSelEndPerLine = execute(SCI_GETSELECTIONNCARET, i);
int nbVirtualAnchorSpc = execute(SCI_GETSELECTIONNANCHORVIRTUALSPACE, i);
int nbVirtualCaretSpc = execute(SCI_GETSELECTIONNCARETVIRTUALSPACE, i);
if (absPosSelStartPerLine == absPosSelEndPerLine && execute(SCI_SELECTIONISRECTANGLE))
{
bool dir = nbVirtualAnchorSpc<nbVirtualCaretSpc?L2R:R2L;
@ -2573,8 +2605,8 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, const TCHAR *str)
unsigned int cp = execute(SCI_GETCODEPAGE);
const char *strA = wmc->wchar2char(str, cp);
execute(SCI_REPLACETARGET, (WPARAM)-1, (LPARAM)strA);
if (hasVirtualSpc)
if (hasVirtualSpc)
{
totalDiff += cmi[i]._nbVirtualAnchorSpc + lstrlen(str);
@ -2608,7 +2640,7 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, int initial, int in
UCHAR f = format & MASK_FORMAT;
bool isZeroLeading = (MASK_ZERO_LEADING & format) != 0;
int base = 10;
if (f == BASE_16)
base = 16;
@ -2677,7 +2709,7 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, int initial, int in
const char *strA = wmc->wchar2char(str, cp);
execute(SCI_REPLACETARGET, (WPARAM)-1, (LPARAM)strA);
if (hasVirtualSpc)
if (hasVirtualSpc)
{
totalDiff += cmi[i]._nbVirtualAnchorSpc + lstrlen(str);
// Now there's no more virtual space
@ -2843,7 +2875,7 @@ void ScintillaEditView::runMarkers(bool doHide, int searchStart, bool endOfDoc,
return
else
search for other hidden sections
Show:
Run through all lines
Find open hiding marker

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -153,7 +153,7 @@ const bool L2R = true;
const bool R2L = false;
struct ColumnModeInfo {
int _selLpos;
int _selLpos;
int _selRpos;
int _order; // 0 based index
bool _direction; // L2R or R2L
@ -218,7 +218,7 @@ public:
{
::FreeLibrary(_hLib);
for (BufferStyleMap::iterator it(_hotspotStyles.begin()); it != _hotspotStyles.end(); ++it )
for (BufferStyleMap::iterator it(_hotspotStyles.begin()); it != _hotspotStyles.end(); ++it )
{
for (StyleMap::iterator it2(it->second->begin()) ; it2 != it->second->end() ; ++it2)
{
@ -240,7 +240,7 @@ public:
LRESULT execute(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) const {
return _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam);
};
void activateBuffer(BufferID buffer);
void getCurrentFoldStates(std::vector<size_t> & lineStateVector);
@ -303,7 +303,7 @@ public:
void getWordToCurrentPos(TCHAR * str, int strLen) const {
int caretPos = execute(SCI_GETCURRENTPOS);
int startPos = static_cast<int>(execute(SCI_WORDSTARTPOSITION, caretPos, true));
str[0] = '\0';
if ((caretPos - startPos) < strLen)
getGenericText(str, strLen, startPos, caretPos);
@ -394,7 +394,7 @@ public:
};
void showIndentGuideLine(bool willBeShowed = true) {
execute(SCI_SETINDENTATIONGUIDES, (WPARAM)willBeShowed?(SC_IV_LOOKBOTH):(SC_IV_NONE));
execute(SCI_SETINDENTATIONGUIDES, (WPARAM)willBeShowed?(SC_IV_LOOKBOTH):(SC_IV_NONE));
};
bool isShownIndentGuide() const {
@ -450,7 +450,7 @@ public:
long getTextHeight()const{
return long(execute(SCI_TEXTHEIGHT));
};
void gotoLine(int line){
if (line < execute(SCI_GETLINECOUNT))
execute(SCI_GOTOLINE,line);
@ -467,17 +467,18 @@ public:
long start = long(execute(SCI_GETSELECTIONSTART));
long end = long(execute(SCI_GETSELECTIONEND));
selByte = (start < end)?end-start:start-end;
start = long(execute(SCI_LINEFROMPOSITION, start));
end = long(execute(SCI_LINEFROMPOSITION, end));
selLine = (start < end)?end-start:start-end;
if (selLine)
if (selLine)
++selLine;
return true;
};
long getSelectedLength() const {
long getSelectedLength() const
{
// return -1 if it's multi-selection or rectangle selection
if ((execute(SCI_GETSELECTIONS) > 1) || execute(SCI_SELECTIONISRECTANGLE))
return -1;
@ -494,7 +495,7 @@ public:
}
delete [] selected;
return length;
};
}
long getLineLength(int line) const {
@ -507,7 +508,8 @@ public:
void setLineIndent(int line, int indent) const;
void showLineNumbersMargin(bool show){
void showLineNumbersMargin(bool show)
{
if (show == _lineNumbersShown) return;
_lineNumbersShown = show;
if (show)
@ -536,7 +538,7 @@ public:
void performGlobalStyles();
void expand(int &line, bool doExpand, bool force = false, int visLevels = 0, int level = -1);
void currentLineUp() const;
void currentLineDown() const;
@ -562,7 +564,7 @@ public:
else
execute(SCI_UPPERCASE);
};
void collapse(int level2Collapse, bool mode);
void foldAll(bool mode);
void fold(int line, bool mode);
@ -575,7 +577,7 @@ public:
NppParameters * getParameter() {
return _pParameter;
};
ColumnModeInfos getColumnModeSelectInfo();
void columnReplace(ColumnModeInfos & cmi, const TCHAR *str);
@ -606,7 +608,7 @@ public:
bool isSelecting() const {
static CharacterRange previousSelRange = getSelection();
CharacterRange currentSelRange = getSelection();
if (currentSelRange.cpMin == currentSelRange.cpMax)
{
previousSelRange = currentSelRange;
@ -618,7 +620,7 @@ public:
previousSelRange = currentSelRange;
return true;
}
previousSelRange = currentSelRange;
return false;
};
@ -627,14 +629,14 @@ public:
void mouseWheel(WPARAM wParam, LPARAM lParam) {
scintillaNew_Proc(_hSelf, WM_MOUSEWHEEL, wParam, lParam);
};
void setHotspotStyle(Style& styleToSet);
void setTabSettings(Lang *lang);
bool isWrapRestoreNeeded() const {return _wrapRestoreNeeded;};
void setWrapRestoreNeeded(bool isWrapRestoredNeeded) {_wrapRestoreNeeded = isWrapRestoredNeeded;};
bool isCJK() const {
return ((_codepage == CP_CHINESE_TRADITIONAL) || (_codepage == CP_CHINESE_SIMPLIFIED) ||
return ((_codepage == CP_CHINESE_TRADITIONAL) || (_codepage == CP_CHINESE_SIMPLIFIED) ||
(_codepage == CP_JAPANESE) || (_codepage == CP_KOREAN));
};
void scrollPosToCenter(int pos);
@ -646,7 +648,7 @@ public:
protected:
static HINSTANCE _hLib;
static int _refCount;
static UserDefineDialog _userDefineDlg;
static const int _markersArray[][NB_FOLDER_STATE];
@ -663,7 +665,7 @@ protected:
//Store the current buffer so it can be retrieved later
BufferID _currentBufferID;
Buffer * _currentBuffer;
NppParameters *_pParameter;
int _codepage;
bool _lineNumbersShown;
@ -697,6 +699,7 @@ protected:
void setEmbeddedJSLexer();
void setEmbeddedPhpLexer();
void setEmbeddedAspLexer();
void setJsonLexer();
//Simple lexers
void setCssLexer() {
setLexer(SCLEX_CSS, L_CSS, LIST_0 | LIST_1);
@ -861,7 +864,7 @@ protected:
void setRLexer() {
setLexer(SCLEX_R, L_R, LIST_0 | LIST_1 | LIST_2);
};
void setCoffeeScriptLexer() {
setLexer(SCLEX_COFFEESCRIPT, L_COFFEESCRIPT, LIST_0 | LIST_1 | LIST_2 | LIST_3);
};
@ -902,7 +905,7 @@ protected:
};
int codepage2CharSet() const {
switch (_codepage)
switch (_codepage)
{
case CP_CHINESE_TRADITIONAL : return SC_CHARSET_CHINESEBIG5;
case CP_CHINESE_SIMPLIFIED : return SC_CHARSET_GB2312;

View File

@ -1037,9 +1037,11 @@ void UserDefineDialog::updateDlg()
_symbolsStyleDlg.updateDlg();
}
INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
NppParameters *pNppParam = NppParameters::getInstance();
switch (message)
{
case WM_INITDIALOG :
@ -1130,7 +1132,7 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
return TRUE;
}
case WM_NOTIFY :
case WM_NOTIFY:
{
NMHDR *nmhdr = (NMHDR *)lParam;
if (nmhdr->code == TCN_SELCHANGE)
@ -1144,7 +1146,7 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
break;
}
case WM_HSCROLL :
case WM_HSCROLL:
{
if ((HWND)lParam == ::GetDlgItem(_hSelf, IDC_UD_PERCENTAGE_SLIDER))
{
@ -1211,10 +1213,13 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
::SendMessage(_hParent, msg, 0, 0);
return TRUE;
}
case IDCANCEL :
::SendMessage(_hParent, WM_CLOSE_USERDEFINE_DLG, 0, 0);
display(false);
return TRUE;
case IDCANCEL:
{
::SendMessage(_hParent, WM_CLOSE_USERDEFINE_DLG, 0, 0);
display(false);
return TRUE;
}
case IDC_REMOVELANG_BUTTON :
{
@ -1327,8 +1332,6 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
}
case IDC_IMPORT_BUTTON :
{
NppParameters *pNppParam = NppParameters::getInstance();
FileDialog fDlg(_hSelf, ::GetModuleHandle(NULL));
fDlg.setExtFilter(TEXT("UDL"), TEXT(".xml"), NULL);
TCHAR *fn = fDlg.doOpenSingleFileDlg();
@ -1353,10 +1356,7 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
case IDC_EXPORT_BUTTON :
{
NppParameters *pNppParam = NppParameters::getInstance();
int i2Export = ::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_GETCURSEL, 0, 0);
int i2Export = ::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_GETCURSEL, 0, 0);
if (i2Export == 0)
{
// maybe a better option would be to simply send IDC_SAVEAS_BUTTON message, and display "Save As..." dialog?

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -35,7 +35,7 @@
INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
switch (message)
{
case WM_INITDIALOG :
{
@ -82,12 +82,12 @@ INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
return TRUE;
}
case WM_COMMAND :
case WM_COMMAND :
{
switch (wParam)
{
case IDCANCEL :
case IDOK :
case IDOK :
display(false);
return TRUE;
@ -101,7 +101,7 @@ INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
return TRUE;
}
}
return FALSE;
return FALSE;
}
void AboutDlg::doDialog()

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -31,37 +31,37 @@
static BYTE XORMask[128] =
{
0xff, 0xff, 0xff, 0xff,
0xf9, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf9, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0x24, 0xff, 0xff,
0xf0, 0x00, 0x7f, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0xff, 0xff, 0xff,
0xf0, 0x24, 0xff, 0xff,
0xf0, 0x00, 0x7f, 0xff,
0xc0, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0xc0, 0x00, 0x7f, 0xff,
0xe0, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0x80, 0x00, 0x7f, 0xff,
0xc0, 0x00, 0x7f, 0xff,
0xe0, 0x00, 0x7f, 0xff,
0xf0, 0x00, 0xff, 0xff,
0xf0, 0x00, 0xff, 0xff,
0xf0, 0x00, 0xff, 0xff,
0xf0, 0x00, 0xff, 0xff,
0xf0, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
};
/* AND mask for hand cursor */
@ -69,37 +69,37 @@ static BYTE XORMask[128] =
static BYTE ANDMask[128] =
{
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00,
0x06, 0xdb, 0x00, 0x00,
0x06, 0xdb, 0x00, 0x00,
0x36, 0xdb, 0x00, 0x00,
0x36, 0xdb, 0x00, 0x00,
0x37, 0xff, 0x00, 0x00,
0x06, 0xdb, 0x00, 0x00,
0x36, 0xdb, 0x00, 0x00,
0x36, 0xdb, 0x00, 0x00,
0x37, 0xff, 0x00, 0x00,
0x3f, 0xff, 0x00, 0x00,
0x3f, 0xff, 0x00, 0x00,
0x1f, 0xff, 0x00, 0x00,
0x0f, 0xff, 0x00, 0x00,
0x3f, 0xff, 0x00, 0x00,
0x1f, 0xff, 0x00, 0x00,
0x0f, 0xff, 0x00, 0x00,
0x07, 0xfe, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
@ -165,7 +165,7 @@ void URLCtrl::action()
else
{
_linkColor = _visitedColor;
::InvalidateRect(_hSelf, 0, 0);
::UpdateWindow(_hSelf);
@ -183,7 +183,7 @@ void URLCtrl::action()
}
}
LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
@ -191,14 +191,14 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
case WM_NCDESTROY:
//HeapFree(GetProcessHeap(), 0, url);
break;
// Paint the static control using our custom
// colours, and with an underline text style
case WM_PAINT:
{
DWORD dwStyle = ::GetWindowLongPtr(hwnd, GWL_STYLE);
DWORD dwDTStyle = DT_SINGLELINE;
//Test if centered horizontally or vertically
if(dwStyle & SS_CENTER) dwDTStyle |= DT_CENTER;
if(dwStyle & SS_RIGHT) dwDTStyle |= DT_RIGHT;
@ -209,12 +209,12 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps;
HDC hdc = ::BeginPaint(hwnd, &ps);
::SetTextColor(hdc, _linkColor);
::SetBkColor(hdc, getCtrlBgColor(GetParent(hwnd))); ///*::GetSysColor(COLOR_3DFACE)*/);
// Create an underline font
// Create an underline font
if(_hfUnderlined == 0)
{
// Get the default GUI font
@ -224,18 +224,18 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
// Add UNDERLINE attribute
GetObject(hf, sizeof lf, &lf);
lf.lfUnderline = TRUE;
// Create a new font
_hfUnderlined = ::CreateFontIndirect(&lf);
}
HANDLE hOld = SelectObject(hdc, _hfUnderlined);
// Draw the text!
TCHAR szWinText[MAX_PATH];
::GetWindowText(hwnd, szWinText, MAX_PATH);
::DrawText(hdc, szWinText, -1, &rect, dwDTStyle);
::SelectObject(hdc, hOld);
::EndPaint(hwnd, &ps);
@ -255,11 +255,11 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
if (_hCursor == 0)
_hCursor = ::CreateCursor(::GetModuleHandle(0), 5, 2, 32, 32, XORMask, ANDMask);
SetCursor(_hCursor);
return TRUE;
}
case WM_LBUTTONDOWN:
_clicking = true;
break;
@ -273,7 +273,7 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
}
break;
//Support using space to activate this object
case WM_KEYDOWN:
if(wParam == VK_SPACE)

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -35,26 +35,26 @@ void ListView::init(HINSTANCE hInst, HWND parent)
{
Window::init(hInst, parent);
INITCOMMONCONTROLSEX icex;
// Ensure that the common control DLL is loaded.
// Ensure that the common control DLL is loaded.
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icex);
// Create the list-view window in report view with label editing enabled.
int listViewStyles = LVS_REPORT | LVS_NOSORTHEADER\
| LVS_SINGLESEL | LVS_AUTOARRANGE\
| LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
_hSelf = ::CreateWindow(WC_LISTVIEW,
TEXT(""),
_hSelf = ::CreateWindow(WC_LISTVIEW,
TEXT(""),
WS_CHILD | listViewStyles,
0,
0,
0,
0,
_hParent,
(HMENU) NULL,
0,
_hParent,
(HMENU) NULL,
hInst,
NULL);
if (!_hSelf)
@ -77,15 +77,15 @@ void ListView::init(HINSTANCE hInst, HWND parent)
generic_string hexStr = pNativeSpeaker->getAttrNameStr(TEXT("Hex"), "AsciiInsertion", "ColumnHex");
generic_string charStr = pNativeSpeaker->getAttrNameStr(TEXT("Character"), "AsciiInsertion", "ColumnChar");
lvColumn.cx = 45;
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleX(45);
lvColumn.pszText = (TCHAR *)valStr.c_str();
ListView_InsertColumn(_hSelf, 0, &lvColumn);
lvColumn.cx = 45;
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(45);;
lvColumn.pszText = (TCHAR *)hexStr.c_str();
ListView_InsertColumn(_hSelf, 1, &lvColumn);
lvColumn.cx = 70;
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(70);;
lvColumn.pszText = (TCHAR *)charStr.c_str();
ListView_InsertColumn(_hSelf, 2, &lvColumn);
}
@ -190,7 +190,7 @@ generic_string ListView::getAscii(unsigned char value)
void ListView::setValues(int codepage)
{
_codepage = codepage;
for (int i = 0 ; i < 256 ; ++i)
{
LVITEM item;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,74 +24,69 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <iostream>
#include "ColourPicker.h"
#include "ColourPopup.h"
void ColourPicker::init(HINSTANCE hInst, HWND parent)
{
Window::init(hInst, parent);
_hSelf = ::CreateWindowEx(
0,
TEXT("Button"),
TEXT("F"),
WS_CHILD | WS_VISIBLE,
0, 0, 25, 25,
_hParent,
NULL,
_hInst,
(LPVOID)0);
0,
TEXT("Button"),
TEXT("F"),
WS_CHILD | WS_VISIBLE,
0, 0, 25, 25,
_hParent, NULL, _hInst, (LPVOID)0);
if (!_hSelf)
{
throw std::runtime_error("ColourPicker::init : CreateWindowEx() function return null");
}
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)this);
_buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, (LONG_PTR)staticWinProc));
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)this);
_buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, (LONG_PTR)staticWinProc));
}
void ColourPicker::destroy()
{
if (_pColourPopup)
{
delete _pColourPopup;
_pColourPopup = NULL;
}
delete _pColourPopup;
_pColourPopup = NULL;
::DestroyWindow(_hSelf);
}
void ColourPicker::drawBackground(HDC hDC)
{
RECT rc;
RECT rc;
HBRUSH hbrush;
if(!hDC)
if (!hDC)
return;
getClientRect(rc);
getClientRect(rc);
hbrush = ::CreateSolidBrush(_currentColour);
HGDIOBJ oldObj = ::SelectObject(hDC, hbrush);
::Rectangle(hDC, 0, 0, rc.right, rc.bottom);
::SelectObject(hDC, oldObj);
//FillRect(hDC, &rc, hbrush);
::DeleteObject(hbrush);
::DeleteObject(hbrush);
}
void ColourPicker::drawForeground(HDC hDC)
{
RECT rc;
RECT rc;
HBRUSH hbrush = NULL;
if(!hDC || _isEnabled)
if (!hDC || _isEnabled)
return;
int oldMode = ::SetBkMode(hDC, TRANSPARENT);
getClientRect(rc);
getClientRect(rc);
COLORREF strikeOut = RGB(0,0,0);
if ((((_currentColour ) & 0xFF) +
((_currentColour >> 8) & 0xFF) +
@ -103,17 +98,18 @@ void ColourPicker::drawForeground(HDC hDC)
::Rectangle(hDC, 0, 0, rc.right, rc.bottom);
::SelectObject(hDC, oldObj);
//FillRect(hDC, &rc, hbrush);
::DeleteObject(hbrush);
::DeleteObject(hbrush);
::SetBkMode(hDC, oldMode);
}
LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message)
{
case WM_LBUTTONDBLCLK :
case WM_LBUTTONDOWN :
{
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
{
RECT rc;
POINT p;
Window::getClientRect(rc);
@ -134,8 +130,9 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
_pColourPopup->doDialog(p);
_pColourPopup->display(true);
}
return TRUE;
}
return TRUE;
}
case WM_RBUTTONDOWN:
{
_isEnabled = !_isEnabled;
@ -152,41 +149,44 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
break;
}
case WM_PAINT :
{
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC dc = ::BeginPaint(_hSelf, &ps);
drawForeground(dc);
drawForeground(dc);
::EndPaint(_hSelf, &ps);
return TRUE;
}
return TRUE;
}
case WM_PICKUP_COLOR :
{
_currentColour = (COLORREF)wParam;
redraw();
case WM_PICKUP_COLOR:
{
_currentColour = (COLORREF)wParam;
redraw();
_pColourPopup->display(false);
::SendMessage(_hParent, WM_COMMAND, MAKELONG(0, CPN_COLOURPICKED), (LPARAM)_hSelf);
return TRUE;
}
return TRUE;
}
case WM_ENABLE :
{
if ((BOOL)wParam == FALSE)
{
_currentColour = ::GetSysColor(COLOR_3DFACE);
redraw();
}
return TRUE;
}
case WM_ENABLE:
{
if ((BOOL)wParam == FALSE)
{
_currentColour = ::GetSysColor(COLOR_3DFACE);
redraw();
}
return TRUE;
}
case WM_PICKUP_CANCEL :
case WM_PICKUP_CANCEL:
{
_pColourPopup->display(false);
return TRUE;
}
default :
default:
return ::CallWindowProc(_buttonDefaultProc, _hSelf, Message, wParam, lParam);
}
return FALSE;
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,62 +24,54 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef COLOUR_POPUP_H
#define COLOUR_POPUP_H
#ifndef COLOUR_POPUP_RESOURCE_H
#pragma once
#include "ColourPopupResource.h"
#endif //COLOUR_POPUP_RESOURCE_H
#ifndef RESOURCE_H
#include "resource.h"
#endif //RESOURCE_H
#include "Window.h"
#define WM_PICKUP_COLOR (COLOURPOPUP_USER + 1)
#define WM_PICKUP_COLOR (COLOURPOPUP_USER + 1)
#define WM_PICKUP_CANCEL (COLOURPOPUP_USER + 2)
class ColourPopup : public Window
{
public :
ColourPopup() : Window()/*, isColourChooserLaunched(false)*/ {};
ColourPopup(COLORREF defaultColor) : Window(), /* isColourChooserLaunched(false), */ _colour(defaultColor) {};
~ColourPopup(){};
bool isCreated() const {
ColourPopup() = default;
explicit ColourPopup(COLORREF defaultColor) : _colour(defaultColor) {}
virtual ~ColourPopup() {}
bool isCreated() const
{
return (_hSelf != NULL);
};
}
void create(int dialogID);
void doDialog(POINT p) {
if (!isCreated())
create(IDD_COLOUR_POPUP);
::SetWindowPos(_hSelf, HWND_TOP, p.x, p.y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW);
};
void doDialog(POINT p)
{
if (!isCreated())
create(IDD_COLOUR_POPUP);
::SetWindowPos(_hSelf, HWND_TOP, p.x, p.y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW);
}
virtual void destroy() {
::DestroyWindow(_hSelf);
};
virtual void destroy()
{
::DestroyWindow(_hSelf);
}
void setColour(COLORREF c) {
_colour = c;
};
void setColour(COLORREF c)
{
_colour = c;
}
COLORREF getSelColour(){return _colour;};
COLORREF getSelColour(){return _colour;};
private :
RECT _rc;
COLORREF _colour;
//bool isColourChooserLaunched;
COLORREF _colour;
//bool isColourChooserLaunched = false;
static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
};
#endif //COLOUR_POPUP_H

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,11 +24,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma once
#ifndef COLOUR_POPUP_RESOURCE_H
#define IDD_COLOUR_POPUP 2100
#define IDC_COLOUR_LIST (IDD_COLOUR_POPUP + 1)
#endif //COLOUR_POPUP_RESOURCE_H
#define IDD_COLOUR_POPUP 2100
#define IDC_COLOUR_LIST (IDD_COLOUR_POPUP + 1)

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -37,35 +37,35 @@ using namespace std;
LRESULT CALLBACK ColourStaticTextHooker::colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_PAINT:
{
RECT rect;
::GetClientRect(hwnd, &rect);
{
case WM_PAINT:
{
RECT rect;
::GetClientRect(hwnd, &rect);
PAINTSTRUCT ps;
HDC hdc = ::BeginPaint(hwnd, &ps);
::SetTextColor(hdc, _colour);
PAINTSTRUCT ps;
HDC hdc = ::BeginPaint(hwnd, &ps);
// Get the default GUI font
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
::SetTextColor(hdc, _colour);
// Get the default GUI font
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
HANDLE hOld = SelectObject(hdc, hf);
// Draw the text!
TCHAR text[MAX_PATH];
::GetWindowText(hwnd, text, MAX_PATH);
::DrawText(hdc, text, -1, &rect, DT_LEFT);
::SelectObject(hdc, hOld);
// Draw the text!
TCHAR text[MAX_PATH];
::GetWindowText(hwnd, text, MAX_PATH);
::DrawText(hdc, text, -1, &rect, DT_LEFT);
::EndPaint(hwnd, &ps);
::SelectObject(hdc, hOld);
return TRUE;
}
}
return ::CallWindowProc(_oldProc, hwnd, Message, wParam, lParam);
::EndPaint(hwnd, &ps);
return TRUE;
}
}
return ::CallWindowProc(_oldProc, hwnd, Message, wParam, lParam);
}
void WordStyleDlg::updateGlobalOverrideCtrls()
{
@ -87,8 +87,8 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
{
NppParameters *nppParamInst = NppParameters::getInstance();
_hCheckBold = ::GetDlgItem(_hSelf, IDC_BOLD_CHECK);
_hCheckItalic = ::GetDlgItem(_hSelf, IDC_ITALIC_CHECK);
_hCheckBold = ::GetDlgItem(_hSelf, IDC_BOLD_CHECK);
_hCheckItalic = ::GetDlgItem(_hSelf, IDC_ITALIC_CHECK);
_hCheckUnderline = ::GetDlgItem(_hSelf, IDC_UNDERLINE_CHECK);
_hFontNameCombo = ::GetDlgItem(_hSelf, IDC_FONT_COMBO);
_hFontSizeCombo = ::GetDlgItem(_hSelf, IDC_FONTSIZE_COMBO);
@ -110,12 +110,12 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
{
pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(i);
int j = ::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, (LPARAM)themeInfo.first.c_str());
if (! themeInfo.second.compare( nppParamInst->getNppGUI()._themeName ) )
if (! themeInfo.second.compare( nppParamInst->getNppGUI()._themeName ) )
{
_currentThemeIndex = j;
_themeName.assign(themeInfo.second);
}
if (! themeInfo.first.compare(TEXT("Default")) )
if (! themeInfo.first.compare(TEXT("Default")) )
{
defaultThemeIndex = j;
}
@ -141,16 +141,15 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
_pFgColour->init(_hInst, _hSelf);
_pBgColour->init(_hInst, _hSelf);
POINT p1, p2;
POINT p1, p2;
alignWith(_hFgColourStaticText, _pFgColour->getHSelf(), PosAlign::right, p1);
alignWith(_hBgColourStaticText, _pBgColour->getHSelf(), PosAlign::right, p2);
alignWith(_hFgColourStaticText, _pFgColour->getHSelf(), ALIGNPOS_RIGHT, p1);
alignWith(_hBgColourStaticText, _pBgColour->getHSelf(), ALIGNPOS_RIGHT, p2);
p1.x = p2.x = ((p1.x > p2.x)?p1.x:p2.x) + 10;
p1.y -= 4; p2.y -= 4;
p1.x = p2.x = ((p1.x > p2.x)?p1.x:p2.x) + 10;
p1.y -= 4; p2.y -= 4;
::MoveWindow((HWND)_pFgColour->getHSelf(), p1.x, p1.y, 25, 25, TRUE);
::MoveWindow((HWND)_pBgColour->getHSelf(), p2.x, p2.y, 25, 25, TRUE);
::MoveWindow((HWND)_pFgColour->getHSelf(), p1.x, p1.y, 25, 25, TRUE);
::MoveWindow((HWND)_pBgColour->getHSelf(), p2.x, p2.y, 25, 25, TRUE);
_pFgColour->display();
_pBgColour->display();
@ -170,7 +169,6 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
goToCenter();
loadLangListFromNppParam();
return TRUE;
}
@ -193,10 +191,10 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
return TRUE;
}
case WM_COMMAND :
case WM_COMMAND :
{
if (HIWORD(wParam) == EN_CHANGE)
{
{
int editID = LOWORD(wParam);
if (editID == IDC_USER_KEYWORDS_EDIT)
{
@ -237,21 +235,21 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
if (_isDirty)
{
NppParameters *nppParamInst = NppParameters::getInstance();
if (_restoreInvalid)
{
if (_restoreInvalid)
{
generic_string str( nppParamInst->getNppGUI()._themeName );
nppParamInst->reloadStylers( &str[0] );
}
LexerStylerArray & lsArray = nppParamInst->getLStylerArray();
StyleArray & globalStyles = nppParamInst->getGlobalStylers();
if (_restoreInvalid)
if (_restoreInvalid)
{
_lsArray = _styles2restored = lsArray;
_globalStyles = _gstyles2restored = globalStyles;
}
else
else
{
globalStyles = _globalStyles = _gstyles2restored;
lsArray = _lsArray = _styles2restored;
@ -264,7 +262,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
_isThemeDirty = false;
setVisualFromStyleList();
//(nppParamInst->getNppGUI())._themeName
::SendMessage(_hSwitch2ThemeCombo, CB_SETCURSEL, _currentThemeIndex, 0);
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
@ -297,7 +295,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
return TRUE;
}
case IDC_SC_TRANSPARENT_CHECK :
{
bool isChecked = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_SC_TRANSPARENT_CHECK, BM_GETCHECK, 0, 0));
@ -355,7 +353,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
apply();
return TRUE;
}
case IDC_GLOBAL_ITALIC_CHECK :
{
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
@ -416,7 +414,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
return TRUE;
}
case CPN_COLOURPICKED:
case CPN_COLOURPICKED:
{
if ((HWND)lParam == _pFgColour->getHSelf())
{
@ -467,17 +465,17 @@ void WordStyleDlg::loadLangListFromNppParam()
{
NppParameters *nppParamInst = NppParameters::getInstance();
_lsArray = nppParamInst->getLStylerArray();
_globalStyles = nppParamInst->getGlobalStylers();
_globalStyles = nppParamInst->getGlobalStylers();
// Clean up Language List
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_RESETCONTENT, 0, 0);
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Global Styles"));
// All the lexers
for (int i = 0, nb = _lsArray.getNbLexer() ; i < nb ; ++i)
{
for (int i = 0, nb = _lsArray.getNbLexer() ; i < nb ; ++i)
{
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)_lsArray.getLexerDescFromIndex(i));
}
}
const int index2Begin = 0;
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_SETCURSEL, 0, index2Begin);
@ -491,7 +489,7 @@ void WordStyleDlg::updateThemeName(generic_string themeName)
nppGUI._themeName.assign( themeName );
}
int WordStyleDlg::whichTabColourIndex()
int WordStyleDlg::whichTabColourIndex()
{
int i = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETCURSEL, 0, 0);
if (i == LB_ERR)
@ -582,7 +580,7 @@ void WordStyleDlg::updateUserKeywords()
void WordStyleDlg::updateFontName()
{
Style & style = getCurrentStyler();
Style & style = getCurrentStyler();
int iFontSel = ::SendMessage(_hFontNameCombo, CB_GETCURSEL, 0, 0);
TCHAR *fnStr = (TCHAR *)::SendMessage(_hFontNameCombo, CB_GETITEMDATA, iFontSel, 0);
style._fontName = fnStr;
@ -590,7 +588,7 @@ void WordStyleDlg::updateFontName()
void WordStyleDlg::updateFontStyleStatus(fontStyleType whitchStyle)
{
Style & style = getCurrentStyler();
Style & style = getCurrentStyler();
if (style._fontStyle == STYLE_NOT_USED)
style._fontStyle = FONTSTYLE_NONE;
@ -624,11 +622,11 @@ void WordStyleDlg::switchToTheme()
generic_string prevThemeName(_themeName);
_themeName.clear();
NppParameters *nppParamInst = NppParameters::getInstance();
ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher();
ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher();
pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(iSel);
_themeName = themeInfo.second;
_themeName = themeInfo.second;
if (_isThemeDirty)
{
@ -638,7 +636,7 @@ void WordStyleDlg::switchToTheme()
PathRemoveExtension(themeFileName);
int mb_response =
::MessageBox( _hSelf,
TEXT(" Unsaved changes are about to be discarded!\n")
TEXT(" Unsaved changes are about to be discarded!\n")
TEXT(" Do you want to save your changes before switching themes?"),
themeFileName,
MB_ICONWARNING | MB_YESNO | MB_APPLMODAL | MB_SETFOREGROUND );
@ -654,10 +652,10 @@ void WordStyleDlg::switchToTheme()
void WordStyleDlg::setStyleListFromLexer(int index)
{
_currentLexerIndex = index;
_currentLexerIndex = index;
// Fill out Styles listbox
// Before filling out, we clean it
// Fill out Styles listbox
// Before filling out, we clean it
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_RESETCONTENT, 0, 0);
if (index)
@ -667,39 +665,39 @@ void WordStyleDlg::setStyleListFromLexer(int index)
const TCHAR *userExt = (_lsArray.getLexerStylerByName(langName))->getLexerUserExt();
::SendDlgItemMessage(_hSelf, IDC_DEF_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(ext));
// WM_SETTEXT cause sending WM_COMMAND message with EN_CHANGE.
// That makes status dirty, even it shouldn't in this case.
// The walk around solution is get the current status before sending WM_SETTEXT,
// then restore the status after sending this message.
bool isDirty = _isDirty;
// WM_SETTEXT cause sending WM_COMMAND message with EN_CHANGE.
// That makes status dirty, even it shouldn't in this case.
// The walk around solution is get the current status before sending WM_SETTEXT,
// then restore the status after sending this message.
bool isDirty = _isDirty;
bool isThemeDirty = _isThemeDirty;
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(userExt));
_isDirty = isDirty;
_isThemeDirty = isThemeDirty;
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), isDirty || isThemeDirty);
_isDirty = isDirty;
_isThemeDirty = isThemeDirty;
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), isDirty || isThemeDirty);
}
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_EDIT), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_STATIC), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_STATIC), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_EXT_EDIT), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_EXT_STATIC), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_EXT_STATIC), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_PLUSSYMBOL2_STATIC), index?SW_SHOW:SW_HIDE);
StyleArray & lexerStyler = index?_lsArray.getLexerFromIndex(index-1):_globalStyles;
for (int i = 0, nb = lexerStyler.getNbStyler(); i < nb ; ++i)
{
Style & style = lexerStyler.getStyler(i);
for (int i = 0, nb = lexerStyler.getNbStyler(); i < nb ; ++i)
{
Style & style = lexerStyler.getStyler(i);
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_ADDSTRING, 0, (LPARAM)style._styleDesc);
}
}
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_SETCURSEL, 0, 0);
setVisualFromStyleList();
setVisualFromStyleList();
}
void WordStyleDlg::setVisualFromStyleList()
void WordStyleDlg::setVisualFromStyleList()
{
showGlobalOverrideCtrls(false);
Style & style = getCurrentStyler();
Style & style = getCurrentStyler();
// Global override style
if (style._styleDesc && lstrcmp(style._styleDesc, TEXT("Global override")) == 0)
@ -707,14 +705,14 @@ void WordStyleDlg::setVisualFromStyleList()
showGlobalOverrideCtrls(true);
}
//--Warning text
//bool showWarning = ((_currentLexerIndex == 0) && (style._styleID == STYLE_DEFAULT));//?SW_SHOW:SW_HIDE;
//--Warning text
//bool showWarning = ((_currentLexerIndex == 0) && (style._styleID == STYLE_DEFAULT));//?SW_SHOW:SW_HIDE;
COLORREF c = RGB(0x00, 0x00, 0xFF);
TCHAR str[256];
str[0] = '\0';
int i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETCURSEL, 0, 0);
if (i == LB_ERR)
return;
@ -802,7 +800,7 @@ void WordStyleDlg::setVisualFromStyleList()
::SendMessage(_hCheckUnderline, BM_SETCHECK, BST_UNCHECKED, 0);
}
enableFontStyle(isEnable);
enableFontStyle(isEnable);
//-- Default Keywords
@ -827,6 +825,7 @@ void WordStyleDlg::setVisualFromStyleList()
const TCHAR *ckwStr = (style._keywords)?style._keywords->c_str():TEXT("");
::SendDlgItemMessage(_hSelf, IDC_USER_KEYWORDS_EDIT, WM_SETTEXT, 0, (LPARAM)(ckwStr));
}
int showOption = shouldBeDisplayed?SW_SHOW:SW_HIDE;
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_KEYWORDS_EDIT), showOption);
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_KEYWORDS_EDIT),showOption);
@ -834,9 +833,10 @@ void WordStyleDlg::setVisualFromStyleList()
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_KEYWORDS_STATIC),showOption);
::ShowWindow(::GetDlgItem(_hSelf, IDC_PLUSSYMBOL_STATIC),showOption);
redraw();
redraw();
}
void WordStyleDlg::create(int dialogID, bool isRTL)
{
StaticDialog::create(dialogID, isRTL);
@ -845,7 +845,7 @@ void WordStyleDlg::create(int dialogID, bool isRTL)
{
::ShowWindow(::GetDlgItem(_hSelf, IDC_SC_TRANSPARENT_CHECK), SW_SHOW);
::ShowWindow(::GetDlgItem(_hSelf, IDC_SC_PERCENTAGE_SLIDER), SW_SHOW);
::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(20, 200));
::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, TBM_SETPOS, TRUE, 150);
if (!(BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, BM_GETCHECK, 0, 0)))
@ -853,6 +853,7 @@ void WordStyleDlg::create(int dialogID, bool isRTL)
}
}
void WordStyleDlg::apply()
{
LexerStylerArray & lsa = (NppParameters::getInstance())->getLStylerArray();

View File

@ -31,16 +31,17 @@
MenuItemUnit::MenuItemUnit(unsigned long cmdID, const TCHAR *itemName, const TCHAR *parentFolderName) : _cmdID(cmdID)
{
if (!itemName)
_itemName = TEXT("");
_itemName.clear();
else
_itemName = itemName;
if (!parentFolderName)
_parentFolderName = TEXT("");
_parentFolderName.clear();
else
_parentFolderName = parentFolderName;
}
ContextMenu::~ContextMenu()
{
if (isCreated())
@ -50,6 +51,7 @@ ContextMenu::~ContextMenu()
::DestroyMenu(_hMenu);
}
}
void ContextMenu::create(HWND hParent, const std::vector<MenuItemUnit> & menuItemArray, const HMENU mainMenuHandle)
{
@ -57,15 +59,15 @@ void ContextMenu::create(HWND hParent, const std::vector<MenuItemUnit> & menuIte
_hMenu = ::CreatePopupMenu();
bool lastIsSep = false;
HMENU hParentFolder = NULL;
generic_string currentParentFolderStr = TEXT("");
generic_string currentParentFolderStr;
int j = 0;
for (size_t i = 0, len = menuItemArray.size(); i < len; ++i)
{
const MenuItemUnit & item = menuItemArray[i];
if (item._parentFolderName == TEXT(""))
if (item._parentFolderName.empty())
{
currentParentFolderStr = TEXT("");
currentParentFolderStr.clear();
hParentFolder = NULL;
j = 0;
}

View File

@ -24,53 +24,55 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef CONTEXTMENU_H
#define CONTEXTMENU_H
#pragma once
#include "Common.h"
struct MenuItemUnit {
unsigned long _cmdID;
struct MenuItemUnit final
{
unsigned long _cmdID = 0;
generic_string _itemName;
generic_string _parentFolderName;
MenuItemUnit() : _cmdID(0), _itemName(TEXT("")), _parentFolderName(TEXT("")){};
MenuItemUnit(unsigned long cmdID, generic_string itemName, generic_string parentFolderName=TEXT(""))
MenuItemUnit() = default;
MenuItemUnit(unsigned long cmdID, generic_string itemName, generic_string parentFolderName = generic_string())
: _cmdID(cmdID), _itemName(itemName), _parentFolderName(parentFolderName){};
MenuItemUnit(unsigned long cmdID, const TCHAR *itemName, const TCHAR *parentFolderName=NULL);
MenuItemUnit(unsigned long cmdID, const TCHAR *itemName, const TCHAR *parentFolderName = nullptr);
};
class ContextMenu {
class ContextMenu final
{
public:
ContextMenu() : _hParent(NULL), _hMenu(NULL) {};
~ContextMenu();
void create(HWND hParent, const std::vector<MenuItemUnit> & menuItemArray, const HMENU mainMenuHandle = NULL);
bool isCreated() const {return _hMenu != NULL;};
bool isCreated() const {return _hMenu != NULL;}
void display(const POINT & p) const {
::TrackPopupMenu(_hMenu, TPM_LEFTALIGN, p.x, p.y, 0, _hParent, NULL);
};
}
void enableItem(int cmdID, bool doEnable) const {
int flag = doEnable?MF_ENABLED | MF_BYCOMMAND:MF_DISABLED | MF_GRAYED | MF_BYCOMMAND;
void enableItem(int cmdID, bool doEnable) const
{
int flag = doEnable ? (MF_ENABLED | MF_BYCOMMAND) : (MF_DISABLED | MF_GRAYED | MF_BYCOMMAND);
::EnableMenuItem(_hMenu, cmdID, flag);
};
}
void checkItem(int cmdID, bool doCheck) const {
::CheckMenuItem(_hMenu, cmdID, MF_BYCOMMAND | (doCheck?MF_CHECKED:MF_UNCHECKED));
};
void checkItem(int cmdID, bool doCheck) const
{
::CheckMenuItem(_hMenu, cmdID, MF_BYCOMMAND | (doCheck ? MF_CHECKED : MF_UNCHECKED));
}
HMENU getMenuHandle() {
HMENU getMenuHandle() const
{
return _hMenu;
};
}
private:
HWND _hParent;
HMENU _hMenu;
HWND _hParent = NULL;
HMENU _hMenu = NULL;
std::vector<HMENU> _subMenus;
};
#endif //CONTEXTMENU_H

View File

@ -86,6 +86,14 @@ DockingCont::DockingCont()
_hoverMPos = posClose;
_bDrawOgLine = TRUE;
_vTbData.clear();
_captionHeightDynamic = NppParameters::getInstance()->_dpiManager.scaleY(_captionHeightDynamic);
_captionGapDynamic = NppParameters::getInstance()->_dpiManager.scaleY(_captionGapDynamic);
_closeButtonPosLeftDynamic = NppParameters::getInstance()->_dpiManager.scaleX(_closeButtonPosLeftDynamic);
_closeButtonPosTopDynamic = NppParameters::getInstance()->_dpiManager.scaleY(_closeButtonPosTopDynamic);
_closeButtonWidth = NppParameters::getInstance()->_dpiManager.scaleX(12); // bitmap image is 12x12
_closeButtonHeight = NppParameters::getInstance()->_dpiManager.scaleY(12);
}
DockingCont::~DockingCont()
@ -533,7 +541,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
// draw text
rc.left += 1;
rc.top += HIGH_CAPTION;
rc.top += _captionHeightDynamic;
// to make ellipsis working
rc.right = rc.bottom - rc.top;
rc.bottom += 14;
@ -564,9 +572,9 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
// select correct bitmap
if ((_isMouseOver == TRUE) && (_isMouseDown == TRUE))
hBmpCur = ::LoadBitmap(_hInst, MAKEINTRESOURCE(IDB_CLOSE_DOWN));
hBmpCur = (HBITMAP)::LoadImage(_hInst, MAKEINTRESOURCE(IDB_CLOSE_DOWN), IMAGE_BITMAP, _closeButtonWidth, _closeButtonHeight, 0);
else
hBmpCur = ::LoadBitmap(_hInst, MAKEINTRESOURCE(IDB_CLOSE_UP));
hBmpCur = (HBITMAP)::LoadImage(_hInst, MAKEINTRESOURCE(IDB_CLOSE_UP), IMAGE_BITMAP, _closeButtonWidth, _closeButtonHeight, 0);
// blit bitmap into the destination
::GetObject(hBmpCur, sizeof(bmp), &bmp);
@ -577,9 +585,9 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
::SelectObject(hDc, hBmpNew);
if (_isTopCaption == TRUE)
::BitBlt(hDc, rc.right-bmp.bmWidth-CLOSEBTN_POS_LEFT, CLOSEBTN_POS_TOP, bmp.bmWidth, bmp.bmHeight, dcMem, 0, 0, SRCCOPY);
::BitBlt(hDc, rc.right - bmp.bmWidth - _closeButtonPosLeftDynamic, _closeButtonPosTopDynamic, bmp.bmWidth, bmp.bmHeight, dcMem, 0, 0, SRCCOPY);
else
::BitBlt(hDc, CLOSEBTN_POS_LEFT, CLOSEBTN_POS_LEFT, bmp.bmWidth, bmp.bmHeight, dcMem, 0, 0, SRCCOPY);
::BitBlt(hDc, _closeButtonPosLeftDynamic, _closeButtonPosLeftDynamic, bmp.bmWidth, bmp.bmHeight, dcMem, 0, 0, SRCCOPY);
::SelectObject(dcMem, hBmpOld);
::DeleteObject(hBmpCur);
@ -599,24 +607,24 @@ eMousePos DockingCont::isInRect(HWND hwnd, int x, int y)
if (_isTopCaption == TRUE)
{
if ((x > rc.left) && (x < rc.right-HIGH_CAPTION) && (y > rc.top) && (y < rc.bottom))
if ((x > rc.left) && (x < rc.right - _captionHeightDynamic) && (y > rc.top) && (y < rc.bottom))
{
ret = posCaption;
}
else if ((x > rc.right-(12+CLOSEBTN_POS_LEFT)) && (x < (rc.right-CLOSEBTN_POS_LEFT)) &&
(y > (rc.top+CLOSEBTN_POS_TOP)) && (y < (rc.bottom-CLOSEBTN_POS_TOP)))
else if ((x > rc.right - (_closeButtonWidth + _closeButtonPosLeftDynamic)) && (x < (rc.right - _closeButtonPosLeftDynamic)) &&
(y >(rc.top + _closeButtonPosTopDynamic)) && (y < (rc.bottom - _closeButtonPosTopDynamic)))
{
ret = posClose;
}
}
else
{
if ((x > rc.left) && (x < rc.right) && (y > rc.top+HIGH_CAPTION) && (y < rc.bottom))
if ((x > rc.left) && (x < rc.right) && (y > rc.top + _captionHeightDynamic) && (y < rc.bottom))
{
ret = posCaption;
}
else if ((x > rc.left+CLOSEBTN_POS_LEFT) && (x < rc.right-CLOSEBTN_POS_LEFT) &&
(y > (rc.top+CLOSEBTN_POS_TOP)) && (y < (rc.top+(12+CLOSEBTN_POS_LEFT))))
else if ((x > rc.left + _closeButtonPosLeftDynamic) && (x < rc.right - _closeButtonPosLeftDynamic) &&
(y >(rc.top + _closeButtonPosTopDynamic)) && (y < (rc.top + (_closeButtonHeight + _closeButtonPosLeftDynamic))))
{
ret = posClose;
}
@ -1023,15 +1031,15 @@ void DockingCont::onSize()
// draw caption
if (_isTopCaption == TRUE)
{
::SetWindowPos(_hCaption, NULL, rc.left, rc.top, rc.right, HIGH_CAPTION, SWP_NOZORDER | SWP_NOACTIVATE);
rc.top += HIGH_CAPTION;
rc.bottom -= HIGH_CAPTION;
::SetWindowPos(_hCaption, NULL, rc.left, rc.top, rc.right, _captionHeightDynamic, SWP_NOZORDER | SWP_NOACTIVATE);
rc.top += _captionHeightDynamic;
rc.bottom -= _captionHeightDynamic;
}
else
{
::SetWindowPos(_hCaption, NULL, rc.left, rc.top, HIGH_CAPTION, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE);
rc.left += HIGH_CAPTION;
rc.right -= HIGH_CAPTION;
::SetWindowPos(_hCaption, NULL, rc.left, rc.top, _captionHeightDynamic, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE);
rc.left += _captionHeightDynamic;
rc.right -= _captionHeightDynamic;
}
if (iItemCnt >= 2)
@ -1039,7 +1047,7 @@ void DockingCont::onSize()
// resize tab and plugin control if tabs exceeds one
// resize tab
rcTemp = rc;
rcTemp.top = (rcTemp.bottom + rcTemp.top) - (tabDpiDynamicalHeight + CAPTION_GAP);
rcTemp.top = (rcTemp.bottom + rcTemp.top) - (tabDpiDynamicalHeight + _captionGapDynamic);
rcTemp.bottom = tabDpiDynamicalHeight;
iTabOff = tabDpiDynamicalHeight;
@ -1052,13 +1060,13 @@ void DockingCont::onSize()
rcTemp = rc;
if (_isTopCaption == TRUE)
{
rcTemp.top += CAPTION_GAP;
rcTemp.bottom -= (iTabOff + CAPTION_GAP);
rcTemp.top += _captionGapDynamic;
rcTemp.bottom -= (iTabOff + _captionGapDynamic);
}
else
{
rcTemp.left += CAPTION_GAP;
rcTemp.right -= CAPTION_GAP;
rcTemp.left += _captionGapDynamic;
rcTemp.right -= _captionGapDynamic;
rcTemp.bottom -= iTabOff;
}
@ -1084,7 +1092,7 @@ void DockingCont::onSize()
{
// resize tab if size of elements exceeds one
rcTemp = rc;
rcTemp.top = rcTemp.bottom - (tabDpiDynamicalHeight + CAPTION_GAP);
rcTemp.top = rcTemp.bottom - (tabDpiDynamicalHeight + _captionGapDynamic);
rcTemp.bottom = tabDpiDynamicalHeight;
::SetWindowPos(_hContTab, NULL,
@ -1369,7 +1377,7 @@ void DockingCont::SelectTab(int iTab)
for (int iItem = 0; iItem < iItemCnt; ++iItem)
{
generic_string szText(TEXT(""));
generic_string szText;
if (iItem == iTab && pszMaxTxt)
{
// fake here an icon before text ...

View File

@ -232,6 +232,13 @@ private:
BOOL _bCapTTHover;
eMousePos _hoverMPos;
int _captionHeightDynamic = HIGH_CAPTION;
int _captionGapDynamic = CAPTION_GAP;
int _closeButtonPosLeftDynamic = CLOSEBTN_POS_LEFT;
int _closeButtonPosTopDynamic = CLOSEBTN_POS_TOP;
int _closeButtonWidth;
int _closeButtonHeight;
// data of added windows
std::vector<tTbData *> _vTbData;
};

View File

@ -41,27 +41,34 @@
#include "Common.h"
#include "StaticDialog.h"
class DockingDlgInterface : public StaticDialog
{
public:
DockingDlgInterface(): StaticDialog(), _HSource(NULL),\
_dlgID(-1), _isFloating(TRUE), _iDockedPos(0), _pluginName(TEXT("")) {};
DockingDlgInterface() = default;
DockingDlgInterface(int dlgID): StaticDialog(), _HSource(NULL),\
_dlgID(dlgID), _isFloating(TRUE), _iDockedPos(0), _pluginName(TEXT("")) {};
explicit DockingDlgInterface(int dlgID)
: _dlgID(dlgID)
{}
virtual void init(HINSTANCE hInst, HWND parent) {
virtual void init(HINSTANCE hInst, HWND parent)
{
StaticDialog::init(hInst, parent);
TCHAR temp[MAX_PATH];
::GetModuleFileName((HMODULE)hInst, temp, MAX_PATH);
_moduleName = ::PathFindFileName(temp);
};
}
void create(tTbData * data, bool isRTL = false){
void create(tTbData * data, bool isRTL = false)
{
assert(data != nullptr);
StaticDialog::create(_dlgID, isRTL);
TCHAR temp[MAX_PATH];
::GetWindowText(_hSelf, temp, MAX_PATH);
_pluginName = temp;
// user information
data->hClient = _hSelf;
data->pszName = (TCHAR *)_pluginName.c_str();
@ -71,36 +78,34 @@ public:
// additional info
data->pszAddInfo = NULL;
};
}
virtual void updateDockingDlg() {
virtual void updateDockingDlg()
{
::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, (LPARAM)_hSelf);
}
virtual void destroy() {
};
virtual void destroy() {}
virtual void setBackgroundColor(COLORREF) {
};
virtual void setBackgroundColor(COLORREF) {}
virtual void setForegroundColor(COLORREF) {
};
virtual void setForegroundColor(COLORREF) {}
virtual void display(bool toShow = true) const {
::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf);
};
}
bool isClosed() const {
return _isClosed;
};
}
void setClosed(bool toClose) {
_isClosed = toClose;
};
}
const TCHAR * getPluginFileName() const {
return _moduleName.c_str();
};
}
protected :
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam)
@ -144,13 +149,13 @@ protected :
};
// Handles
HWND _HSource;
int _dlgID;
bool _isFloating;
int _iDockedPos;
HWND _HSource = NULL;
int _dlgID = -1;
bool _isFloating = true;
int _iDockedPos = 0;
generic_string _moduleName;
generic_string _pluginName;
bool _isClosed;
bool _isClosed = false;
};
#endif // DOCKINGDLGINTERFACE_H

View File

@ -1,16 +1,16 @@
// this file is part of docking functionality for Notepad++
// Copyright (C)2006 Jens Lorenz <jens.plugin.npp@gmx.de>
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -20,7 +20,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -118,7 +118,7 @@ void DockingManager::init(HINSTANCE hInst, HWND hWnd, Window ** ppWin)
clz.hInstance = _hInst;
clz.hIcon = NULL;
clz.hCursor = ::LoadCursor(NULL, IDC_ARROW);
clz.hbrBackground = NULL;
clz.hbrBackground = NULL;
clz.lpszMenuName = NULL;
clz.lpszClassName = DSPC_CLASS_NAME;
@ -177,7 +177,7 @@ void DockingManager::init(HINSTANCE hInst, HWND hWnd, Window ** ppWin)
_isInitialized = TRUE;
}
void DockingManager::destroy()
void DockingManager::destroy()
{
::DestroyWindow(_hSelf);
}
@ -186,7 +186,7 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w
{
DockingManager *pDockingManager = NULL;
switch (message)
{
{
case WM_NCCREATE :
pDockingManager = (DockingManager *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDockingManager->_hSelf = hwnd;
@ -201,7 +201,7 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w
}
}
void DockingManager::updateContainerInfo(HWND hClient)
void DockingManager::updateContainerInfo(HWND hClient)
{
for (size_t iCont = 0, len = _vContainer.size(); iCont < len; ++iCont)
{
@ -212,7 +212,7 @@ void DockingManager::updateContainerInfo(HWND hClient)
}
}
void DockingManager::showContainer(HWND hCont, BOOL view)
void DockingManager::showContainer(HWND hCont, BOOL view)
{
for (size_t iCont = 0, len = _vContainer.size(); iCont < len; ++iCont)
{
@ -417,7 +417,7 @@ void DockingManager::reSizeTo(RECT & rc)
_dockData.rcRegion[CONT_TOP].left = rc.left;
_dockData.rcRegion[CONT_TOP].top = rc.top;
_dockData.rcRegion[CONT_TOP].right = rc.right-rc.left;
_vSplitter[CONT_TOP]->display(false);
if (_vContainer[CONT_TOP]->isVisible())
@ -519,7 +519,7 @@ void DockingManager::reSizeTo(RECT & rc)
// set window positions of container
if (_vContainer[CONT_BOTTOM]->isVisible())
{
::SetWindowPos(_vContainer[CONT_BOTTOM]->getHSelf(), NULL,
::SetWindowPos(_vContainer[CONT_BOTTOM]->getHSelf(), NULL,
rcBottom.left ,
rcBottom.top ,
rcBottom.right ,
@ -530,7 +530,7 @@ void DockingManager::reSizeTo(RECT & rc)
if (_vContainer[CONT_TOP]->isVisible())
{
::SetWindowPos(_vContainer[CONT_TOP]->getHSelf(), NULL,
::SetWindowPos(_vContainer[CONT_TOP]->getHSelf(), NULL,
_dockData.rcRegion[CONT_TOP].left ,
_dockData.rcRegion[CONT_TOP].top ,
_dockData.rcRegion[CONT_TOP].right ,
@ -541,7 +541,7 @@ void DockingManager::reSizeTo(RECT & rc)
if (_vContainer[CONT_RIGHT]->isVisible())
{
::SetWindowPos(_vContainer[CONT_RIGHT]->getHSelf(), NULL,
::SetWindowPos(_vContainer[CONT_RIGHT]->getHSelf(), NULL,
rcRight.left ,
rcRight.top ,
rcRight.right ,
@ -552,7 +552,7 @@ void DockingManager::reSizeTo(RECT & rc)
if (_vContainer[CONT_LEFT]->isVisible())
{
::SetWindowPos(_vContainer[CONT_LEFT]->getHSelf(), NULL,
::SetWindowPos(_vContainer[CONT_LEFT]->getHSelf(), NULL,
_dockData.rcRegion[CONT_LEFT].left ,
_dockData.rcRegion[CONT_LEFT].top ,
_dockData.rcRegion[CONT_LEFT].right ,
@ -644,7 +644,7 @@ void DockingManager::createDockableDlg(tTbData data, int iCont, bool isVisible)
// get current container from map
iCont = _iContMap[iCont];
}
// previous container is in floating state
// previous container is in floating state
else
{
// no mapping for available store mapping
@ -683,7 +683,7 @@ void DockingManager::setActiveTab(int iCont, int iItem)
_vContainer[_iContMap[iCont]]->setActiveTb(iItem);
}
void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
{
for (size_t i = 0, len = _vContainer.size(); i < len; ++i)
{
@ -710,7 +710,7 @@ void DockingManager::showDockableDlg(TCHAR* pszName, BOOL view)
}
}
LRESULT DockingManager::SendNotify(HWND hWnd, UINT message)
LRESULT DockingManager::SendNotify(HWND hWnd, UINT message)
{
NMHDR nmhdr;
nmhdr.code = message;
@ -790,7 +790,7 @@ DockingCont* DockingManager::toggleActiveTb(DockingCont* pContSrc, UINT message,
{
// set new target
pContTgt = _vContainer[iContPrev];
// change data normaly
TbData.iPrevCont = iContSrc;
pContTgt->createToolbar(TbData);
@ -868,7 +868,7 @@ void DockingManager::toggleActiveTb(DockingCont* pContSrc, DockingCont* pContTgt
{
tTbData TbData = *pContSrc->getDataOfActiveTb();
toggleTb(pContSrc, pContTgt, TbData);
toggleTb(pContSrc, pContTgt, TbData);
}
void DockingManager::toggleVisTb(DockingCont* pContSrc, DockingCont* pContTgt)
@ -884,7 +884,7 @@ void DockingManager::toggleVisTb(DockingCont* pContSrc, DockingCont* pContTgt)
{
// get data one by another
tTbData TbData = *vTbData[iTb];
toggleTb(pContSrc, pContTgt, TbData);
toggleTb(pContSrc, pContTgt, TbData);
}
pContTgt->setActiveTb(pTbData);
}
@ -909,7 +909,7 @@ void DockingManager::toggleTb(DockingCont* pContSrc, DockingCont* pContTgt, tTbD
SendNotify(TbData.hClient, MAKELONG(DMN_FLOAT, iContTgt));
// create new toolbar
pContTgt->createToolbar(TbData);
pContTgt->createToolbar(TbData);
// remove toolbar from source
_vContainer[iContSrc]->removeToolbar(TbData);
@ -982,7 +982,7 @@ int DockingManager::FindEmptyContainer()
delete [] pPrevDockList;
// search for empty arrays
return iRetCont;
return iRetCont;
}

View File

@ -1,16 +1,16 @@
// this file is part of docking functionality for Notepad++
// Copyright (C)2006 Jens Lorenz <jens.plugin.npp@gmx.de>
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -20,7 +20,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -55,7 +55,7 @@ static LRESULT CALLBACK hookProcMouse(UINT nCode, WPARAM wParam, LPARAM lParam)
case WM_NCLBUTTONUP:
::PostMessage(hWndMouse, wParam, 0, 0);
return TRUE;
default:
default:
break;
}
}
@ -63,7 +63,7 @@ static LRESULT CALLBACK hookProcMouse(UINT nCode, WPARAM wParam, LPARAM lParam)
return ::CallNextHookEx(hookMouse, nCode, wParam, lParam);
}
void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags)
void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags)
{
Window::init(hInst, hWnd);
_hMessage = hMessage;
@ -112,7 +112,7 @@ void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags
/* create splitter windows and initialize it */
_hSelf = ::CreateWindowEx( 0, wc.lpszClassName, TEXT(""), WS_CHILD | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
_hParent, NULL, _hInst, (LPVOID)this);
if (!_hSelf)
@ -127,7 +127,7 @@ LRESULT CALLBACK DockingSplitter::staticWinProc(HWND hwnd, UINT message, WPARAM
{
DockingSplitter *pDockingSplitter = NULL;
switch (message)
{
{
case WM_NCCREATE :
pDockingSplitter = (DockingSplitter *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDockingSplitter->_hSelf = hwnd;
@ -186,7 +186,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (_isLeftButtonDown == TRUE)
{
POINT pt;
::GetCursorPos(&pt);
if ((_flags & DMS_HORIZONTAL) && (_ptOldPos.y != pt.y))

View File

@ -1,16 +1,16 @@
// this file is part of docking functionality for Notepad++
// Copyright (C)2006 Jens Lorenz <jens.plugin.npp@gmx.de>
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -20,12 +20,12 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Changed something around drawRectangle() (for details see there) to enhance
// Changed something around drawRectangle() (for details see there) to enhance
// speed and consistency of the drag-rectangle - August 2010, Joern Gruel (jg)
@ -66,7 +66,7 @@ static LRESULT CALLBACK hookProcMouse(INT nCode, WPARAM wParam, LPARAM lParam)
//::PostMessage(hWndServer, wParam, 0, 0);
::SendMessage(hWndServer, wParam, 0, 0);
return TRUE;
default:
default:
break;
}
}
@ -101,7 +101,7 @@ Gripper::Gripper()
_ptOld.x = 0;
_ptOld.y = 0;
_bPtOldValid = FALSE;
_hTab = NULL;
_hTabSource = NULL;
_startMovingFromTab = FALSE;
@ -137,7 +137,7 @@ void Gripper::startGrip(DockingCont* pCont, DockingManager* pDockMgr)
clz.hIcon = NULL;
clz.hCursor = ::LoadCursor(NULL, IDC_ARROW);
clz.hbrBackground = NULL;
clz.hbrBackground = NULL;
clz.lpszMenuName = NULL;
clz.lpszClassName = MDLG_CLASS_NAME;
@ -171,7 +171,7 @@ LRESULT CALLBACK Gripper::staticWinProc(HWND hwnd, UINT message, WPARAM wParam,
{
Gripper *pDlgMoving = NULL;
switch (message)
{
{
case WM_NCCREATE :
pDlgMoving = (Gripper *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDlgMoving->_hSelf = hwnd;
@ -239,8 +239,8 @@ LRESULT Gripper::runProc(UINT message, WPARAM wParam, LPARAM lParam)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
::SetWindowPos(_hParent, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
_pCont->focusClient();
delete this;
break;
delete this; // TODO: remove this line and delete this object outside of itself
return TRUE;
}
default:
break;
@ -249,7 +249,7 @@ LRESULT Gripper::runProc(UINT message, WPARAM wParam, LPARAM lParam)
return ::DefWindowProc(_hSelf, message, wParam, lParam);
}
void Gripper::create()
{
RECT rc = {0};
@ -285,7 +285,7 @@ void Gripper::create()
// calculate the mouse pt within dialog
::GetCursorPos(&pt);
// get tab informations
initTabInformation();
@ -333,14 +333,14 @@ void Gripper::onButtonUp()
::GetCursorPos(&pt);
getMousePoints(&pt, &ptBuf);
// do nothing, when old point is not valid
// do nothing, when old point is not valid
if (_bPtOldValid == FALSE)
return;
// erase last drawn rectangle
drawRectangle(NULL);
// look if current position is within dockable area
// look if current position is within dockable area
DockingCont* pDockCont = contHitTest(pt);
if (pDockCont == NULL)
@ -368,7 +368,7 @@ void Gripper::onButtonUp()
if (_startMovingFromTab == TRUE)
{
/* when tab is moved */
if ((!_pCont->isFloating()) ||
if ((!_pCont->isFloating()) ||
((_pCont->isFloating()) && (::SendMessage(_hTabSource, TCM_GETITEMCOUNT, 0, 0) > 1)))
{
pContMove = _pDockMgr->toggleActiveTb(_pCont, DMM_FLOAT, TRUE, &rc);
@ -527,28 +527,28 @@ void Gripper::doTabReordering(POINT pt)
// Changed behaviour (jg): Now this function handles erasing of drag-rectangles and drawing of
// new ones within one drawing step to the desktop. This is against flickering, but also it is
// necessary for the Vista Aero style - because in this case the control is given so much to
// the graphics driver, that accesses (especially read accesses) to the desktop window become
// too expensive to access it more than absolutely necessary. Besides, usage of the function
// ::LockWindowUpdate() was added, because with often redrawn windows in the background we had
// inconsistencies while erasing our drag-rectangle (because it could already have been erased
// the graphics driver, that accesses (especially read accesses) to the desktop window become
// too expensive to access it more than absolutely necessary. Besides, usage of the function
// ::LockWindowUpdate() was added, because with often redrawn windows in the background we had
// inconsistencies while erasing our drag-rectangle (because it could already have been erased
// on some places).
//
// Parameter pPt==NULL says that only erasing is wanted and the drag-rectangle is no more needed,
// Parameter pPt==NULL says that only erasing is wanted and the drag-rectangle is no more needed,
// thatswhy this also leads to a call of ::LockWindowUpdate(NULL) to enable drawing by others again.
// The previously drawn rectangle is memoried within _rectPrev (and _bPtOldValid says if it already
// is valid - did not change this members name because didn't want change too much at once).
//
// I was too lazy to always draw four rectangles for the four edges of the drag-rectangle - it seems
// that drawing an outer rectangle first and then erasing the inner stuff by drawing a second,
// smaller rectangle inside seems to be not slower - wich comes not unawaited, because it is mostly
// smaller rectangle inside seems to be not slower - wich comes not unawaited, because it is mostly
// hardware-driven and each single draw has its own fixed costs.
//
// For further solutions I think we should leave this classic way of dragging and better use
// alpha-blending and always move the whole content of the toolbars - so we could leave the
//
// For further solutions I think we should leave this classic way of dragging and better use
// alpha-blending and always move the whole content of the toolbars - so we could leave the
// ::LockWindowUpdate() behind us.
//
// Besides, while debugging into the dragging process please let the ::LockWindowUpdate() out,
// by #undef the USE_LOCKWINDOWUPDATE in gripper.h, because it works for your debugging window
// by #undef the USE_LOCKWINDOWUPDATE in gripper.h, because it works for your debugging window
// as well, of course. Or just try by this #define what difference it makes.
//
void Gripper::drawRectangle(const POINT* pPt)
@ -571,7 +571,7 @@ void Gripper::drawRectangle(const POINT* pPt)
_hdc= ::GetDCEx(hWnd, NULL, DCX_WINDOW|DCX_CACHE);
#endif
}
// Create a brush with the appropriate bitmap pattern to draw our drag rectangle
if (!_hbm)
_hbm = ::CreateBitmap(8, 8, 1, 1, DotPattern);
@ -581,24 +581,24 @@ void Gripper::drawRectangle(const POINT* pPt)
if (pPt != NULL)
{
// Determine whether to draw a solid drag rectangle or checkered
// ???(jg) solid or checked ??? - must have been an old comment, I didn't
// ???(jg) solid or checked ??? - must have been an old comment, I didn't
// find here this difference, but at least it's a question of drag-rects size
//
getMovingRect(*pPt, &rcNew);
_rcPrev= rcNew; // save the new drawn rcNew
// note that from here for handling purposes the right and bottom values of the rects
// contain width and height - its handsome, but i find it dangerous, but didn't want to
// change that already this time.
// change that already this time.
if (_bPtOldValid)
{
// okay, there already a drag-rect has been drawn - and its position
// had been saved within the rectangle _rectPrev, wich already had been
// okay, there already a drag-rect has been drawn - and its position
// had been saved within the rectangle _rectPrev, wich already had been
// copied into rcOld in the beginning, and a new drag position
// is available, too.
// If now rcOld and rcNew are the same, just stop further handling to not
// draw the same drag-rectangle twice (this really happens, it should be
// draw the same drag-rectangle twice (this really happens, it should be
// better avoided anywhere earlier)
//
if (rcOld.left==rcNew.left && rcOld.right==rcNew.right && rcOld.top== rcNew.top && rcOld.bottom==rcNew.bottom)
@ -622,13 +622,13 @@ void Gripper::drawRectangle(const POINT* pPt)
rcOld.left= rcOld.left - rc.left;
rcOld.top = rcOld.top - rc.top;
rcNew.left= rcNew.left - rc.left;
rcNew.top = rcNew.top - rc.top;
rcNew.top = rcNew.top - rc.top;
HDC hdcMem= ::CreateCompatibleDC(_hdc);
HBITMAP hBm= ::CreateCompatibleBitmap(_hdc, rc.right, rc.bottom);
hbrushOrig= (HBRUSH)::SelectObject(hdcMem, hBm);
::SetBrushOrgEx(hdcMem, rc.left%8, rc.top%8, 0);
::SetBrushOrgEx(hdcMem, rc.left%8, rc.top%8, 0);
hbmOrig= (HBITMAP)::SelectObject(hdcMem, _hbrush);
::BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, _hdc, rc.left, rc.top, SRCCOPY);
@ -642,20 +642,20 @@ void Gripper::drawRectangle(const POINT* pPt)
::PatBlt(hdcMem, rcNew.left , rcNew.top , rcNew.right , rcNew.bottom , PATINVERT);
::PatBlt(hdcMem, rcNew.left+3, rcNew.top+3, rcNew.right-6, rcNew.bottom-6, PATINVERT);
}
::BitBlt(_hdc, rc.left, rc.top, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
::BitBlt(_hdc, rc.left, rc.top, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
SelectObject(hdcMem, hbrushOrig);
SelectObject(hdcMem, hbmOrig);
DeleteObject(hBm);
DeleteDC(hdcMem);
if (pPt == NULL)
{
#if defined(USE_LOCKWINDOWUPDATE)
::LockWindowUpdate(NULL);
#endif
_bPtOldValid= FALSE;
if (_hdc)
if (_hdc)
{
::ReleaseDC(0, _hdc);
_hdc= NULL;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -96,7 +96,7 @@ size_t FunctionListPanel::getBodyClosePos(size_t begin, const TCHAR *bodyOpenSym
// Now we determinate the symbol (open or close)
int tmpStart = (*_ppEditView)->searchInTarget(bodyOpenSymbol, lstrlen(bodyOpenSymbol), targetStart, targetEnd);
if (tmpStart != -1 && tmpStart != -2) // open symbol found
if (tmpStart != -1 && tmpStart != -2) // open symbol found
{
++cntOpen;
}
@ -241,7 +241,7 @@ void FunctionListPanel::reload()
setSort(false);
vector<foundInfo> fi;
const TCHAR *fn = ((*_ppEditView)->getCurrentBuffer())->getFileName();
LangType langID = ((*_ppEditView)->getCurrentBuffer())->getLangType();
const TCHAR *udln = NULL;
@ -292,7 +292,7 @@ void FunctionListPanel::reload()
else
{
::SendMessage(_hSearchEdit, WM_SETTEXT, 0, (LPARAM)(previousParams->_searchParameters)._text2Find.c_str());
_treeView.restoreFoldingStateFrom(previousParams->_treeState, root);
bool isSort = (previousParams->_searchParameters)._doSort;
@ -318,7 +318,7 @@ void FunctionListPanel::init(HINSTANCE hInst, HWND hPere, ScintillaEditView **pp
{
generic_string funcListXmlPath = (NppParameters::getInstance())->getUserPath();
PathAppend(funcListXmlPath, TEXT("functionList.xml"));
if (!PathFileExists(funcListXmlPath.c_str()))
{
generic_string funcListDefaultXmlPath = (NppParameters::getInstance())->getNppPath();
@ -378,8 +378,8 @@ void FunctionListPanel::notified(LPNMHDR notification)
{
if (notification->code == TTN_GETDISPINFO)
{
LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)notification;
lpttt->hinst = NULL;
LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)notification;
lpttt->hinst = NULL;
if (notification->idFrom == IDC_SORTBUTTON_FUNCLIST)
{
@ -400,11 +400,11 @@ void FunctionListPanel::notified(LPNMHDR notification)
openSelection(treeView);
}
break;
case TVN_KEYDOWN:
{
LPNMTVKEYDOWN ptvkd = (LPNMTVKEYDOWN)notification;
if (ptvkd->wVKey == VK_RETURN)
{
if (!openSelection(treeView))
@ -434,7 +434,7 @@ BOOL FunctionListPanel::setTreeViewImageList(int root_id, int node_id, int leaf_
const int nbBitmaps = 3;
// Creation of image list
if ((_hTreeViewImaLst = ImageList_Create(CX_BITMAP, CY_BITMAP, ILC_COLOR32 | ILC_MASK, nbBitmaps, 0)) == NULL)
if ((_hTreeViewImaLst = ImageList_Create(CX_BITMAP, CY_BITMAP, ILC_COLOR32 | ILC_MASK, nbBitmaps, 0)) == NULL)
return FALSE;
// Add the bmp in the list
@ -516,7 +516,7 @@ static LRESULT CALLBACK funclstToolbarProc(HWND hwnd, UINT message, WPARAM wPara
bool FunctionListPanel::shouldSort()
{
TBBUTTONINFO tbbuttonInfo;
tbbuttonInfo.cbSize = sizeof(TBBUTTONINFO);
tbbuttonInfo.cbSize = sizeof(TBBUTTONINFO);
tbbuttonInfo.dwMask = TBIF_STATE;
::SendMessage(_hToolbarMenu, TB_GETBUTTONINFO, IDC_SORTBUTTON_FUNCLIST, (LPARAM)&tbbuttonInfo);
@ -527,7 +527,7 @@ bool FunctionListPanel::shouldSort()
void FunctionListPanel::setSort(bool isEnabled)
{
TBBUTTONINFO tbbuttonInfo;
tbbuttonInfo.cbSize = sizeof(TBBUTTONINFO);
tbbuttonInfo.cbSize = sizeof(TBBUTTONINFO);
tbbuttonInfo.dwMask = TBIF_STATE;
tbbuttonInfo.fsState = isEnabled ? TBSTATE_ENABLED | TBSTATE_CHECKED : TBSTATE_ENABLED;
::SendMessage(_hToolbarMenu, TB_SETBUTTONINFO, IDC_SORTBUTTON_FUNCLIST, (LPARAM)&tbbuttonInfo);
@ -565,19 +565,20 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
case WM_INITDIALOG :
{
int editWidth = 100;
int editHeight = 20;
int editWidth = NppParameters::getInstance()->_dpiManager.scaleX(100);
int editWidthSep = NppParameters::getInstance()->_dpiManager.scaleX(105); //editWidth + 5
int editHeight = NppParameters::getInstance()->_dpiManager.scaleY(20);
// Create toolbar menu
//int style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | CCS_TOP | BTNS_AUTOSIZE | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER;
int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT | BTNS_AUTOSIZE | BTNS_SEP | TBSTYLE_TOOLTIPS;
_hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style,
0,0,0,0,_hSelf,(HMENU)0, _hInst, NULL);
//::GetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC);
oldFunclstToolbarProc = (WNDPROC)::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, (LONG_PTR)funclstToolbarProc);
TBBUTTON tbButtons[3];
// Add the bmap image into toolbar's imagelist
// Add the bmap image into toolbar's imagelist
TBADDBITMAP addbmp = {_hInst, 0};
addbmp.nID = IDI_FUNCLIST_SORTBUTTON;
::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, (LPARAM)&addbmp);
@ -586,14 +587,14 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
// Place holder of search text field
tbButtons[0].idCommand = 0;
tbButtons[0].iBitmap = editWidth + 10;
tbButtons[0].iBitmap = editWidthSep;
tbButtons[0].fsState = TBSTATE_ENABLED;
tbButtons[0].fsStyle = BTNS_SEP;
tbButtons[0].fsStyle = BTNS_SEP; //This is just a separator (blank space)
tbButtons[0].iString = 0;
tbButtons[1].idCommand = IDC_SORTBUTTON_FUNCLIST;
tbButtons[1].iBitmap = 0;
tbButtons[1].fsState = TBSTATE_ENABLED;
tbButtons[1].fsState = TBSTATE_ENABLED;
tbButtons[1].fsStyle = BTNS_CHECK | BTNS_AUTOSIZE;
tbButtons[1].iString = (INT_PTR)TEXT("");
@ -604,8 +605,8 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
tbButtons[2].iString = (INT_PTR)TEXT("");
::SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE , (WPARAM)0, (LPARAM)MAKELONG (16, 16));
::SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), (LPARAM)&tbButtons);
::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(16, 16));
::SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), (LPARAM)&tbButtons);
::SendMessage(_hToolbarMenu, TB_AUTOSIZE, 0, 0);
ShowWindow(_hToolbarMenu, SW_SHOW);
@ -614,32 +615,31 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
_sortTipStr = pNativeSpeaker->getAttrNameStr(_sortTipStr.c_str(), FL_FUCTIONLISTROOTNODE, FL_SORTLOCALNODENAME);
_reloadTipStr = pNativeSpeaker->getAttrNameStr(_reloadTipStr.c_str(), FL_FUCTIONLISTROOTNODE, FL_RELOADLOCALNODENAME);
_hSearchEdit = CreateWindowEx(0L, L"Edit", NULL,
WS_CHILD | WS_BORDER | WS_VISIBLE | ES_AUTOVSCROLL,
2, 2, editWidth, editHeight,
_hSearchEdit = CreateWindowEx(0, L"Edit", NULL,
WS_CHILD | WS_BORDER | WS_VISIBLE | ES_AUTOVSCROLL,
2, 2, editWidth, editHeight,
_hToolbarMenu, (HMENU) IDC_SEARCHFIELD_FUNCLIST, _hInst, 0 );
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
if (hf)
::SendMessage(_hSearchEdit, WM_SETFONT, (WPARAM)hf, MAKELPARAM(TRUE, 0));
_treeViewSearchResult.init(_hInst, _hSelf, IDC_LIST_FUNCLIST_AUX);
_treeView.init(_hInst, _hSelf, IDC_LIST_FUNCLIST);
setTreeViewImageList(IDI_FUNCLIST_ROOT, IDI_FUNCLIST_NODE, IDI_FUNCLIST_LEAF);
_treeView.display();
return TRUE;
}
case WM_DESTROY:
_treeView.destroy();
_treeViewSearchResult.destroy();
::DestroyWindow(_hToolbarMenu);
break;
case WM_COMMAND :
case WM_COMMAND :
{
if (HIWORD(wParam) == EN_CHANGE)
{
@ -669,35 +669,37 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
}
}
break;
case WM_NOTIFY:
{
notified((LPNMHDR)lParam);
}
return TRUE;
case WM_SIZE:
{
int width = LOWORD(lParam);
int height = HIWORD(lParam);
RECT toolbarMenuRect;
::GetClientRect(_hToolbarMenu, &toolbarMenuRect);
case WM_SIZE:
{
int width = LOWORD(lParam);
int height = HIWORD(lParam);
int extraValue = NppParameters::getInstance()->_dpiManager.scaleX(4);
RECT toolbarMenuRect;
::GetClientRect(_hToolbarMenu, &toolbarMenuRect);
::MoveWindow(_hToolbarMenu, 0, 0, width, toolbarMenuRect.bottom, TRUE);
::MoveWindow(_hToolbarMenu, 0, 0, width, toolbarMenuRect.bottom, TRUE);
HWND hwnd = _treeView.getHSelf();
if (hwnd)
::MoveWindow(hwnd, 0, toolbarMenuRect.bottom + 2, width, height - toolbarMenuRect.bottom - 2, TRUE);
::MoveWindow(hwnd, 0, toolbarMenuRect.bottom + extraValue, width, height - toolbarMenuRect.bottom - extraValue, TRUE);
HWND hwnd_aux = _treeViewSearchResult.getHSelf();
if (hwnd_aux)
::MoveWindow(hwnd_aux, 0, toolbarMenuRect.bottom + 2, width, height - toolbarMenuRect.bottom - 2, TRUE);
break;
}
::MoveWindow(hwnd_aux, 0, toolbarMenuRect.bottom + extraValue, width, height - toolbarMenuRect.bottom - extraValue, TRUE);
default :
return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
}
break;
}
default :
return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
}
return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
}

View File

@ -104,9 +104,11 @@ public:
virtual void setBackgroundColor(COLORREF bgColour) {
TreeView_SetBkColor(_treeView.getHSelf(), bgColour);
TreeView_SetBkColor(_treeViewSearchResult.getHSelf(), bgColour);
};
virtual void setForegroundColor(COLORREF fgColour) {
TreeView_SetTextColor(_treeView.getHSelf(), fgColour);
TreeView_SetTextColor(_treeViewSearchResult.getHSelf(), fgColour);
};
void setParent(HWND parent2set){

View File

@ -358,7 +358,7 @@ void FunctionParser::funcParse(std::vector<foundInfo> & foundInfos, size_t begin
fi._pos = foundPos;
}
if (classStructName != TEXT(""))
if (not classStructName.empty())
{
fi._data2 = classStructName;
fi._pos2 = -1; // change -1 valeur for validated data2
@ -378,9 +378,7 @@ void FunctionParser::funcParse(std::vector<foundInfo> & foundInfos, size_t begin
foundInfos.push_back(fi);
}
else
{
foundInfos.push_back(fi);
}
}
begin = targetStart + foundTextLen;
@ -388,16 +386,17 @@ void FunctionParser::funcParse(std::vector<foundInfo> & foundInfos, size_t begin
}
}
generic_string FunctionParser::parseSubLevel(size_t begin, size_t end, std::vector< generic_string > dataToSearch, int & foundPos, ScintillaEditView **ppEditView)
{
if (begin >= end)
{
foundPos = -1;
return TEXT("");
return generic_string();
}
if (!dataToSearch.size())
return TEXT("");
return generic_string();
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
@ -408,7 +407,7 @@ generic_string FunctionParser::parseSubLevel(size_t begin, size_t end, std::vect
if (targetStart == -1 || targetStart == -2)
{
foundPos = -1;
return TEXT("");
return generic_string();
}
int targetEnd = int((*ppEditView)->execute(SCI_GETTARGETEND));
@ -417,17 +416,16 @@ generic_string FunctionParser::parseSubLevel(size_t begin, size_t end, std::vect
dataToSearch.erase(dataToSearch.begin());
return parseSubLevel(targetStart, targetEnd, dataToSearch, foundPos, ppEditView);
}
else // only one processed element, so we conclude the result
{
TCHAR foundStr[1024];
(*ppEditView)->getGenericText(foundStr, 1024, targetStart, targetEnd);
// only one processed element, so we conclude the result
TCHAR foundStr[1024];
(*ppEditView)->getGenericText(foundStr, 1024, targetStart, targetEnd);
foundPos = targetStart;
return foundStr;
}
foundPos = targetStart;
return foundStr;
}
bool FunctionParsersManager::parse(std::vector<foundInfo> & foundInfos, const AssociationInfo & assoInfo)
{
if (!_pXmlFuncListDoc)
@ -445,6 +443,7 @@ bool FunctionParsersManager::parse(std::vector<foundInfo> & foundInfos, const As
return true;
}
size_t FunctionZoneParser::getBodyClosePos(size_t begin, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol, const std::vector< std::pair<int, int> > & commentZones, ScintillaEditView **ppEditView)
{
size_t cntOpen = 1;
@ -522,15 +521,13 @@ void FunctionZoneParser::classParse(vector<foundInfo> & foundInfos, vector< pair
generic_string classStructName = parseSubLevel(targetStart, targetEnd, _classNameExprArray, foundPos, ppEditView);
if (_openSymbole != TEXT("") && _closeSymbole != TEXT(""))
if (not _openSymbole.empty() && not _closeSymbole.empty())
{
targetEnd = getBodyClosePos(targetEnd, _openSymbole.c_str(), _closeSymbole.c_str(), commentZones, ppEditView);
}
if (targetEnd > int(end)) //we found a result but outside our range, therefore do not process it
{
break;
}
scannedZones.push_back(pair<int, int>(targetStart, targetEnd));
@ -549,12 +546,11 @@ void FunctionZoneParser::classParse(vector<foundInfo> & foundInfos, vector< pair
}
}
void FunctionParser::getCommentZones(vector< pair<int, int> > & commentZone, size_t begin, size_t end, ScintillaEditView **ppEditView)
{
if ((begin >= end) || (_commentExpr == TEXT("")))
{
if ((begin >= end) || (_commentExpr.empty()))
return;
}
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
@ -567,9 +563,7 @@ void FunctionParser::getCommentZones(vector< pair<int, int> > & commentZone, siz
targetStart = int((*ppEditView)->execute(SCI_GETTARGETSTART));
targetEnd = int((*ppEditView)->execute(SCI_GETTARGETEND));
if (targetEnd > int(end)) //we found a result but outside our range, therefore do not process it
{
break;
}
commentZone.push_back(pair<int, int>(targetStart, targetEnd));
@ -582,18 +576,18 @@ void FunctionParser::getCommentZones(vector< pair<int, int> > & commentZone, siz
}
}
bool FunctionParser::isInZones(int pos2Test, const std::vector< std::pair<int, int> > & zones)
{
for (size_t i = 0, len = zones.size(); i < len; ++i)
{
if (pos2Test >= zones[i].first && pos2Test < zones[i].second)
{
return true;
}
}
return false;
}
void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vector< pair<int, int> > & sourceZones, size_t begin, size_t end)
{
if (sourceZones.size() == 0)
@ -622,6 +616,7 @@ void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vecto
}
}
void FunctionZoneParser::parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName)
{
vector< pair<int, int> > classZones, commentZones, nonCommentZones;
@ -647,8 +642,10 @@ void FunctionUnitParser::parse(std::vector<foundInfo> & foundInfos, size_t begin
//
// SortClass for vector<pair<int, int>>
// sort in _selLpos : increased order
struct SortZones {
bool operator() (pair<int, int> & l, pair<int, int> & r) {
struct SortZones final
{
bool operator() (pair<int, int> & l, pair<int, int> & r)
{
return (l.first < r.first);
}
};
@ -677,4 +674,4 @@ void FunctionMixParser::parse(std::vector<foundInfo> & foundInfos, size_t begin,
_funcUnitPaser->funcParse(foundInfos, nonScannedZones[i].first, nonScannedZones[i].second, ppEditView, classStructName);
}
}
}
}

View File

@ -24,23 +24,23 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef FUNCTIONPARSER_H
#define FUNCTIONPARSER_H
#pragma once;
class ScintillaEditView;
class TiXmlDocument;
class TiXmlNode;
struct foundInfo {
struct foundInfo final
{
generic_string _data;
generic_string _data2;
int _pos;
int _pos2;
foundInfo(): _data(TEXT("")), _data2(TEXT("")), _pos(-1), _pos2(-1) {};
int _pos = -1;
int _pos2 = -1;
};
class FunctionParser {
class FunctionParser
{
friend class FunctionParsersManager;
public:
FunctionParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr, generic_string functionExpr, std::vector<generic_string> functionNameExprArray, std::vector<generic_string> classNameExprArray):
@ -62,7 +62,8 @@ protected:
};
class FunctionZoneParser : public FunctionParser {
class FunctionZoneParser : public FunctionParser
{
public:
FunctionZoneParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr, generic_string rangeExpr, generic_string openSymbole, generic_string closeSymbole,
std::vector<generic_string> classNameExprArray, generic_string functionExpr, std::vector<generic_string> functionNameExprArray):
@ -84,70 +85,77 @@ private:
class FunctionUnitParser : public FunctionParser {
class FunctionUnitParser : public FunctionParser
{
public:
FunctionUnitParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr,
generic_string mainExpr, std::vector<generic_string> functionNameExprArray,
std::vector<generic_string> classNameExprArray): FunctionParser(id, displayName, commentExpr, mainExpr, functionNameExprArray, classNameExprArray){};
std::vector<generic_string> classNameExprArray): FunctionParser(id, displayName, commentExpr, mainExpr, functionNameExprArray, classNameExprArray)
{}
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
};
class FunctionMixParser : public FunctionZoneParser {
class FunctionMixParser : public FunctionZoneParser
{
public:
FunctionMixParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr, generic_string rangeExpr, generic_string openSymbole, generic_string closeSymbole,
std::vector<generic_string> classNameExprArray, generic_string functionExpr, std::vector<generic_string> functionNameExprArray, FunctionUnitParser *funcUnitPaser):
FunctionZoneParser(id, displayName, commentExpr, rangeExpr, openSymbole, closeSymbole, classNameExprArray, functionExpr, functionNameExprArray), _funcUnitPaser(funcUnitPaser){};
~FunctionMixParser() {
if (_funcUnitPaser)
delete _funcUnitPaser;
~FunctionMixParser()
{
delete _funcUnitPaser;
}
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
private:
FunctionUnitParser *_funcUnitPaser;
FunctionUnitParser* _funcUnitPaser = nullptr;
};
struct AssociationInfo {
struct AssociationInfo final
{
int _id;
int _langID;
generic_string _ext;
generic_string _userDefinedLangName;
AssociationInfo(int id, int langID, const TCHAR *ext, const TCHAR *userDefinedLangName): _id(id), _langID(langID) {
AssociationInfo(int id, int langID, const TCHAR *ext, const TCHAR *userDefinedLangName)
: _id(id), _langID(langID)
{
if (ext)
_ext = ext;
else
_ext = TEXT("");
_ext.clear();
if (userDefinedLangName)
_userDefinedLangName = userDefinedLangName;
else
_userDefinedLangName = TEXT("");
_userDefinedLangName.clear();
};
};
class FunctionParsersManager {
class FunctionParsersManager final
{
public:
FunctionParsersManager() : _ppEditView(NULL), _pXmlFuncListDoc(NULL){};
~FunctionParsersManager();
bool init(generic_string xmlPath, ScintillaEditView ** ppEditView);
bool parse(std::vector<foundInfo> & foundInfos, const AssociationInfo & assoInfo);
void writeFunctionListXml(const TCHAR *destFoder) const;
private:
ScintillaEditView **_ppEditView;
ScintillaEditView **_ppEditView = nullptr;
std::vector<FunctionParser *> _parsers;
std::vector<AssociationInfo> _associationMap;
TiXmlDocument *_pXmlFuncListDoc;
TiXmlDocument *_pXmlFuncListDoc = nullptr;
bool getFuncListFromXmlTree();
bool getZonePaserParameters(TiXmlNode *classRangeParser, generic_string &mainExprStr, generic_string &openSymboleStr, generic_string &closeSymboleStr, std::vector<generic_string> &classNameExprArray, generic_string &functionExprStr, std::vector<generic_string> &functionNameExprArray);
bool getUnitPaserParameters(TiXmlNode *functionParser, generic_string &mainExprStr, std::vector<generic_string> &functionNameExprArray, std::vector<generic_string> &classNameExprArray);
FunctionParser * getParser(const AssociationInfo & assoInfo);
};
#endif //FUNCTIONPARSER_H
};

View File

@ -5,7 +5,7 @@
//Printed BABYGRID message reference and tutorial available.
//email: mudcat@mis.net for more information.
/*
/*
Add WM_MOUSEWHEEL, WM_LBUTTONDBLCLK and WM_RBUTTONUP events
Modified by Don HO <don.h@free.fr>
*/
@ -27,7 +27,7 @@ HFONT hfontbody,hfontheader,hfonttitle;
HFONT holdfont;
struct _gridhandlestruct
struct _gridhandlestruct
{
UINT gridmenu;
HWND hlist1;
@ -124,7 +124,7 @@ int CountGrids();
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
int HomeColumnNthVisible(int SI)
{
{
int j,hc,count;
count=0;
hc=BGHS[SI].homecol;
@ -219,7 +219,7 @@ int GetColOfMouse(int SI,int x)
j++;
}
j--;
ReturnValue = j;
if(BGHS[SI].EXTENDLASTCOLUMN)
{
@ -340,7 +340,7 @@ void DisplayTitle(HWND hWnd,int SI,HFONT hfont)
HFONT holdfont;
GetClientRect(hWnd,&rect);
gdc=GetDC(hWnd);
@ -368,7 +368,7 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
SetBkMode(gdc,TRANSPARENT);
ShowHscroll(hWnd,SI);
ShowVscroll(hWnd,SI);
holdfont = (HFONT)SelectObject(gdc,hcolumnheadingfont);
SetTextColor(gdc,BGHS[SI].textcolor);
@ -390,7 +390,7 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
//extend this column
RECT trect;
GetClientRect(hWnd,&trect);
rect.right = offset + (trect.right - rect.left);
}
}
@ -412,7 +412,7 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
}
}
SetCell(&BGcell,r,c);
lstrcpy(buffer, TEXT(""));
SendMessage(hWnd,BGM_GETCELLDATA,(WPARAM)&BGcell,(LPARAM)buffer);
@ -470,7 +470,7 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
if(c==0)
{
DrawEdge(gdc,&rect,EDGE_ETCHED,BF_MIDDLE|BF_RECT|BF_ADJUST);
}
else
{
@ -1189,7 +1189,7 @@ void DisplayEditString(HWND hWnd,int SI,TCHAR* tstring)
ah=BGHS[SI].fontascentheight;
SetCaretPos(rt.right-4,rt.top+(int)(rh/2)-ah+2);
}
SelectObject(cdc,holdfont);
@ -1207,7 +1207,7 @@ ATOM RegisterGridClass(HINSTANCE hInstance)
for(int j = 0 ; j < MAX_GRIDS ; j++)
{
BGHS[j].gridmenu = 0;
BGHS[j].hlist1 = NULL;
BGHS[j].hlist1 = NULL;
lstrcpy(BGHS[j].protect, TEXT("U"));
BGHS[j].rows = 100;
BGHS[j].cols = 255;
@ -1220,15 +1220,15 @@ ATOM RegisterGridClass(HINSTANCE hInstance)
BGHS[j].EDITABLE = FALSE;
BGHS[j].EDITING = FALSE;
BGHS[j].AUTOROW = TRUE;
BGHS[j].cursorcol = 1;
BGHS[j].cursorrow = 1;
BGHS[j].cursorcol = 1;
BGHS[j].cursorrow = 1;
BGHS[j].columnwidths[0]=50;
BGHS[j].ADVANCEROW = TRUE;
BGHS[j].DRAWHIGHLIGHT = TRUE;
BGHS[j].cursorcolor = RGB(255,255,255);
BGHS[j].protectcolor = RGB(255,255,255);
BGHS[j].protectcolor = RGB(255,255,255);
BGHS[j].unprotectcolor = RGB(255,255,255);
BGHS[j].highlightcolor = RGB(0,0,128);
BGHS[j].highlightcolor = RGB(0,0,128);
BGHS[j].gridlinecolor = RGB(220,220,220);
BGHS[j].highlighttextcolor = RGB(255,255,255);
BGHS[j].textcolor = RGB(0,0,0);
@ -1249,7 +1249,7 @@ ATOM RegisterGridClass(HINSTANCE hInstance)
{
BGHS[j].columnwidths[k]=50;
}
}
WNDCLASS wclass;
@ -1262,7 +1262,7 @@ ATOM RegisterGridClass(HINSTANCE hInstance)
wclass.hInstance = hInstance;
wclass.hIcon = NULL;
wclass.hCursor = ::LoadCursor(NULL, IDC_ARROW);
wclass.hbrBackground = (HBRUSH)(GetStockObject(GRAY_BRUSH));
wclass.lpszClassName = TEXT("BABYGRID");
wclass.lpszMenuName = NULL;
@ -1275,7 +1275,7 @@ void SizeGrid(HWND hWnd,int SI)
{
SendMessage(hWnd,WM_SIZE,SIZE_MAXIMIZED,MAKELPARAM(BGHS[SI].wannabewidth,BGHS[SI].wannabeheight));
SendMessage(hWnd,WM_SIZE,SIZE_MAXIMIZED,MAKELPARAM(BGHS[SI].wannabewidth,BGHS[SI].wannabeheight));
}
int FindLongestLine(HDC hdc,TCHAR* text,SIZE* size)
@ -1320,7 +1320,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HINSTANCE hInst;
int iDataType;
static int ASCII;
SelfIndex=FindGrid((UINT)GetMenu(hWnd));
SelfMenu=BGHS[SelfIndex].gridmenu;
@ -1328,7 +1328,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
//update the grid width and height variable
{
RECT rect;
GetClientRect(hWnd,&rect);
BGHS[SelfIndex].gridwidth = rect.right - rect.left;
BGHS[SelfIndex].gridheight = rect.bottom - rect.top;
@ -1337,11 +1337,11 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ReturnValue = 0;
switch (message)
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
@ -1371,7 +1371,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
DisplayColumn(hWnd,SelfIndex,c,offset,BGHS[SelfIndex].hfont,BGHS[SelfIndex].hcolumnheadingfont);
offset+=BGHS[SelfIndex].columnwidths[c];
}
}
EndPaint(hWnd, &ps);
//
@ -1393,8 +1393,8 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
MessageBeep(0);
}
break;
case WM_SETTEXT:
{
case WM_SETTEXT:
{
int j,linecount;
SIZE size;
HDC gdc;
@ -1407,13 +1407,13 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
lstrcpy(BGHS[SelfIndex].title,(TCHAR*)lParam);
}
gdc=GetDC(hWnd);
//get linecount of title;
if(lstrlen(BGHS[SelfIndex].title) > 0)
{
linecount=1;
for(j=0;j<(int)lstrlen(BGHS[SelfIndex].title);j++)
for(j=0;j<(int)lstrlen(BGHS[SelfIndex].title);j++)
{
if(BGHS[SelfIndex].title[j]=='\n')
{
@ -1433,10 +1433,10 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
ReleaseDC(hWnd,gdc);
RefreshGrid(hWnd);
SizeGrid(hWnd,SelfIndex);
}
break;
case BGM_GETROWS:
@ -1565,8 +1565,8 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
lstrcpy(BGHS[SelfIndex].protect, TEXT("P"));
}
else
{
else
{
lstrcpy(BGHS[SelfIndex].protect, TEXT("U"));
}
break;
@ -1626,7 +1626,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
lstrcat(buffer, TEXT("|"));
lstrcat(buffer, (TCHAR*)lParam);
FindResult=SendMessage(BGHS[SelfIndex].hlist1,LB_ADDSTRING,0,(LPARAM)buffer);
if(FindResult==LB_ERR)
{
MessageBeep(0);
@ -1847,13 +1847,13 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case BGM_SETHEADERROWHEIGHT:
if(wParam >= 0)
if(wParam >= 0)
{
RECT rect;
BGHS[SelfIndex].headerrowheight = wParam;
SizeGrid(hWnd,SelfIndex);
GetClientRect(hWnd,&rect);
InvalidateRect(hWnd,&rect,FALSE);
InvalidateRect(hWnd,&rect,FALSE);
}
break;
@ -2056,9 +2056,9 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
else
{
BGHS[SelfIndex].textcolor = RGB(0,0,0);
}
}
case WM_MOUSEMOVE:
case WM_MOUSEMOVE:
int x,y,r,c,t,z;
x=LOWORD(lParam);
y=HIWORD(lParam);
@ -2146,7 +2146,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
BGHS[SelfIndex].columntoresize = c;
}
BGHS[SelfIndex].columntoresizeinitsize = BGHS[SelfIndex].columnwidths[c];
}
@ -2162,10 +2162,10 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL NRC,NCC;
NRC=FALSE;
NCC=FALSE;
if(GetFocus()==hWnd)
{
x=LOWORD(lParam);
y=HIWORD(lParam);
r=GetRowOfMouse(SelfIndex,y);
@ -2191,11 +2191,11 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
BGHS[SelfIndex].cursorcol = c;
}
}
if(NRC){NotifyRowChanged(hWnd,SelfIndex);}
if(NCC){NotifyColChanged(hWnd,SelfIndex);}
DrawCursor(hWnd,SelfIndex);
SetCurrentCellStatus(hWnd,SelfIndex);
SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
@ -2359,7 +2359,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
rpp = (gridrect.bottom - (BGHS[SelfIndex].headerrowheight+BGHS[SelfIndex].titleheight))/BGHS[SelfIndex].rowheight;
DrawCursor(hWnd,SelfIndex);
BGHS[SelfIndex].cursorrow += rpp;
if(BGHS[SelfIndex].cursorrow > BGHS[SelfIndex].rows)
{
BGHS[SelfIndex].cursorrow = BGHS[SelfIndex].rows;
@ -2401,7 +2401,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
RefreshGrid(hWnd);
break;
}
if(wParam == VK_DOWN)
if(wParam == VK_DOWN)
{
if(BGHS[SelfIndex].EDITING)
{
@ -2505,7 +2505,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SetCurrentCellStatus(hWnd,SelfIndex);
if((BGHS[SelfIndex].CURRENTCELLPROTECTED)&&(wParam == 13))
@ -2555,11 +2555,11 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
}
//if it's not an arrow key, make an edit box in the active cell rectangle
if((BGHS[SelfIndex].EDITABLE)&&(BGHS[SelfIndex].rows > 0))
{
SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
DrawCursor(hWnd,SelfIndex);
DrawCursor(hWnd,SelfIndex);
@ -2642,7 +2642,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BGHS[SelfIndex].homecol = np;
SetScrollPos(hWnd,SB_HORZ,cp,TRUE);
RefreshGrid(hWnd);
}
}
if((LOWORD(wParam==SB_LINELEFT))||(LOWORD(wParam)==SB_PAGELEFT))
{
int cp,np;
@ -2653,7 +2653,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BGHS[SelfIndex].homecol = np;
SetScrollPos(hWnd,SB_HORZ,cp,TRUE);
RefreshGrid(hWnd);
}
}
if(LOWORD(wParam)==SB_THUMBTRACK)
{
int cp,np;
@ -2664,7 +2664,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SetScrollPos(hWnd,SB_HORZ,cp,TRUE);
RefreshGrid(hWnd);
}
break;
@ -2822,7 +2822,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BGHS[SelfIndex].headerrowheight = 20;
BGHS[SelfIndex].ROWSNUMBERED = TRUE;
BGHS[SelfIndex].COLUMNSNUMBERED = TRUE;
BGHS[SelfIndex].DRAWHIGHLIGHT = TRUE;
BGHS[SelfIndex].DRAWHIGHLIGHT = TRUE;
BGHS[SelfIndex].cursorcol = 1;
BGHS[SelfIndex].cursorrow = 1;
@ -2839,7 +2839,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_SETFOCUS:
DrawCursor(hWnd,SelfIndex);
BGHS[SelfIndex].GRIDHASFOCUS = TRUE;
BGHS[SelfIndex].GRIDHASFOCUS = TRUE;
DrawCursor(hWnd,SelfIndex);
SetCurrentCellStatus(hWnd,SelfIndex);
SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
@ -2858,7 +2858,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
RefreshGrid(hWnd);
break;
case WM_KILLFOCUS:
case WM_KILLFOCUS:
DestroyCaret();
DrawCursor(hWnd,SelfIndex);
BGHS[SelfIndex].GRIDHASFOCUS = FALSE;
@ -2868,7 +2868,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SendMessage(GetParent(hWnd),WM_COMMAND,wParam,lParam);
RefreshGrid(hWnd);
break;
case WM_SETFONT:
BGHS[SelfIndex].hfont = (HFONT)wParam;
@ -2968,10 +2968,10 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CREATE:
lpcs = &cs;
lpcs = (LPCREATESTRUCT)lParam;
hInst = lpcs->hInstance;
BG_GridIndex = AddGrid((UINT)GetMenu(hWnd));
if(CountGrids()==1)
@ -3139,7 +3139,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
return ReturnValue;
}
//is it the tail?
SendMessage(lbhWnd,LB_GETTEXT,tail,(LPARAM)tailtext);
@ -3159,9 +3159,9 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
}
//is it the finger?
ReturnValue = LB_ERR;
ReturnValue = LB_ERR;
FOUND=FALSE;
while((!FOUND)&&((tail-head)>1))
{
@ -3175,13 +3175,13 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
FOUND=TRUE;
ReturnValue = finger;
}
if(p<0)
{
//change tail to finger
head = finger;
}
if(p>0)
if(p>0)
{
//change head to finger
tail = finger;
@ -3191,4 +3191,4 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
}
return ReturnValue;
}

View File

@ -230,59 +230,78 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
NppParameters *nppParam = NppParameters::getInstance();
int row = _babygrid.getSelectedRow();
switch(_currentState) {
case STATE_MENU: {
switch(_currentState)
{
case STATE_MENU:
{
//Get CommandShortcut corresponding to row
vector<CommandShortcut> & shortcuts = nppParam->getUserShortcuts();
CommandShortcut csc = shortcuts[row - 1], prevcsc = shortcuts[row - 1];
csc.init(_hInst, _hSelf);
if (csc.doDialog() != -1 && prevcsc != csc) { //shortcut was altered
if (csc.doDialog() != -1 && prevcsc != csc)
{
//shortcut was altered
nppParam->addUserModifiedIndex(row-1);
shortcuts[row - 1] = csc;
_babygrid.setText(row, 2, csc.toString().c_str());
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
nppParam->setShortcutDirty();
}
break; }
case STATE_MACRO: {
break;
}
case STATE_MACRO:
{
//Get MacroShortcut corresponding to row
vector<MacroShortcut> & shortcuts = nppParam->getMacroList();
MacroShortcut msc = shortcuts[row - 1], prevmsc = shortcuts[row - 1];
msc.init(_hInst, _hSelf);
if (msc.doDialog() != -1 && prevmsc != msc) { //shortcut was altered
if (msc.doDialog() != -1 && prevmsc != msc)
{
//shortcut was altered
shortcuts[row - 1] = msc;
_babygrid.setText(row, 1, msc.getName());
_babygrid.setText(row, 2, msc.toString().c_str());
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
nppParam->setShortcutDirty();
}
break; }
case STATE_USER: {
break;
}
case STATE_USER:
{
//Get UserCommand corresponding to row
vector<UserCommand> & shortcuts = nppParam->getUserCommandList();
UserCommand ucmd = shortcuts[row - 1], prevucmd = shortcuts[row - 1];
ucmd.init(_hInst, _hSelf);
prevucmd = ucmd;
if (ucmd.doDialog() != -1 && prevucmd != ucmd) { //shortcut was altered
if (ucmd.doDialog() != -1 && prevucmd != ucmd)
{
//shortcut was altered
shortcuts[row - 1] = ucmd;
_babygrid.setText(row, 1, ucmd.getName());
_babygrid.setText(row, 2, ucmd.toString().c_str());
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
nppParam->setShortcutDirty();
}
break; }
case STATE_PLUGIN: {
break;
}
case STATE_PLUGIN:
{
//Get PluginCmdShortcut corresponding to row
vector<PluginCmdShortcut> & shortcuts = nppParam->getPluginCommandList();
PluginCmdShortcut pcsc = shortcuts[row - 1], prevpcsc = shortcuts[row - 1];
pcsc.init(_hInst, _hSelf);
prevpcsc = pcsc;
if (pcsc.doDialog() != -1 && prevpcsc != pcsc) { //shortcut was altered
if (pcsc.doDialog() != -1 && prevpcsc != pcsc)
{
//shortcut was altered
nppParam->addPluginModifiedIndex(row-1);
shortcuts[row - 1] = pcsc;
_babygrid.setText(row, 2, pcsc.toString().c_str());
@ -297,9 +316,13 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
shortcut._key = pcsc.getKeyCombo()._key;
::SendMessage(_hParent, NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED, cmdID, (LPARAM)&shortcut);
nppParam->setShortcutDirty();
}
break; }
case STATE_SCINTILLA: {
break;
}
case STATE_SCINTILLA:
{
//Get ScintillaKeyMap corresponding to row
vector<ScintillaKeyMap> & shortcuts = nppParam->getScintillaKeyList();
ScintillaKeyMap skm = shortcuts[row - 1], prevskm = shortcuts[row-1];
@ -313,12 +336,14 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
//Notify current Accelerator class to update key
nppParam->getScintillaAccelerator()->updateKeys();
nppParam->setShortcutDirty();
}
break;
}
}
return TRUE;
}
case IDM_BABYGRID_DELETE :
{
NppParameters *nppParam = NppParameters::getInstance();
@ -341,6 +366,7 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
{
return FALSE; //this is bad
}
case STATE_MACRO:
{
vector<MacroShortcut> & theMacros = nppParam->getMacroList();
@ -362,6 +388,7 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
}
break;
}
case STATE_USER:
{
vector<UserCommand> & theUserCmds = nppParam->getUserCommandList();
@ -387,6 +414,7 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
// updateShortcuts() will update all menu item - the menu items will be shifted
nppParam->getAccelerator()->updateShortcuts();
nppParam->setShortcutDirty();
// All menu items are shifted up. So we delete the last item
::RemoveMenu(hMenu, posBase + nbElem, MF_BYPOSITION);

View File

@ -402,6 +402,7 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
{
bool isChecked = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_DOCSWITCH, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_SHOWDOCSWITCHER, 0, isChecked?TRUE:FALSE);
getFocus();
}
return TRUE;
case IDC_CHECK_DOCSWITCH_NOEXTCOLUMN :
@ -1099,23 +1100,25 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
NewDocDefaultSettings & ndds = (NewDocDefaultSettings &)nppGUI.getNewDocDefaultSettings();
switch (Message)
switch (Message)
{
case WM_INITDIALOG :
case WM_INITDIALOG:
{
int ID2Check = 0;
int ID2Check = IDC_RADIO_F_WIN;
switch (ndds._format)
{
case MAC_FORMAT :
case FormatType::windows:
ID2Check = IDC_RADIO_F_WIN;
break;
case FormatType::macos:
ID2Check = IDC_RADIO_F_MAC;
break;
case UNIX_FORMAT :
case FormatType::unix:
ID2Check = IDC_RADIO_F_UNIX;
break;
default : //WIN_FORMAT
ID2Check = IDC_RADIO_F_WIN;
case FormatType::unknown:
assert(false);
break;
}
::SendDlgItemMessage(_hSelf, ID2Check, BM_SETCHECK, BST_CHECKED, 0);
@ -1137,10 +1140,10 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
default : //uni8Bit
ID2Check = IDC_RADIO_ANSI;
}
int selIndex = -1;
generic_string str;
EncodingMapper *em = EncodingMapper::getInstance();
EncodingMapper* em = EncodingMapper::getInstance();
for (size_t i = 0, encodingArraySize = sizeof(encodings)/sizeof(int) ; i < encodingArraySize ; ++i)
{
int cmdID = em->getIndexFromEncoding(encodings[i]);
@ -1164,14 +1167,15 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
ID2Check = IDC_RADIO_OTHERCP;
::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_SETCURSEL, selIndex, 0);
}
::SendDlgItemMessage(_hSelf, ID2Check, BM_SETCHECK, BST_CHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, (ID2Check == IDC_RADIO_UTF8SANSBOM && ndds._openAnsiAsUtf8)?BST_CHECKED:BST_UNCHECKED, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), ID2Check == IDC_RADIO_UTF8SANSBOM);
int index = 0;
for (int i = L_TEXT ; i < pNppParam->L_END ; ++i)
{
generic_string str;
str.clear();
if ((LangType)i != L_USER)
{
int cmdID = pNppParam->langTypeToCommandID((LangType)i);
@ -1198,7 +1202,7 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
}
case WM_COMMAND :
case WM_COMMAND:
switch (wParam)
{
case IDC_RADIO_UCS2BIG:
@ -1250,16 +1254,23 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
}
case IDC_RADIO_F_MAC:
ndds._format = MAC_FORMAT;
{
ndds._format = FormatType::macos;
return TRUE;
}
case IDC_RADIO_F_UNIX:
ndds._format = UNIX_FORMAT;
{
ndds._format = FormatType::unix;
return TRUE;
}
case IDC_RADIO_F_WIN:
ndds._format = WIN_FORMAT;
{
ndds._format = FormatType::windows;
return TRUE;
}
default:
{
if (HIWORD(wParam) == CBN_SELCHANGE)
{
if (LOWORD(wParam) == IDC_COMBO_DEFAULTLANG)
@ -1277,6 +1288,7 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
}
}
return FALSE;
}
}
}
return FALSE;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -28,6 +28,7 @@
#include "TreeView.h"
#include "Parameters.h"
#define CY_ITEMHEIGHT 18
@ -40,14 +41,15 @@ void TreeView::init(HINSTANCE hInst, HWND parent, int treeViewID)
WC_TREEVIEW,
TEXT("Tree View"),
WS_CHILD | WS_BORDER | WS_HSCROLL | WS_TABSTOP | TVS_LINESATROOT | TVS_HASLINES |
TVS_HASBUTTONS | TVS_SHOWSELALWAYS | TVS_EDITLABELS | TVS_INFOTIP,
TVS_HASBUTTONS | TVS_SHOWSELALWAYS | TVS_EDITLABELS | TVS_INFOTIP,
0, 0, 0, 0,
_hParent,
NULL,
_hInst,
_hParent,
NULL,
_hInst,
(LPVOID)0);
TreeView_SetItemHeight(_hSelf, CY_ITEMHEIGHT);
int itemHeight = NppParameters::getInstance()->_dpiManager.scaleY(CY_ITEMHEIGHT);
TreeView_SetItemHeight(_hSelf, itemHeight);
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)this);
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, (LONG_PTR)staticProc));
@ -60,7 +62,7 @@ void TreeView::destroy()
cleanSubEntries(root);
::DestroyWindow(_hSelf);
_hSelf = NULL;
}
}
LRESULT TreeView::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
@ -78,8 +80,8 @@ bool TreeView::setItemParam(HTREEITEM Item2Set, const TCHAR *paramStr)
tvItem.mask = TVIF_PARAM;
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
if (!tvItem.lParam)
if (!tvItem.lParam)
tvItem.lParam = (LPARAM)(new generic_string(paramStr));
else
{
@ -92,21 +94,21 @@ bool TreeView::setItemParam(HTREEITEM Item2Set, const TCHAR *paramStr)
HTREEITEM TreeView::addItem(const TCHAR *itemName, HTREEITEM hParentItem, int iImage, const TCHAR *filePath)
{
TVITEM tvi;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
// Set the item label.
tvi.pszText = (LPTSTR)itemName;
tvi.cchTextMax = MAX_PATH;
tvi.pszText = (LPTSTR)itemName;
tvi.cchTextMax = MAX_PATH;
// Set icon
tvi.iImage = iImage;//isNode?INDEX_CLOSED_NODE:INDEX_LEAF;
tvi.iSelectedImage = iImage;//isNode?INDEX_OPEN_NODE:INDEX_LEAF;
tvi.iImage = iImage;//isNode?INDEX_CLOSED_NODE:INDEX_LEAF;
tvi.iSelectedImage = iImage;//isNode?INDEX_OPEN_NODE:INDEX_LEAF;
// Save the full path of file in the item's application-defined data area.
// Save the full path of file in the item's application-defined data area.
tvi.lParam = (filePath == NULL?0:(LPARAM)(new generic_string(filePath)));
TVINSERTSTRUCT tvInsertStruct;
tvInsertStruct.item = tvi;
tvInsertStruct.item = tvi;
tvInsertStruct.hInsertAfter = (HTREEITEM)TVI_LAST;
tvInsertStruct.hParent = hParentItem;
@ -174,7 +176,7 @@ HTREEITEM TreeView::searchSubItemByName(const TCHAR *itemName, HTREEITEM hParent
hItem = getChildFrom(hParentItem);
else
hItem = getRoot();
for ( ; hItem != NULL; hItem = getNextSibling(hItem))
{
TCHAR textBuffer[MAX_PATH];
@ -184,7 +186,7 @@ HTREEITEM TreeView::searchSubItemByName(const TCHAR *itemName, HTREEITEM hParent
tvItem.cchTextMax = MAX_PATH;
tvItem.mask = TVIF_TEXT;
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
if (lstrcmp(itemName, tvItem.pszText) == 0)
{
return hItem;
@ -292,7 +294,7 @@ bool TreeView::dropItem()
::ImageList_Destroy(_draggedImageList);
::ReleaseCapture();
::ShowCursor(true);
SendMessage(_hSelf,TVM_SELECTITEM,TVGN_CARET,(LPARAM)targetItem);
SendMessage(_hSelf,TVM_SELECTITEM,TVGN_DROPHILITE,0);
@ -333,7 +335,7 @@ bool TreeView::isDescendant(HTREEITEM targetItem, HTREEITEM draggedItem)
HTREEITEM parent = getParent(targetItem);
if (parent == draggedItem)
return true;
return isDescendant(parent, draggedItem);
}
@ -509,7 +511,7 @@ bool TreeView::searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const gene
tvItem.cchTextMax = MAX_PATH;
tvItem.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
if (tvItem.iImage == index2Search)
{
generic_string itemNameUpperCase = stringToUpper(tvItem.pszText);
@ -555,7 +557,7 @@ bool TreeView::retrieveFoldingStateTo(TreeStateNode & treeState2Construct, HTREE
tvItem.cchTextMax = MAX_PATH;
tvItem.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
treeState2Construct._label = textBuffer;
treeState2Construct._isExpanded = (tvItem.state & TVIS_EXPANDED) != 0;
treeState2Construct._isSelected = (tvItem.state & TVIS_SELECTED) != 0;
@ -587,7 +589,7 @@ bool TreeView::restoreFoldingStateFrom(const TreeStateNode & treeState2Compare,
tvItem.cchTextMax = MAX_PATH;
tvItem.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
if (treeState2Compare._label != textBuffer)
return false;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,8 +24,6 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <iostream>
#include <windows.h>
#include "Splitter.h"
@ -38,28 +36,24 @@ bool Splitter::_isVerticalFixedRegistered = false;
#define SPLITTER_SIZE 8
Splitter::Splitter() : Window()
Splitter::Splitter()
{
//hInstance = GetModuleHandle(NULL);
_rect.left = 0; // x axis
_rect.top = 0; // y axis
_rect.left = 0; // x axis
_rect.top = 0; // y axis
_rect.right = 0; // Width of the spliter.
_rect.bottom = 0; // Height of the spliter
_isFixed = false;
}
void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
double iSplitRatio, DWORD dwFlags)
void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize, double iSplitRatio, DWORD dwFlags)
{
if (hPere == NULL)
{
throw std::runtime_error("Splitter::init : Parameter hPere is null");
}
if (iSplitRatio < 0)
{
throw std::runtime_error("Splitter::init : Parameter iSplitRatio shoulds be 0 < ratio < 100");
}
Window::init(hInst, hPere);
_spiltterSize = splitterSize;
@ -67,11 +61,11 @@ void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
WNDCLASSEX wcex;
DWORD dwExStyle = 0L;
DWORD dwStyle = WS_CHILD | WS_VISIBLE;
_hParent = hPere;
_dwFlags = dwFlags;
if (_dwFlags & SV_FIXED)
{
//Fixed spliter
@ -81,49 +75,49 @@ void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
{
if (iSplitRatio >= 100)
{
//cant be 100 % or more
//cant be 100 % or more
throw std::runtime_error("Splitter::init : Parameter iSplitRatio shoulds be 0 < ratio < 100");
}
}
_splitPercent = iSplitRatio;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)staticWndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = _hInst;
wcex.hIcon = NULL;
::GetClientRect(_hParent, &_rect);
if (_dwFlags & SV_HORIZONTAL) //Horizontal spliter
{
_rect.top = (LONG)((_rect.bottom * _splitPercent)/100);
// y axis determined by the split% of the parent windows height
_rect.left = 0;
// x axis is always 0
_rect.bottom = _spiltterSize;
// the height of the spliter
// the width of the splitter remains the same as the width of the parent window.
}
else //Vertical spliter
{
// y axis is 0 always
_rect.left = (LONG)((_rect.right * _splitPercent)/100);
// y axis is 0 always
_rect.left = (LONG)((_rect.right * _splitPercent)/100);
// x axis determined by split% of the parent windows width.
_rect.right = _spiltterSize;
// width of the spliter.
_rect.right = _spiltterSize;
// width of the spliter.
//height of the spliter remains the same as the height of the parent window
}
if (!_isFixed)
{
if ((_dwFlags & SV_ENABLERDBLCLK) || (_dwFlags & SV_ENABLELDBLCLK))
@ -132,7 +126,7 @@ void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
// enable mouse double click messages.
}
}
if (_isFixed)
{
wcex.hCursor = ::LoadCursor(NULL, IDC_ARROW);
@ -157,11 +151,11 @@ void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
wcex.lpszClassName = TEXT("wespliter");
}
}
wcex.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
wcex.lpszMenuName = NULL;
wcex.hIconSm = NULL;
if ((_dwFlags & SV_HORIZONTAL)&&(!_isHorizontalRegistered))
{
RegisterClassEx(&wcex);
@ -183,61 +177,61 @@ void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
_isVerticalFixedRegistered = true;
}
_hSelf = CreateWindowEx(
dwExStyle,
wcex.lpszClassName,
TEXT(""),
dwStyle,
_rect.left,
_rect.top,
_rect.right,
_rect.bottom,
_hParent,
NULL,
_hInst,
(LPVOID)this);
_hSelf = CreateWindowEx(dwExStyle, wcex.lpszClassName,
TEXT(""),
dwStyle,
_rect.left, _rect.top, _rect.right, _rect.bottom,
_hParent, NULL, _hInst, this);
if (!_hSelf)
{
throw std::runtime_error("Splitter::init : CreateWindowEx() function return null");
}
RECT rc;
getClientRect(rc);
//::GetClientRect(_hParent,&rc);
_clickZone2TL.left = rc.left;
_clickZone2TL.top = rc.top;
_clickZone2TL.left = rc.left;
_clickZone2TL.top = rc.top;
int clickZoneWidth = getClickZone(WIDTH);
int clickZoneHeight = getClickZone(HEIGHT);
_clickZone2TL.right = clickZoneWidth;
int clickZoneWidth = getClickZone(WH::width);
int clickZoneHeight = getClickZone(WH::height);
_clickZone2TL.right = clickZoneWidth;
_clickZone2TL.bottom = clickZoneHeight;
_clickZone2BR.left = rc.right - clickZoneWidth;
_clickZone2BR.top = rc.bottom - clickZoneHeight;
_clickZone2BR.right = clickZoneWidth;
_clickZone2BR.left = rc.right - clickZoneWidth;
_clickZone2BR.top = rc.bottom - clickZoneHeight;
_clickZone2BR.right = clickZoneWidth;
_clickZone2BR.bottom = clickZoneHeight;
display();
::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top);
}
// determinated by (_dwFlags & SV_VERTICAL) && _splitterSize
void Splitter::destroy()
{
::DestroyWindow(_hSelf);
}
int Splitter::getClickZone(WH which)
{
// determinated by (_dwFlags & SV_VERTICAL) && _splitterSize
if (_spiltterSize <= 8)
{
return isVertical()?(which==WIDTH?_spiltterSize:HIEGHT_MINIMAL)
:(which==WIDTH?HIEGHT_MINIMAL:_spiltterSize);
return isVertical()
? (which == WH::width ? _spiltterSize : HIEGHT_MINIMAL)
: (which == WH::width ? HIEGHT_MINIMAL : _spiltterSize);
}
else // (_spiltterSize > 8)
{
return isVertical()?(which==WIDTH? 8:15)
:(which==WIDTH?15:8);
return isVertical()
? ((which == WH::width) ? 8 : 15)
: ((which == WH::width) ? 15 : 8);
}
}
LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
@ -260,24 +254,12 @@ LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
}
}
LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
/*
case WM_LBUTTONDBLCLK:
{
::MessageBox(NULL, TEXT(""), TEXT(""), MB_OK);
}
return 0;
case WM_RBUTTONDBLCLK:
{
}
return 0;
*/
case WM_LBUTTONDOWN:
case WM_LBUTTONDOWN:
{
POINT p;
p.x = LOWORD(lParam);
@ -300,14 +282,17 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
::SetCapture(_hSelf);
_isDraged = true;
}
return 0;
}
return 0;
case WM_RBUTTONDOWN :
::SendMessage(_hParent, WM_DOPOPUPMENU, wParam, lParam);
return TRUE;
case WM_RBUTTONDOWN:
{
::SendMessage(_hParent, WM_DOPOPUPMENU, wParam, lParam);
return TRUE;
}
case WM_MOUSEMOVE:
case WM_MOUSEMOVE:
{
POINT p;
p.x = LOWORD(lParam);
@ -378,7 +363,7 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
return 0;
}
case WM_LBUTTONUP:
case WM_LBUTTONUP:
{
if (!_isFixed)
{
@ -386,7 +371,8 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
}
return 0;
}
case WM_CAPTURECHANGED:
case WM_CAPTURECHANGED:
{
if (_isDraged)
{
@ -397,17 +383,23 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
return 0;
}
case WM_PAINT :
drawSplitter();
return 0;
case WM_PAINT:
{
drawSplitter();
return 0;
}
case WM_CLOSE:
destroy();
return 0;
case WM_CLOSE:
{
destroy();
return 0;
}
}
return ::DefWindowProc(_hSelf, uMsg, wParam, lParam);
}
void Splitter::resizeSpliter(RECT *pRect)
{
RECT rect;
@ -416,13 +408,13 @@ void Splitter::resizeSpliter(RECT *pRect)
rect = *pRect;
else
::GetClientRect(_hParent,&rect);
if (_dwFlags & SV_HORIZONTAL)
{
// for a Horizontal spliter the width remains the same
// for a Horizontal spliter the width remains the same
// as the width of the parent window, so get the new width of the parent.
_rect.right = rect.right;
//if resizeing should be done proportionately.
if (_dwFlags & SV_RESIZEWTHPERCNT)
_rect.top = (LONG)((rect.bottom * _splitPercent)/100);
@ -431,26 +423,26 @@ void Splitter::resizeSpliter(RECT *pRect)
}
else
{
// for a (default) Vertical spliter the height remains the same
// for a (default) Vertical spliter the height remains the same
// as the height of the parent window, so get the new height of the parent.
_rect.bottom = rect.bottom;
//if resizeing should be done proportionately.
if (_dwFlags & SV_RESIZEWTHPERCNT)
{
if (_dwFlags & SV_RESIZEWTHPERCNT)
{
_rect.left = (LONG)((rect.right * _splitPercent)/100);
}
else // soit la fenetre gauche soit la fenetre droit qui est fixee
}
else // soit la fenetre gauche soit la fenetre droit qui est fixee
_rect.left = getSplitterFixPosX();
}
::MoveWindow(_hSelf, _rect.left, _rect.top, _rect.right, _rect.bottom, TRUE);
::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top);
RECT rc;
getClientRect(rc);
_clickZone2BR.right = getClickZone(WIDTH);
_clickZone2BR.bottom = getClickZone(HEIGHT);
getClientRect(rc);
_clickZone2BR.right = getClickZone(WH::width);
_clickZone2BR.bottom = getClickZone(WH::height);
_clickZone2BR.left = rc.right - _clickZone2BR.right;
_clickZone2BR.top = rc.bottom - _clickZone2BR.bottom;
@ -460,43 +452,47 @@ void Splitter::resizeSpliter(RECT *pRect)
redraw();
}
void Splitter::gotoTopLeft()
void Splitter::gotoTopLeft()
{
if ((_dwFlags & SV_ENABLELDBLCLK) && (!_isFixed) && (_splitPercent > 1))
{
if (_dwFlags & SV_HORIZONTAL)
_rect.top = 1;
_rect.top = 1;
else
_rect.left = 1;
_rect.left = 1;
_splitPercent = 1;
::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top);
::MoveWindow(_hSelf, _rect.left, _rect.top, _rect.right, _rect.bottom, TRUE);
redraw();
}
}
void Splitter::gotoRightBouuom()
void Splitter::gotoRightBouuom()
{
if ((_dwFlags & SV_ENABLERDBLCLK) && (!_isFixed) && (_splitPercent < 99))
{
RECT rt;
GetClientRect(_hParent,&rt);
if (_dwFlags & SV_HORIZONTAL)
_rect.top = rt.bottom - _spiltterSize;
else
_rect.left = rt.right - _spiltterSize;
_splitPercent = 99;
::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top);
::MoveWindow(_hSelf, _rect.left, _rect.top, _rect.right, _rect.bottom, TRUE);
redraw();
}
}
void Splitter::drawSplitter()
void Splitter::drawSplitter()
{
PAINTSTRUCT ps;
RECT rc, rcToDraw1, rcToDraw2, TLrc, BRrc;
@ -506,25 +502,25 @@ void Splitter::drawSplitter()
if ((_spiltterSize >= 4) && (_dwFlags & SV_RESIZEWTHPERCNT))
{
adjustZoneToDraw(TLrc, TOP_LEFT);
adjustZoneToDraw(BRrc, BOTTOM_RIGHT);
paintArrow(hdc, TLrc, isVertical()?ARROW_LEFT:ARROW_UP);
adjustZoneToDraw(TLrc, ZONE_TYPE::topLeft);
adjustZoneToDraw(BRrc, ZONE_TYPE::bottomRight);
paintArrow(hdc, TLrc, isVertical() ? Arrow::left : Arrow::up);
}
if (isVertical())
{
rcToDraw2.top = (_dwFlags & SV_RESIZEWTHPERCNT)?_clickZone2TL.bottom:0;
rcToDraw2.top = (_dwFlags & SV_RESIZEWTHPERCNT) ? _clickZone2TL.bottom : 0;
rcToDraw2.bottom = rcToDraw2.top + 2;
rcToDraw1.top = rcToDraw2.top + 1;
rcToDraw1.top = rcToDraw2.top + 1;
rcToDraw1.bottom = rcToDraw1.top + 2;
}
else
{
rcToDraw2.top = 1;
rcToDraw2.top = 1;
rcToDraw2.bottom = 3;
rcToDraw1.top = 2;
rcToDraw1.top = 2;
rcToDraw1.bottom = 4;
}
@ -538,10 +534,10 @@ void Splitter::drawSplitter()
{
if (isVertical())
{
rcToDraw2.left = 1;
rcToDraw2.left = 1;
rcToDraw2.right = 3;
rcToDraw1.left = 2;
rcToDraw1.left = 2;
rcToDraw1.right = 4;
}
else
@ -563,6 +559,7 @@ void Splitter::drawSplitter()
rcToDraw1.left += 4;
rcToDraw1.right += 4;
}
rcToDraw2.top += 4;
rcToDraw2.bottom += 4;
rcToDraw1.top += 4;
@ -570,16 +567,18 @@ void Splitter::drawSplitter()
}
if ((_spiltterSize >= 4) && (_dwFlags & SV_RESIZEWTHPERCNT))
paintArrow(hdc, BRrc, isVertical()?ARROW_RIGHT:ARROW_DOWN);
paintArrow(hdc, BRrc, isVertical() ? Arrow::right : Arrow::down);
::EndPaint(_hSelf, &ps);
}
void Splitter::rotate()
{
if (!_isFixed)
{
destroy();
if (_dwFlags & SV_HORIZONTAL)
{
_dwFlags ^= SV_HORIZONTAL;
@ -590,82 +589,101 @@ void Splitter::rotate()
_dwFlags ^= SV_VERTICAL;
_dwFlags |= SV_HORIZONTAL;
}
init(_hInst, _hParent, _spiltterSize, _splitPercent, _dwFlags);
}
}
void Splitter::paintArrow(HDC hdc, const RECT &rect, Arrow arrowDir)
{
RECT rc;
rc.left = rect.left; rc.top = rect.top;
rc.right = rect.right; rc.bottom = rect.bottom;
if (arrowDir == ARROW_LEFT)
{
int x = rc.right;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (x > rc.left) && (y != rc.bottom) ; x--)
switch (arrowDir)
{
case Arrow::left:
{
::MoveToEx(hdc, x, y++, NULL);
::LineTo(hdc, x, rc.bottom--);
int x = rc.right;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (x > rc.left) && (y != rc.bottom) ; --x)
{
::MoveToEx(hdc, x, y++, NULL);
::LineTo(hdc, x, rc.bottom--);
}
break;
}
}
else if (arrowDir == ARROW_RIGHT)
{
int x = rc.left;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (x < rc.right) && (y != rc.bottom) ; ++x)
case Arrow::right:
{
::MoveToEx(hdc, x, y++, NULL);
::LineTo(hdc, x, rc.bottom--);
int x = rc.left;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (x < rc.right) && (y != rc.bottom) ; ++x)
{
::MoveToEx(hdc, x, y++, NULL);
::LineTo(hdc, x, rc.bottom--);
}
break;
}
}
else if (arrowDir == ARROW_UP)
{
int x = rc.left;
int y = rc.bottom;
//::MoveToEx(hdc, x, y, NULL);
for (; (y > rc.top) && (x != rc.right) ; y--)
case Arrow::up:
{
::MoveToEx(hdc, x++, y, NULL);
::LineTo(hdc, rc.right--, y);
int x = rc.left;
int y = rc.bottom;
//::MoveToEx(hdc, x, y, NULL);
for (; (y > rc.top) && (x != rc.right) ; --y)
{
::MoveToEx(hdc, x++, y, NULL);
::LineTo(hdc, rc.right--, y);
}
break;
}
}
else if (arrowDir == ARROW_DOWN)
{
int x = rc.left;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (y < rc.bottom) && (x != rc.right) ; ++y)
case Arrow::down:
{
::MoveToEx(hdc, x++, y, NULL);
::LineTo(hdc, rc.right--, y);
int x = rc.left;
int y = rc.top;
//::MoveToEx(hdc, x, y, NULL);
for (; (y < rc.bottom) && (x != rc.right) ; ++y)
{
::MoveToEx(hdc, x++, y, NULL);
::LineTo(hdc, rc.right--, y);
}
break;
}
}
}
void Splitter::adjustZoneToDraw(RECT & rc2def, ZONE_TYPE whichZone)
void Splitter::adjustZoneToDraw(RECT& rc2def, ZONE_TYPE whichZone)
{
if (_spiltterSize < 4) return;
if (_spiltterSize < 4)
return;
int x0, y0, x1, y1, w, h;
if ((4 <= _spiltterSize) && (_spiltterSize <= 8))
{
w = (isVertical()?4:7);
h = (isVertical()?7:4);
w = (isVertical() ? 4 : 7);
h = (isVertical() ? 7 : 4);
}
else // (_spiltterSize > 8)
{
w = (isVertical()?6:11);
h = (isVertical()?11:6);
w = (isVertical() ? 6 : 11);
h = (isVertical() ? 11 : 6);
}
if (isVertical())
{//w=4 h=7
if (whichZone == TOP_LEFT)
{
// w=4 h=7
if (whichZone == ZONE_TYPE::topLeft)
{
x0 = 0;
y0 = (_clickZone2TL.bottom - h) / 2;
@ -675,12 +693,14 @@ void Splitter::adjustZoneToDraw(RECT & rc2def, ZONE_TYPE whichZone)
x0 = _clickZone2BR.left + _clickZone2BR.right - w;
y0 = (_clickZone2BR.bottom - h) / 2 + _clickZone2BR.top;
}
x1 = x0 + w;
y1 = y0 + h;
}
else // Horizontal
{//w=7 h=4
if (whichZone == TOP_LEFT)
{
//w=7 h=4
if (whichZone == ZONE_TYPE::topLeft)
{
x0 = (_clickZone2TL.right - w) / 2;
y0 = 0;
@ -690,11 +710,14 @@ void Splitter::adjustZoneToDraw(RECT & rc2def, ZONE_TYPE whichZone)
x0 = ((_clickZone2BR.right - w) / 2) + _clickZone2BR.left;
y0 = _clickZone2BR.top + _clickZone2BR.bottom - h;
}
x1 = x0 + w;
y1 = y0 + h;
}
rc2def.left = x0;
rc2def.top = y0;
rc2def.right = x1;
rc2def.bottom = y1;
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,16 +24,11 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef SPLITTER_H
#define SPLITTER_H
#ifndef RESOURCE_H
#pragma once
#include "resource.h"
#endif //RESOURCE_H
#include "Window.h"
#include "Common.h"
#define SV_HORIZONTAL 0x00000001
#define SV_VERTICAL 0x00000002
@ -50,81 +45,90 @@
const int HIEGHT_MINIMAL = 15;
enum Arrow {ARROW_LEFT, ARROW_UP, ARROW_RIGHT, ARROW_DOWN};
typedef bool WH;
const bool WIDTH = true;
const bool HEIGHT = false;
enum class Arrow { left, up, right, down };
typedef bool ZONE_TYPE;
const bool TOP_LEFT = true;
const bool BOTTOM_RIGHT = false;
enum class WH { height, width };
enum SplitterMode {
enum class ZONE_TYPE { bottomRight, topLeft };
enum class SplitterMode: std::uint8_t
{
DYNAMIC, LEFT_FIX, RIGHT_FIX
};
class Splitter : public Window
{
public:
public:
Splitter();
~Splitter(){};
void destroy() {
::DestroyWindow(_hSelf);
};
virtual ~Splitter() = default;
virtual void destroy() override;
void resizeSpliter(RECT *pRect = NULL);
void init(HINSTANCE hInst, HWND hPere, int splitterSize,
double iSplitRatio, DWORD dwFlags);
void init(HINSTANCE hInst, HWND hPere, int splitterSize, double iSplitRatio, DWORD dwFlags);
void rotate();
int getPhisicalSize() const {
int getPhisicalSize() const
{
return _spiltterSize;
};
}
private:
RECT _rect;
double _splitPercent;
int _spiltterSize;
bool _isDraged;
DWORD _dwFlags;
bool _isFixed;
double _splitPercent = 0.;
int _spiltterSize = 0;
bool _isDraged = false;
DWORD _dwFlags = 0;
bool _isFixed = false;
static bool _isHorizontalRegistered;
static bool _isVerticalRegistered;
static bool _isHorizontalFixedRegistered;
static bool _isVerticalFixedRegistered;
static bool _isHorizontalFixedRegistered;
static bool _isVerticalFixedRegistered;
RECT _clickZone2TL, _clickZone2BR;
static LRESULT CALLBACK staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
int getClickZone(WH which);
void adjustZoneToDraw(RECT & rc2def, ZONE_TYPE whichZone);
int getClickZone(WH which);
void adjustZoneToDraw(RECT & rc2def, ZONE_TYPE whichZone);
void drawSplitter();
bool isVertical() const {return (_dwFlags & SV_VERTICAL) != 0;};
void paintArrow(HDC hdc, const RECT &rect, Arrow arrowDir);
void gotoTopLeft();
void gotoRightBouuom();
bool isInLeftTopZone(const POINT &p) const {
return (((p.x >= _clickZone2TL.left) && (p.x <= _clickZone2TL.left + _clickZone2TL.right)) &&
(p.y >= _clickZone2TL.top) && (p.y <= _clickZone2TL.top + _clickZone2TL.bottom));
};
bool isInLeftTopZone(const POINT& p) const
{
return ((p.x >= _clickZone2TL.left)
and (p.x <= _clickZone2TL.left + _clickZone2TL.right)
and (p.y >= _clickZone2TL.top)
and (p.y <= _clickZone2TL.top + _clickZone2TL.bottom));
}
bool isInRightBottomZone(const POINT &p) const {
return (((p.x >= _clickZone2BR.left) &&
(p.x <= _clickZone2BR.left + _clickZone2BR.right)) &&
(p.y >= _clickZone2BR.top) &&
(p.y <= _clickZone2BR.top + _clickZone2BR.bottom));
};
int getSplitterFixPosX() {
bool isInRightBottomZone(const POINT& p) const
{
return ((p.x >= _clickZone2BR.left)
and (p.x <= _clickZone2BR.left + _clickZone2BR.right)
and (p.y >= _clickZone2BR.top)
and (p.y <= _clickZone2BR.top + _clickZone2BR.bottom));
}
int getSplitterFixPosX() const
{
long result = long(::SendMessage(_hParent, WM_GETSPLITTER_X, 0, 0));
return (LOWORD(result) - ((HIWORD(result) == RIGHT_FIX) ? _spiltterSize : 0));
};
return (LOWORD(result) - ((HIWORD(result) == static_cast<std::uint8_t>(SplitterMode::RIGHT_FIX)) ? _spiltterSize : 0));
}
int getSplitterFixPosY() {
int getSplitterFixPosY() const
{
long result = long(::SendMessage(_hParent, WM_GETSPLITTER_Y, 0, 0));
return (LOWORD(result) - ((HIWORD(result) == RIGHT_FIX) ? _spiltterSize : 0));
};
return (LOWORD(result) - ((HIWORD(result) == static_cast<std::uint8_t>(SplitterMode::RIGHT_FIX)) ? _spiltterSize : 0));
}
};
#endif //SPLITTER_H

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,16 +24,18 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <iostream>
#include <windows.h>
#include "SplitterContainer.h"
#include <cassert>
bool SplitterContainer::_isRegistered = false;
void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize,
SplitterMode mode, int ratio, bool isVertical)
void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize, SplitterMode mode, int ratio, bool isVertical)
{
//Window::init(hInst, parent);
_pWin0 = pWin0;
@ -42,9 +44,10 @@ void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize,
_splitterMode = mode;
_ratio = ratio;
_dwSplitterStyle |= isVertical?SV_VERTICAL:SV_HORIZONTAL;
if (_splitterMode != DYNAMIC)
if (_splitterMode != SplitterMode::DYNAMIC)
{
_dwSplitterStyle |= SV_FIXED;
_dwSplitterStyle |= SV_FIXED;
_dwSplitterStyle &= ~SV_RESIZEWTHPERCNT;
}
if (!_isRegistered)
@ -61,49 +64,82 @@ void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize,
// hbrBackground must be NULL,
// otherwise this window will hide some parts of 2 windows
splitterContainerClass.hbrBackground = NULL;
splitterContainerClass.hbrBackground = NULL;
splitterContainerClass.lpszMenuName = NULL;
splitterContainerClass.lpszClassName = SPC_CLASS_NAME;
if (!::RegisterClass(&splitterContainerClass))
{
throw std::runtime_error(" SplitterContainer::create : RegisterClass() function failed");
}
_isRegistered = true;
}
_hSelf = ::CreateWindowEx(
0,
SPC_CLASS_NAME,
TEXT("a koi sert?"),
WS_CHILD | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
_hParent,
NULL,
_hInst,
(LPVOID)this);
0, SPC_CLASS_NAME, TEXT("a koi sert?"),
WS_CHILD | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
_hParent, NULL, _hInst, this);
if (!_hSelf)
{
throw std::runtime_error(" SplitterContainer::create : CreateWindowEx() function return null");
}
}
void SplitterContainer::rotateTo(DIRECTION direction)
void SplitterContainer::destroy()
{
if (_hPopupMenu)
::DestroyMenu(_hPopupMenu);
_splitter.destroy();
::DestroyWindow(_hSelf);
}
void SplitterContainer::reSizeTo(RECT & rc)
{
_x = rc.left;
_y = rc.top;
::MoveWindow(_hSelf, _x, _y, rc.right, rc.bottom, FALSE);
_splitter.resizeSpliter();
}
void SplitterContainer::display(bool toShow) const
{
Window::display(toShow);
assert(_pWin0 != nullptr);
assert(_pWin1 != nullptr);
_pWin0->display(toShow);
_pWin1->display(toShow);
_splitter.display(toShow);
}
void SplitterContainer::redraw() const
{
assert(_pWin0 != nullptr);
assert(_pWin1 != nullptr);
_pWin0->redraw(true);
_pWin1->redraw(true);
}
void SplitterContainer::rotateTo(DIRECTION direction)
{
bool doSwitchWindow = false;
if (_dwSplitterStyle & SV_VERTICAL)
{
_dwSplitterStyle ^= SV_VERTICAL;
_dwSplitterStyle |= SV_HORIZONTAL;
doSwitchWindow = (direction == LEFT);
doSwitchWindow = (direction == DIRECTION::LEFT);
}
else
{
_dwSplitterStyle ^= SV_HORIZONTAL;
_dwSplitterStyle |= SV_VERTICAL;
doSwitchWindow = (direction == RIGHT);
doSwitchWindow = (direction == DIRECTION::RIGHT);
}
if (doSwitchWindow)
{
@ -119,43 +155,55 @@ LRESULT CALLBACK SplitterContainer::staticWinProc(HWND hwnd, UINT message, WPARA
{
SplitterContainer *pSplitterContainer = NULL;
switch (message)
{
case WM_NCCREATE :
{
case WM_NCCREATE:
{
pSplitterContainer = (SplitterContainer *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pSplitterContainer->_hSelf = hwnd;
::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pSplitterContainer);
return TRUE;
}
default :
default:
{
pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (!pSplitterContainer)
return ::DefWindowProc(hwnd, message, wParam, lParam);
return pSplitterContainer->runProc(message, wParam, lParam);
}
}
}
LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE :
case WM_CREATE:
{
_splitter.init(_hInst, _hSelf, _splitterSize, _ratio, _dwSplitterStyle);
return TRUE;
case WM_COMMAND :
}
case WM_COMMAND:
{
switch (LOWORD(wParam))
switch (LOWORD(wParam))
{
case ROTATION_A_GAUCHE:
rotateTo(LEFT);
return TRUE;
{
rotateTo(DIRECTION::LEFT);
break;
}
case ROTATION_A_DROITE:
rotateTo(RIGHT);
return TRUE;
{
rotateTo(DIRECTION::RIGHT);
break;
}
}
return TRUE;
}
case WM_RESIZE_CONTAINER :
case WM_RESIZE_CONTAINER:
{
RECT rc0, rc1;
getClientRect(rc0);
@ -179,7 +227,7 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (lParam != 0)
{
rc0.bottom = int(lParam);
rc0.bottom = int(lParam);
rc1.top = int(lParam) + _y + _splitter.getPhisicalSize();
rc1.bottom = rc1.bottom - rc1.top + _y;
@ -191,80 +239,87 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
::InvalidateRect(_splitter.getHSelf(), NULL, TRUE);
return TRUE;
}
case WM_DOPOPUPMENU :
case WM_DOPOPUPMENU:
{
if ((_splitterMode != LEFT_FIX) && (_splitterMode != RIGHT_FIX) )
if ((_splitterMode != SplitterMode::LEFT_FIX) && (_splitterMode != SplitterMode::RIGHT_FIX) )
{
POINT p;
::GetCursorPos(&p);
if (!_hPopupMenu)
{
POINT p;
::GetCursorPos(&p);
_hPopupMenu = ::CreatePopupMenu();
::InsertMenu(_hPopupMenu, 1, MF_BYPOSITION, ROTATION_A_GAUCHE, TEXT("Rotate to left"));
::InsertMenu(_hPopupMenu, 0, MF_BYPOSITION, ROTATION_A_DROITE, TEXT("Rotate to right"));
}
::TrackPopupMenu(_hPopupMenu, TPM_LEFTALIGN, p.x, p.y, 0, _hSelf, NULL);
}
return TRUE;
}
case WM_GETSPLITTER_X :
{
if (_splitterMode == LEFT_FIX)
return MAKELONG(_pWin0->getWidth(), LEFT_FIX);
else if (_splitterMode == RIGHT_FIX)
{
int x = getWidth()-_pWin1->getWidth();
if (x < 0)
x = 0;
return MAKELONG(x, RIGHT_FIX);
}
else
return MAKELONG(0, DYNAMIC);
}
case WM_GETSPLITTER_X:
{
switch (_splitterMode)
{
case SplitterMode::LEFT_FIX:
{
return MAKELONG(_pWin0->getWidth(), static_cast<std::uint8_t>(SplitterMode::LEFT_FIX));
}
case WM_GETSPLITTER_Y :
{
if (_splitterMode == LEFT_FIX)
return MAKELONG(_pWin0->getHeight(), LEFT_FIX);
else if (_splitterMode == RIGHT_FIX)
{
int y = getHeight()-_pWin1->getHeight();
if (y < 0)
y = 0;
return MAKELONG(y, RIGHT_FIX);
}
else
return MAKELONG(0, DYNAMIC);
}
case SplitterMode::RIGHT_FIX:
{
int x = getWidth()-_pWin1->getWidth();
if (x < 0)
x = 0;
return MAKELONG(x, static_cast<std::uint8_t>(SplitterMode::RIGHT_FIX));
}
default:
break;
}
return MAKELONG(0, static_cast<std::uint8_t>(SplitterMode::DYNAMIC));
}
case WM_GETSPLITTER_Y:
{
switch (_splitterMode)
{
case SplitterMode::LEFT_FIX:
{
return MAKELONG(_pWin0->getHeight(), static_cast<std::uint8_t>(SplitterMode::LEFT_FIX));
}
case SplitterMode::RIGHT_FIX:
{
int y = getHeight()-_pWin1->getHeight();
if (y < 0)
y = 0;
return MAKELONG(y, static_cast<std::uint8_t>(SplitterMode::RIGHT_FIX));
}
default:
break;
}
return MAKELONG(0, static_cast<std::uint8_t>(SplitterMode::DYNAMIC));
}
case WM_LBUTTONDBLCLK:
{
{
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(_splitter.getHSelf(), &pt);
Window* targetWindow;
if(this->isVertical())
targetWindow = pt.x < 0?_pWin0:_pWin1;
else
targetWindow = pt.y < 0?_pWin0:_pWin1;
HWND parent = ::GetParent(getHSelf());
Window* targetWindow = (this->isVertical())
? (pt.x < 0 ? _pWin0 : _pWin1)
: (pt.y < 0 ? _pWin0 : _pWin1);
::SendMessage(parent, NPPM_INTERNAL_SWITCHVIEWFROMHWND, 0, (LPARAM)targetWindow->getHSelf());
::SendMessage(parent, WM_COMMAND, IDM_FILE_NEW, 0);
return TRUE;
}
default :
default:
return ::DefWindowProc(_hSelf, message, wParam, lParam);
}
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,94 +24,74 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef SPLITTER_CONTAINER_H
#define SPLITTER_CONTAINER_H
#ifndef SPLITTER_H
#pragma once
#include "Splitter.h"
#endif //SPLITTER_H
#ifndef MENUCMDID_H
#include "menuCmdID.h"
#endif //MENUCMDID_H
#define SPC_CLASS_NAME TEXT("splitterContainer")
#define ROTATION_A_GAUCHE 2000
#define ROTATION_A_DROITE 2001
typedef bool DIRECTION;
const bool LEFT = true;
const bool RIGHT = false;
enum class DIRECTION
{
RIGHT,
LEFT
};
class SplitterContainer : public Window
{
public :
SplitterContainer(): Window(), _x(0), _y(0), _hPopupMenu(NULL),
_dwSplitterStyle(SV_ENABLERDBLCLK | SV_ENABLELDBLCLK | SV_RESIZEWTHPERCNT){
};
~SplitterContainer(){};
virtual ~SplitterContainer() = default;
void create(Window *pWin0, Window *pWin1, int splitterSize = 4,
SplitterMode mode = DYNAMIC, int ratio = 50, bool _isVertical = true);
SplitterMode mode = SplitterMode::DYNAMIC, int ratio = 50, bool _isVertical = true);
void destroy() {
if (_hPopupMenu)
::DestroyMenu(_hPopupMenu);
_splitter.destroy();
::DestroyWindow(_hSelf);
};
void reSizeTo(RECT & rc) {
_x = rc.left;
_y = rc.top;
::MoveWindow(_hSelf, _x, _y, rc.right, rc.bottom, FALSE);
_splitter.resizeSpliter();
};
virtual void display(bool toShow = true) const {
Window::display(toShow);
_pWin0->display(toShow);
_pWin1->display(toShow);
_splitter.display(toShow);
};
virtual void redraw() const {
_pWin0->redraw(true);
_pWin1->redraw(true);
};
void destroy();
void setWin0(Window *pWin) {
_pWin0 = pWin;
void reSizeTo(RECT & rc);
};
virtual void display(bool toShow = true) const;
void setWin1(Window *pWin) {
_pWin1 = pWin;
};
virtual void redraw() const;
bool isVertical() const {
void setWin0(Window* pWin)
{
_pWin0 = pWin;
}
void setWin1(Window* pWin)
{
_pWin1 = pWin;
}
bool isVertical() const
{
return ((_dwSplitterStyle & SV_VERTICAL) != 0);
};
}
private :
Window *_pWin0; // left or top window
Window *_pWin1; // right or bottom window
Window* _pWin0 = nullptr; // left or top window
Window* _pWin1 = nullptr; // right or bottom window
Splitter _splitter;
int _splitterSize;
int _ratio;
int _x, _y;
HMENU _hPopupMenu;
DWORD _dwSplitterStyle;
int _splitterSize = 0;
int _ratio = 0;
int _x = 0;
int _y = 0;
HMENU _hPopupMenu = NULL;
DWORD _dwSplitterStyle = (SV_ENABLERDBLCLK | SV_ENABLELDBLCLK | SV_RESIZEWTHPERCNT);
SplitterMode _splitterMode;
SplitterMode _splitterMode = SplitterMode::DYNAMIC;
static bool _isRegistered;
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam);
void rotateTo(DIRECTION direction);
};
#endif //SPLITTER_CONTAINER_H

View File

@ -250,18 +250,20 @@ INT_PTR CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
theUserCmds.push_back(uc);
::InsertMenu(hRunMenu, posBase + nbCmd, MF_BYPOSITION, cmdID, uc.toMenuItemString().c_str());
NppParameters* nppParams = NppParameters::getInstance();
if (nbCmd == 0)
{
// Insert the separator and modify/delete command
::InsertMenu(hRunMenu, posBase + nbCmd + 1, MF_BYPOSITION, (unsigned int)-1, 0);
NativeLangSpeaker *pNativeLangSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
NativeLangSpeaker *pNativeLangSpeaker = nppParams->getNativeLangSpeaker();
generic_string nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO);
if (nativeLangShortcutMapperMacro == TEXT(""))
nativeLangShortcutMapperMacro = TEXT("Modify Shortcut/Delete Command...");
::InsertMenu(hRunMenu, posBase + nbCmd + 2, MF_BYCOMMAND, IDM_SETTING_SHORTCUT_MAPPER_RUN, nativeLangShortcutMapperMacro.c_str());
}
(NppParameters::getInstance())->getAccelerator()->updateShortcuts();
nppParams->getAccelerator()->updateShortcuts();
nppParams->setShortcutDirty();
}
return TRUE;
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -29,14 +29,51 @@
#include <windows.h>
#include "StaticDialog.h"
StaticDialog::~StaticDialog()
{
if (isCreated())
{
// Prevent run_dlgProc from doing anything, since its virtual
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR) NULL);
destroy();
}
}
void StaticDialog::destroy()
{
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)_hSelf);
::DestroyWindow(_hSelf);
}
POINT StaticDialog::getTopPoint(HWND hwnd, bool isLeft) const
{
RECT rc;
::GetWindowRect(hwnd, &rc);
POINT p;
if (isLeft)
p.x = rc.left;
else
p.x = rc.right;
p.y = rc.top;
::ScreenToClient(_hSelf, &p);
return p;
}
void StaticDialog::goToCenter()
{
RECT rc;
::GetClientRect(_hParent, &rc);
POINT center;
center.x = rc.left + (rc.right - rc.left)/2;
center.y = rc.top + (rc.bottom - rc.top)/2;
::ClientToScreen(_hParent, &center);
RECT rc;
::GetClientRect(_hParent, &rc);
POINT center;
center.x = rc.left + (rc.right - rc.left)/2;
center.y = rc.top + (rc.bottom - rc.top)/2;
::ClientToScreen(_hParent, &center);
int x = center.x - (_rc.right - _rc.left)/2;
int y = center.y - (_rc.bottom - _rc.top)/2;
@ -45,9 +82,10 @@ void StaticDialog::goToCenter()
}
void StaticDialog::display(bool toShow) const
void StaticDialog::display(bool toShow) const
{
if (toShow) {
if (toShow)
{
// If the user has switched from a dual monitor to a single monitor since we last
// displayed the dialog, then ensure that it's still visible on the single monitor.
RECT workAreaRect = {0};
@ -57,6 +95,7 @@ void StaticDialog::display(bool toShow) const
int newLeft = rc.left;
int newTop = rc.top;
int margin = ::GetSystemMetrics(SM_CYSMCAPTION);
if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN)-margin)
newLeft -= rc.right - workAreaRect.right;
if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN)+margin)
@ -96,7 +135,7 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat
*ppMyDlgTemplate = (DLGTEMPLATE *)::GlobalLock(hMyDlgTemplate);
::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg);
DLGTEMPLATEEX *pMyDlgTemplateEx = (DLGTEMPLATEEX *)*ppMyDlgTemplate;
if (pMyDlgTemplateEx->signature == 0xFFFF)
pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL;
@ -131,22 +170,23 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent)
::SendMessage(msgDestParent?_hParent:(::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, (WPARAM)_hSelf);
}
INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
switch (message)
{
case WM_INITDIALOG :
case WM_INITDIALOG:
{
StaticDialog *pStaticDlg = (StaticDialog *)(lParam);
pStaticDlg->_hSelf = hwnd;
::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
::GetWindowRect(hwnd, &(pStaticDlg->_rc));
pStaticDlg->run_dlgProc(message, wParam, lParam);
pStaticDlg->run_dlgProc(message, wParam, lParam);
return TRUE;
}
default :
default:
{
StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
if (!pStaticDlg)
@ -158,34 +198,39 @@ INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, L
void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point)
{
RECT rc, rc2;
::GetWindowRect(handle, &rc);
RECT rc, rc2;
::GetWindowRect(handle, &rc);
point.x = rc.left;
point.y = rc.top;
point.x = rc.left;
point.y = rc.top;
switch (pos)
{
case ALIGNPOS_LEFT :
::GetWindowRect(handle2Align, &rc2);
point.x -= rc2.right - rc2.left;
break;
switch (pos)
{
case PosAlign::left:
{
::GetWindowRect(handle2Align, &rc2);
point.x -= rc2.right - rc2.left;
break;
}
case PosAlign::right:
{
::GetWindowRect(handle, &rc2);
point.x += rc2.right - rc2.left;
break;
}
case PosAlign::top:
{
::GetWindowRect(handle2Align, &rc2);
point.y -= rc2.bottom - rc2.top;
break;
}
case PosAlign::bottom:
{
::GetWindowRect(handle, &rc2);
point.y += rc2.bottom - rc2.top;
break;
}
}
case ALIGNPOS_RIGHT :
::GetWindowRect(handle, &rc2);
point.x += rc2.right - rc2.left;
break;
case ALIGNPOS_TOP :
::GetWindowRect(handle2Align, &rc2);
point.y -= rc2.bottom - rc2.top;
break;
default : //ALIGNPOS_BOTTOM
::GetWindowRect(handle, &rc2);
point.y += rc2.bottom - rc2.top;
break;
}
::ScreenToClient(_hSelf, &point);
::ScreenToClient(_hSelf, &point);
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,81 +24,64 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef STATIC_DIALOG_H
#define STATIC_DIALOG_H
#pragma once
#include "Notepad_plus_msgs.h"
#include "Window.h"
typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD);
enum PosAlign{ALIGNPOS_LEFT, ALIGNPOS_RIGHT, ALIGNPOS_TOP, ALIGNPOS_BOTTOM};
enum class PosAlign { left, right, top, bottom };
struct DLGTEMPLATEEX {
struct DLGTEMPLATEEX
{
WORD dlgVer;
WORD signature;
DWORD helpID;
DWORD exStyle;
DWORD style;
DWORD style;
WORD cDlgItems;
short x;
short y;
short y;
short cx;
short cy;
// The structure has more fields but are variable length
} ;
};
class StaticDialog : public Window
{
public :
StaticDialog() : Window() {};
~StaticDialog(){
if (isCreated()) {
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)NULL); //Prevent run_dlgProc from doing anything, since its virtual
destroy();
}
};
virtual ~StaticDialog();
virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true);
virtual bool isCreated() const {
virtual bool isCreated() const
{
return (_hSelf != NULL);
};
}
void goToCenter();
void display(bool toShow = true) const;
POINT getTopPoint(HWND hwnd, bool isLeft = true) const {
RECT rc;
::GetWindowRect(hwnd, &rc);
POINT p;
if (isLeft)
p.x = rc.left;
else
p.x = rc.right;
p.y = rc.top;
::ScreenToClient(_hSelf, &p);
return p;
};
POINT getTopPoint(HWND hwnd, bool isLeft = true) const;
bool isCheckedOrNot(int checkControlID) const {
bool isCheckedOrNot(int checkControlID) const
{
return (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, checkControlID), BM_GETCHECK, 0, 0));
};
}
void destroy() {
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)_hSelf);
::DestroyWindow(_hSelf);
};
virtual void destroy() override;
protected :
protected:
RECT _rc;
static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0;
void alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point);
HGLOBAL makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate);
};
#endif //STATIC_DIALOG_H
};

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -29,74 +29,137 @@
#include <windows.h>
#include <commctrl.h>
#include "StatusBar.h"
#include <algorithm>
#include <cassert>
//#define IDC_STATUSBAR 789
const int defaultPartWidth = 5;
enum
{
defaultPartWidth = 5,
};
StatusBar::~StatusBar()
{
if (_lpParts != nullptr)
delete[] _lpParts;
}
void StatusBar::init(HINSTANCE /*hInst*/, HWND /*hPere*/)
{
assert(false and "should never be called");
}
void StatusBar::init(HINSTANCE hInst, HWND hPere, int nbParts)
{
Window::init(hInst, hPere);
InitCommonControls();
_hSelf = //CreateStatusWindow(WS_CHILD | WS_CLIPSIBLINGS, NULL, _hParent, IDC_STATUSBAR);
::CreateWindowEx(
0,
STATUSCLASSNAME,
TEXT(""),
WS_CHILD | SBARS_SIZEGRIP ,
0, 0, 0, 0,
_hParent,
NULL,
_hInst,
0);
// _hSelf = CreateStatusWindow(WS_CHILD | WS_CLIPSIBLINGS, NULL, _hParent, IDC_STATUSBAR);
_hSelf = ::CreateWindowEx(
0,
STATUSCLASSNAME,
TEXT(""),
WS_CHILD | SBARS_SIZEGRIP ,
0, 0, 0, 0,
_hParent, nullptr, _hInst, 0);
if (!_hSelf)
{
throw std::runtime_error("StatusBar::init : CreateWindowEx() function return null");
}
_nbParts = nbParts;
_partWidthArray = new int[_nbParts];
// Set the default width
for (int i = 0 ; i < _nbParts ; ++i)
_partWidthArray[i] = defaultPartWidth;
_partWidthArray.clear();
if (nbParts > 0)
_partWidthArray.resize(nbParts, (int) defaultPartWidth);
// Allocate an array for holding the right edge coordinates.
_hloc = ::LocalAlloc(LHND, sizeof(int) * _nbParts);
_lpParts = (LPINT)::LocalLock(_hloc);
if (_partWidthArray.size())
_lpParts = new int[_partWidthArray.size()];
RECT rc;
::GetClientRect(_hParent, &rc);
adjustParts(rc.right);
}
bool StatusBar::setPartWidth(int whichPart, int width)
{
if ((size_t) whichPart < _partWidthArray.size())
{
_partWidthArray[whichPart] = width;
return true;
}
assert(false and "invalid status bar index");
return false;
}
void StatusBar::destroy()
{
::DestroyWindow(_hSelf);
}
void StatusBar::reSizeTo(const RECT& rc)
{
::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE);
adjustParts(rc.right);
redraw();
}
int StatusBar::getHeight() const
{
return (FALSE != ::IsWindowVisible(_hSelf)) ? Window::getHeight() : 0;
}
void StatusBar::adjustParts(int clientWidth)
{
// Calculate the right edge coordinate for each part, and
// copy the coordinates to the array.
int nWidth = clientWidth - 20;
for (int i = _nbParts - 1 ; i >= 0 ; i--)
{
_lpParts[i] = nWidth;
nWidth -= _partWidthArray[i];
}
int nWidth = std::max<int>(clientWidth - 20, 0);
for (int i = (int)_partWidthArray.size() - 1; i >= 0; i--)
{
_lpParts[i] = nWidth;
nWidth -= _partWidthArray[i];
}
// Tell the status bar to create the window parts.
::SendMessage(_hSelf, SB_SETPARTS, (WPARAM)_nbParts, (LPARAM)_lpParts);
::SendMessage(_hSelf, SB_SETPARTS, (WPARAM)_partWidthArray.size(), (LPARAM)_lpParts);
}
bool StatusBar::setText(const TCHAR *str, int whichPart)
bool StatusBar::setText(const TCHAR* str, int whichPart)
{
if (whichPart > _nbParts)
return false;
_lastSetText = str;
return (::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()) == TRUE);
if ((size_t) whichPart < _partWidthArray.size())
{
if (str != nullptr)
_lastSetText = str;
else
_lastSetText.clear();
return (TRUE == ::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()));
}
assert(false and "invalid status bar index");
return false;
}
bool StatusBar::setOwnerDrawText(const TCHAR *str)
bool StatusBar::setOwnerDrawText(const TCHAR* str)
{
_lastSetText = str;
if (str != nullptr)
_lastSetText = str;
else
_lastSetText.clear();
return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE);
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,10 +24,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef STATUS_BAR_H
#define STATUS_BAR_H
#pragma once
#ifndef _WIN32_IE
#define _WIN32_IE 0x0600
@ -35,58 +32,34 @@
#include "Window.h"
#include "Common.h"
#include <vector>
class StatusBar : public Window
class StatusBar final : public Window
{
public :
StatusBar() : Window(), _partWidthArray(NULL), _hloc(NULL), _lpParts(NULL) {};
virtual ~StatusBar(){
if (_hloc)
{
::LocalUnlock(_hloc);
::LocalFree(_hloc);
}
if (_partWidthArray)
delete [] _partWidthArray;
};
public:
virtual ~StatusBar();
virtual void init(HINSTANCE hInst, HWND hPere, int nbParts);
void init(HINSTANCE hInst, HWND hPere, int nbParts);
bool setPartWidth(int whichPart, int width) {
if (whichPart >= _nbParts)
return false;
bool setPartWidth(int whichPart, int width);
_partWidthArray[whichPart] = width;
return true;
};
virtual void destroy() {
::DestroyWindow(_hSelf);
};
virtual void destroy() override;
virtual void reSizeTo(const RECT& rc);
virtual void reSizeTo(RECT & rc) {
::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE);
adjustParts(rc.right);
redraw();
};
int getHeight() const;
int getHeight() const {
if (!::IsWindowVisible(_hSelf))
return 0;
return Window::getHeight();
};
bool setText(const TCHAR *str, int whichPart);
bool setOwnerDrawText(const TCHAR *str);
bool setText(const TCHAR* str, int whichPart);
bool setOwnerDrawText(const TCHAR* str);
void adjustParts(int clientWidth);
private :
int _nbParts;
int *_partWidthArray;
HLOCAL _hloc;
LPINT _lpParts;
private:
virtual void init(HINSTANCE hInst, HWND hPere) override;
private:
std::vector<int> _partWidthArray;
int *_lpParts = nullptr;
generic_string _lastSetText;
};
#endif // STATUS_BAR_H
};

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -37,7 +37,8 @@
#include "window.h"
#include "Common.h"
struct DlgInfo {
struct DlgInfo
{
Window *_dlg;
generic_string _name;
generic_string _internalName;
@ -47,22 +48,26 @@ struct DlgInfo {
typedef std::vector<DlgInfo> WindowVector;
class ControlsTab : public TabBar
class ControlsTab final : public TabBar
{
public :
ControlsTab() : TabBar(), _pWinVector(NULL), _current(0), _isVertical(false) {};
~ControlsTab(){};
ControlsTab() = default;
virtual ~ControlsTab() = default;
virtual void init(HINSTANCE hInst, HWND hwnd, bool isVertical = false, bool isTraditional = false, bool isMultiLine = false) {
virtual void init(HINSTANCE hInst, HWND hwnd, bool isVertical = false, bool isTraditional = false, bool isMultiLine = false)
{
_isVertical = isVertical;
TabBar::init(hInst, hwnd, false, isTraditional, isMultiLine);
};
}
void createTabs(WindowVector & winVector);
void destroy() {
void destroy()
{
TabBar::destroy();
};
}
virtual void reSizeTo(RECT & rc);
void activateWindowAt(int index);
@ -74,10 +79,10 @@ public :
void renameTab(int index, const TCHAR *newName);
bool renameTab(const TCHAR *internalName, const TCHAR *newName);
private :
WindowVector *_pWinVector;
int _current;
bool _isVertical;
private:
WindowVector *_pWinVector = nullptr;
int _current = 0;
bool _isVertical = false;
};

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -59,7 +59,7 @@ void TabBar::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTraditio
int vertical = isVertical?(TCS_VERTICAL | TCS_MULTILINE | TCS_RIGHTJUSTIFY):0;
_isTraditional = isTraditional;
_isVertical = isVertical;
_isMultiLine = isMultiLine;
_isMultiLine = isMultiLine;
INITCOMMONCONTROLSEX icce;
icce.dwSize = sizeof(icce);
@ -87,6 +87,7 @@ void TabBar::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTraditio
}
}
void TabBar::destroy()
{
if (_hFont)
@ -105,34 +106,37 @@ void TabBar::destroy()
_hSelf = NULL;
}
int TabBar::insertAtEnd(const TCHAR *subTabName)
{
TCITEM tie;
TCITEM tie;
tie.mask = TCIF_TEXT | TCIF_IMAGE;
int index = -1;
if (_hasImgLst)
index = 0;
tie.iImage = index;
tie.pszText = (TCHAR *)subTabName;
tie.iImage = index;
tie.pszText = (TCHAR *)subTabName;
return int(::SendMessage(_hSelf, TCM_INSERTITEM, _nbItem++, reinterpret_cast<LPARAM>(&tie)));
}
void TabBar::getCurrentTitle(TCHAR *title, int titleLen)
{
TCITEM tci;
tci.mask = TCIF_TEXT;
tci.pszText = title;
tci.pszText = title;
tci.cchTextMax = titleLen-1;
::SendMessage(_hSelf, TCM_GETITEM, getCurrentTabIndex(), reinterpret_cast<LPARAM>(&tci));
}
void TabBar::setFont(TCHAR *fontName, size_t fontSize)
{
if (_hFont)
::DeleteObject(_hFont);
_hFont = ::CreateFont( fontSize, 0,
_hFont = ::CreateFont( fontSize, 0,
(_isVertical) ? 900:0,
(_isVertical) ? 900:0,
FW_NORMAL,
@ -143,12 +147,12 @@ void TabBar::setFont(TCHAR *fontName, size_t fontSize)
::SendMessage(_hSelf, WM_SETFONT, reinterpret_cast<WPARAM>(_hFont), 0);
}
void TabBar::activateAt(int index) const
void TabBar::activateAt(int index) const
{
if (getCurrentTabIndex() != index)
{
if (getCurrentTabIndex() != index)
::SendMessage(_hSelf, TCM_SETCURSEL, index, 0);
}
TBHDR nmhdr;
nmhdr.hdr.hwndFrom = _hSelf;
nmhdr.hdr.code = TCN_SELCHANGE;
@ -156,7 +160,8 @@ void TabBar::activateAt(int index) const
nmhdr.tabOrigin = index;
}
void TabBar::deletItemAt(size_t index)
void TabBar::deletItemAt(size_t index)
{
if ((index == _nbItem-1))
{
@ -167,7 +172,7 @@ void TabBar::deletItemAt(size_t index)
RECT itemRect;
::SendMessage(_hSelf, TCM_GETITEMRECT, (WPARAM)index, (LPARAM)&itemRect);
if (itemRect.left < 5) //if last visible tab, scroll left once (no more than 5px away should be safe, usually 2px depending on the drawing)
{
{
//To scroll the tab control to the left, use the WM_HSCROLL notification
//Doesn't really seem to be documented anywhere, but the values do match the message parameters
//The up/down control really is just some sort of scrollbar
@ -184,6 +189,14 @@ void TabBar::deletItemAt(size_t index)
_nbItem--;
}
void TabBar::setImageList(HIMAGELIST himl)
{
_hasImgLst = true;
::SendMessage(_hSelf, TCM_SETIMAGELIST, 0, (LPARAM)himl);
}
void TabBar::reSizeTo(RECT & rc2Ajust)
{
RECT RowRect;
@ -195,10 +208,10 @@ void TabBar::reSizeTo(RECT & rc2Ajust)
display(rc2Ajust.right > 10);
RECT rc = rc2Ajust;
Window::reSizeTo(rc);
// Do our own calculations because TabCtrl_AdjustRect doesn't work
// on vertical or multi-lined tab controls
// on vertical or multi-lined tab controls
RowCount = TabCtrl_GetRowCount(_hSelf);
TabCtrl_GetItemRect(_hSelf, 0, &RowRect);
if (_isTraditional)
@ -206,12 +219,12 @@ void TabBar::reSizeTo(RECT & rc2Ajust)
TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust);
}
else if (_isVertical)
{
{
TabsLength = RowCount * (RowRect.right - RowRect.left);
TabsLength += GetSystemMetrics(SM_CXEDGE);
rc2Ajust.left += TabsLength;
rc2Ajust.right -= TabsLength;
rc2Ajust.right -= TabsLength;
}
else
{
@ -223,21 +236,22 @@ void TabBar::reSizeTo(RECT & rc2Ajust)
}
}
void TabBarPlus::destroy()
{
TabBar::destroy();
::DestroyWindow(_tooltips);
_tooltips = NULL;
}
void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTraditional, bool isMultiLine)
{
Window::init(hInst, parent);
int vertical = isVertical?(TCS_VERTICAL | TCS_MULTILINE | TCS_RIGHTJUSTIFY):0;
_isTraditional = isTraditional;
_isVertical = isVertical;
_isMultiLine = isMultiLine;
_isMultiLine = isMultiLine;
INITCOMMONCONTROLSEX icce;
icce.dwSize = sizeof(icce);
@ -289,7 +303,7 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
_hwndArray[_nbCtrl] = _hSelf;
_ctrlID = _nbCtrl;
}
else
else
{
int i = 0;
bool found = false;
@ -314,25 +328,26 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
LOGFONT LogFont;
_hFont = (HFONT)::SendMessage(_hSelf, WM_GETFONT, 0, 0);
if (_hFont == NULL)
_hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
if (_hLargeFont == NULL)
_hLargeFont = (HFONT)::GetStockObject(SYSTEM_FONT);
_hLargeFont = (HFONT)::GetStockObject(SYSTEM_FONT);
if (::GetObject(_hFont, sizeof(LOGFONT), &LogFont) != 0)
{
LogFont.lfEscapement = 900;
LogFont.lfOrientation = 900;
_hVerticalFont = CreateFontIndirect(&LogFont);
_hVerticalFont = CreateFontIndirect(&LogFont);
LogFont.lfWeight = 900;
_hVerticalLargeFont = CreateFontIndirect(&LogFont);
}
}
void TabBarPlus::doOwnerDrawTab()
void TabBarPlus::doOwnerDrawTab()
{
::SendMessage(_hwndArray[0], TCM_SETPADDING, 0, MAKELPARAM(6, 0));
for (int i = 0 ; i < _nbCtrl ; ++i)
@ -355,7 +370,8 @@ void TabBarPlus::doOwnerDrawTab()
}
}
void TabBarPlus::setColour(COLORREF colour2Set, tabColourIndex i)
void TabBarPlus::setColour(COLORREF colour2Set, tabColourIndex i)
{
switch (i)
{
@ -380,6 +396,7 @@ void TabBarPlus::setColour(COLORREF colour2Set, tabColourIndex i)
doOwnerDrawTab();
}
void TabBarPlus::doVertical()
{
for (int i = 0 ; i < _nbCtrl ; ++i)
@ -389,6 +406,7 @@ void TabBarPlus::doVertical()
}
}
void TabBarPlus::doMultiLine()
{
for (int i = 0 ; i < _nbCtrl ; ++i)
@ -398,6 +416,7 @@ void TabBarPlus::doMultiLine()
}
}
LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message)
@ -406,17 +425,17 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
case WM_TABSETSTYLE:
{
LONG_PTR style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
if (wParam > 0)
style |= lParam;
else
style &= ~lParam;
_isVertical = ((style & TCS_VERTICAL) != 0);
_isMultiLine = ((style & TCS_MULTILINE) != 0);
::SetWindowLongPtr(hwnd, GWL_STYLE, style);
::InvalidateRect(hwnd, NULL, TRUE);
::InvalidateRect(hwnd, NULL, TRUE);
return TRUE;
}
@ -450,7 +469,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
point.x = LOWORD(lParam);
point.y = HIWORD(lParam);
::ClientToScreen(hwnd, &point);
if(::DragDetect(hwnd, point))
if(::DragDetect(hwnd, point))
{
// Yes, we're beginning to drag, so capture the mouse...
_isDragging = true;
@ -468,17 +487,19 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
return TRUE;
}
case WM_RBUTTONDOWN : //rightclick selects tab aswell
{
::CallWindowProc(_tabBarDefaultProc, hwnd, WM_LBUTTONDOWN, wParam, lParam);
return TRUE;
}
//#define NPPM_INTERNAL_ISDRAGGING 40926
//#define NPPM_INTERNAL_ISDRAGGING 40926
case WM_MOUSEMOVE :
{
if (_isDragging)
{
POINT p;
POINT p;
p.x = LOWORD(lParam);
p.y = HIWORD(lParam);
exchangeItemData(p);
@ -489,7 +510,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
draggingCursor(_draggingPoint);
return TRUE;
}
if (_drawTabCloseButton)
{
int xPos = LOWORD(lParam);
@ -510,7 +531,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
SetRectEmpty(&_currentHoverTabRect);
_isCloseHover = false;
}
if (_currentHoverTabItem != _currentHoverTabItemOld || _isCloseHover != _isCloseHoverOld)
{
if (_isCloseHoverOld && (_currentHoverTabItem != _currentHoverTabItemOld || !_isCloseHover))
@ -532,12 +553,14 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
}
case WM_MOUSELEAVE:
{
if (_isCloseHover)
InvalidateRect(hwnd, &_currentHoverTabRect, FALSE);
_currentHoverTabItem = -1;
SetRectEmpty(&_currentHoverTabRect);
_isCloseHover = false;
break;
}
case WM_LBUTTONUP :
{
@ -560,7 +583,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
nmhdr.tabOrigin = currentTabOn;
::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));
return TRUE;
return TRUE;
}
if (_drawTabCloseButton)
@ -575,7 +598,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));
_whichCloseClickDown = -1;
_whichCloseClickDown = -1;
return TRUE;
}
_whichCloseClickDown = -1;
@ -622,7 +645,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
return TRUE;
}
case WM_LBUTTONDBLCLK :
case WM_LBUTTONDBLCLK:
{
if (_isDbClk2Close)
{
@ -640,13 +663,15 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
return TRUE;
}
}
return ::CallWindowProc(_tabBarDefaultProc, hwnd, Message, wParam, lParam);
}
void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
{
RECT rect = pDrawItemStruct->rcItem;
int nTab = pDrawItemStruct->itemID;
if (nTab < 0)
{
@ -658,15 +683,15 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
TCHAR label[MAX_PATH];
TCITEM tci;
tci.mask = TCIF_TEXT|TCIF_IMAGE;
tci.pszText = label;
tci.pszText = label;
tci.cchTextMax = MAX_PATH-1;
if (!::SendMessage(_hSelf, TCM_GETITEM, nTab, reinterpret_cast<LPARAM>(&tci)))
if (!::SendMessage(_hSelf, TCM_GETITEM, nTab, reinterpret_cast<LPARAM>(&tci)))
{
::MessageBox(NULL, TEXT("! TCM_GETITEM"), TEXT(""), MB_OK);
}
HDC hDC = pDrawItemStruct->hDC;
int nSavedDC = ::SaveDC(hDC);
::SetBkMode(hDC, TRANSPARENT);
@ -698,7 +723,7 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
hBrush = ::CreateSolidBrush(_activeTopBarUnfocusedColour); // #FAD296
::FillRect(hDC, &barRect, hBrush);
::DeleteObject((HGDIOBJ)hBrush);
::DeleteObject((HGDIOBJ)hBrush);
}
}
else
@ -726,12 +751,12 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
else
{
if (_isVertical)
closeButtonRect.left += 2;
closeButtonRect.left += 2;
else
closeButtonRect.left += NppParameters::getInstance()->_dpiManager.scaleX(2);
}
// 3 status for each inactive tab and selected tab close item :
// normal / hover / pushed
int idCloseImg;
@ -749,7 +774,7 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
HBITMAP hBmp = ::LoadBitmap(_hInst, MAKEINTRESOURCE(idCloseImg));
BITMAP bmp;
::GetObject(hBmp, sizeof(bmp), &bmp);
int bmDpiDynamicalWidth = NppParameters::getInstance()->_dpiManager.scaleX(bmp.bmWidth);
int bmDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(bmp.bmHeight);
@ -775,23 +800,22 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
if (hImgLst && tci.iImage >= 0)
{
IMAGEINFO info;
int yPos = 0, xPos = 0;
int marge = 0;
ImageList_GetImageInfo(hImgLst, tci.iImage, &info);
RECT & imageRect = info.rcImage;
RECT& imageRect = info.rcImage;
int yPos = 0;
int xPos = 0;
if (_isVertical)
xPos = (rect.left + (rect.right - rect.left) / 2 + NppParameters::getInstance()->_dpiManager.scaleX(2)) - (imageRect.right - imageRect.left) / 2;
else
yPos = (rect.top + (rect.bottom - rect.top) / 2 + (isSelected ? 0 : NppParameters::getInstance()->_dpiManager.scaleX(2))) - (imageRect.bottom - imageRect.top) / 2;
marge = spaceUnit;
int marge = spaceUnit;
if (_isVertical)
{
rect.bottom -= imageRect.bottom - imageRect.top;
rect.bottom -= imageRect.bottom - imageRect.top;
ImageList_Draw(hImgLst, tci.iImage, hDC, xPos, rect.bottom - marge, isSelected?ILD_TRANSPARENT:ILD_SELECTED);
rect.bottom += marge;
}
@ -850,10 +874,10 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
if (!_isVertical)
Flags |= DT_CENTER;
}
// the following uses pixel values the fix alignments issues with DrawText
// the following uses pixel values the fix alignments issues with DrawText
// and font's that are rotated 90 degrees
if (isSelected)
if (isSelected)
{
//COLORREF selectedColor = RGB(0, 0, 255);
::SetTextColor(hDC, _activeTextColour);
@ -874,8 +898,8 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
Flags |= DT_VCENTER;
}
}
else
}
else
{
::SetTextColor(hDC, _inactiveTextColour);
if (_isVertical)
@ -888,7 +912,7 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
{
rect.left += (_drawTabCloseButton)?spaceUnit:0;
}
Flags |= DT_BOTTOM;
}
::DrawText(hDC, decodedLabel, lstrlen(decodedLabel), &rect, Flags);
@ -980,9 +1004,10 @@ void TabBarPlus::exchangeItemData(POINT point)
//::SetCursor(::LoadCursor(_hInst, MAKEINTRESOURCE(IDC_DRAG_TAB)));
_isDraggingInside = false;
}
}
CloseButtonZone::CloseButtonZone()
{
_width = NppParameters::getInstance()->_dpiManager.scaleX(11);
@ -991,7 +1016,8 @@ CloseButtonZone::CloseButtonZone()
_fromRight = NppParameters::getInstance()->_dpiManager.scaleX(3);
}
bool CloseButtonZone::isHit(int x, int y, const RECT & testZone) const
bool CloseButtonZone::isHit(int x, int y, const RECT & testZone) const
{
if (((x + _width + _fromRight) < testZone.right) || (x > (testZone.right - _fromRight)))
return false;
@ -1002,7 +1028,8 @@ bool CloseButtonZone::isHit(int x, int y, const RECT & testZone) const
return true;
}
RECT CloseButtonZone::getButtonRectFrom(const RECT & tabItemRect) const
RECT CloseButtonZone::getButtonRectFrom(const RECT & tabItemRect) const
{
RECT rect;
rect.right = tabItemRect.right - _fromRight;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -60,11 +60,14 @@ const TCHAR TABBAR_ACTIVEUNFOCUSEDINDCATOR[64] = TEXT("Active tab unfocused indi
const TCHAR TABBAR_ACTIVETEXT[64] = TEXT("Active tab text");
const TCHAR TABBAR_INACTIVETEXT[64] = TEXT("Inactive tabs");
struct TBHDR {
struct TBHDR
{
NMHDR hdr;
int tabOrigin;
};
class TabBar : public Window
{
public:
@ -92,21 +95,18 @@ public:
_nbItem = 0;
};
void setImageList(HIMAGELIST himl) {
_hasImgLst = true;
::SendMessage(_hSelf, TCM_SETIMAGELIST, 0, (LPARAM)himl);
};
void setImageList(HIMAGELIST himl);
int nbItem() const {
return _nbItem;
};
}
void setFont(TCHAR *fontName, size_t fontSize);
void setVertical(bool b) {
_isVertical = b;
};
void setMultiLine(bool b) {
_isMultiLine = b;
};
@ -125,14 +125,15 @@ protected:
bool _isVertical;
bool _isMultiLine;
long getRowCount() const {
return long(::SendMessage(_hSelf, TCM_GETROWCOUNT, 0, 0));
};
}
};
struct CloseButtonZone {
struct CloseButtonZone
{
CloseButtonZone();
bool isHit(int x, int y, const RECT & testZone) const;
RECT getButtonRectFrom(const RECT & tabItemRect) const;
@ -143,10 +144,11 @@ struct CloseButtonZone {
int _fromRight; // distance from right in pixzl
};
class TabBarPlus : public TabBar
{
public :
TabBarPlus() : TabBar(), _isDragging(false), _tabBarDefaultProc(NULL), _currentHoverTabItem(-1),\
_isCloseHover(false), _whichCloseClickDown(-1), _lmbdHit(false), _tooltips(NULL) {};
enum tabColourIndex {
@ -196,29 +198,31 @@ public :
static void setDrawTopBar(bool b) {
_drawTopBar = b;
doOwnerDrawTab();
};
}
static void setDrawInactiveTab(bool b) {
_drawInactiveTab = b;
doOwnerDrawTab();
};
}
static void setDrawTabCloseButton(bool b) {
_drawTabCloseButton = b;
doOwnerDrawTab();
};
}
static void setDbClk2Close(bool b) {
_isDbClk2Close = b;
};
}
static void setVertical(bool b) {
_isCtrlVertical = b;
doVertical();
};
}
static void setMultiLine(bool b) {
_isCtrlMultiLine = b;
doMultiLine();
};
}
static void setColour(COLORREF colour2Set, tabColourIndex i);
@ -270,23 +274,26 @@ protected:
void drawItem(DRAWITEMSTRUCT *pDrawItemStruct);
void draggingCursor(POINT screenPoint);
int getTabIndexAt(const POINT & p) {
int getTabIndexAt(const POINT & p)
{
return getTabIndexAt(p.x, p.y);
};
}
int getTabIndexAt(int x, int y) {
int getTabIndexAt(int x, int y)
{
TCHITTESTINFO hitInfo;
hitInfo.pt.x = x;
hitInfo.pt.y = y;
return ::SendMessage(_hSelf, TCM_HITTEST, 0, (LPARAM)&hitInfo);
};
}
bool isPointInParentZone(POINT screenPoint) const {
bool isPointInParentZone(POINT screenPoint) const
{
RECT parentZone;
::GetWindowRect(_hParent, &parentZone);
return (((screenPoint.x >= parentZone.left) && (screenPoint.x <= parentZone.right)) &&
(screenPoint.y >= parentZone.top) && (screenPoint.y <= parentZone.bottom));
};
}
};
#endif // TAB_BAR_H

View File

@ -200,8 +200,8 @@ int ToolBar::getWidth() const {
int ToolBar::getHeight() const {
DWORD size = (DWORD)SendMessage(_hSelf, TB_GETBUTTONSIZE, 0, 0);
DWORD padding = (DWORD)SendMessage(_hSelf, TB_GETPADDING, 0,0);
int totalHeight = HIWORD(size) + HIWORD(padding);
DWORD padding = (DWORD)SendMessage(_hSelf, TB_GETPADDING, 0, 0);
int totalHeight = HIWORD(size) + HIWORD(padding) - 3;
return totalHeight;
}
@ -212,9 +212,9 @@ void ToolBar::reduce()
int iconDpiDynamicalSize = NppParameters::getInstance()->_dpiManager.scaleX(16);
_toolBarIcons.resizeIcon(iconDpiDynamicalSize);
bool recreate = (_state == TB_STANDARD);
bool recreate = (_state == TB_STANDARD || _state == TB_LARGE);
setState(TB_SMALL);
reset(recreate); //recreate toolbar if std icons were used
reset(recreate); //recreate toolbar if previous state was Std icons or Big icons
Window::redraw();
}
@ -225,9 +225,9 @@ void ToolBar::enlarge()
int iconDpiDynamicalSize = NppParameters::getInstance()->_dpiManager.scaleX(32);
_toolBarIcons.resizeIcon(iconDpiDynamicalSize);
bool recreate = (_state == TB_STANDARD);
bool recreate = (_state == TB_STANDARD || _state == TB_SMALL);
setState(TB_LARGE);
reset(recreate); //recreate toolbar if std icons were used
reset(recreate); //recreate toolbar if previous state was Std icons or Small icons
Window::redraw();
}
@ -393,7 +393,7 @@ void ToolBar::addToRebar(ReBar * rebar)
_rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_ID;
_rbBand.fStyle = RBBS_VARIABLEHEIGHT | RBBS_USECHEVRON;
_rbBand.fStyle = RBBS_VARIABLEHEIGHT | RBBS_USECHEVRON | RBBS_NOGRIPPER;
_rbBand.hwndChild = getHSelf();
_rbBand.wID = REBAR_BAR_TOOLBAR; //ID REBAR_BAR_TOOLBAR for toolbar
_rbBand.cxMinChild = 0;

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -43,26 +43,26 @@ HTREEITEM TreeView::insertTo(HTREEITEM parent, TCHAR *itemStr, int imgIndex)
void TreeView::init(HINSTANCE hInst, HWND pere)
{
Window::init(hInst, pere);
InitCommonControls();
InitCommonControls();
HTREEITEM Parent; // Tree item handle
HTREEITEM Before; // .......
HTREEITEM Root;
// Get the dimensions of the parent window's client area, and create
// the tree-view control.
HTREEITEM Root;
// Get the dimensions of the parent window's client area, and create
// the tree-view control.
_hSelf = CreateWindowEx(0,
WC_TREEVIEW,
TEXT("Tree View"),
WS_VISIBLE | WS_CHILD | WS_BORDER |
TVS_HASLINES | TVS_HASBUTTONS | TVS_SHOWSELALWAYS ,
WS_VISIBLE | WS_CHILD | WS_BORDER |
TVS_HASLINES | TVS_HASBUTTONS | TVS_SHOWSELALWAYS ,
0, 0, 0, 0,
_hParent,
NULL,
_hInst,
NULL);
_hParent,
NULL,
_hInst,
NULL);
if (!_hSelf)
throw int(56);
@ -78,7 +78,7 @@ void TreeView::init(HINSTANCE hInst, HWND pere)
Parent = insertTo(Before, TEXT("Macro"), 0);
insertTo(Parent, TEXT("ChangeCode"), 0);
insertTo(Parent, TEXT("CipherData"), 0);
insertTo(NULL, TEXT("Bla bla bla bla..."), 0);
//display();
}

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -24,18 +24,22 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef WINDOW_CONTROL_H
#define WINDOW_CONTROL_H
#pragma once
#include <windows.h>
class Window
{
public:
Window(): _hInst(NULL), _hParent(NULL), _hSelf(NULL){};
virtual ~Window() {};
//! \name Constructors & Destructor
//@{
Window() = default;
Window(const Window&) = delete;
virtual ~Window() = default;
//@}
virtual void init(HINSTANCE hInst, HWND parent)
{
@ -45,77 +49,91 @@ public:
virtual void destroy() = 0;
virtual void display(bool toShow = true) const {
::ShowWindow(_hSelf, toShow?SW_SHOW:SW_HIDE);
};
virtual void display(bool toShow = true) const
{
::ShowWindow(_hSelf, toShow ? SW_SHOW : SW_HIDE);
}
virtual void reSizeTo(RECT & rc) // should NEVER be const !!!
{
{
::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE);
redraw();
};
}
virtual void reSizeToWH(RECT & rc) // should NEVER be const !!!
{
virtual void reSizeToWH(RECT& rc) // should NEVER be const !!!
{
::MoveWindow(_hSelf, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
redraw();
};
}
virtual void redraw(bool forceUpdate = false) const {
::InvalidateRect(_hSelf, NULL, TRUE);
virtual void redraw(bool forceUpdate = false) const
{
::InvalidateRect(_hSelf, nullptr, TRUE);
if (forceUpdate)
::UpdateWindow(_hSelf);
};
virtual void getClientRect(RECT & rc) const {
}
virtual void getClientRect(RECT & rc) const
{
::GetClientRect(_hSelf, &rc);
};
}
virtual void getWindowRect(RECT & rc) const {
virtual void getWindowRect(RECT & rc) const
{
::GetWindowRect(_hSelf, &rc);
};
}
virtual int getWidth() const {
virtual int getWidth() const
{
RECT rc;
::GetClientRect(_hSelf, &rc);
return (rc.right - rc.left);
};
}
virtual int getHeight() const {
virtual int getHeight() const
{
RECT rc;
::GetClientRect(_hSelf, &rc);
if (::IsWindowVisible(_hSelf) == TRUE)
return (rc.bottom - rc.top);
return 0;
};
}
virtual bool isVisible() const {
virtual bool isVisible() const
{
return (::IsWindowVisible(_hSelf)?true:false);
};
}
HWND getHSelf() const {
HWND getHSelf() const
{
//assert(_hSelf != 0);
return _hSelf;
};
}
HWND getHParent() const {
return _hParent;
};
}
void getFocus() const {
::SetFocus(_hSelf);
};
}
HINSTANCE getHinst() const {
HINSTANCE getHinst() const
{
//assert(_hInst != 0);
return _hInst;
};
}
Window& operator = (const Window&) = delete;
protected:
HINSTANCE _hInst;
HWND _hParent;
HWND _hSelf;
};
#endif //WINDOW_CONTROL_H
HINSTANCE _hInst = NULL;
HWND _hParent = NULL;
HWND _hSelf = NULL;
};

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -61,25 +61,30 @@ LRESULT SizeableDlg::onWinMgr(WPARAM, LPARAM)
INT_PTR CALLBACK SizeableDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
switch (message)
{
case WM_INITDIALOG :
return onInitDialog();
case WM_GETMINMAXINFO :
onGetMinMaxInfo((MINMAXINFO*)lParam);
return TRUE;
case WM_SIZE:
onSize(wParam, LOWORD(lParam), HIWORD(lParam));
return TRUE;
default:
if (message == WM_WINMGR)
case WM_INITDIALOG:
{
return (BOOL)onWinMgr(wParam, lParam);
return onInitDialog();
}
case WM_GETMINMAXINFO:
{
onGetMinMaxInfo((MINMAXINFO*)lParam);
return TRUE;
}
case WM_SIZE:
{
onSize(wParam, LOWORD(lParam), HIWORD(lParam));
return TRUE;
}
default:
{
if (message == WM_WINMGR)
return (BOOL)onWinMgr(wParam, lParam);
break;
}
break;
}
return FALSE;
}

View File

@ -5,19 +5,19 @@
// Compiles with Visual C++ 6.0. Runs on Win 98 and probably Win 2000 too.
// Set tabsize = 3 in your editor.
//
// Theo - Heavily modified to remove MFC dependencies.
// Theo - Heavily modified to remove MFC dependencies.
// Replaced CWnd*/HWND, CRect/RECT, CSize/SIZE, CPoint/POINT
#include "WinMgr.h"
// Theo - Style Helpers
inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
}
inline static DWORD GetExStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
inline static DWORD GetExStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
}
const UINT WM_WINMGR = RegisterWindowMessage(TEXT("WM_WINMGR"));
@ -147,7 +147,7 @@ CWinMgr::CalcGroup(WINRECT* pGroup, HWND hWnd)
h = min(abs(h), RectHeight(rcTotal)/2);
::InflateRect(&rcTotal, -w, -h);
}
BOOL bRow = pGroup->IsRowGroup(); // Is this a row group?
// Running height or width: start with total
@ -223,7 +223,7 @@ CWinMgr::AdjustSize(WINRECT* wrc, BOOL bRow,
//
int hwCurrent = wrc->GetHeightOrWidth(bRow); // current size
int hwExtra = hw - hwCurrent; // amount extra
hwExtra = min(max(hwExtra, 0), hwRemaining); // truncate
hwExtra = min(max(hwExtra, 0), hwRemaining); // truncate
hw = hwCurrent + hwExtra; // new height-or-width
wrc->SetHeightOrWidth(hw, bRow); // set...
hwRemaining -= hwExtra; // and adjust remaining
@ -274,7 +274,7 @@ CWinMgr::OnGetSizeInfo(SIZEINFO& szi, WINRECT* wrc, HWND hWnd)
{
szi.szMin = SIZEZERO; // default min size = zero
szi.szMax = SIZEMAX; // default max size = infinite
szi.szDesired = RectToSize(wrc->GetRect()); // default desired size = current
szi.szDesired = RectToSize(wrc->GetRect()); // default desired size = current
if (wrc->IsGroup()) {
// For groups, calculate min, max, desired size as aggregate of children
@ -304,7 +304,7 @@ CWinMgr::OnGetSizeInfo(SIZEINFO& szi, WINRECT* wrc, HWND hWnd)
}
}
// Add margins.
// Add margins.
int w2,h2;
wrc->GetMargins(w2,h2); // get margins
w2<<=1; h2<<=1; // double
@ -396,7 +396,7 @@ BOOL CWinMgr::SendGetSizeInfo(SIZEINFO& szi, HWND hWnd, UINT nID)
szi = nmw.sizeinfo; // copy back to caller's struct
return TRUE;
}
//////////////////
// Get min/max info.
//
@ -410,7 +410,7 @@ CWinMgr::GetMinMaxInfo(HWND hWnd, MINMAXINFO* lpMMI)
}
//////////////////
// Get min/max info.
// Get min/max info.
//
void CWinMgr::GetMinMaxInfo(HWND hWnd, SIZEINFO& szi)
{

View File

@ -7,10 +7,10 @@
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
@ -46,11 +46,11 @@ using namespace std;
static const TCHAR *readonlyString = TEXT(" [Read Only]");
const UINT WDN_NOTIFY = RegisterWindowMessage(TEXT("WDN_NOTIFY"));
inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
}
inline static DWORD GetExStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
inline static DWORD GetExStyle(HWND hWnd) {
return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
}
inline static BOOL ModifyStyle(HWND hWnd, DWORD dwRemove, DWORD dwAdd) {
@ -97,21 +97,21 @@ struct NumericStringEquivalence
break;
}
if (_istdigit(*str1) && _istdigit(*str2))
{
{
lcmp = generic_strtol(str1, &p1, 10) - generic_strtol(str2, &p2, 10);
if ( lcmp == 0 )
lcmp = (p2 - str2) - (p1 - str1);
if ( lcmp != 0 )
break;
break;
str1 = p1, str2 = p2;
}
else
else
{
if (_istascii(*str1) && _istupper(*str1))
c1 = _totlower(*str1);
else
c1 = *str1;
if (_istascii(*str2) && _istupper(*str2))
if (_istascii(*str2) && _istupper(*str2))
c2 = _totlower(*str2);
else
c2 = *str2;
@ -131,7 +131,7 @@ struct BufferEquivalent
DocTabView *_pTab;
int _iColumn;
bool _reverse;
BufferEquivalent(DocTabView *pTab, int iColumn, bool reverse)
BufferEquivalent(DocTabView *pTab, int iColumn, bool reverse)
: _pTab(pTab), _iColumn(iColumn), _reverse(reverse)
{}
@ -143,7 +143,7 @@ struct BufferEquivalent
}
bool compare(int i1, int i2) const
{
{
BufferID bid1 = _pTab->getBufferByIndex(i1);
BufferID bid2 = _pTab->getBufferByIndex(i2);
Buffer * b1 = MainFileManager->getBufferByID(bid1);
@ -164,7 +164,7 @@ struct BufferEquivalent
{
int t1 = (int)b1->getLangType();
int t2 = (int)b2->getLangType();
return (t1 < t2); // yeah should be the name
return (t1 < t2); // yeah should be the name
}
return false;
}
@ -220,51 +220,58 @@ void WindowsDlg::init(HINSTANCE hInst, HWND parent)
INT_PTR CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
switch (message)
{
case WM_INITDIALOG :
{
changeDlgLang();
return MyBaseClass::run_dlgProc(message, wParam, lParam);
return MyBaseClass::run_dlgProc(message, wParam, lParam);
}
case WM_COMMAND :
case WM_COMMAND :
{
switch (wParam)
{
case IDOK :
activateCurrent();
return TRUE;
case IDCANCEL :
::GetWindowRect(_hSelf, &_lastKnownLocation);
EndDialog(_hSelf, IDCANCEL);
return TRUE;
case IDC_WINDOWS_SAVE:
doSave();
return TRUE;
case IDC_WINDOWS_CLOSE:
doClose();
return TRUE;
case IDC_WINDOWS_SORT:
doSortToTabs();
_isSorted = false;
updateButtonState();
break;
default :
break;
case IDOK:
{
activateCurrent();
return TRUE;
}
case IDCANCEL:
{
::GetWindowRect(_hSelf, &_lastKnownLocation);
EndDialog(_hSelf, IDCANCEL);
return TRUE;
}
case IDC_WINDOWS_SAVE:
{
doSave();
return TRUE;
}
case IDC_WINDOWS_CLOSE:
{
doClose();
return TRUE;
}
case IDC_WINDOWS_SORT:
{
doSortToTabs();
_isSorted = false;
updateButtonState();
break;
}
}
break;
}
case WM_DESTROY :
case WM_DESTROY:
{
//destroy();
return TRUE;
}
case WM_NOTIFY :
{
{
if (wParam == IDC_WINDOWS_LIST)
{
NMHDR* pNMHDR = (NMHDR*)lParam;
@ -272,7 +279,7 @@ INT_PTR CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa
{
NMLVDISPINFO *pLvdi = (NMLVDISPINFO *)pNMHDR;
//if(pLvdi->item.mask & LVIF_IMAGE)
// ;
// ;
if(pLvdi->item.mask & LVIF_TEXT)
{
pLvdi->item.pszText[0] = 0;
@ -388,12 +395,13 @@ INT_PTR CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa
return TRUE;
}
}
break;
}
break;
}
return MyBaseClass::run_dlgProc(message, wParam, lParam);
return MyBaseClass::run_dlgProc(message, wParam, lParam);
}
void WindowsDlg::updateButtonState()
{
int nSelection = ListView_GetSelectedCount(_hList);
@ -507,7 +515,7 @@ BOOL WindowsDlg::onInitDialog()
if (_lastKnownLocation.bottom > 0 && _lastKnownLocation.right > 0)
{
SetWindowPos(_hSelf, NULL, _lastKnownLocation.left, _lastKnownLocation.top,
SetWindowPos(_hSelf, NULL, _lastKnownLocation.left, _lastKnownLocation.top,
_lastKnownLocation.right-_lastKnownLocation.left, _lastKnownLocation.bottom-_lastKnownLocation.top, SWP_SHOWWINDOW);
}
else
@ -549,7 +557,7 @@ LRESULT WindowsDlg::onWinMgr(WPARAM wp, LPARAM lp)
nmw.sizeinfo.szMin = _szMinListCtrl;
nmw.processed = TRUE;
return TRUE;
}
}
}
return MyBaseClass::onWinMgr(wp, lp);
}
@ -621,14 +629,14 @@ void WindowsDlg::doSave()
{
NMWINDLG nmdlg;
nmdlg.type = WDT_SAVE;
nmdlg.curSel = ListView_GetNextItem(_hList, -1, LVNI_SELECTED);
nmdlg.curSel = ListView_GetNextItem(_hList, -1, LVNI_SELECTED);
nmdlg.hwndFrom = _hSelf;
nmdlg.code = WDN_NOTIFY;
nmdlg.nItems = ListView_GetSelectedCount(_hList);
nmdlg.Items = new UINT[nmdlg.nItems];
for (int i=-1, j=0;;++j) {
i = ListView_GetNextItem(_hList, i, LVNI_SELECTED);
if (i == -1) break;
i = ListView_GetNextItem(_hList, i, LVNI_SELECTED);
if (i == -1) break;
nmdlg.Items[j] = _idxMap[i];
}
SendMessage(_hParent, WDN_NOTIFY, 0, LPARAM(&nmdlg));
@ -644,7 +652,7 @@ void WindowsDlg::destroy()
HWND hSelf = _hSelf;
_hSelf = NULL;
::DestroyWindow(hSelf);
}
void WindowsDlg::activateCurrent()
@ -669,7 +677,7 @@ void WindowsDlg::doClose()
nmdlg.type = WDT_CLOSE;
int index = ListView_GetNextItem(_hList, -1, LVNI_ALL|LVNI_SELECTED);
if (index == -1) return;
nmdlg.curSel = _idxMap[index];
nmdlg.hwndFrom = _hSelf;
nmdlg.code = WDN_NOTIFY;
@ -678,7 +686,7 @@ void WindowsDlg::doClose()
vector<int> key;
key.resize(n, 0x7fffffff);
for(int i=-1, j=0;; ++j) {
i = ListView_GetNextItem(_hList, i, LVNI_SELECTED);
i = ListView_GetNextItem(_hList, i, LVNI_SELECTED);
if (i == -1) break;
ListView_SetItemState(_hList, i, 0, LVIS_SELECTED); // deselect
nmdlg.Items[j] = _idxMap[i];
@ -737,14 +745,14 @@ void WindowsDlg::doSortToTabs()
vector<int> key;
key.resize(n, 0x7fffffff);
for(int i=-1, j=0;; ++j) {
i = ListView_GetNextItem(_hList, i, LVNI_ALL);
i = ListView_GetNextItem(_hList, i, LVNI_ALL);
if (i == -1) break;
nmdlg.Items[j] = _idxMap[i];
if (i == curSel)
nmdlg.curSel = j;
key[j] = i;
}
SendMessage(_hParent, WDN_NOTIFY, 0, LPARAM(&nmdlg));
if (nmdlg.processed)
{

View File

@ -1,93 +0,0 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -93,7 +93,7 @@ http://notepad-plus-plus.org/features/function-list.html
<parser id="c_function" displayName="C source" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|(\*|\*\*)[\s]+|[\s]+(\*|\*\*)|[\s]+(\*|\*\*)[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
displayMode="$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_~]+[\s]*\("/>
@ -121,7 +121,7 @@ http://notepad-plus-plus.org/features/function-list.html
<parser id="c_cpp_function" displayName="C++ Class" commentExpr="((/\*.*?\*)/|(//.*?$))">
<classRange
mainExpr="^[\t ]*(class|struct)[\t ]+[\w]+[\s]*(:[\s]*(public|protected|private)[\s]+[\w]+[\s]*)?\{"
mainExpr="^[\t ]*(class|struct)[\t ]+[\w]+[\s]*(final)?[\s]*(:[\s]*(public|protected|private)[\s]+[\w]+[\s]*)?\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
@ -131,7 +131,7 @@ http://notepad-plus-plus.org/features/function-list.html
<nameExpr expr="[\w]+"/>
</className>
<function
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?([\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{">
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?([\w]+([\s]+[\w]+)?([\s]+|(\*|\*\*|&amp;)[\s]+|[\s]+(\*|\*\*|&amp;)|[\s]+(\*|\*\*|&amp;)[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?([\s]*(final|override|final[\s]*override|override[\s]*final)[\s]*)?[\n\s]*\{">
<functionName>
<funcNameExpr expr="(?!(if|while|for|switch))[\w_~]+[\s]*\("/>
<funcNameExpr expr="(?!(if|while|for|switch))[\w_~]+"/>
@ -139,7 +139,7 @@ http://notepad-plus-plus.org/features/function-list.html
</function>
</classRange>
<function
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w]+([\s]+[\w]+)?([\s]+|(\*|\*\*|&amp;)[\s]+|[\s]+(\*|\*\*|&amp;)|[\s]+(\*|\*\*|&amp;)[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/>

File diff suppressed because one or more lines are too long

View File

@ -219,16 +219,23 @@ MenuPosition & getMenuPosition(const char *id)
void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & pluginsTrans, generic_string & windowTrans)
{
if (!_nativeLangA) return;
TiXmlNodeA *mainMenu = _nativeLangA->FirstChild("Menu");
if (!mainMenu) return;
mainMenu = mainMenu->FirstChild("Main");
if (!mainMenu) return;
TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries");
if (!entriesRoot) return;
const char *idName = NULL;
if (nullptr == _nativeLangA)
return;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
TiXmlNodeA *mainMenu = _nativeLangA->FirstChild("Menu");
if (nullptr == mainMenu)
return;
mainMenu = mainMenu->FirstChild("Main");
if (nullptr == mainMenu)
return;
TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries");
if (nullptr == entriesRoot)
return;
const char* idName = nullptr;
WcharMbcsConvertor* wmc = WcharMbcsConvertor::getInstance();
for (TiXmlNodeA *childNode = entriesRoot->FirstChildElement("Item");
childNode ;
@ -246,7 +253,7 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & plugin
::ModifyMenu(menuHandle, menuPos._x, MF_BYPOSITION, 0, nameW);
}
}
else
else
{
idName = element->Attribute("idName");
if (idName)
@ -286,24 +293,24 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & plugin
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int x, y, z;
TiXmlElementA* element = childNode->ToElement();
//const char *xStr = element->Attribute("posX", &x);
//const char *yStr = element->Attribute("posY", &y);
const char *subMenuIdStr = element->Attribute("subMenuId");
const char *name = element->Attribute("name");
const char* subMenuIdStr = element->Attribute("subMenuId");
const char* name = element->Attribute("name");
if (!subMenuIdStr || !name)
if (nullptr == subMenuIdStr or nullptr == name)
continue;
MenuPosition & menuPos = getMenuPosition(subMenuIdStr);
x = menuPos._x;
y = menuPos._y;
z = menuPos._z;
MenuPosition& menuPos = getMenuPosition(subMenuIdStr);
int x = menuPos._x;
int y = menuPos._y;
int z = menuPos._z;
HMENU hSubMenu = ::GetSubMenu(menuHandle, x);
if (!hSubMenu)
continue;
HMENU hSubMenu2 = ::GetSubMenu(hSubMenu, y);
if (!hSubMenu2)
continue;
@ -326,42 +333,45 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & plugin
}
}
int tabContextMenuItemPos[] = {
0, // 0 : Close
1, // 1 : Close ALL BUT This
4, // 2 : Save
5, // 3 : Save As
9, // 4 : Print
21,// 5 : Move to Other View
22,// 6 : Clone to Other View
17,// 7 : Full File Path to Clipboard
18,// 8 : Filename to Clipboard
19,// 9 : Current Dir. Path to Clipboard
6, // 10: Rename
7, // 11: Move to Recycle Bin
14,// 12: Read-Only
15,// 13: Clear Read-Only Flag
23,// 14: Move to New Instance
24,// 15: Open to New Instance
8, // 16: Reload
2, // 17: Close ALL to the Left
3, // 18: Close ALL to the Right
11,// 19: Open Containing Folder in Explorer
12,// 20: Open Containing Folder in cmd
-1 //-------End
static const int tabContextMenuItemPos[] =
{
0, // 0 : Close
1, // 1 : Close ALL BUT This
4, // 2 : Save
5, // 3 : Save As
9, // 4 : Print
21, // 5 : Move to Other View
22, // 6 : Clone to Other View
17, // 7 : Full File Path to Clipboard
18, // 8 : Filename to Clipboard
19, // 9 : Current Dir. Path to Clipboard
6, // 10: Rename
7, // 11: Move to Recycle Bin
14, // 12: Read-Only
15, // 13: Clear Read-Only Flag
23, // 14: Move to New Instance
24, // 15: Open to New Instance
8, // 16: Reload
2, // 17: Close ALL to the Left
3, // 18: Close ALL to the Right
11, // 19: Open Containing Folder in Explorer
12, // 20: Open Containing Folder in cmd
-1 //-------End
};
void NativeLangSpeaker::changeLangTabContextMenu(HMENU hCM)
{
if (_nativeLangA)
if (nullptr != _nativeLangA)
{
TiXmlNodeA *tabBarMenu = _nativeLangA->FirstChild("Menu");
if (tabBarMenu)
if (tabBarMenu)
{
tabBarMenu = tabBarMenu->FirstChild("TabBar");
if (tabBarMenu)
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
WcharMbcsConvertor* wmc = WcharMbcsConvertor::getInstance();
int nbCMItems = sizeof(tabContextMenuItemPos)/sizeof(int);
for (TiXmlNodeA *childNode = tabBarMenu->FirstChildElement("Item");
@ -395,12 +405,13 @@ void NativeLangSpeaker::changeLangTabDrapContextMenu(HMENU hCM)
if (_nativeLangA)
{
const char *goToViewA = NULL;
const char *cloneToViewA = NULL;
const char *goToViewA = nullptr;
const char *cloneToViewA = nullptr;
TiXmlNodeA *tabBarMenu = _nativeLangA->FirstChild("Menu");
if (tabBarMenu)
tabBarMenu = tabBarMenu->FirstChild("TabBar");
if (tabBarMenu)
{
for (TiXmlNodeA *childNode = tabBarMenu->FirstChildElement("Item");
@ -433,13 +444,16 @@ void NativeLangSpeaker::changeLangTabDrapContextMenu(HMENU hCM)
}
}
void NativeLangSpeaker::changeConfigLang(HWND hDlg)
{
if (!_nativeLangA) return;
if (nullptr == _nativeLangA)
return;
TiXmlNodeA *styleConfDlgNode = _nativeLangA->FirstChild("Dialog");
if (!styleConfDlgNode) return;
if (!styleConfDlgNode)
return;
styleConfDlgNode = styleConfDlgNode->FirstChild("StyleConfig");
if (!styleConfDlgNode) return;

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More