GUI Enhancement: User Define dlgs

- main dlg shared part - tab focus reorder
- string dlg (User language name, New tab name) - make edit ctrl larger
- remove obsolete style
- add initializer
- fix override warnings
- optimize dark mode
- make translation consistent between source code and english lang xml files

Fix #13615, close #13616
This commit is contained in:
ozone10 2023-04-23 18:21:32 +02:00 committed by Don Ho
parent 2a21a042d1
commit 052626ca99
6 changed files with 122 additions and 163 deletions

View File

@ -725,10 +725,10 @@ The comments are here for explanation, it's not necessary to translate them.
<UserDefine title="User-Defined"> <UserDefine title="User-Defined">
<Item id="20001" name="Dock"/> <Item id="20001" name="Dock"/>
<Item id="20002" name="Rename"/> <Item id="20002" name="Rename"/>
<Item id="20003" name="Create New..."/> <Item id="20003" name="Create new..."/>
<Item id="20004" name="Remove"/> <Item id="20004" name="Remove"/>
<Item id="20005" name="Save As..."/> <Item id="20005" name="Save As..."/>
<Item id="20007" name="User language: "/> <Item id="20007" name="User language"/>
<Item id="20009" name="Ext.:"/> <Item id="20009" name="Ext.:"/>
<Item id="20012" name="Ignore case"/> <Item id="20012" name="Ignore case"/>
<Item id="20011" name="Transparency"/> <Item id="20011" name="Transparency"/>
@ -736,7 +736,7 @@ The comments are here for explanation, it's not necessary to translate them.
<Item id="20016" name="Export..."/> <Item id="20016" name="Export..."/>
<Item id="20017" name="Undock"/> <Item id="20017" name="Undock"/>
<StylerDialog title="Styler Dialog"> <StylerDialog title="Styler Dialog">
<Item id="25030" name="Font options:"/> <Item id="25030" name="Font options"/>
<Item id="25006" name="Foreground color"/> <Item id="25006" name="Foreground color"/>
<Item id="25007" name="Background color"/> <Item id="25007" name="Background color"/>
<Item id="25031" name="Name:"/> <Item id="25031" name="Name:"/>
@ -744,7 +744,7 @@ The comments are here for explanation, it's not necessary to translate them.
<Item id="25001" name="Bold"/> <Item id="25001" name="Bold"/>
<Item id="25002" name="Italic"/> <Item id="25002" name="Italic"/>
<Item id="25003" name="Underline"/> <Item id="25003" name="Underline"/>
<Item id="25029" name="Nesting:"/> <Item id="25029" name="Nesting"/>
<Item id="25008" name="Delimiter 1"/> <Item id="25008" name="Delimiter 1"/>
<Item id="25009" name="Delimiter 2"/> <Item id="25009" name="Delimiter 2"/>
<Item id="25010" name="Delimiter 3"/> <Item id="25010" name="Delimiter 3"/>
@ -774,20 +774,20 @@ The comments are here for explanation, it's not necessary to translate them.
<Folder title="Folder &amp;&amp; Default"> <Folder title="Folder &amp;&amp; Default">
<Item id="21101" name="Default style"/> <Item id="21101" name="Default style"/>
<Item id="21102" name="Styler"/> <Item id="21102" name="Styler"/>
<Item id="21105" name="Documentation:"/> <Item id="21105" name="Documentation"/>
<Item id="21104" name="Temporary doc site:"/> <Item id="21104" name="Temporary doc site:"/>
<Item id="21106" name="Fold &amp;compact (fold empty lines too)"/> <Item id="21106" name="Fold &amp;compact (fold empty lines too)"/>
<Item id="21220" name="Folding in code 1 style:"/> <Item id="21220" name="Folding in code 1 style"/>
<Item id="21224" name="Open:"/> <Item id="21224" name="Open:"/>
<Item id="21225" name="Middle:"/> <Item id="21225" name="Middle:"/>
<Item id="21226" name="Close:"/> <Item id="21226" name="Close:"/>
<Item id="21227" name="Styler"/> <Item id="21227" name="Styler"/>
<Item id="21320" name="Folding in code 2 style (separators needed):"/> <Item id="21320" name="Folding in code 2 style (separators needed)"/>
<Item id="21324" name="Open:"/> <Item id="21324" name="Open:"/>
<Item id="21325" name="Middle:"/> <Item id="21325" name="Middle:"/>
<Item id="21326" name="Close:"/> <Item id="21326" name="Close:"/>
<Item id="21327" name="Styler"/> <Item id="21327" name="Styler"/>
<Item id="21420" name="Folding in comment style:"/> <Item id="21420" name="Folding in comment style"/>
<Item id="21424" name="Open:"/> <Item id="21424" name="Open:"/>
<Item id="21425" name="Middle:"/> <Item id="21425" name="Middle:"/>
<Item id="21426" name="Close:"/> <Item id="21426" name="Close:"/>
@ -1631,9 +1631,9 @@ Find in all files but exclude all folders log or logs recursively:
<finder-wrap-long-lines value="Word wrap long lines"/> <finder-wrap-long-lines value="Word wrap long lines"/>
<common-ok value="OK"/> <common-ok value="OK"/>
<common-cancel value="Cancel"/> <common-cancel value="Cancel"/>
<common-name value="Name: "/> <common-name value="Name"/>
<tabrename-title value="Rename Current Tab"/> <tabrename-title value="Rename Current Tab"/>
<tabrename-newname value="New Name: "/> <tabrename-newname value="New name"/>
<splitter-rotate-left value="Rotate to left"/> <splitter-rotate-left value="Rotate to left"/>
<splitter-rotate-right value="Rotate to right"/> <splitter-rotate-right value="Rotate to right"/>
<userdefined-title-new value="Create New Language..."/> <userdefined-title-new value="Create New Language..."/>

View File

@ -720,10 +720,10 @@ The comments are here for explanation, it's not necessary to translate them.
<UserDefine title="User-Defined"> <UserDefine title="User-Defined">
<Item id="20001" name="Dock"/> <Item id="20001" name="Dock"/>
<Item id="20002" name="Rename"/> <Item id="20002" name="Rename"/>
<Item id="20003" name="Create New..."/> <Item id="20003" name="Create new..."/>
<Item id="20004" name="Remove"/> <Item id="20004" name="Remove"/>
<Item id="20005" name="Save As..."/> <Item id="20005" name="Save As..."/>
<Item id="20007" name="User language: "/> <Item id="20007" name="User language"/>
<Item id="20009" name="Ext.:"/> <Item id="20009" name="Ext.:"/>
<Item id="20012" name="Ignore case"/> <Item id="20012" name="Ignore case"/>
<Item id="20011" name="Transparency"/> <Item id="20011" name="Transparency"/>
@ -731,7 +731,7 @@ The comments are here for explanation, it's not necessary to translate them.
<Item id="20016" name="Export..."/> <Item id="20016" name="Export..."/>
<Item id="20017" name="Undock"/> <Item id="20017" name="Undock"/>
<StylerDialog title="Styler Dialog"> <StylerDialog title="Styler Dialog">
<Item id="25030" name="Font options:"/> <Item id="25030" name="Font options"/>
<Item id="25006" name="Foreground color"/> <Item id="25006" name="Foreground color"/>
<Item id="25007" name="Background color"/> <Item id="25007" name="Background color"/>
<Item id="25031" name="Name:"/> <Item id="25031" name="Name:"/>
@ -739,7 +739,7 @@ The comments are here for explanation, it's not necessary to translate them.
<Item id="25001" name="Bold"/> <Item id="25001" name="Bold"/>
<Item id="25002" name="Italic"/> <Item id="25002" name="Italic"/>
<Item id="25003" name="Underline"/> <Item id="25003" name="Underline"/>
<Item id="25029" name="Nesting:"/> <Item id="25029" name="Nesting"/>
<Item id="25008" name="Delimiter 1"/> <Item id="25008" name="Delimiter 1"/>
<Item id="25009" name="Delimiter 2"/> <Item id="25009" name="Delimiter 2"/>
<Item id="25010" name="Delimiter 3"/> <Item id="25010" name="Delimiter 3"/>
@ -769,20 +769,20 @@ The comments are here for explanation, it's not necessary to translate them.
<Folder title="Folder &amp;&amp; Default"> <Folder title="Folder &amp;&amp; Default">
<Item id="21101" name="Default style"/> <Item id="21101" name="Default style"/>
<Item id="21102" name="Styler"/> <Item id="21102" name="Styler"/>
<Item id="21105" name="Documentation:"/> <Item id="21105" name="Documentation"/>
<Item id="21104" name="Temporary doc site:"/> <Item id="21104" name="Temporary doc site:"/>
<Item id="21106" name="Fold &amp;compact (fold empty lines too)"/> <Item id="21106" name="Fold &amp;compact (fold empty lines too)"/>
<Item id="21220" name="Folding in code 1 style:"/> <Item id="21220" name="Folding in code 1 style"/>
<Item id="21224" name="Open:"/> <Item id="21224" name="Open:"/>
<Item id="21225" name="Middle:"/> <Item id="21225" name="Middle:"/>
<Item id="21226" name="Close:"/> <Item id="21226" name="Close:"/>
<Item id="21227" name="Styler"/> <Item id="21227" name="Styler"/>
<Item id="21320" name="Folding in code 2 style (separators needed):"/> <Item id="21320" name="Folding in code 2 style (separators needed)"/>
<Item id="21324" name="Open:"/> <Item id="21324" name="Open:"/>
<Item id="21325" name="Middle:"/> <Item id="21325" name="Middle:"/>
<Item id="21326" name="Close:"/> <Item id="21326" name="Close:"/>
<Item id="21327" name="Styler"/> <Item id="21327" name="Styler"/>
<Item id="21420" name="Folding in comment style:"/> <Item id="21420" name="Folding in comment style"/>
<Item id="21424" name="Open:"/> <Item id="21424" name="Open:"/>
<Item id="21425" name="Middle:"/> <Item id="21425" name="Middle:"/>
<Item id="21426" name="Close:"/> <Item id="21426" name="Close:"/>
@ -1615,9 +1615,9 @@ Find in all files but exclude all folders log or logs recursively:
<finder-wrap-long-lines value="Word wrap long lines"/> <finder-wrap-long-lines value="Word wrap long lines"/>
<common-ok value="OK"/> <common-ok value="OK"/>
<common-cancel value="Cancel"/> <common-cancel value="Cancel"/>
<common-name value="Name: "/> <common-name value="Name"/>
<tabrename-title value="Rename Current Tab"/> <tabrename-title value="Rename Current Tab"/>
<tabrename-newname value="New Name: "/> <tabrename-newname value="New name"/>
<splitter-rotate-left value="Rotate to left"/> <splitter-rotate-left value="Rotate to left"/>
<splitter-rotate-right value="Rotate to right"/> <splitter-rotate-right value="Rotate to right"/>
<userdefined-title-new value="Create New Language..."/> <userdefined-title-new value="Create New Language..."/>

View File

@ -1884,7 +1884,7 @@ bool Notepad_plus::fileRename(BufferID id)
// Reserved characters: < > : " / \ | ? * // Reserved characters: < > : " / \ | ? *
std::wstring reservedChars = TEXT("<>:\"/\\|\?*"); std::wstring reservedChars = TEXT("<>:\"/\\|\?*");
generic_string staticName = _nativeLangSpeaker.getLocalizedStrFromID("tabrename-newname", TEXT("New Name: ")); generic_string staticName = _nativeLangSpeaker.getLocalizedStrFromID("tabrename-newname", TEXT("New name"));
StringDlg strDlg; StringDlg strDlg;
generic_string title = _nativeLangSpeaker.getLocalizedStrFromID("tabrename-title", TEXT("Rename Current Tab")); generic_string title = _nativeLangSpeaker.getLocalizedStrFromID("tabrename-title", TEXT("Rename Current Tab"));

View File

@ -18,11 +18,11 @@
#include "localization.h" #include "localization.h"
#include "UserDefineDialog.h" #include "UserDefineDialog.h"
#include "ScintillaEditView.h" #include "ScintillaEditView.h"
#include "Parameters.h" //#include "Parameters.h"
#include "resource.h" //#include "resource.h"
#include "Notepad_plus_msgs.h" #include "Notepad_plus_msgs.h"
#include "CustomFileDialog.h" #include "CustomFileDialog.h"
#include "Common.h" //#include "Common.h"
using namespace std; using namespace std;
@ -107,23 +107,15 @@ intptr_t CALLBACK SharedParametersDialog::run_dlgProc(UINT Message, WPARAM wPara
} }
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORDLG: case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
{ {
@ -1100,32 +1092,20 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
} }
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORLISTBOX: case WM_CTLCOLORLISTBOX:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORDLG: case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
{ {
@ -1280,7 +1260,7 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_GETLBTEXT, i, reinterpret_cast<LPARAM>(langName)); ::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_GETLBTEXT, i, reinterpret_cast<LPARAM>(langName));
generic_string strName = pNativeSpeaker->getLocalizedStrFromID("common-name", TEXT("Name: ")); generic_string strName = pNativeSpeaker->getLocalizedStrFromID("common-name", TEXT("Name"));
generic_string strTitle = pNativeSpeaker->getLocalizedStrFromID("userdefined-title-rename", TEXT("Rename Current Language Name")); generic_string strTitle = pNativeSpeaker->getLocalizedStrFromID("userdefined-title-rename", TEXT("Rename Current Language Name"));
StringDlg strDlg; StringDlg strDlg;
@ -1332,7 +1312,7 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
wParam = IDC_ADDNEW_BUTTON; wParam = IDC_ADDNEW_BUTTON;
generic_string strName = pNativeSpeaker->getLocalizedStrFromID("common-name", TEXT("Name: ")); generic_string strName = pNativeSpeaker->getLocalizedStrFromID("common-name", TEXT("Name"));
generic_string strTitle = (wParam == IDC_SAVEAS_BUTTON) ? generic_string strTitle = (wParam == IDC_SAVEAS_BUTTON) ?
pNativeSpeaker->getLocalizedStrFromID("userdefined-title-save", TEXT("Save Current Language Name As...")) : pNativeSpeaker->getLocalizedStrFromID("userdefined-title-save", TEXT("Save Current Language Name As...")) :
pNativeSpeaker->getLocalizedStrFromID("userdefined-title-new", TEXT("Create New Language...")); pNativeSpeaker->getLocalizedStrFromID("userdefined-title-new", TEXT("Create New Language..."));
@ -1586,29 +1566,21 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
} }
if (_shouldGotoCenter) if (_shouldGotoCenter)
goToCenter(); goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE);
return TRUE; return TRUE;
} }
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORDLG: case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
{ {
@ -1623,7 +1595,7 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
{ {
if (NppDarkMode::isEnabled()) if (NppDarkMode::isEnabled())
{ {
RECT rc = {}; RECT rc{};
getClientRect(rc); getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); ::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE; return TRUE;
@ -1773,7 +1745,7 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA
Style & style = SharedParametersDialog::_pUserLang->_styles.getStyler(dlg->_stylerIndex); Style & style = SharedParametersDialog::_pUserLang->_styles.getStyler(dlg->_stylerIndex);
// move dialog over UDL GUI (position 0,0 of UDL window) so it wouldn't cover the code // move dialog over UDL GUI (position 0,0 of UDL window) so it wouldn't cover the code
RECT wrc; RECT wrc{};
::GetWindowRect(dlg->_parent, &wrc); ::GetWindowRect(dlg->_parent, &wrc);
wrc.left = wrc.left < 0 ? 200 : wrc.left; // if outside of visible area wrc.left = wrc.left < 0 ? 200 : wrc.left; // if outside of visible area
wrc.top = wrc.top < 0 ? 200 : wrc.top; wrc.top = wrc.top < 0 ? 200 : wrc.top;
@ -1849,32 +1821,20 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA
} }
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORLISTBOX: case WM_CTLCOLORLISTBOX:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_CTLCOLORDLG: case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{ {
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
} }
break;
}
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
{ {
@ -1917,7 +1877,7 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA
style._fontSize = -1; style._fontSize = -1;
else else
{ {
TCHAR *finStr; TCHAR *finStr = nullptr;
style._fontSize = wcstol(intStr, &finStr, 10); style._fontSize = wcstol(intStr, &finStr, 10);
if (*finStr != '\0') if (*finStr != '\0')
style._fontSize = -1; style._fontSize = -1;

View File

@ -21,7 +21,6 @@
#include "ColourPicker.h" #include "ColourPicker.h"
#include "Parameters.h" #include "Parameters.h"
#include "URLCtrl.h" #include "URLCtrl.h"
#include "tchar.h"
#include "SciLexer.h" #include "SciLexer.h"
#include <unordered_map> #include <unordered_map>
@ -247,7 +246,7 @@ protected :
//Shared data //Shared data
static UserLangContainer *_pUserLang; static UserLangContainer *_pUserLang;
static ScintillaEditView *_pScintilla; static ScintillaEditView *_pScintilla;
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) override;
bool setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set); bool setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set);
virtual void setKeywords2List(int ctrlID) = 0; virtual void setKeywords2List(int ctrlID) = 0;
}; };
@ -256,10 +255,10 @@ class FolderStyleDialog : public SharedParametersDialog
{ {
public: public:
FolderStyleDialog() = default; FolderStyleDialog() = default;
void updateDlg(); void updateDlg() override;
protected : protected :
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) override;
void setKeywords2List(int ctrlID); void setKeywords2List(int ctrlID) override;
private : private :
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const; void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
URLCtrl _pageLink; URLCtrl _pageLink;
@ -269,20 +268,20 @@ class KeyWordsStyleDialog : public SharedParametersDialog
{ {
public: public:
KeyWordsStyleDialog() = default; KeyWordsStyleDialog() = default;
void updateDlg(); void updateDlg() override;
protected : protected :
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) override;
void setKeywords2List(int id); void setKeywords2List(int id) override;
}; };
class CommentStyleDialog : public SharedParametersDialog class CommentStyleDialog : public SharedParametersDialog
{ {
public : public :
CommentStyleDialog() = default; CommentStyleDialog() = default;
void updateDlg(); void updateDlg() override;
protected : protected :
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) override;
void setKeywords2List(int id); void setKeywords2List(int id) override;
private : private :
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, const TCHAR *prefix) const; void retrieve(TCHAR *dest, const TCHAR *toRetrieve, const TCHAR *prefix) const;
}; };
@ -291,10 +290,10 @@ class SymbolsStyleDialog : public SharedParametersDialog
{ {
public : public :
SymbolsStyleDialog() = default; SymbolsStyleDialog() = default;
void updateDlg(); void updateDlg() override;
protected : protected :
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) override;
void setKeywords2List(int id); void setKeywords2List(int id) override;
private : private :
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const; void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
}; };
@ -315,16 +314,14 @@ public :
void setScintilla(ScintillaEditView *pScinView) { void setScintilla(ScintillaEditView *pScinView) {
_pScintilla = pScinView; _pScintilla = pScinView;
}; };
virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true) {
StaticDialog::create(dialogID, isRTL, msgDestParent); void destroy() override {
}
void destroy() {
// A Ajouter les fils... // A Ajouter les fils...
}; };
int getWidth() const { int getWidth() const override {
return _dlgPos.right; return _dlgPos.right;
}; };
int getHeight() const { int getHeight() const override {
return _dlgPos.bottom; return _dlgPos.bottom;
}; };
void doDialog(bool willBeShown = true, bool isRTL = false) { void doDialog(bool willBeShown = true, bool isRTL = false) {
@ -332,7 +329,7 @@ public :
create(IDD_GLOBAL_USERDEFINE_DLG, isRTL); create(IDD_GLOBAL_USERDEFINE_DLG, isRTL);
display(willBeShown); display(willBeShown);
}; };
virtual void reSizeTo(RECT & rc) // should NEVER be const !!! void reSizeTo(RECT & rc) override// should NEVER be const !!!
{ {
Window::reSizeTo(rc); Window::reSizeTo(rc);
display(false); display(false);
@ -358,7 +355,7 @@ public :
_ctrlTab.renameTab(index, name2set); _ctrlTab.renameTab(index, name2set);
}; };
protected : protected :
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
private : private :
ControlsTab _ctrlTab; ControlsTab _ctrlTab;
WindowVector _wVector; WindowVector _wVector;
@ -368,7 +365,7 @@ private :
CommentStyleDialog _commentStyleDlg; CommentStyleDialog _commentStyleDlg;
SymbolsStyleDialog _symbolsStyleDlg; SymbolsStyleDialog _symbolsStyleDlg;
bool _status = UNDOCK; bool _status = UNDOCK;
RECT _dlgPos = {}; RECT _dlgPos{};
int _currentHight = 0; int _currentHight = 0;
int _yScrollPos = 0; int _yScrollPos = 0;
int _prevHightVal = 0; int _prevHightVal = 0;
@ -380,8 +377,8 @@ private :
void restorePosSize(){reSizeTo(_dlgPos);}; void restorePosSize(){reSizeTo(_dlgPos);};
void enableLangAndControlsBy(size_t index); void enableLangAndControlsBy(size_t index);
protected : protected :
void setKeywords2List(int){}; void setKeywords2List(int) override {};
void updateDlg(); void updateDlg() override;
}; };
class StringDlg : public StaticDialog class StringDlg : public StaticDialog
@ -405,10 +402,10 @@ public :
return ::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_STRING_DLG), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)); return ::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_STRING_DLG), _hParent, dlgProc, reinterpret_cast<LPARAM>(this));
}; };
virtual void destroy() {}; void destroy() override {};
protected : protected :
intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM); intptr_t CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM) override;
// Custom proc to subclass edit control // Custom proc to subclass edit control
LRESULT static CALLBACK customEditProc(HWND hEdit, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT static CALLBACK customEditProc(HWND hEdit, UINT msg, WPARAM wParam, LPARAM lParam);

View File

@ -20,14 +20,14 @@
IDD_FOLDER_STYLE_DLG DIALOGEX 36, 44, 466, 415 IDD_FOLDER_STYLE_DLG DIALOGEX 36, 44, 466, 415
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
LTEXT "https://ivan-radic.github.io/udl-documentation/",IDC_WEB_HELP_LINK,40,45,160,13 CTEXT "https://ivan-radic.github.io/udl-documentation/",IDC_WEB_HELP_LINK,19,45,200,13
LTEXT "Temporary doc site:",IDC_WEB_HELP_STATIC,40,31,160,13 CTEXT "Temporary doc site:",IDC_WEB_HELP_STATIC,19,31,200,13
GROUPBOX "Documentation:",IDC_WEB_HELP_DESCGROUP_STATIC,12,14,210,49 GROUPBOX "Documentation",IDC_WEB_HELP_DESCGROUP_STATIC,12,14,210,49
PUSHBUTTON "Styler",IDC_DEFAULT_STYLER,87,94,54,13 PUSHBUTTON "Styler",IDC_DEFAULT_STYLER,87,94,54,13
GROUPBOX "Default style:",IDC_DEFAULT_DESCGROUP_STATIC,12,71,210,49 GROUPBOX "Default style",IDC_DEFAULT_DESCGROUP_STATIC,12,71,210,49
CONTROL "Fold &compact (fold empty lines too)",IDC_FOLDER_FOLD_COMPACT, CONTROL "Fold &compact (fold empty lines too)",IDC_FOLDER_FOLD_COMPACT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,143,152,11 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,143,152,11
EDITTEXT IDC_FOLDER_IN_COMMENT_OPEN_EDIT,252,62,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_COMMENT_OPEN_EDIT,252,62,190,22,ES_MULTILINE | WS_VSCROLL
@ -37,7 +37,7 @@ BEGIN
LTEXT "Open:",IDC_FOLDER_IN_COMMENT_OPEN_STATIC,252,53,113,8 LTEXT "Open:",IDC_FOLDER_IN_COMMENT_OPEN_STATIC,252,53,113,8
LTEXT "Middle:",IDC_FOLDER_IN_COMMENT_MIDDLE_STATIC,252,89,113,9 LTEXT "Middle:",IDC_FOLDER_IN_COMMENT_MIDDLE_STATIC,252,89,113,9
LTEXT "Close:",IDC_FOLDER_IN_COMMENT_CLOSE_STATIC,252,126,113,9 LTEXT "Close:",IDC_FOLDER_IN_COMMENT_CLOSE_STATIC,252,126,113,9
GROUPBOX "Folding in comment style:",IDC_FOLDER_IN_COMMENT_DESCGROUP_STATIC,241,14,210,156,BS_CENTER GROUPBOX "Folding in comment style",IDC_FOLDER_IN_COMMENT_DESCGROUP_STATIC,241,14,210,156,BS_CENTER
EDITTEXT IDC_FOLDER_IN_CODE1_OPEN_EDIT,22,236,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE1_OPEN_EDIT,22,236,190,22,ES_MULTILINE | WS_VSCROLL
EDITTEXT IDC_FOLDER_IN_CODE1_MIDDLE_EDIT,22,273,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE1_MIDDLE_EDIT,22,273,190,22,ES_MULTILINE | WS_VSCROLL
EDITTEXT IDC_FOLDER_IN_CODE1_CLOSE_EDIT,22,311,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE1_CLOSE_EDIT,22,311,190,22,ES_MULTILINE | WS_VSCROLL
@ -45,7 +45,7 @@ BEGIN
LTEXT "Open:",IDC_FOLDER_IN_CODE1_OPEN_STATIC,23,224,113,9 LTEXT "Open:",IDC_FOLDER_IN_CODE1_OPEN_STATIC,23,224,113,9
LTEXT "Middle:",IDC_FOLDER_IN_CODE1_MIDDLE_STATIC,23,262,113,9 LTEXT "Middle:",IDC_FOLDER_IN_CODE1_MIDDLE_STATIC,23,262,113,9
LTEXT "Close:",IDC_FOLDER_IN_CODE1_CLOSE_STATIC,23,299,113,9 LTEXT "Close:",IDC_FOLDER_IN_CODE1_CLOSE_STATIC,23,299,113,9
GROUPBOX "Folding in code 1 style:",IDC_FOLDER_IN_CODE1_DESCGROUP_STATIC,12,186,210,156,BS_CENTER GROUPBOX "Folding in code 1 style",IDC_FOLDER_IN_CODE1_DESCGROUP_STATIC,12,186,210,156,BS_CENTER
EDITTEXT IDC_FOLDER_IN_CODE2_OPEN_EDIT,253,236,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE2_OPEN_EDIT,253,236,190,22,ES_MULTILINE | WS_VSCROLL
EDITTEXT IDC_FOLDER_IN_CODE2_MIDDLE_EDIT,253,273,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE2_MIDDLE_EDIT,253,273,190,22,ES_MULTILINE | WS_VSCROLL
EDITTEXT IDC_FOLDER_IN_CODE2_CLOSE_EDIT,253,311,190,22,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_FOLDER_IN_CODE2_CLOSE_EDIT,253,311,190,22,ES_MULTILINE | WS_VSCROLL
@ -53,11 +53,11 @@ BEGIN
LTEXT "Open:",IDC_FOLDER_IN_CODE2_OPEN_STATIC,253,224,113,9 LTEXT "Open:",IDC_FOLDER_IN_CODE2_OPEN_STATIC,253,224,113,9
LTEXT "Middle:",IDC_FOLDER_IN_CODE2_MIDDLE_STATIC,253,261,113,9 LTEXT "Middle:",IDC_FOLDER_IN_CODE2_MIDDLE_STATIC,253,261,113,9
LTEXT "Close:",IDC_FOLDER_IN_CODE2_CLOSE_STATIC,253,298,113,9 LTEXT "Close:",IDC_FOLDER_IN_CODE2_CLOSE_STATIC,253,298,113,9
GROUPBOX "Folding in code 2 style (separators needed):",IDC_FOLDER_IN_CODE2_DESCGROUP_STATIC,242,186,210,156,BS_CENTER GROUPBOX "Folding in code 2 style (separators needed)",IDC_FOLDER_IN_CODE2_DESCGROUP_STATIC,242,186,210,156,BS_CENTER
END END
IDD_SYMBOL_STYLE_DLG DIALOGEX 36, 44, 466, 415 IDD_SYMBOL_STYLE_DLG DIALOGEX 36, 44, 466, 415
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
EDITTEXT IDC_OPERATOR1_EDIT,15,31,205,19,ES_MULTILINE | WS_VSCROLL EDITTEXT IDC_OPERATOR1_EDIT,15,31,205,19,ES_MULTILINE | WS_VSCROLL
@ -133,7 +133,7 @@ BEGIN
END END
IDD_KEYWORD_STYLE_DLG DIALOGEX 36, 44, 466, 415 IDD_KEYWORD_STYLE_DLG DIALOGEX 36, 44, 466, 415
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
EDITTEXT IDC_KEYWORD1_EDIT,19,44,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL EDITTEXT IDC_KEYWORD1_EDIT,19,44,180,50,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
@ -171,7 +171,7 @@ BEGIN
END END
IDD_COMMENT_STYLE_DLG DIALOGEX 36, 44, 466, 415 IDD_COMMENT_STYLE_DLG DIALOGEX 36, 44, 466, 415
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
GROUPBOX "Line comment position",IDC_COMMENTLINE_POSITION_STATIC,11,7,156,57 GROUPBOX "Line comment position",IDC_COMMENTLINE_POSITION_STATIC,11,7,156,57
@ -217,39 +217,41 @@ BEGIN
CONTROL "Both",IDC_BOTH_RADIO,"Button",BS_AUTORADIOBUTTON,319,335,59,8 CONTROL "Both",IDC_BOTH_RADIO,"Button",BS_AUTORADIOBUTTON,319,335,59,8
END END
IDD_GLOBAL_USERDEFINE_DLG DIALOGEX 36, 44, 490, 470 IDD_GLOBAL_USERDEFINE_DLG DIALOGEX 0, 0, 490, 470
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_VSCROLL | WS_SYSMENU STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_VSCROLL | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW EXSTYLE WS_EX_TOOLWINDOW
CAPTION "User Defined Language v2.1" CAPTION "User Defined Language v2.1"
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
LTEXT "User language : ",IDC_LANGNAME_STATIC,0,3,63,8,0,WS_EX_RIGHT RTEXT "User language:",IDC_LANGNAME_STATIC,0,3,63,8
COMBOBOX IDC_LANGNAME_COMBO,64,1,90,58,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_LANGNAME_COMBO,64,1,90,58,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
CONTROL "Transparency",IDC_UD_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,408,22,66,10 PUSHBUTTON "Create new...",IDC_ADDNEW_BUTTON,161,1,62,14
CONTROL "",IDC_UD_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | NOT WS_VISIBLE | WS_TABSTOP,422,33,53,10 PUSHBUTTON "Save as...",IDC_SAVEAS_BUTTON,226,1,62,14
PUSHBUTTON "Dock",IDC_DOCK_BUTTON,425,1,50,14,BS_FLAT
PUSHBUTTON "Create New...",IDC_ADDNEW_BUTTON,161,1,62,14
PUSHBUTTON "Save As...",IDC_SAVEAS_BUTTON,226,1,62,14
CONTROL "Ignore case",IDC_LANGNAME_IGNORECASE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,24,76,10
RTEXT "Ext. :",IDC_EXT_STATIC,259,25,33,8,0,WS_EX_RIGHT
EDITTEXT IDC_EXT_EDIT,293,23,33,14,ES_AUTOHSCROLL
PUSHBUTTON "Import...",IDC_IMPORT_BUTTON,23,21,62,14
PUSHBUTTON "Export...",IDC_EXPORT_BUTTON,93,21,62,14
PUSHBUTTON "Rename",IDC_RENAME_BUTTON,290,1,62,14 PUSHBUTTON "Rename",IDC_RENAME_BUTTON,290,1,62,14
PUSHBUTTON "Remove",IDC_REMOVELANG_BUTTON,354,1,62,14 PUSHBUTTON "Remove",IDC_REMOVELANG_BUTTON,354,1,62,14
PUSHBUTTON "Import...",IDC_IMPORT_BUTTON,23,21,62,14
PUSHBUTTON "Export...",IDC_EXPORT_BUTTON,93,21,62,14
CONTROL "Ignore case",IDC_LANGNAME_IGNORECASE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,24,76,10
RTEXT "Ext.:",IDC_EXT_STATIC,259,25,33,8
EDITTEXT IDC_EXT_EDIT,295,23,70,12,ES_AUTOHSCROLL
PUSHBUTTON "Dock",IDC_DOCK_BUTTON,425,1,50,14
CONTROL "Transparency",IDC_UD_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,408,22,66,10
CONTROL "",IDC_UD_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | NOT WS_VISIBLE | WS_TABSTOP,422,33,53,10
END END
IDD_STRING_DLG DIALOGEX 0, 0, 151, 52 IDD_STRING_DLG DIALOGEX 0, 0, 150, 60
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x1 FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
LTEXT "STATIC :",IDC_STRING_STATIC,6,4,42,8,0,WS_EX_RIGHT GROUPBOX "STATIC",IDC_STRING_STATIC,7,3,136,30,BS_CENTER
EDITTEXT IDC_STRING_EDIT,49,2,88,14,ES_AUTOHSCROLL EDITTEXT IDC_STRING_EDIT,14,14,122,12,ES_AUTOHSCROLL
PUSHBUTTON "OK",IDOK,20,26,50,14 PUSHBUTTON "OK",IDOK,24,40,50,14
PUSHBUTTON "Cancel",IDCANCEL,87,26,50,14 PUSHBUTTON "Cancel",IDCANCEL,77,40,50,14
END END
IDD_STYLER_POPUP_DLG DIALOGEX 100, 50, 324, 305 IDD_STYLER_POPUP_DLG DIALOGEX 0, 0, 324, 305
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
CAPTION "Styler Dialog" CAPTION "Styler Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
@ -275,8 +277,8 @@ BEGIN
CONTROL "Keyword 2",IDC_STYLER_CHECK_NESTING_KEYWORD2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,149,76,13 CONTROL "Keyword 2",IDC_STYLER_CHECK_NESTING_KEYWORD2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,149,76,13
CONTROL "Keyword 3",IDC_STYLER_CHECK_NESTING_KEYWORD3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,166,76,13 CONTROL "Keyword 3",IDC_STYLER_CHECK_NESTING_KEYWORD3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,166,76,13
CONTROL "Keyword 4",IDC_STYLER_CHECK_NESTING_KEYWORD4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,183,76,13 CONTROL "Keyword 4",IDC_STYLER_CHECK_NESTING_KEYWORD4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,183,76,13
GROUPBOX "Nesting:",IDC_STYLER_STATIC_NESTING_GROUP,14,116,295,157 GROUPBOX "Nesting",IDC_STYLER_STATIC_NESTING_GROUP,14,116,295,157
GROUPBOX "Font options:",IDC_STYLER_STATIC_FONT_OPTIONS,14,15,295,95 GROUPBOX "Font options",IDC_STYLER_STATIC_FONT_OPTIONS,14,15,295,95
CONTROL "Delimiter 4",IDC_STYLER_CHECK_NESTING_DELIMITER4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,183,76,13 CONTROL "Delimiter 4",IDC_STYLER_CHECK_NESTING_DELIMITER4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,183,76,13
CONTROL "Delimiter 5",IDC_STYLER_CHECK_NESTING_DELIMITER5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,200,76,13 CONTROL "Delimiter 5",IDC_STYLER_CHECK_NESTING_DELIMITER5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,200,76,13
CONTROL "Delimiter 6",IDC_STYLER_CHECK_NESTING_DELIMITER6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,217,76,13 CONTROL "Delimiter 6",IDC_STYLER_CHECK_NESTING_DELIMITER6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,217,76,13